var l=window.location.hash;
if(l.match('forum')!=null || l.match('jackpots')!=null)
{
content_type='forum';
}else{
content_type='undefined';
}
function delete_element(id){
if(navigator.userAgent.match('MSIE')!=null){
if(document.getElementById(id)){
document.getElementById(id).removeNode(true);
}
}else{
var Node1=document.getElementById('body');
var len=Node1.childNodes.length;
for(var i=0;i<=5;i++)
{if(Node1.childNodes[i]){
if(Node1.childNodes[i].id==id)
{
Node1.removeChild(Node1.childNodes[i]);
}
}
}
}
}
img=0;
function load1(){
img=img+1;
if(img==37){
loadup();
}
}
function get(type,el,but){
document.getElementById('contentbox').style.marginLeft='0px';
Fade.OUT('contentbox',0.2);
if(type=="acc"){
if(document.getElementById('lnav1')){
document.getElementById('lnav1').style.color='#000';
document.getElementById('lnav2').style.color='#FFF';
document.getElementById('lnav3').style.color='#000';
}
document.getElementById('fnav1').style.color='#000';
document.getElementById('fnav2').style.color='#000';
document.getElementById('fnav3').style.color='#000';
document.getElementById('fnav4').style.color='#000';
document.getElementById('fnav5').style.color='#000';
document.getElementById('fnav6').style.color='#000';
if(document.getElementById('but1')){
document.getElementById('but1').style.backgroundImage='url(images/lnavibut.png)';
}
if(document.getElementById('but2')){
document.getElementById('but2').style.backgroundImage='url(images/lnavibut.png)';
}
if(document.getElementById('but3')){
document.getElementById('but3').style.backgroundImage='url(images/lnavibut.png)';
}
if(document.getElementById('but4')){
document.getElementById('but4').style.backgroundImage='url(images/lnavibut.png)';
}
if(document.getElementById('but5')){
document.getElementById('but5').style.backgroundImage='url(images/lnavibut.png)';
}
if(document.getElementById('but6')){
document.getElementById('but6').style.backgroundImage='url(images/lnavibut.png)';
}
if(document.getElementById('but7')){
document.getElementById('but7').style.backgroundImage='url(images/lnavibut.png)';
}
if(document.getElementById('but8')){
document.getElementById('but8').style.backgroundImage='url(images/lnavibut.png)';
}
if(document.getElementById(but)){
document.getElementById(but).style.backgroundImage='url(images/lnavibuth.png)';
}
}
var xmlHttp=GetXmlHttpObject();
if(xmlHttp==null)
{
alert("Browser does not support HTTP Request");
return;
}
var url="index.php";
var data="h=acc&cont="+el;
xmlHttp.onreadystatechange=function(){
	if(xmlHttp.readyState==1)
{
document.getElementById("contentbox").innerHTML='<table width="100%" height="350px"><tr><td align="center" valign="middle"><img src="loading.gif" ></td></tr></table>';
}
if(xmlHttp.readyState==2)
{
document.getElementById("contentbox").innerHTML='<table width="100%" height="350px"><tr><td align="center" valign="middle"><img src="loading.gif" ></td></tr></table>';
}
if(xmlHttp.readyState==3)
{
document.getElementById("contentbox").innerHTML='<table width="100%" height="350px"><tr><td align="center" valign="middle"><img src="loading.gif" ></td></tr></table>';
}
if(xmlHttp.readyState==4)
{
if(navigator.userAgent.match('MSIE')!=null){
Fade.IN('leff');
}else{
if(document.getElementById('leff').className.match('left_box fade0')!=null){
Fade.IN('leff');
}
}
Fade.IN('contentbox');
if(xmlHttp.responseText.match('Login first!')!=null){
window.location.hash='home';
window.location.reload();
}else{
document.getElementById("contentbox").innerHTML=xmlHttp.responseText;
}
}
loopAll();
};
xmlHttp.open("POST",url,true);
xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlHttp.send(data);
cancel('tipt','v');
if(el.match('history')!=null){
var el='history';
}
window.location.hash=el;
}
function set_height()
{
h=window.innerHeight;
h2=window.screen.availHeight;
document.getElementById('conn').style.minHeight=h-292-48;
}
function limitTextTo(obj,limit){
if(obj.value.length>limit){
obj.value=obj.value.substr(0,limit);
}
}
function cancel(x,t){
if(x=='tipt'){
var tipt=document.getElementById('tipt');
if(tipt){
tipt.style.top='-400px';
}
}
if(x=='popup'){
setTimeout('document.getElementById(\'popup\').innerHTML=\'\'',400);
Fade.OUT(x,4);
}else{
Fade.OUT(x,0.5);
}
}
function GetXmlHttpObject()
{
var xmlHttp=null;
try
{
xmlHttp=new XMLHttpRequest();
}
catch(e)
{
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e)
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}
var xmlHttp;
function check(x,v,c)
{
var xmlHttp=GetXmlHttpObject();
if(xmlHttp==null)
{
alert("Browser does not support HTTP Request");
return;
}
document.getElementById(x).innerHTML='<img src="loading.gif" title="Please wait..." width="17" height="17" alt="" height/>';
var data="h=check&"+x+"="+v+"&confirm="+c;
var url="index.php";
xmlHttp.onreadystatechange=function(){
	if(xmlHttp.readyState==4)
{
document.getElementById(x).innerHTML=xmlHttp.responseText;
};};
xmlHttp.open("POST",url,true);
xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlHttp.send(data);
}
function checked(c_id)
{

}
function checkavatar(src){
var newImg=new Image();
newImg.src=src;
var height=newImg.height;
var width=newImg.width;
var limitx='120';
var limity='120';
if(height>limity||width>limitx){
alert('Image too big, avatar can\'t be bigger than 120x120(width x height)');
document.getElementById('ff1').value='http://www';
}else{
document.getElementById('avatar').src=src;
}
}
function action(act,x){
var xmlHttp=GetXmlHttpObject();
if(xmlHttp==null)
{
alert("Browser does not support HTTP Request");
return;
}
setdim('popup');
if(act=='quote_topic'&&document.getElementById('pop1')!=null&&x.indexOf('&')==0||act=='quote_reply'&&document.getElementById('pop1')!=null&&x.indexOf('&')==0){
if(act.match('topic')!=null){
type='topic';
}else{
type='post';
}
var data="h=forms&v=quote&value="+type+x;
var url="/index.php";
xmlHttp.onreadystatechange=function(){
if(xmlHttp.readyState==4){
var browser=navigator.userAgent;
var com=document.getElementById('com');
var text=com.value;
var start=selection_start('com');
var end=selection_end('com');
var selected=text.substring(start,end);
var part1=text.substring(0,start);
var part2=text.substring(end);
if(browser.match('MSIE')!=null){
var new_text=text+xmlHttp.responseText;
}else{
var new_text=part1+xmlHttp.responseText+part2;
}
com.value=new_text;
}
};
xmlHttp.open("POST",url,true);
xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
cancel('tipt','v');
xmlHttp.send(data);
}else{
var data="h=action&act="+act+"&value="+x;
var url="index.php";
xmlHttp.onreadystatechange=function(){
if(document.getElementById('popup').className.match('fade100')==null)
{
Fade.IN('popup',4);
}
if(xmlHttp.readyState==1)
{
document.getElementById("popup").innerHTML='<img src="loading.gif" alt="loading" />';
}
if(xmlHttp.readyState==2)
{
document.getElementById("popup").innerHTML='<img src="loading.gif" alt="loading" />';
}
if(xmlHttp.readyState==3)
{
document.getElementById("popup").innerHTML='<img src="loading.gif" alt="loading" />';
}
if(xmlHttp.readyState==4)
{
if(xmlHttp.responseText.match('Login first!')!=null){
window.location.hash='home';
window.location.reload();
}else{
if(xmlHttp.responseText.match('<img src="loading.gif" name="dep1v5ds6sitfdsgfs" align="middle" />')!=null){
document.getElementById("popup").innerHTML='<img src="loading.gif" alt="loading" /><div style="display:none">'+xmlHttp.responseText+'</div>';
var deposit=document.getElementById('deposit');
deposit.submit();
deposit.innerHTML='';
}else{
document.getElementById("popup").innerHTML=xmlHttp.responseText;
}
}
dragDrop.initElement('drag');
loopAll();
}

};
xmlHttp.open("POST",url,true);
xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
cancel('tipt','v');
xmlHttp.send(data);
}
}
function setdim(id){
if(id=='iframe'){
var y=document.documentElement.clientHeight-60;
var x=document.documentElement.clientWidth;
}else{
var y=document.documentElement.clientHeight;
var x=document.documentElement.clientWidth;
}
var y1=document.body.scrollTop||document.documentElement.scrollTop||document.body.offsetTop;
var x1=document.body.scrollLeft||document.documentElement.scrollLeft||document.body.offsetLeft;
if(id=='loading'){
idd=document.getElementById(id);
if(idd){
idd.style.margin=(y/2)-55+y1+'px auto';
}
}else{
var i=document.getElementById(id);
var browser=navigator.userAgent;
if(browser.match('MSIE 6.')!=null){
i.style.position='absolute';
i.style.top=y1+'px';
i.style.left=x1+'px';
}
var popu=document.getElementById('popup');
if(popu){
popu.width=x+'px';
popu.height=y+'px';
}
}
}
function get_content(c,y){
var xmlHttp=GetXmlHttpObject();
Fade.OUT('contentbox',0.2);
if(document.getElementById('lnav1')){
document.getElementById('lnav1').style.color='#000';
}
if(document.getElementById('lnav2')){
document.getElementById('lnav2').style.color='#000';
}
if(document.getElementById('lnav3')){
document.getElementById('lnav3').style.color='#000';
}
if(document.getElementById('nav1')){
document.getElementById('nav1').style.color='#000';
}
if(document.getElementById('nav2')){
document.getElementById('nav2').style.color='#000';
}
if(document.getElementById('nav3')){
document.getElementById('nav3').style.color='#000';
}
if(document.getElementById('nav4')){
document.getElementById('nav4').style.color='#000';
}
if(document.getElementById('nav5')){
document.getElementById('nav5').style.color='#000';
}
if(document.getElementById('fnav1')){
document.getElementById('fnav1').style.color='#000';
}
if(document.getElementById('fnav2')){
document.getElementById('fnav2').style.color='#000';
}
if(document.getElementById('fnav3')){
document.getElementById('fnav3').style.color='#000';
}
if(document.getElementById('fnav4')){
document.getElementById('fnav4').style.color='#000';
}
if(document.getElementById('fnav5')){
document.getElementById('fnav5').style.color='#000';
}
if(document.getElementById('fnav6')){
document.getElementById('fnav6').style.color='#000';
}
if(c=='va'){
if(document.getElementById('nav1')){
document.getElementById('nav1').style.color='#FFF';
}
if(document.getElementById('lnav1')){
document.getElementById('lnav1').style.color='#FFF';
}
}
if(c.match('forum')!=null){
if(document.getElementById('nav4')){
document.getElementById('nav4').style.color='#FFF';
}
if(document.getElementById('nav5')){
document.getElementById('nav5').style.color='#FFF';
}
if(document.getElementById('lnav3')){
document.getElementById('lnav3').style.color='#FFF';
}
if(document.getElementById('fnav6')){
document.getElementById('fnav6').style.color='#FFF';
}
}
if(c=='login'){
if(document.getElementById('nav2')){
document.getElementById('nav2').style.color='#FFF';
}
}
if(c.match('register')!=null){
if(document.getElementById('nav3')){
document.getElementById('nav3').style.color='#FFF';
}
}
if(c=='tos'){
if(document.getElementById('fnav2')){
document.getElementById('fnav2').style.color='#FFF';
}
}
if(c=='faq'){
if(document.getElementById('fnav3')){
document.getElementById('fnav3').style.color='#FFF';
}
}
if(c=='home'){
if(document.getElementById('fnav1')){
document.getElementById('fnav1').style.color='#FFF';
}
}
if(c=='support'){
if(document.getElementById('fnav4')){
document.getElementById('fnav4').style.color='#FFF';
}
}
if(c=='pricing'){
if(document.getElementById('fnav5')){
document.getElementById('fnav5').style.color='#FFF';
}
}
if(c=='vaxxx'){
if(document.getElementById('nav7')){
document.getElementById('nav7').style.color='#FFF';
}
if(document.getElementById('lnav7')){
document.getElementById('lnav7').style.color='#FFF';
}
}
if(document.getElementById('but1')){
document.getElementById('but1').style.backgroundImage='url(images/lnavibut.png)';
}
if(document.getElementById('but2')){
document.getElementById('but2').style.backgroundImage='url(images/lnavibut.png)';
}
if(document.getElementById('but3')){
document.getElementById('but3').style.backgroundImage='url(images/lnavibut.png)';
}
if(document.getElementById('but4')){
document.getElementById('but4').style.backgroundImage='url(images/lnavibut.png)';
}
if(document.getElementById('but5')){
document.getElementById('but5').style.backgroundImage='url(images/lnavibut.png)';
}
if(document.getElementById('but6')){
document.getElementById('but6').style.backgroundImage='url(images/lnavibut.png)';
}
if(document.getElementById('but7')){
document.getElementById('but7').style.backgroundImage='url(images/lnavibut.png)';
}
if(document.getElementById('but8')){
document.getElementById('but8').style.backgroundImage='url(images/lnavibut.png)';
}
if(xmlHttp==null)
{
alert("Browser does not support HTTP Request");
return;
}
var data="h=con&c="+c;
var url="index.php";
xmlHttp.onreadystatechange=function(){
if(xmlHttp.readyState==1)
{
document.getElementById("contentbox").innerHTML='<table width="100%" height="350px"><tr><td align="center" valign="middle"><img src="loading.gif" ></td></tr></table>';
}
if(xmlHttp.readyState==2)
{
document.getElementById("contentbox").innerHTML='<table width="100%" height="350px"><tr><td align="center" valign="middle"><img src="loading.gif" ></td></tr></table>';
}
if(xmlHttp.readyState==3)
{
document.getElementById("contentbox").innerHTML='<table width="100%" height="350px"><tr><td align="center" valign="middle"><img src="loading.gif" ></td></tr></table>';
}
if(xmlHttp.readyState==4)
{
var c=window.location.hash;
if(c.match('forum')==null && c.match('jackpots')==null){
if(document.getElementById('leff').className.match('left_box fade100')==null){
document.getElementById('contentbox').style.marginLeft='0px';
Fade.IN('leff');
}
}else{
if(document.getElementById('leff').className.match('left_box fade0')==null){
Fade.OUT('leff',1);
}
var browser=navigator.userAgent;
if(browser.match('MSIE 6')!=null){
var lmar='6px';
}else{
var lmar='12px';
}
document.getElementById('contentbox').style.marginLeft=lmar;
}
if(xmlHttp.responseText.match('Login first!')!=null){
window.location.hash='home';
window.location.reload();
}else{
Fade.IN('contentbox');
document.getElementById("contentbox").innerHTML=xmlHttp.responseText;
}
loopAll();
if(c.match('login')!=null){
s_1=document.getElementById('s_1');
s_2=document.getElementById('s_2');
lo1=document.getElementById('lo1');
fo1=document.getElementById('fo1');
fo2=document.getElementById('fo2');
}else if(c.match('register')!=null){
}
}
};
xmlHttp.open("POST",url,true);
xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlHttp.send(data);
if(c.match('register')!=null){
c='register';
}else if(c.match('login')!=null){
c='login';
}
cancel('tipt','v');
window.location.hash=c;
}
function c_all(){
var x=0;
if(document.getElementById('f1').value!=''){
x=x+500;
setTimeout("check('userr',document.getElementById('f1').value)",x);
}
if(document.getElementById('f2').value!=''){
x=x+500;
setTimeout("check('passw',document.getElementById('f2').value,document.getElementById('f3').value)",x);
}
if(document.getElementById('f3').value!=''){
x=x+500;
setTimeout("check('cpassw',document.getElementById('f3').value,document.getElementById('f2').value)",x);
}
if(document.getElementById('f4').value!=''){
x=x+500;
setTimeout("check('aemail',document.getElementById('f4').value,document.getElementById('f5').value)",x);
}
if(document.getElementById('f5').value!=''){
x=x+500;
setTimeout("check('acemail',document.getElementById('f5').value,document .getElementById('f4').value)",x);
}
if(document.getElementById('f6').value!=''){
x=x+500;
setTimeout("check('apemail',document.getElementById('f6').value,document.getElementById('f7').value)",x);
}
if(document.getElementById('f7').value!=''){
x=x+500;
setTimeout("check('acpemail',document.getElementById('f7').value,document.getElementById('f6').value)",x);
}
if(document.getElementById('f8').value!=''){
x=x+500;
setTimeout("check('asex',document.getElementById('f8').value)",x);
}
}
function login(type){
var xmlHttp=GetXmlHttpObject();
if(xmlHttp==null)
{
alert("Browser does not support HTTP Request");
return;
}
if(type=='side'){
var user=document.getElementById('side_username').value;
var pass=document.getElementById('side_password').value;
var rem=document.getElementById('side_remember');
}else{
var user=document.getElementById('username').value;
var pass=document.getElementById('password').value;
var rem=document.getElementById('m_remember');
}
var data="h=forms&v=login&username="+user+"&password="+pass;
var url="/index.php";
if(rem.checked){
var data=data+'&rem=true';
}
xmlHttp.onreadystatechange=function(){
if(xmlHttp.readyState==1)
{
document.getElementById("contentbox").innerHTML='<table width=700px height=350px><tr><td align=center valign=middle><img src=loading.gif ></td></tr></table>';
}
if(xmlHttp.readyState==2)
{
document.getElementById("contentbox").innerHTML='<table width=700px height=350px><tr><td align=center valign=middle><img src=loading.gif ></td></tr></table>';
}
if(xmlHttp.readyState==3)
{
document.getElementById("contentbox").innerHTML='<table width=700px height=350px><tr><td align=center valign=middle><img src=loading.gif ></td></tr></table>';
}
if(xmlHttp.readyState==4)
{
document.getElementById("contentbox").vAlign='top';
document.getElementById("contentbox").align='left';
if(xmlHttp.responseText=='success'){
window.location.href='#summary';
window.location.reload();
}else{
alert(xmlHttp.responseText);
get_content('login');
}
}
};
xmlHttp.open("POST",url,true);
xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlHttp.send(data);
}
function save_profile(){
var xmlHttp=GetXmlHttpObject();
if(xmlHttp==null)
{
alert("Browser does not support HTTP Request");
return;
}
var npass=document.getElementById('f1').value;
var ncpass=document.getElementById('f2').value;
var email=document.getElementById('f3').value;
var pemail=document.getElementById('f4').value;
var ppemail=document.getElementById('f5').value;
var cbid=document.getElementById('f6').value;
var avatar=document.getElementById('ff1').value;
var tpp=document.getElementById('ff2').value;
var ppp=document.getElementById('ff2').value;
var pcf=document.getElementById('cf1').value;
var show_stats=document.getElementById('ff4').value;
var timezone=document.getElementById('fff3').value;
var crediting=document.getElementById('fff4').value;
var profile="h=forms&v=save_profile&npass="+npass+"&ncpass="+ncpass+"&email="+email+"&pemail="+pemail+"&ppemail="+ppemail+"&cbid="+cbid+"&avatar="+avatar+"&tpp="+tpp+"&ppp="+ppp+"&pfc="+pcf+"&show_stats="+show_stats+"&timezone="+timezone+"&crediting="+crediting;
var url="index.php";
xmlHttp.onreadystatechange=function(){
if(xmlHttp.readyState==1)
{
document.getElementById("contentbox").innerHTML='<table width=700px height=350px><tr><td align=center valign=middle><img src=loading.gif ></td></tr></table>';
}
if(xmlHttp.readyState==2)
{
document.getElementById("contentbox").innerHTML='<table width=700px height=350px><tr><td align=center valign=middle><img src=loading.gif ></td></tr></table>';
}
if(xmlHttp.readyState==3)
{
document.getElementById("contentbox").innerHTML='<table width=700px height=350px><tr><td align=center valign=middle><img src=loading.gif ></td></tr></table>';
}
if(xmlHttp.readyState==4)
{
document.getElementById("contentbox").vAlign='top';
document.getElementById("contentbox").align='left';
if(xmlHttp.responseText=='success'){
alert('Profile successfully updated.');
get('acc','account','but1');
}else{
alert(xmlHttp.responseText);
get('acc','profile','but2');
}
}
};
xmlHttp.open("POST",url,true);
xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlHttp.send(profile);
}
function detectTimezone(obj,id){
var tmz=round(new Date().getTimezoneOffset()/60*(-1),2);
obj.style.display='none';
var inp=document.getElementById(id);
for(var i=0; i<=inp.options.length;i++){
	if(inp.options[i]){
		if(inp.options[i].value==tmz){
			inp.selectedIndex=i;
			inp.disabled=true;
		}
	}
}

}
function send_ticket(){
var xmlHttp=GetXmlHttpObject();
if(xmlHttp==null)
{
alert("Browser does not support HTTP Request");
return;
}
var url="/index.php";
var com=document.getElementById('com').value;
var des=document.getElementById('des').value;
var email=document.getElementById('temail').value;
var name=document.getElementById('tname').value;
var data='h=forms&v=s_t&com='+com+'&des='+des+'&email='+email+'&name='+name;
xmlHttp.onreadystatechange=function(){
if(xmlHttp.readyState==1)
{
document.getElementById("contentbox").innerHTML='<table width=700px height=350px><tr><td align=center valign=middle><img src="loading.gif" ></td></tr></table>';
}
if(xmlHttp.readyState==2)
{
document.getElementById("contentbox").innerHTML='<table width=700px height=350px><tr><td align=center valign=middle><img src="loading.gif" ></td></tr></table>';
}
if(xmlHttp.readyState==3)
{
document.getElementById("contentbox").innerHTML='<table width=700px height=350px><tr><td align=center valign=middle><img src="loading.gif" ></td></tr></table>';
}
if(xmlHttp.readyState==4)
{
if(xmlHttp.responseText=='success'){
alert("Your message has been sent successfully. We will reply to you in less than 24 hours.");
window.location.href='index.php';
}else{
alert(xmlHttp.responseText);
get_content('support');
}
}
};
xmlHttp.open("POST",url,true);
xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlHttp.send(data);
}
function logout(){
var xmlHttp=GetXmlHttpObject();
if(xmlHttp==null)
{
alert("Browser does not support HTTP Request");
return;
}
var url="index.php";
var data='h=forms&v=lg';
xmlHttp.onreadystatechange=function(){if(xmlHttp.readyState==4){window.location.href='#home';window.location.reload();}};
xmlHttp.open("POST",url,true);
xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlHttp.send(data);
}
function tip_init(event,obj,txt,timed){
	if(typeof(obj)=='string'){
		var obj=document.getElementById(obj);
	}
	obj.onmouseover=function(event){
		tip(event,txt,'');
	}
	obj.onmouseout=function(){
		cancel('tipt','v')
	}
	obj.onmousemove=function(event){
		tip(event,'','move');
	}
	obj.style.cursor='help';
}
function tip(e,cont,a,h){
if(!document.getElementById('tipt')){
var node=document.createElement('table');
node.className='tipt';
node.id='tipt';
node.cellPadding='0';
node.cellSpacing='0';
node.innerHTML='<tr><td class="tgltc"></td><td class="ttc"></td><td class="tgrtc"></td></tr><tr><td class="tls"></td><td class="tct" id="tip"></td><td class="trs"></td></tr><tr><td class="tglbc"></td><td class="tbc"><div class="tbcc"></div></td><td class="tgrbc"></td></tr>';
document.getElementById('body').appendChild(node);
}
if(navigator.userAgent.match('MSIE 7.0')!=null){
var x=window.event.clientX;
var y=window.event.clientY;
}else{
var x=e.clientX;
var y=e.clientY;
}
var x1=document.documentElement.scrollLeft||document.body.scrollLeft;
var y1=document.documentElement.scrollTop||document.body.scrollTop;
if(a=='move'){
var cont=document.getElementById('tip').innerHTML;
}
var tip=document.getElementById('tip');
if(cont.match('Login first!')!=null){
window.location.hash='home';
window.location.reload();
}
tip.innerHTML=cont;
var tipt=document.getElementById('tipt');
tipt.style.display='block';
var h=tipt.clientHeight;
var browser=navigator.userAgent;
tipt.style.position='absolute';
tipt.style.zIndex='100';
tipt.style.top=y+y1-h-30+'px';
tipt.style.left=x+x1-20+'px';
if(a!='move'&&a!='move2'){
Fade.IN('tipt',2);
}
tipt.style.visibility='visible';
}
function loadup(h){
var popup=document.createElement('div');
popup.id='popup';
var tip=document.createElement('div');
tip.innerHTML='<table cellpadding="0" cellspacing="0" class="tipt" id="tipt" style="position:absolute; top:-50px; left:-20px;"><tr><td class="tgltc"></td><td class="ttc"></td><td class="tgrtc"></td></tr><tr><td class="tls"></td><td class="tct" id="tip"></td><td class="trs"></td></tr><tr><td class="tglbc"></td><td class="tbc"><div class="tbcc"></div></td><td class="tgrbc"></td></tr></table>';
document.getElementById('body').appendChild(tip);
document.getElementById('body').appendChild(popup);
window.name='TwistbuX';
window.onresize=function(){setdim('loading');setdim('popup')};
window.onscroll=function(){setdim('popup');};
window.onunload=function(){unload();};
window.onabort=function(){return false;};
if(document.getElementById('preload')){
document.getElementById('preload').innerHTML='';
}
if(document.getElementById('loading')){
document.getElementById('loading').style.display='none';
}
delete_element('loading');
delete_element('nojs');
delete_element('preload');
document.getElementById('wrap').removeAttribute('style');
hash=window.location.hashl
if(document.getElementById('l_box_but1')){
document.getElementById('l_box_but1').onclick=function(){extend('l_box1','l_box_but1');};
}
if(document.getElementById('l_box_but2')){
document.getElementById('l_box_but2').onclick=function(){extend('l_box2','l_box_but2');};
}
if(document.getElementById('l_box_but3')){
document.getElementById('l_box_but3').onclick=function(){extend('l_box3','l_box_but3');};
}
if(document.getElementById('l_box_but4')){
document.getElementById('l_box_but4').onclick=function(){extend('l_box4','l_box_but4');};
}
if(document.getElementById('lnav1')){
document.getElementById('lnav1').onclick=function(){get_content('va');};
}
if(document.getElementById('lnav2')){
document.getElementById('lnav2').onclick=function(){get('acc','summary','but1');};
}
if(document.getElementById('lnav3')){
document.getElementById('lnav3').onclick=function(){get_content('forum');};
}
if(document.getElementById('nav1')){
document.getElementById('nav1').onclick=function(){get_content('va');};
}
if(document.getElementById('lnav7')){
document.getElementById('lnav7').onclick=function(){get_content('vaxxx');};
}
if(document.getElementById('nav2')){
document.getElementById('nav2').onclick=function(){get_content('login');};
}
if(document.getElementById('nav3')){
document.getElementById('nav3').onclick=function(){get_content('register');};
}
if(document.getElementById('nav4')){
document.getElementById('nav4').onclick=function(){get_content('forum');};
}
if(document.getElementById('nav5')){
document.getElementById('nav5').onclick=function(){get_content('memberhomepagedir');};
}
if(document.getElementById('nav7')){
document.getElementById('nav7').onclick=function(){get_content('vaxxx');};
}
if(document.getElementById('but1')){
document.getElementById('but1').onclick=function(){get('acc','summary','but1');};
}
if(document.getElementById('but2')){
document.getElementById('but2').onclick=function(){get('acc','profile','but2');};
}
if(document.getElementById('but3')){
document.getElementById('but3').onclick=function(){get('acc','history','but3');};
}
if(document.getElementById('but4')){
document.getElementById('but4').onclick=function(){get('acc','direct referrals','but4');};
}
if(document.getElementById('but5')){
document.getElementById('but5').onclick=function(){get('acc','rented referrals','but5');};
}
if(document.getElementById('but6')){
document.getElementById('but6').onclick=function(){get('acc','referring','but6');};
}
if(document.getElementById('but7')){
document.getElementById('but7').onclick=function(){get('acc','advertisements_managment','but7');};
}
if(document.getElementById('but8')){
document.getElementById('but8').onclick=function(){get('acc','homepage_managment','but8');};
}
if(document.getElementById('fnav1')){
document.getElementById('fnav1').onclick=function(){get_content('home');};
}
if(document.getElementById('fnav2')){
document.getElementById('fnav2').onclick=function(){get_content('tos');};
}
if(document.getElementById('fnav3')){
document.getElementById('fnav3').onclick=function(){get_content('faq');};
}
if(document.getElementById('fnav4')){
document.getElementById('fnav4').onclick=function(){get_content('support');};
}
if(document.getElementById('fnav5')){
document.getElementById('fnav5').onclick=function(){get_content('pricing');};
}
if(document.getElementById('fnav6')){
document.getElementById('fnav6').onclick=function(){get_content('forum');};
}
if(document.getElementById('tnav1')){
document.getElementById('tnav1').onclick=function(){switch_top('t1','tnav1');};
document.getElementById('tnav1').style.color='#FFF';
}
if(document.getElementById('tnav2')){
document.getElementById('tnav2').onclick=function(){switch_top('t2','tnav2');};
}
document.getElementById('m_but1').onclick=function(){get_content('home');};
document.getElementById('m_but2').onclick=function(){get_content('advertise');};
document.getElementById('m_but3').onclick=function(){get_content('support');};
document.getElementById('m_but4').onclick=function(){get_content('faq');};
if(document.getElementById('m_but5')){
document.getElementById('m_but5').onclick=function(){action('cashout');};
}
if(document.getElementById('m_but6')){
document.getElementById('m_but6').onclick=function(){action('deposit');};
}
if(document.getElementById('m_but7')){
document.getElementById('m_but7').onclick=function(){get_content('jackpots&t=mjp');};
}
if(document.getElementById('m_but8')){
document.getElementById('m_but8').onclick=function(){action('shop');};
}
var hash=window.location.hash;
if(hash==null||hash==""){
var last_loc=getCookie('last_location');
if(last_loc==null||last_loc==""){
var hash='home';
}else{
var hash=last_loc;
}
}
var hash=hash.replace("#","");
if(hash=='profile'||hash=='summary'||hash.match('history')!=null||hash.match('rented referrals')!=null||hash.match('direct referrals')!=null||hash=='referring'||hash.match('advertisements_managment')!=null||hash.match('homepage_managment')!=null){
Fade.IN('leff');
if(hash.match('summary')!=null){
var but='but1';
}else if(hash.match('profile')!=null){
var but='but2';
}else if(hash.match('history')!=null){
var but='but3';
}else if(hash.match('direct referrals')!=null){
var but='but4';
}else if(hash.match('rented referrals')!=null){
var but='but5';
}else if(hash.match('referring')!=null){
var but='but6';
}else if(hash.match('advertisements_managment')!=null){
var but='but7';
}else if(hash.match('homepage_managment')!=null){
var but='but8';
}
get('acc',hash,but);
}
else{
if(hash.match('forum')!=null || hash.match('jackpots')!=null){
document.getElementById('leff').setAttribute('class','left_box fade0');
document.getElementById('contentbox').style.marginLeft='12px';
}
get_content(hash);
}
Fade.IN('wrap');
loopAll();
}
function setCookie(c_name,value,expiredays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+"="+escape(value)+((expiredays==null)?"":"; expires="+exdate.toGMTString());
}
function getCookie(c_name)
{
if(document.cookie.length>0)
{
c_start=document.cookie.indexOf(c_name+"=");
if(c_start!=-1)
{
c_start=c_start+c_name.length+1;
c_end=document.cookie.indexOf(";",c_start);
if(c_end==-1)c_end=document.cookie.length;
return unescape(document.cookie.substring(c_start,c_end));
}
}
return""
}
function get_stats(e){
var xmlHttp=GetXmlHttpObject();
if(navigator.userAgent.match('MSIE')!=null){
ee=window.event;
}else{
ee=e;
}
if(xmlHttp==null)
{
alert("Browser does not support HTTP Request");
return;
}
var url="index.php";
var data="h=acc&cont=astats";
xmlHttp.onreadystatechange=function(){
if(navigator.userAgent.match('Opera')!=null){
var ev=ee;
}else{
var ev=e;
}
if(xmlHttp.readyState==1)
{
if(navigator.userAgent.match('MSIE 6.0')!=null){
document.getElementById('tip').innerHTML='<div style="height:20px;"></div><img src="loading.gif" alt="Loading" />';
}else{
tip(ev,'<div style="height:20px;"></div><img src="loading.gif" alt="Loading" />','');
}
}
if(xmlHttp.readyState==4)
{
if(navigator.userAgent.match('MSIE 6.0')!=null){
if(xmlHttp.responseText.match('Login first!')!=null){
window.location.hash='home';
window.location.reload();
}else{
document.getElementById('tip').innerHTML=xmlHttp.responseText;
}
}else{
tip(ev,xmlHttp.responseText,'move2');
}
}
};
xmlHttp.open("POST",url,true);
xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlHttp.send(data);
}
function switch_top(x,y){
document.getElementById('t2').style.display='none';
document.getElementById('t1').style.display='none';
document.getElementById(x).style.display='block';
document.getElementById('tnav1').style.color='#000000';
document.getElementById('tnav2').style.color='#000000';
document.getElementById(y).style.color='#FFF';
}
function extend(id1,id2){
var box=document.getElementById(id1);
var img=document.getElementById(id2);
if(box.style.display=='none'){
img.style.backgroundPosition='0px -30px';
img.setAttribute('title','Collapse');
box.style.height='auto';
box.style.display='';
setCookie(id1,'extended','10');
}else{
img.style.backgroundPosition='0px 0px';
img.setAttribute('title','Extend');
box.style.display='none';
box.style.overflow='hidden';
setCookie(id1,'collapsed','10');
}
}
function unload(){
setCookie('last_location',window.location.hash,'10')
}
function scroll_right(id,hm){
var chm=document.getElementById(id).scrollLeft;
var ns=chm+hm*1;
if(ns<=mem_limit){
document.getElementById(id).scrollLeft=ns;
}
}
function scroll_left(id,hm){
var chm=document.getElementById(id).scrollLeft;
var ns=chm-hm*1;
if(ns>=0){
document.getElementById(id).scrollLeft=ns;
}
}
function checkimgdim(id){
var img=document.getElementById(id);
var cimg=new Image();
cimg.src=img.src;
var width=cimg.width;
var height=cimg.height;
var imgpar=img.parentNode;
var par=imgpar.nodeName;
var max_width=810;
if(par=='BLOCKQUOTE'){
var max_width=max_width*0.9;
}
if(width>max_width){
img.width=max_width;
var n_height=max_width*height/width;
img.height=n_height;
img.style.cursor='pointer';
var browser=navigator.userAgent;
if(browser.match('MSIE')!=null){
img.onmouseover=function(){tip(event,'This images has been resized<br>Click it to view source','');};
img.onmousemove=function(){tip(event,'','move');};
img.onmouseout=function(){cancel('tipt','v');};
img.onclick=function(){window.location.href=img.src};
}else{
img.setAttribute('onmouseover','tip(event,\'This images has been resized<br>Click it to view source\',\'\')');
img.setAttribute('onmousemove','tip(event,\'\',\'move\')');
img.setAttribute('onmouseout','cancel(\'tipt\',\'v\')');
img.setAttribute('onclick','window.location.href=\''+img.src+'\'');
}
}
img.style.visibility='visible';
}
Fade={
Set:function(id,i,c_class){
var obj=document.getElementById(id);
obj.setAttribute('class',c_class+' fade'+i);
},
IN:function(id,timeout){
if(isNaN(timeout)!=false){
timeout=4;
}
if(id!=''&&id!='undefined'){
fade1=document.getElementById(id);
if(fade1.className.match('right_box')!=null)
{
c_class='right_box';
}else if(fade1.className.match('tipt')!=null)
{
c_class='tipt';
}else if(fade1.className.match('left_box')!=null)
{
c_class='left_box';
}else if(fade1.id=='popup')
{
c_class='';
}else{
c_class=fade1.className;
}
var browser=navigator.userAgent;
if(browser.match('MSIE')!=null){
fade1.style.display='block';
}else{
for(opa=1;opa<101;opa++){
f_in=setTimeout('Fade.Set(\''+id+'\',\''+opa+'\',\''+c_class+'\')',timeout*opa);
}
}
}
},
OUT:function(id,timeout){
if(isNaN(timeout)!=false){
timeout=4;
}
if(id!=''&&id!='undefined'){
fade1=document.getElementById(id);
if(fade1.className.match('right_box')!=null)
{
c_class='right_box';
}else if(fade1.className.match('tipt')!=null)
{
c_class='tipt';
}else if(fade1.className.match('left_box')!=null)
{
c_class='left_box';
}else if(fade1.id=='popup')
{
c_class='';
}else{
c_class=fade1.className;
}
var browser=navigator.userAgent;
if(browser.match('MSIE')!=null){
fade1.style.display='none';
}else{
ti=0;
for(opa=100;opa>-1;opa--){
ti++;
f_out=setTimeout('Fade.Set(\''+id+'\',\''+opa+'\',\''+c_class+'\')',timeout*ti);
}
}
}
}
}
function s_sb(){
var sm=document.getElementById('sm_box');
var tl=document.getElementById('tl2');
if(sm.style.display==''){
tl.style.backgroundPosition='0px 0px';
tl.setAttribute('title','Show smileys');
sm.style.display='none';
}else{
tl.style.backgroundPosition='0px -50px';
tl.setAttribute('title','Hide smileys');
sm.style.display='';
}
}
function a_s(sm){
var com=document.getElementById('com');
var cont=com.value;
var start=selection_start('com');
var end=selection_end('com');
var part1=cont.substring(0,start);
var part2=cont.substring(end);
var new_cont=part1+sm+part2;
if(navigator.userAgent.match('MSIE')!=null){
com.value=com.value+sm;
}else{
com.value=new_cont;
}
}
function selection_start(id){
var textarea=document.getElementById(id);
textarea.focus();
var start=textarea.selectionStart;
return start;
}
function selection_end(id){
var textarea=document.getElementById(id);
textarea.focus();
var end=textarea.selectionEnd;
return end;
}
function bbc(tag,color){
var id='com';
var browser=navigator.userAgent;
var com=document.getElementById(id);
var text=com.value;
var start=selection_start(id);
var end=selection_end(id);
var selected=text.substring(start,end);
var part1=text.substring(0,start);
var part2=text.substring(end);
if(tag=='HR'){
if(browser.match('MSIE')!=null){
var new_text=text+'['+tag+']';
}else{
var new_text=part1+'['+tag+']'+part2;
}
}else if(tag=='LIST'){
if(browser.match('MSIE'!=null)){
var new_text=text+'['+tag+']\n[li][/li]\n[][/'+tag+']';
}else{
var new_text=part1+'['+tag+']\n[li]'+selected+'[/li]\n[/'+tag+']'+part2;
}
}else if(tag=='URL'){
var url=prompt('ENTER the URL','http://');
if(url!='http://'){
if(browser.match('MSIE')!=null){
var new_text=text+'['+tag+'='+url+']'+url+'[/'+tag+']';
}else{
var new_text=part1+'['+tag+'='+url+']'+url+'[/'+tag+']'+part2;
}
}else{
if(browser.match('MSIE')!=null){
var new_text=text+'['+tag+'][/'+tag+']';
}else{
var new_text=part1+'['+tag+'][/'+tag+']'+part2;
}
}
}else if(tag=='IMG'){
var url=prompt('ENTER the URL','http://');
if(browser.match('MSIE')!=null){
var new_text=text+'['+tag+']'+url+'[/'+tag+']';
}else{
var new_text=part1+'['+tag+']'+url+'[/'+tag+']'+part2;
}
}else if(tag=='SIZE'){
var f_size=prompt('ENTER desired font size','12');
if(browser.match('MSIE')!=null){
var new_text=text+'['+tag+'='+f_size+']'+url+'[/'+tag+']';
}else{
var new_text=part1+'['+tag+'='+f_size+']'+selected+'[/'+tag+']'+part2;
}
}else if(tag=='COLOR'){
if(browser.match('MSIE')!=null){
var new_text=text+'['+tag+'='+color+']'+url+'[/'+tag+']';
}else{
var new_text=part1+'['+tag+'='+color+']'+selected+'[/'+tag+']'+part2;
}
}else{
if(browser.match('MSIE')!=null){
var new_text=text+'['+tag+'][/'+tag+']';
}else{
var new_text=part1+'['+tag+']'+selected+'[/'+tag+']'+part2;
}
}
com.value=new_text;
}
quantity=1;
function inc(x,t){
var am=document.getElementById('am');
var y=am.innerHTML;
if(t=='m'){
if(y-(-x)<=500&&m_bal>=y-(-x)){
am.innerHTML=y-(-x);
}
}else if(t=='c'){
if(y-(-x)<1000&&m_bal>=y-(-x)){
am.innerHTML=y-(-x);
}
}else if(t=='cl'){
if(y-(-x)<1000000&&p_b>=c_p*(y-(-x))){
am.innerHTML=y-(-x);
if((am.innerHTML+'"').length-1<=4){
}else{
document.getElementById('p_w').style.width=300+((am.innerHTML+'"').length-1)*7+'px';
}
document.getElementById('pr').innerHTML='$'+round(c_p*am.innerHTML,2);
}
}else if(t=='acl'){
if(y-(-x)<=rem_clicks){
am.innerHTML=y-(-x);
}
}else if(t=='ap' || t=='pp'){
quantity=quantity+parseInt(x);
am.innerHTML=y-(-x*1);
}else{
if(y-(-x)<=500){
am.innerHTML=y-(-x);
}
}
}
function denc(x,t){
var am=document.getElementById('am');
var y=am.innerHTML;
if(t=='m'){
if(y-x>=0.5){
am.innerHTML=y-x;
}
}else if(t=='c'){
if(y-x>=m_c){
am.innerHTML=y-x;
}
}else if(t=='cl'){
if(y-x>=b_c){
am.innerHTML=y-x;
if((am.innerHTML+'"').length-1>4){
}else{
document.getElementById('p_w').style.width=document.getElementById('p_w').style.width.replace('px','')-((am.value+'"').length-1)*7+'px';
}
document.getElementById('pr').innerHTML='$'+round(c_p*am.innerHTML,2);
}
}else if(t=='acl'){
if(y-x>=50){
am.innerHTML=y-x;
}
}else if(t=='ap' || t=='pp'){
if(quantity-x>=1){
quantity=quantity-x;
am.innerHTML=y-x*1;
}
}else{
if(y-x>=3){
am.innerHTML=y-x;
}
}
}
function round(val,precision){
return parseFloat(parseFloat(val).toFixed(precision));
}
function toggle_visibility(id){
var e=document.getElementById(id);
if(e.style.display=='block')
e.style.display='none';
else
e.style.display='block';
}
function check_event(e){
var key=e.keyCode;
if(document.getElementById('va').style.display!='none'){
}
}
function tab(x){
for(var a=1;a<=4;a++){
var tab_=document.getElementById('tt'+a);
var mem_=document.getElementById('m'+a)
if(tab_){
tab_.style.marginBottom='';
}
if(mem_){
mem_.style.display='none';
}
}
var tab=document.getElementById('tt'+x);
var mem=document.getElementById('m'+x);
mem.style.display='block';
tab.style.marginBottom='6px';
}
function openad(event,ad,hash){
if(event){
if(event.button!=0){
var hack='ti';
}else{
var hack='to';
}
}else{
var hack='ti';
}
ad=ad;
hash=hash;
if(ad&&hash!=null){
var xmlHttp=GetXmlHttpObject();
if(xmlHttp==null)
{
alert("Browser does not support HTTP Request");
return;
}
var data='h=ads&t=s&a='+hash+'&s='+hack;
var url="index.php";
xmlHttp.onreadystatechange=function(){
if(xmlHttp.readyState==4){
if(xmlHttp.responseText=='OK'){
var win=window.open('ViewAd.php');
}else{
alert(xmlHttp.responseText);
}
}
}
xmlHttp.open("POST",url,true);
xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlHttp.send(data);
}
}
function s_a_refs(count){
var mCB=document.getElementById('s_refs');
if(mCB.checked){
for(var i=1;i<=count;i++){
var box=document.getElementById('cb'+i);
if(box.disabled==false){
	box.checked=true;
}
}
}else{
for(var i=1;i<=count;i++){
var box=document.getElementById('cb'+i);
if(box.disabled==false){
box.checked=false;
}
}
}
var rOptions=document.getElementById('r_o');
if(mCB.checked==false){
rOptions.innerHTML='';
}else{
var r_a=document.getElementById('r_a');
if(!r_a){
s_a(count);
}else{
	
if(document.getElementById('rec_pr')){
document.getElementById('rec_pr').innerHTML=round(count*recyclingPrice,3);
}
if(document.getElementById('ext_pr')){
		var tmp=get_renting_price(count);
document.getElementById('ext_pr').innerHTML=tmp;
}
}
}
}
function ds_ref(i,count){
var box=document.getElementById('cb'+i);
var rOptions=document.getElementById('r_o');
var r_a=document.getElementById('r_a');
c=0;
if(box.checked==true){
box.checked=false;
c-=1;
}
if(document.getElementById('rec_pr')){
document.getElementById('rec_pr').innerHTML=round(document.getElementById('rec_pr').innerHTML-recyclingPrice,3);
}
if(c<1){
rOptions.innerHTML='';
}
}
function s_ref(i,count){
var box=document.getElementById('cb'+i);
var rOptions=document.getElementById('r_o');
var r_a=document.getElementById('r_a');
if(box.checked){
if(!r_a){
s_a(count);
}else{
if(document.getElementById('rec_pr')){
document.getElementById('rec_pr').innerHTML=round(document.getElementById('rec_pr').innerHTML-(-recyclingPrice),3);
}
if(document.getElementById('ext_pr')){
		var tmp=get_renting_price(1);
document.getElementById('ext_pr').innerHTML=round(document.getElementById('ext_pr').innerHTML-(-tmp),3);
}
}
}else{
c=0;
for(var a=1;a<=count;a++){
var box=document.getElementById('cb'+a);
if(box.checked==true){
c+=1;
}
}
if(document.getElementById('rec_pr')){
document.getElementById('rec_pr').innerHTML=round(document.getElementById('rec_pr').innerHTML-recyclingPrice,3);
}
if(document.getElementById('ext_pr')){
		var tmp=get_renting_price(1);
document.getElementById('ext_pr').innerHTML=round(document.getElementById('ext_pr').innerHTML-tmp,3);
}
if(c<1){
rOptions.innerHTML='';
}
}
}
extendDays=0;
function s_a(count){
var rOptions=document.getElementById('r_o');
var node=document.createElement('select');
node.id='r_a';
node.style.width='245px';
node.onchange=function(){
var refs='';
var refsCount=0;
for(var i=1;i<=count;i++){
var box=document.getElementById('cb'+i);
if(box.checked){
var ref=document.getElementById('ref'+i).innerHTML;
var refs=refs+'|'+ref;
refsCount+=1;
}
}
if(this.value=='rec_a'){
var sa=document.getElementById('s_a2');
var price=refsCount*recyclingPrice;
var tab=document.createElement('div');
tab.className='tab';
tab.style.paddingTop='6px';
tab.style.cssFloat='right';
tab.onmouseover=function(){this.style.backgroundColor='#f3f3f3';this.style.color='#000';};
tab.onmouseout=function(){this.style.backgroundColor='';this.style.color='';};
var txt=document.createTextNode('Recycle');
tab.appendChild(txt);
tab.onclick=function(){
rec_all(count);
}
sa.innerHTML='<div style="float:left;margin-top:15px;">Price: <b>$</b><span id="rec_pr" style="font-weight:bold;">'+round(price,3)+'</span></div>';
sa.appendChild(tab);
}else if(this.value=='p_f_a'){
		extendDays=10;
		var price=get_renting_price(refsCount)
	var s_a2=document.getElementById('s_a2');
	s_a2.innerHTML='';
	var sel=document.createElement('select');
	sel.onchange=function(){
		var refs='';
		var refsCount=0;
		for(var i=1;i<=count;i++){
			var box=document.getElementById('cb'+i);
			if(box.checked){
				var ref=document.getElementById('ref'+i).innerHTML;
				var refs=refs+'|'+ref;
				refsCount+=1;
			}
		}
		extendDays=this.value;
		document.getElementById('ext_pr').innerHTML=get_renting_price(refsCount);

	}
	sel.id="e_days";
	sel.style.cssFloat='right';
	var opt=document.createElement('option');
	opt.value=10;
	var tmp=document.createTextNode('10 days (+20%)');
	opt.appendChild(tmp);
	sel.appendChild(opt);
	
	var opt=document.createElement('option');
	opt.value=20;
	var tmp=document.createTextNode('20 days (+10%)');
	opt.appendChild(tmp);
	sel.appendChild(opt);
	
	var opt=document.createElement('option');
	opt.value=30;
	var tmp=document.createTextNode('30 days (0%)');
	opt.appendChild(tmp);
	sel.appendChild(opt);
	
	var opt=document.createElement('option');
	opt.value=45;
	var tmp=document.createTextNode('45 days (-5%)');
	opt.appendChild(tmp);
	sel.appendChild(opt);
	
	var opt=document.createElement('option');
	opt.value=60;
	var tmp=document.createTextNode('60 days (-10%)');
	opt.appendChild(tmp);
	sel.appendChild(opt);
	
	var opt=document.createElement('option');
	opt.value=90;
	var tmp=document.createTextNode('90 days (-15%)');
	opt.appendChild(tmp);
	sel.appendChild(opt);
	
	var tab=document.createElement('div');
	tab.className='tab';
	tab.style.paddingTop='6px';
	tab.style.cssFloat='right';
	tab.onmouseover=function(){this.style.backgroundColor='#f3f3f3';this.style.color='#000';};
	tab.onmouseout=function(){this.style.backgroundColor='';this.style.color='';};
	var txt=document.createTextNode('Extend');
	tab.appendChild(txt);
	tab.onclick=function(){
	ext_all(count);
	document.getElementById('r_o').innerHTML='<img src="loading.gif" style="float:right;" width="20" height="20" alt="Please wait" />';
	}
	
	
	var div=document.createElement('div');
	div.style.cssFloat='left';
	div.innerHTML='Price: <b>$</b><span id="ext_pr" style="font-weight:bold">'+price+'</span>';
	div.style.marginTop='3px';
	s_a2.appendChild(div);
	div2=document.createElement('div');
	div2.style.cssFloat='right';
	div2.style.width='240px';
	div2.appendChild(sel);
	div2.appendChild(div);
	s_a2.appendChild(div2);
	s_a2.appendChild(document.createElement('br'));
	s_a2.appendChild(tab);
	
}else{
if(document.getElementById('s_a2')){
document.getElementById('s_a2').innerHTML='';
}
}
};
var nodeOpt=document.createElement('option');
nodeOpt.value='';
nodeOpt.innerHTML='Select action';
node.appendChild(nodeOpt);
var nodeOpt=document.createElement('option');
nodeOpt.value='rec_a';
nodeOpt.innerHTML='I want to recycle the selected referrals';
node.appendChild(nodeOpt);

var nodeOpt=document.createElement('option');
nodeOpt.value='p_f_a';
nodeOpt.innerHTML='I want to extend the selected referrals';
node.appendChild(nodeOpt);

var node2=document.createElement('div');
node2.id='s_a2';
rOptions.appendChild(node);
rOptions.appendChild(node2);
}
function get_renting_price(__count){
	var price=extendDays*rentingPrice/refsDuration;
	var price=price*__count;
	if(extendDays==10){
		var price=price*1.2;
	}
	if(extendDays==20){
		var price=price*1.1;
	}
	if(extendDays==30){
		var price=price*1;
	}
	if(extendDays==45){
		var price=price*0.95;
	}
	if(extendDays==60){
		var price=price*0.9;
	}
	if(extendDays==90){
		var price=price*0.85;
	}
	var price=round(price,3);
return price;
}
function rec_all(count){
timeout=0;
var str='';
for(refI=1;refI<=count;refI++){
var box=document.getElementById('cb'+refI);
if(box.checked){
var user=document.getElementById('ref'+refI).innerHTML;
var user=base64_encode(base64_encode(base64_encode(base64_encode(user))));
var str=str+"setTimeout('rec(\\\'"+refI+"\\\',\\\'"+user+"\\\',true);ds_ref(\\\'"+refI+"\\\',\\\'"+count+"\\\')',"+timeout+");";
timeout=timeout+20;
}
}
eval(str);
}
function ext_all(__count){
var refs='';
for(refI=1;refI<=__count;refI++){
var box=document.getElementById('cb'+refI);
if(box.checked){
var user=document.getElementById('ref'+refI).innerHTML;
var refs=refs+'|'+user+','+refI;

}
}
var refs=refs.substr(1,refs.length);
var data='h=forms&v=ext&l='+refs+'&e='+extendDays;
var xmlHttp=GetXmlHttpObject();
xmlHttp.open("POST",'index.php',true);
xmlHttp.onreadystatechange=function(){
	if(xmlHttp.readyState==4){
		eval(urldecode(base64_decode(base64_decode(xmlHttp.responseText))));
	}
}
xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlHttp.send(data);

}
function add_Ad(){
var title=urlencode(document.getElementById('t').value);
var des=urlencode(document.getElementById('d').value);
var ad_url=urlencode(document.getElementById('u').value);
var cat=urlencode(document.getElementById('cat').value);
var data='h=forms&v=nad&cat='+cat+'&des='+des+'&title='+title+'&url='+ad_url;
var xmlHttp=GetXmlHttpObject();
if(xmlHttp==null)
{
alert("Browser does not support HTTP Request");
return;
}
xmlHttp.onreadystatechange=function(){
if(xmlHttp.readyState==4){
if(xmlHttp.responseText.match('Login first!')!=null){
window.location.hash='home';
window.location.reload();
}else{
if(xmlHttp.responseText=='OK'){
get('acc','advertisements_managment','but7')
}else{
alert(xmlHttp.responseText);
}
}
}
};
xmlHttp.open("POST",'index.php',true);
xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlHttp.send(data);
}
function edit_Ad(hash){
var title=document.getElementById('t').value;
var des=document.getElementById('d').value;
var ad_url=document.getElementById('u').value;
var cat=document.getElementById('cat').value;
var data='h=forms&v=ead&cat='+cat+'&des='+des+'&title='+title+'&url='+ad_url+'&hash='+hash;
var xmlHttp=GetXmlHttpObject();
if(xmlHttp==null)
{
alert("Browser does not support HTTP Request");
return;
}
xmlHttp.onreadystatechange=edit_ad_suc;
xmlHttp.open("POST",'index.php',true);
xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlHttp.send(data);
}
function edit_ad_suc(){
if(xmlHttp.readystate==1){
}else if(xmlHttp.readyState==4){
if(xmlHttp.responseText.match('Login first!')!=null){
window.location.hash='home';
window.location.reload();
}else{
if(xmlHttp.responseText=='OK'){
get('acc','advertisements_managment','but7')
}else{
alert(xmlHttp.responseText);
}
}
}
}
function add_homepage(){
var title=urlencode(document.getElementById('t').value);
var des=urlencode(document.getElementById('d').value);
var hp_url=urlencode(document.getElementById('u').value);
var keywords=urlencode(document.getElementById('k').value);
var cat=urlencode(document.getElementById('cat').value);
var data='h=forms&v=nhp&cat='+cat+'&des='+des+'&title='+title+'&url='+hp_url+'&keywords='+keywords;
var xmlHttp=GetXmlHttpObject();
if(xmlHttp==null)
{
alert("Browser does not support HTTP Request");
return;
}
xmlHttp.onreadystatechange=function(){
if(xmlHttp.readyState==4){
if(xmlHttp.responseText.match('Login first!')!=null){
window.location.hash='home';
window.location.reload();
}else{
if(xmlHttp.responseText=='OK'){
get('acc','homepage_managment','but8')
}else{
alert(xmlHttp.responseText);
}
}
}
};
xmlHttp.open("POST",'index.php',true);
xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlHttp.send(data);
}
function edit_homepage(id){
var title=document.getElementById('title').value;
var description=document.getElementById('description').value;
var hp_url=urlencode(document.getElementById('hp_url').value);
var keywords=urlencode(document.getElementById('keywords').value);
var cat=document.getElementById('cat').value;
var data='h=forms&v=ehp&cat='+cat+'&description='+description+'&title='+title+'&hp_url='+hp_url+'&keywords='+keywords+'&id='+id;
var xmlHttp=GetXmlHttpObject();
if(xmlHttp==null)
{
alert("Browser does not support HTTP Request");
return;
}
xmlHttp.onreadystatechange=edit_hp_suc;
xmlHttp.open("POST",'index.php',true);
xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlHttp.send(data);
}
function edit_hp_suc(){
if(xmlHttp.readystate==1){
}else if(xmlHttp.readyState==4){
if(xmlHttp.responseText.match('Login first!')!=null){
window.location.hash='home';
window.location.reload();
}else{
if(xmlHttp.responseText=='OK'){
get('acc','homepage_managment','but8')
}else{
alert(xmlHttp.responseText);
}
}
}
}
function loopAll(){
arr=document.documentElement.getElementsByTagName("*");
for(var i=0;i<=arr.length;i++){
var ell=arr[i];
removeEvents(ell);
}
}
function removeEvents(id){
if (id !=null)
{
var change_=id.onchange;
var onkeyup_=id.onkeyup;
var onkeydown_=id.onkeydown;
var click_=id.onclick;
var load_=id.onload;
var mouseout=id.onmouseout;
var mouseon=id.onmouseover;
var mousemove=id.onmousemove;
var change=id.onchange;
id.removeAttribute('onkeyup');
id.removeAttribute('onkeydown');
id.removeAttribute('onclick');
id.removeAttribute('onmousemove');
id.removeAttribute('onload');
id.removeAttribute('onmouseover');
id.removeAttribute('onmouseout');
id.removeAttribute('onchange');
id.onkeyup='';
id.onkeydown='';
id.onmousemove='';
id.onclick='';
id.onload='';
id.onmouseout='';
id.onmouseout='';
id.onchange='';
id.onclick=click_;
id.onload=load_;
id.onkeyup=onkeyup_;
id.onkeydown=onkeydown_;
id.onmousemove=mousemove;
id.onmouseout=mouseout;
id.onmouseover=mouseon;
id.onchange=change;
}
}
function fVa(hash){
hash=hash;
var data='h=ads&t=cl&a='+hash;
var url="index.php";
xmlHttp.onreadystatechange=function(){}
xmlHttp.open("POST",url,true);
xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlHttp.send(data);
}
function sw_banner(i){
for(var b=0;b<=6;b++){
var ban=document.getElementById('b'+b);
if(ban){
ban.style.display='none';
ban.style.visibility='hidden';
}
}
document.getElementById('b'+i).style.display='';
document.getElementById('b'+i).style.visibility='visible';
document.getElementById('dim').innerHTML=document.getElementById('tab'+i).innerHTML;
}
function delete_ref(id){
	var xmlHttp=GetXmlHttpObject();
	var con=confirm('Are you sure you want to remove this referral from your downline?');
	if(con==true){
	var u=base64_encode(base64_encode(base64_encode(urlencode(document.getElementById('ref'+id).innerHTML))));
var data='h=forms&v=del_ref&u='+u;
var url="index.php";
xmlHttp.onreadystatechange=function(){
	if(xmlHttp.readyState==4){
		if(xmlHttp.responseText=='ok'){
			document.getElementById('a'+id).innerHTML='<img height="20" width="20" src="images/ok.png" title="Direct referral have been removed from your account."/>';
			window.location.reload();
		}
	}
	};
xmlHttp.open("POST",url,true);
xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlHttp.send(data);
	}
}
function rec(id,username,ch){
	var xmlHttp=GetXmlHttpObject();
var re=document.getElementById('rec'+id);
var rw=document.getElementById('r_w'+id);
re.style.display='none';
re.style.visibility='hidden';
rw.style.display='';
rw.style.visibility='visible'
if(!ch){
var ch=confirm('Are you sure you want to recycle this referral?');
}
if(ch==true){
var data='h=forms&v=rec&u='+username;
var url="index.php";
if(navigator.userAgent.match('MSIE')!=null){
xmlHttp.open("POST",url,true);
}
xmlHttp.onreadystatechange=function(){
if(xmlHttp.readyState==4){
var str=base64_decode(base64_decode(base64_decode(xmlHttp.responseText)));
eval(str);
if(sts=='ok'){
document.getElementById('ref'+id).innerHTML=nUser;
document.getElementById('redate'+id).innerHTML=since;
//document.getElementById('recr'+id).innerHTML=img;
document.getElementById('cli'+id).innerHTML=clicks;
document.getElementById('rec'+id).style.display='';document.getElementById('rec'+id).style.visibility='';
document.getElementById('r_w'+id).style.display='none';document.getElementById('r_w'+id).style.visibility='hidden';
document.getElementById('2cli'+id).innerHTML=0;
document.getElementById('r_tr'+id).style.background='';
//document.getElementById('r_avg'+id).innerHTML='N/A';
document.getElementById('r_tr'+id).onmouseout=function(){this.style.backgroundColor=''}
document.getElementById('r_lc'+id).innerHTML=lc;
document.getElementById('r_i'+id).innerHTML='<img src="images/imark.png" class="l_img" height="20" width="20" style="cursor:auto; opacity:0.4; filter:alpha(opacity=40);" /></td>';
document.getElementById('cb'+id).disabled=false;
}else{
document.getElementById('recr'+id).innerHTML=img;
document.getElementById('cb'+id).disabled=true;
}
}
};
if(navigator.userAgent.match('MSIE')==null){
xmlHttp.open("POST",url,true);
}
xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlHttp.send(data);
}else{
re.style.display='';
re.style.visibility='visible';
rw.style.display='none';
rw.style.visibility='hidden'
}
}
function show_chart(id,u){
	for(var r=1;r<=25;r++){
		if(r!=id){
		var tmp=document.getElementById('r_m'+r);
			if(tmp){
				tmp.style.visibility='hidden';
				tmp.style.display='none';
				tmp.innerHTML='';
			}
		}
	}
var td=document.getElementById('r_m'+id);
if(td.style.visibility!='visible'){
td.style.visibility='visible';
td.style.display='';
td.innerHTML='<div id="r_c'+id+'"></div>';
swfobject.embedSWF("open-flash-chart.swf","r_c"+id,"300","150","9.0.0","expressInstall.swf",{"data-file":"includes/chart_data.php?u="+u},{wmode:"transparent"})
}else{
td.style.display='none';
td.style.visibility='hidden';
td.innerHTML='';
}
}
function search_history(){
var type=document.getElementById('type').value;
var from=document.getElementById('from').checked;
var since=document.getElementById('since').checked;
var data='&type='+type;
if(from){
var from_m=document.getElementById('from_m').value;
var from_d=document.getElementById('from_d').value;
var from_y=document.getElementById('from_y').value;
var to_m=document.getElementById('to_m').value;
var to_d=document.getElementById('to_d').value;
var to_y=document.getElementById('to_y').value;
var data=data+'&from_m='+from_m+'&from_d='+from_d+'&from_y='+from_y+'&to_m='+to_m+'&to_d='+to_d+'&to_y='+to_y;
}
if(since){
var sins=document.getElementById('since_v').value;
var data=data+'&since='+sins;
}
get('acc','history'+data,'but3');
}
var MSIE=navigator.userAgent.indexOf('MSIE')>=0?true:false;
var navigatorVersion=navigator.appVersion.replace(/.*?MSIE (\d\.\d).*/g,'$1')/1;
var form_widget_amount_slider_handle='images/nopreload/slider_handle.gif';
var slider_handle_image_obj=false;
var sliderObjectArray=new Array();
var slider_counter=0;
var slideInProgress=false;
var handle_start_x;
var event_start_x;
var currentSliderIndex;
function form_widget_cancel_event()
{
return false;
}
function filter(t,hash,count){
	var data='';	
	if(t=='mems'){
		for(var i=1;i<=count;i++){
			data+='&cb'+i+'='+document.getElementById('cb'+i).checked;
		}
	}else if(t==''){
		
	}else if(t==''){
		
	}

	action('ad_filter','edit&hash='+hash+'&type='+t+data)
}
function check_filter(t){
	if(t=='age'){
	
	}else if(t=='dem'){
	
	}
}
function add_filter(t){
	if(t=='age'){
		var table=document.getElementById('a_fi');
		var nr=table.insertRow(index);
		var c1=nr.insertCell(0);
		var c2=nr.insertCell(1);
		var c3=nr.insertCell(2);
		var c4=nr.insertCell(3);
		var sel=document.createElement('select');
		var o_sel=document.getElementById('a_s_1');
		
		sel.id='a_s_'+f;
		for(var opt=0; opt<o_sel.length;opt++){
			var nopt=document.createElement('option');
			nopt.value=o_sel.options[opt].value;
			nopt.text=o_sel.options[opt].text;
			sel.appendChild(nopt);
		}
		c1.appendChild(sel);
		c2.innerHTML='-->';
		var sel2=document.createElement('select');
		var o_sel=document.getElementById('a_e_1');
		
		sel2.id='a_e_'+f;
		for(var opt=0; opt<o_sel.length;opt++){
			var nopt=document.createElement('option');
			nopt.value=o_sel.options[opt].value;
			nopt.text=o_sel.options[opt].text;
			sel2.appendChild(nopt);
		}
		c3.appendChild(sel2);
			var img=document.createElement('img');
				img.src='images/nopreload/plius.png';
				img.id='plius'+f;
				img.className='l_img';
				img.height='20';
				img.width='20';
				img.title='Add additional age group.';
				img.onclick=function(){add_filter('age'); this.src='images/nopreload/minus.png'; this.title='Remove this group.'; this.id=this.id.replace('plius','minus'); this.onclick=function(){remove_filter('age',this.parentNode.parentNode.rowIndex);};};
		c4.appendChild(img);
		index++;
		f++;
	}else if(t=='dem'){
	
	}
}
function remove_filter(t,ind){
	if(t=='age'){
		var table=document.getElementById('a_fi');
		
		table.deleteRow(ind);
		index--;
	}
}
wait=false;
function buyTicket(id,t){
if(wait!=true){
	wait=true;
	document.getElementById('sts').innerHTML='<img src="loading.gif" height="15" width="15" />';
	var data="h=jp&t="+t+"&id="+id;
	var url="/index.php";

	var xmlHttp=GetXmlHttpObject();
	xmlHttp.onreadystatechange=function(){
		if(xmlHttp.readyState==4){
			eval(base64_decode(base64_decode(xmlHttp.responseText)));
			wait=false;
		}
	};
	xmlHttp.open("POST",url,true);
	xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
	xmlHttp.send(data);
}
}
