<?php
//This code is copyright (c) ViciSoft SL, all rights reserved.
//The contents of this file are protected under law as the intellectual property 
//of ViciSoft SL. Any use, reproduction, disclosure or copying of any kind 
//without the express and written permission of ViciSoft SL is forbidden.
//Author: Vince Reid, vincereid@gmail.com
if(@$storesessionvalue=="") $storesessionvalue="virtualstore".time();
if(@$_SESSION['loggedon']!=$storesessionvalue||@$GLOBALS['disallowlogin']||!@$GLOBALS['incfunctionsdefined']) exit;
$success=TRUE;
$alreadygotadmin = getadminsettings();
$numshipmethods=10;
if(getpost('posted')=="1"){
	$adminlangsettings=0;
	if(is_array(@$_POST['adminlangsettings'])){
		foreach(@$_POST['adminlangsettings'] as $objValue)
			$adminlangsettings+=$objValue;
	}
	for($numfilters=0; $numfilters<=1; $numfilters++){
		$pfarr[$numfilters]=0;
		$pftext[$numfilters]='';
		$pftext2[$numfilters]='';
		$pftext3[$numfilters]='';
		for($index=0; $index<=5; $index++){
			if(@$_POST['filtercb'.$numfilters.'_'.$index]=='ON') $pfarr[$numfilters]+=pow(2, $index);
			if($index!=0){
				$pftext[$numfilters].='&';
				$pftext2[$numfilters].='&';
				$pftext3[$numfilters].='&';
			}
			$pftext[$numfilters].=strreplace('&','%26',@$_POST['filtertext'.$numfilters.'_'.$index]);
			$pftext2[$numfilters].=strreplace('&','%26',@$_POST['filtertext'.$numfilters.'_'.$index.'x2']);
			$pftext3[$numfilters].=strreplace('&','%26',@$_POST['filtertext'.$numfilters.'_'.$index.'x3']);
		}
	}
	$sortoptions=0;
	for($index=1; $index<=20; $index++){
		if(@$_POST['sortid'.$index]=="ON") $sortoptions+=pow(2,($index-1));
	}
	$sSQL = "UPDATE admin SET adminEmail='" . getpost('xxemaddr') . "',adminLogging='" . (getpost('adminlogging')=='ON'?1:0) . "',adminStoreURL='" . getpost('url') . "',adminStoreURLSSL='" . getpost('urlssl') . "',adminProdsPerPage='" . getpost('prodperpage') . "',adminShipping=" . getpost('shipping') . ",adminIntShipping=" . getpost('intshipping') . ",adminZipCode='" . getpost('zipcode') . "',adminCountry=" . getpost('countrySetting') . ",adminDelUncompleted=" . getpost('deleteUncompleted') . ",adminClearCart=" . getpost('adminClearCart') . ",adminStockManage=" . getpost('stockManage') . ",adminHandling=" . (is_numeric(getpost('handling'))?getpost('handling'):0) . ",adminHandlingPercent=" . (is_numeric(getpost('handlingpercent'))?getpost('handlingpercent'):0) . ",";
	if(getpost('emailconfirm')=='ON') $adminEmailConfirm=1; else $adminEmailConfirm=0;
	if(getpost('affilconfirm')=='ON') $adminEmailConfirm+=2;
	if(getpost('customerconfirm')=='ON') $adminEmailConfirm+=4;
	if(getpost('reviewconfirm')=='ON') $adminEmailConfirm+=8;
	$sSQL.='adminEmailConfirm=' . $adminEmailConfirm . ',';
	$sSQL.='adminUnits=' . ((int)getpost('adminUnits') + (int)getpost('adminDims'));
	for($index=1;$index<=3;$index++){
		$sSQL.=',currRate' . $index . '=' . (is_numeric(@$_POST['currRate' . $index])?@$_POST['currRate' . $index]:0);
		$sSQL.=',currSymbol' . $index . "='" . @$_POST['currSymbol' . $index] . "'";
	}
	$sSQL.=",currLastUpdate='" . escape_string(date('Y-m-d H:i:s', time()-100000)) . "'";
	$sSQL.=",currConvUser='" . escape_string(getpost('currConvUser')) . "'";
	$sSQL.=",cardinalProcessor='" . escape_string(getpost('cardinalprocessor')) . "'";
	$sSQL.=",cardinalMerchant='" . escape_string(getpost('cardinalmerchant')) . "'";
	$sSQL.=",cardinalPwd='" . escape_string(getpost('cardinalpwd')) . "'";
	$sSQL.=",avalarastate='" . escape_string(getpost('avalarastate')) . "'";
	$sSQL.=",avalaraacctno='" . escape_string(getpost('avalaraacctno')) . "'";
	$sSQL.=",avalaralicensekey='" . escape_string(getpost('avalaralicensekey')) . "'";
	$sSQL.=",avalaracompanycode='" . escape_string(getpost('avalaracompanycode')) . "'";
	$sSQL.=",adminlanguages='" . getpost('adminlanguages') . "'";
	$sSQL.=",adminlang='" . getpost('adminlang') . "'";
	$sSQL.=",storelang='" . getpost('storelang1') . '|' . getpost('storelang2') . '|' . getpost('storelang3') . "'";
	$sSQL.=",adminAltRates='" . getpost('adminAltRates') . "'";
	$sSQL.=", prodFilter=" . $pfarr[0];
	$sSQL.=",sideFilter=" . $pfarr[1];
	$sSQL.=",prodFilterOrder='" . escape_string(getpost("prodfilterorder0")) . "'";
	$sSQL.=",sideFilterOrder='" . escape_string(getpost("prodfilterorder1")) . "'";
	$sSQL.=",prodFilterText='" . escape_string($pftext[0]) . "'";
	$sSQL.=",sideFilterText='" . escape_string($pftext[1]) . "'";
	if(($adminlangsettings & 262144)==262144){
		if($adminlanguages>=1) $sSQL.=",prodFilterText2='" . escape_string($pftext2[0]) . "',sideFilterText2='" . escape_string($pftext2[1]) . "'";
		if($adminlanguages>=2) $sSQL.=",prodFilterText3='" . escape_string($pftext3[0]) . "',sideFilterText3='" . escape_string($pftext3[1]) . "'";
	}
	$sSQL.=",sortOrder=" . getpost('sortorder');
	$sSQL.=",sortOptions=" . $sortoptions;
	$sSQL.=",reCAPTCHAsitekey='" . escape_string(getpost("reCAPTCHAsitekey")) . "'";
	$sSQL.=",reCAPTCHAsecret='" . escape_string(getpost("reCAPTCHAsecret")) . "'";
	$sSQL.=",googleTagID='" . escape_string(getpost("googletagid")) . "'";
	$sSQL.=",googleTagNoHead='" . (getpost("googletagnohead")=='1'?1:0) . "'";
	$sSQL.=",usemailer='" . escape_string(getpost("usemailer")) . "'";
	$sSQL.=",smtpserver='" . escape_string(getpost("smtpserver")) . "'";
	$sSQL.=",smtpport='" . escape_string(getpost("smtpport")) . "'";
	$sSQL.=",smtpsecure='" . escape_string(getpost("smtpsecure")) . "'";
	$sSQL.=",htmlemails='" . escape_string(getpost("htmlemails")) . "'";
	$sSQL.=",emailUser='" . escape_string(getpost("emailUser")) . "'";
	if(getpost("deleteemailpass")=="delete")
		$sSQL.=",emailPass=''";
	elseif(getpost("emailpass")!='')
		$sSQL.=",emailPass='" . escape_string(getpost("emailpass")) . "'";
	if(getpost("deletecurrconvpass")=="delete")
		$sSQL.=",currConvPw=''";
	elseif(getpost("currConvPw")!='')
		$sSQL.=",currConvPw='" . escape_string(getpost("currConvPw")) . "'";
	$sSQL.=",emailfromname='" . escape_string(getpost("emailfromname")) . "'";
	$sSQL.=",uploadDir='" . escape_string(getpost("uploaddir")) . "'";
	$sSQL.=",shipInsuranceInt=" . (is_numeric(getpost('shipinsuranceint'))?getpost('shipinsuranceint'):0);
	$sSQL.=",shipInsuranceDom=" . (is_numeric(getpost('shipinsurancedom'))?getpost('shipinsurancedom'):0);
	$sSQL.=",insuranceIntMin=" . (is_numeric(getpost('insuranceintmin'))?getpost('insuranceintmin'):0);
	$sSQL.=",insuranceDomMin=" . (is_numeric(getpost('insurancedommin'))?getpost('insurancedommin'):0);
	$sSQL.=",insuranceIntPercent=" . (is_numeric(getpost('insuranceintpercent'))?getpost('insuranceintpercent'):0);
	$sSQL.=",insuranceDomPercent=" . (is_numeric(getpost('insurancedompercent'))?getpost('insurancedompercent'):0);
	$sSQL.=",noCarrierDomIns=" . (is_numeric(getpost('nocarrierdomins'))?getpost('nocarrierdomins'):0);
	$sSQL.=",noCarrierIntIns=" . (is_numeric(getpost('nocarrierintins'))?getpost('nocarrierintins'):0);
	
	$sSQL.=",onvacation=" . getpost("onvacation");
	$sSQL.=",vacationmessage='" . escape_string(getpost("vacationmessage")) . "'";
	
	$recaptchauseon=0;
	for($index=1; $index<=20; $index++){
		if(@$_POST['recaptcha'.$index]=='ON') $recaptchauseon+=pow(2,($index-1));
	}
	$sSQL.=",reCAPTCHAuseon=" . $recaptchauseon;
	
	$sSQL.=",adminlangsettings='" . $adminlangsettings . "'  WHERE adminID=1";
	if(!@$GLOBALS['ectdemostore']) ect_query($sSQL) or ect_error();
	
	$sSQL = "UPDATE adminshipping SET adminPacking=" . getpost('packing') . " WHERE adminShipID=1";
	if(!@$GLOBALS['ectdemostore']) ect_query($sSQL) or ect_error();
	
	$sSQL = 'SELECT adminSecret FROM admin WHERE adminID=1';
	$result=ect_query($sSQL) or ect_error();
	$rs=ect_fetch_assoc($result);
	$currsecret=trim($rs['adminSecret']);
	ect_free_result($result);
	if($currsecret==''&&!@$GLOBALS['ectdemostore']) ect_query("UPDATE admin SET adminSecret='itz a ".rand(100000000,999999999)." weal secret ".rand(100000000,999999999)." now' WHERE adminID=1") or ect_error();

	$altrateids = explode(',',getpost('altrateids'));
	$altrateidsintl = explode(',',getpost('altrateidsintl'));
	$altrateuse = explode(',',getpost('altrateuse'));
	$altrateuseintl = explode(',',getpost('altrateuseintl'));
	$altratetext = explode(',',getpost('altratetext'));
	$altratetext2 = explode(',',getpost('altratetext2'));
	$altratetext3 = explode(',',getpost('altratetext3'));

	for($index=1; $index<=$numshipmethods+1; $index++){
		if($index==1 && trim($altratetext[$index-1])=='') $altratetext[$index-1]=$yyFlatShp;
		if($index==2 && trim($altratetext[$index-1])=='') $altratetext[$index-1]=$yyWghtShp;
		if($index==3 && trim($altratetext[$index-1])=='') $altratetext[$index-1]=$yyUSPS;
		if($index==4 && trim($altratetext[$index-1])=='') $altratetext[$index-1]=$yyUPS;
		if($index==5 && trim($altratetext[$index-1])=='') $altratetext[$index-1]=$yyPriShp;
		if($index==6 && trim($altratetext[$index-1])=='') $altratetext[$index-1]=$yyCanPos;
		if($index==7 && trim($altratetext[$index-1])=='') $altratetext[$index-1]=$yyFedex;
		if($index==8 && trim($altratetext[$index-1])=='') $altratetext[$index-1]='FedEx SmartPost';
		if($index==9 && trim($altratetext[$index-1])=='') $altratetext[$index-1]=$yyDHLShp;
		$altratetext[$index-1]=substr($altratetext[$index-1],0,200);
		$altratetext2[$index-1]=substr($altratetext2[$index-1],0,200);
		$altratetext3[$index-1]=substr($altratetext3[$index-1],0,200);
		if(trim($altratetext2[$index-1])=='') $altratetext2[$index-1]=$altratetext[$index-1];
		if(trim($altratetext3[$index-1])=='') $altratetext3[$index-1]=$altratetext[$index-1];

		$sSQL = "UPDATE alternaterates SET altratetext='".escape_string(urldecode($altratetext[$index-1]))."',altratetext2='".escape_string(urldecode($altratetext2[$index-1]))."',altratetext3='".escape_string(urldecode($altratetext3[$index-1]))."', usealtmethod=".$altrateuse[$index-1].",altrateorder=".$index." WHERE altrateid=".$altrateids[$index-1];
		if(!@$GLOBALS['ectdemostore']) ect_query($sSQL) or ect_error();
		$sSQL = "UPDATE alternaterates SET usealtmethodintl=".$altrateuseintl[$index-1].",altrateorderintl=".$index." WHERE altrateid=".$altrateidsintl[$index-1];
		if(!@$GLOBALS['ectdemostore']) ect_query($sSQL) or ect_error();
	}
	print '<meta http-equiv="refresh" content="1; url=adminmain.php">';
}else{
	$allcurrencies=[];
	$numcurrencies=0;
	$sSQL = "SELECT DISTINCT countryCurrency FROM countries ORDER BY countryCurrency";
	$result=ect_query($sSQL) or ect_error();
	while($rs=ect_fetch_assoc($result))
		$allcurrencies[$numcurrencies++]=$rs;
	ect_free_result($result);
}
if(getpost('posted')=="1" && $success){ ?>
			<table width="100%" border="0" cellspacing="0" cellpadding="3">
				<tr> 
					<td width="100%" colspan="2" align="center"><br><strong><?php print $yyUpdSuc?></strong><br><br><?php print $yyNowFrd?><br><br>
						<?php print $yyNoAuto?> <a href="adminmain.php"><strong><?php print $yyClkHer?></strong></a>.<br><br>&nbsp;</td>
				</tr>
			</table>
<?php
}else{
		$sSQL="SELECT adminPacking FROM adminshipping WHERE adminShipID=1";
		$result=ect_query($sSQL) or ect_error();
		$rsShipAdmin=ect_fetch_assoc($result);
		ect_free_result($result);
		
		$sSQL="SELECT adminLogging,adminEmail,adminStoreURL,adminStoreURLSSL,adminProdsPerPage,adminShipping,adminIntShipping,adminZipCode,adminEmailConfirm,adminCountry,adminUnits,adminDelUncompleted,adminClearCart,adminStockManage,adminHandling,adminHandlingPercent,currRate1,currSymbol1,currRate2,currSymbol2,currRate3,currSymbol3,currConvUser,currConvPw,cardinalProcessor,cardinalMerchant,cardinalPwd,avalarastate,avalaraacctno,avalaralicensekey,avalaracompanycode,adminlanguages,adminlang,storelang,reCAPTCHAsitekey,reCAPTCHAsecret,reCAPTCHAuseon,googleTagID,googleTagNoHead,adminlangsettings,adminAltRates,prodFilter,prodFilterOrder,prodFilterText,prodFilterText2,prodFilterText3,sideFilter,sideFilterOrder,sideFilterText,sideFilterText2,sideFilterText3,sortOrder,sortOptions,usemailer,smtpserver,smtpport,smtpsecure,htmlemails,emailUser,emailPass,emailfromname,onvacation,vacationmessage,uploadDir,shipInsuranceInt,shipInsuranceDom,insuranceIntMin,insuranceDomMin,insuranceIntPercent,insuranceDomPercent,noCarrierDomIns,noCarrierIntIns FROM admin WHERE adminID=1";
		$result=ect_query($sSQL) or ect_error();
		$rsAdmin=ect_fetch_assoc($result);
		ect_free_result($result);
?>
<script>
<!--
function formvalidator(theForm){
  if(theForm.prodperpage.value==""){
	alert("<?php print jscheck($yyPlsEntr . ' "' . $yyPPP)?>\".");
	theForm.prodperpage.focus();
	return (false);
  }
  var checkOK = "0123456789";
  var checkStr = theForm.prodperpage.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++){
	ch = checkStr.charAt(i);
	for (j = 0;  j < checkOK.length;  j++)
		if (ch==checkOK.charAt(j))
			break;
	if (j==checkOK.length){
		allValid = false;
			break;
	}
  }
  if (!allValid){
	alert("<?php print jscheck($yyOnlyNum . ' "' . $yyPPP)?>\".");
	theForm.prodperpage.focus();
	return (false);
  }
for(index=1;index<=3;index++){
  var checkOK = "0123456789.";
  var thisRate = eval("theForm.currRate" + index);
  var checkStr = thisRate.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++){
	ch = checkStr.charAt(i);
	for (j = 0;  j < checkOK.length;  j++)
		if (ch==checkOK.charAt(j))
			break;
	if (j==checkOK.length){
		allValid = false;
			break;
	}
  }
  if (!allValid){
	alert("<?php print jscheck($yyOnlyDec . ' "' . $yyConRat)?> " + index + "\".");
	thisRate.focus();
	return (false);
  }
}

  if(theForm.handling.value==""){
	alert('<?php print jscheck($yyPlsEntr . ' "' . $yyHanChg)?>\". <?php print jscheck($yyNoHan)?>');
	theForm.handling.focus();
	return (false);
  }
  var checkOK = "0123456789.";
  var checkStr = theForm.handling.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++){
	ch = checkStr.charAt(i);
	for (j = 0;  j < checkOK.length;  j++)
		if (ch==checkOK.charAt(j))
			break;
	if (j==checkOK.length){
		allValid = false;
			break;
	}
  }
  if (!allValid){
	alert("<?php print jscheck($yyOnlyDec . ' "' . $yyHanChg)?>\".");
	theForm.handling.focus();
	return (false);
  }

	var altrateids="";
	var altrateidsintl="";
	var altrateuse="";
	var altrateuseintl="";
	var altratetext="";
	var altratetext2="";
	var altratetext3="";
	for(var index=1; index<=<?php print $numshipmethods+1?>; index++){
		altrateids+=(document.getElementById("altrateids"+index).value+',');
		altrateidsintl+=(document.getElementById("altrateidsintl"+index).value+',');
		altrateuse+=((document.getElementById("altrateuse"+index).checked?'1':'0')+',');
		altrateuseintl+=((document.getElementById("altrateuseintl"+index).checked?'1':'0')+',');
		altratetext+=(encodeURIComponent(document.getElementById("altratetext_"+index).value)+',');
		altratetext2+=(encodeURIComponent(document.getElementById("altratetext2_"+index).value)+',');
		altratetext3+=(encodeURIComponent(document.getElementById("altratetext3_"+index).value)+',');
	}
	altrateids=altrateids.substr(0,altrateids.length-1);
	altrateidsintl=altrateidsintl.substr(0,altrateidsintl.length-1);
	altrateuse=altrateuse.substr(0,altrateuse.length-1);
	altrateuseintl=altrateuseintl.substr(0,altrateuseintl.length-1);
	altratetext=altratetext.substr(0,altratetext.length-1);
	altratetext2=altratetext2.substr(0,altratetext2.length-1);
	altratetext3=altratetext3.substr(0,altratetext3.length-1);
	// alert(altrateids+"\n"+altrateuse+"\n"+altrateuseintl+"\n"+altratetext+"\n"+altratetext2+"\n"+altratetext3);
	document.getElementById("altrateids").value=altrateids;
	document.getElementById("altrateidsintl").value=altrateidsintl;
	document.getElementById("altrateuse").value=altrateuse;
	document.getElementById("altrateuseintl").value=altrateuseintl;
	document.getElementById("altratetext").value=altratetext;
	document.getElementById("altratetext2").value=altratetext2;
	document.getElementById("altratetext3").value=altratetext3;
	return (true);
}
<?php
	if(trim($rsAdmin['prodFilterOrder'])=='') $prodfilterorder='1,2,4,8,16,32'; else $prodfilterorder=trim($rsAdmin['prodFilterOrder']);
	if(trim($rsAdmin['sideFilterOrder'])=='') $sidefilterorder='1,2,4,8,16,32'; else $sidefilterorder=trim($rsAdmin['sideFilterOrder']);
	$prodfilterorder=replace($prodfilterorder.",","1,",""); // Because Manufacturer (1) is now included with attributes
	$sidefilterorder=replace($sidefilterorder.",","1,","");
	if(substr($prodfilterorder,-1)==',') $prodfilterorder=substr($prodfilterorder,0,-1);
	if(substr($sidefilterorder,-1)==',') $sidefilterorder=substr($sidefilterorder,0,-1);
?>
var currfilterorder=[];
currfilterorder[0]='<?php print $prodfilterorder?>'.split(',');
currfilterorder[1]='<?php print $sidefilterorder?>'.split(',');
function swapFilterTRows(whichfilter,fromrow,torow){
	var srtable=document.getElementById("filtertable"+whichfilter);
	if(srtable.moveRow){
		srtable.moveRow(fromrow+1,torow+1);
	}else{ // FF etc
		var firstRow=srtable.rows[fromrow+1];
		firstRow.parentNode.insertBefore(srtable.rows[torow+1],firstRow);
	}
}
function swapfilteritems(whichfilter,item){
	var thisrow=document.getElementById('filter'+whichfilter+'item'+item);
	var thistemphtml=thisrow.innerHTML;
	var thistempid=thisrow.id,currpos;
	for(var ii in currfilterorder[whichfilter]){
		if(currfilterorder[whichfilter][ii]==item) currpos=parseInt(ii);
	}
	if(currpos!=0){
		swapFilterTRows(whichfilter,currpos-1,currpos)
		var temporder=currfilterorder[whichfilter][currpos-1];
		currfilterorder[whichfilter][currpos-1]=currfilterorder[whichfilter][currpos]
		currfilterorder[whichfilter][currpos]=temporder;
		document.getElementById('prodfilterorder'+whichfilter).value=currfilterorder[whichfilter].join();
	}
	return false;
}
function showhidesmtpservice(tobj){
	for(var ti=1;ti<=5;ti++)
		document.getElementById('smtp'+ti).style.display=tobj.selectedIndex==1?'':'none';
}
var savetabletext=[];
function showhiderow(ishide,tablenum,rownum){
	var thetable=document.getElementById('maintable'+tablenum);
	thetable.rows[rownum].className=ishide?'maintablehidden':'maintablevisible';
}
function hidetablerows(tablenum){
	var thetable=document.getElementById('maintable'+tablenum);
	var tbutton=document.getElementById('mainbutton'+tablenum);
	var tablerows=thetable.rows.length;
	for(var i=1;i < tablerows; i++){
		if(i==1)
			thetable.rows[i].className='maintablehidden';
		else
			setTimeout('showhiderow(true,'+tablenum+','+i+');',30*(i-1));
	}
	tbutton.innerHTML=savetabletext[tablenum]+' <div style="float:right">&#9660;</div>';
}
function showtablerows(tablenum,ttext){
	var thetable=document.getElementById('maintable'+tablenum);
	var tbutton=document.getElementById('mainbutton'+tablenum);
	savetabletext[tablenum]=ttext
	if(thetable.rows[1].className=='maintablevisible'){
		hidetablerows(tablenum);
	}else{
		var tablerows=thetable.rows.length;
		for(var i=1;i < tablerows; i++){
			if(i==1)
				thetable.rows[i].className='maintablevisible';
			else
				setTimeout('showhiderow(false,'+tablenum+','+i+');',30*(i-1));
		}
		tbutton.innerHTML=ttext+' <div style="float:right">&#9650;</div>';
	}
}
function showhidealtrates(obj){
	if(obj.options[obj.selectedIndex].value=="0"){
		document.getElementById('altraterowtitle').style.display='none';
		document.getElementById('altraterow').style.display='none';
		document.getElementById('domesticraterow0').style.display='';
		document.getElementById('domesticraterow1').style.display='';
		document.getElementById('domesticraterow2').style.display='';
		document.getElementById('domesticraterow3').style.display='';
		domesticraterow3
	}else{
		document.getElementById('altraterowtitle').style.display='';
		document.getElementById('altraterow').style.display='';
		document.getElementById('domesticraterow0').style.display='none';
		document.getElementById('domesticraterow1').style.display='none';
		document.getElementById('domesticraterow2').style.display='none';
		document.getElementById('domesticraterow3').style.display='none';
	}
}
function swaptbrows(rid){
	if(rid!=1){
		rid2=rid-1;
		var altrateids=document.getElementById("altrateids"+rid).value;
		var altrateuse=document.getElementById("altrateuse"+rid).checked;
		var methodname=document.getElementById("methodname"+rid).innerHTML;
		var methodnamedom=document.getElementById("methodnamedom"+rid).innerHTML;
		var altratetext=document.getElementById("altratetext_"+rid).value;
		var altratetext2=document.getElementById("altratetext2_"+rid).value;
		var altratetext3=document.getElementById("altratetext3_"+rid).value;
		
		document.getElementById("altrateids"+rid).value=document.getElementById("altrateids"+rid2).value;
		document.getElementById("altrateuse"+rid).checked=document.getElementById("altrateuse"+rid2).checked;
		document.getElementById("methodname"+rid).innerHTML=document.getElementById("methodname"+rid2).innerHTML;
		document.getElementById("methodnamedom"+rid).innerHTML=document.getElementById("methodnamedom"+rid2).innerHTML;
		document.getElementById("altratetext_"+rid).value=document.getElementById("altratetext_"+rid2).value;
		document.getElementById("altratetext2_"+rid).value=document.getElementById("altratetext2_"+rid2).value;
		document.getElementById("altratetext3_"+rid).value=document.getElementById("altratetext3_"+rid2).value;
		
		document.getElementById("altrateids"+rid2).value=altrateids;
		document.getElementById("altrateuse"+rid2).checked=altrateuse;
		document.getElementById("methodname"+rid2).innerHTML=methodname;
		document.getElementById("methodnamedom"+rid2).innerHTML=methodnamedom;
		document.getElementById("altratetext_"+rid2).value=altratetext;
		document.getElementById("altratetext2_"+rid2).value=altratetext2;
		document.getElementById("altratetext3_"+rid2).value=altratetext3;
	}
	return false;
}
function swaptbrowsintl(rid){
	if(rid!=1){
		rid2=rid-1;
		var altrateidsintl=document.getElementById("altrateidsintl"+rid).value;
		var altrateuseintl=document.getElementById("altrateuseintl"+rid).checked;
		var methodnameintl=document.getElementById("methodnameintl"+rid).innerHTML;

		document.getElementById("altrateidsintl"+rid).value=document.getElementById("altrateidsintl"+rid2).value;
		document.getElementById("altrateuseintl"+rid).checked=document.getElementById("altrateuseintl"+rid2).checked;
		document.getElementById("methodnameintl"+rid).innerHTML=document.getElementById("methodnameintl"+rid2).innerHTML;

		document.getElementById("altrateidsintl"+rid2).value=altrateidsintl;
		document.getElementById("altrateuseintl"+rid2).checked=altrateuseintl;
		document.getElementById("methodnameintl"+rid2).innerHTML=methodnameintl;
	}
	return false;
}
//-->
</script>
<form method="post" action="adminmain.php" onsubmit="return formvalidator(this)">
<input type="hidden" name="posted" value="1">
<?php		if(! $success){ ?>
				<p style="text-align:center"><br><br><span style="color:#FF0000"><?php print $errmsg?></span></p>
<?php		} ?>
	<h3 class="round_top half_top"><button class="mainbutton" id="mainbutton1" type="button" onclick="showtablerows(1,'<?php print jsescape($yyStoSet)?>')"><?php print $yyStoSet?> <div style="float:right">&#9660;</div></button></h3>
	<table class="admin-table-b keeptable mainsettings" id="maintable1">
		<tr>
			<th colspan="2"><?php print $yyCouSet.', '.$yyStoreURL.', '.$yyPPP.', '.$yyDefSor?></th>
		</tr>
		<tr class="maintablehidden">
			<td><strong><?php print $yyCouSet?>: </strong></td>
			<td><select name="countrySetting" size="1"><?php
				$sSQL = "SELECT countryID,countryName FROM countries WHERE countryLCID<>'' ORDER BY countryOrder DESC, countryName";
				$rsCountry=ect_query($sSQL) or ect_error();
				while($rs=ect_fetch_assoc($rsCountry)){
					print "<option value='" . $rs['countryID'] . "'";
					if($rsAdmin['adminCountry']==$rs['countryID']) print ' selected';
					print '>'. $rs['countryName'] . "</option>\n";
				}
				ect_free_result($rsCountry);
			?></select></td>
		</tr>
		<tr class="maintablehidden">
			<td colspan="2"><?php print $yyURLEx . ' ' . $yyExample?>:<br><?php
				$guessURL = 'http://' . @$_SERVER['SERVER_NAME'] . @$_SERVER['REQUEST_URI'];
				$guessURL = 'http://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']);
				$wherevs = strpos(strtolower($guessURL),'vsadmin');
				if($wherevs > 0)
					$guessURL = substr($guessURL, 0, $wherevs);
				else
					$guessURL = 'http://www.myurl.com/mystore/';
				print $guessURL;
						?></td>
		</tr>
		<tr class="maintablehidden">
			<td><strong><?php print $yyStoreURL?>:</strong></td>
			<td><input type="text" name="url" size="45" value="<?php print $rsAdmin['adminStoreURL']?>"></td>
		</tr>
		<tr class="maintablehidden">
			<td colspan="2"><div><?php print $yyURLSEx . ' ' . $yyExample?>:</div><?php
				print "<div>" . replace($guessURL,"http:","https:") . "</div>";
				if(@$pathtossl!='') print '<div style="color:#FF1010">You have the parameter &quot;$pathtossl&quot; set in your includes.php file. This parameter is no longer used as the parameter is set here in admin. If you wish to override the parameter, use &quot;$orstoreurlssl&quot;.</div>';
			?></td>
		</tr>
		<tr class="maintablehidden">
			<td><strong>HTTPS <?php print $yyStoreURL?>:</strong></td>
			<td><input type="text" name="urlssl" size="45" value="<?php print $rsAdmin['adminStoreURLSSL']?>"></td>
		</tr>
		<tr class="maintablehidden">
			<td colspan="2"><?php print $yyHMPPP?></td>
		</tr>
		<tr class="maintablehidden">
			<td><strong><?php print $yyPPP?>:</strong></td>
			<td><input type="text" name="prodperpage" class="smallinput" size="10" value="<?php print $rsAdmin['adminProdsPerPage']?>"></td>
		</tr>
		<tr class="maintablehidden">
			<td><strong><?php print $yyDefSor?>:</strong></td>
			<td><select name="sortorder" size="1">
				<option value="0"><?php print $yySelect?></option>
				<option value="1"<?php if($rsAdmin['sortOrder']==1) print ' selected'?>>&#x25B2; <?php print $yySortAl?></option>
				<option value="11"<?php if($rsAdmin['sortOrder']==11) print ' selected'?>>&#x25BC; <?php print $yySortAl?></option>
				<option value="2"<?php if($rsAdmin['sortOrder']==2) print ' selected'?>>&#x25B2; <?php print $yySortID?></option>
				<option value="12"<?php if($rsAdmin['sortOrder']==12) print ' selected'?>>&#x25BC; <?php print $yySortID?></option>
				<option value="14"<?php if($rsAdmin['sortOrder']==14) print ' selected'?>>&#x25B2; Sort By SKU</option>
				<option value="15"<?php if($rsAdmin['sortOrder']==15) print ' selected'?>>&#x25BC; Sort By SKU</option>
				<option value="3"<?php if($rsAdmin['sortOrder']==3) print ' selected'?>>&#x25B2; <?php print $yySortPA?></option>
				<option value="4"<?php if($rsAdmin['sortOrder']==4) print ' selected'?>>&#x25BC; <?php print $yySortPA?></option>
				<option value="6"<?php if($rsAdmin['sortOrder']==6) print ' selected'?>>&#x25B2; <?php print $yySortOA?></option>
				<option value="7"<?php if($rsAdmin['sortOrder']==7) print ' selected'?>>&#x25BC; <?php print $yySortOA?></option>
				<option value="8"<?php if($rsAdmin['sortOrder']==8) print ' selected'?>>&#x25B2; <?php print $yySortDA?></option>
				<option value="9"<?php if($rsAdmin['sortOrder']==9) print ' selected'?>>&#x25BC; <?php print $yySortDA?></option>
				<option value="10"<?php if($rsAdmin['sortOrder']==10) print ' selected'?>><?php print $yySortMa?></option>
				<option value="5"<?php if($rsAdmin['sortOrder']==5) print ' selected'?>><?php print $yySortNS?></option>
				<option value="16"<?php if($rsAdmin['sortOrder']==16) print ' selected'?>>Number of Ratings</option>
				<option value="17"<?php if($rsAdmin['sortOrder']==17) print ' selected'?>>Average Rating</option>
				<option value="18"<?php if($rsAdmin['sortOrder']==18) print ' selected'?>>Number of Sales</option>
				<option value="19"<?php if($rsAdmin['sortOrder']==19) print ' selected'?>>Popularity</option>
				</select></td>
		</tr>
		<tr class="maintablehidden">
			<td><strong><?php print 'Enable XML / JSON request Logging'?>:</strong></td>
			<td><input type="checkbox" name="adminlogging" value="ON"<?php print $rsAdmin['adminLogging']!=0?' checked':''?>> (Do not set for long periods.)</td>
		</tr>
		<tr class="maintablehidden">
			<td><strong><?php print 'Enable Dark Mode'?>:</strong></td>
			<td><input type="hidden" name="setdarkmode" value="1"><input type="checkbox" title="Dark Mode" name="darkmode" value="ON"<?php print @$_COOKIE['darkmode']=='1'?' checked':''?>></td>
		</tr>
		<tr class="maintablehidden">
			<td colspan="2"><div class="mainshow"><button class="mainbuttonbottom" type="button" onclick="hidetablerows(1)"><?php print $yyCliHid?> &#9650;</button> <button class="mainbuttonbottom" type="submit"><?php print $yySubmit?></button></div></td>
		</tr>
	</table>
	
	<h3 class="round_top half_top"><button class="mainbutton" id="mainbutton2" type="button" onclick="showtablerows(2,'<?php print jsescape($yyEmlSet)?>')"><?php print $yyEmlSet?> <div style="float:right">&#9660;</div></button></h3>
	<table class="admin-table-b keeptable mainsettings" id="maintable2">
		<tr>
			<th colspan="2"><?php print 'Confirmation Emails'.', '.$yyEmail.', '.'Email &quot;From&quot; Name'.', '.'Email SMTP Service'.', '.'SMTP Username / Password'?></th>
		</tr>
		<tr class="maintablehidden">
			<td colspan="2">
				<div style="display:inline-block;width:20%"><input type="checkbox" name="emailconfirm" value="ON"<?php if(($rsAdmin['adminEmailConfirm'] & 1)==1) print 'checked="checked"'?>> :<strong><?php print "New Order"?></strong></div>
				<div style="display:inline-block;width:20%"><input type="checkbox" name="affilconfirm" value="ON"<?php if(($rsAdmin['adminEmailConfirm'] & 2)==2) print 'checked="checked"'?>> :<strong><?php print "New Affiliate"?></strong></div>
				<div style="display:inline-block;width:20%"><input type="checkbox" name="customerconfirm" value="ON"<?php if(($rsAdmin['adminEmailConfirm'] & 4)==4) print 'checked="checked"'?>> :<strong><?php print "New Customer"?></strong></div>
				<div style="display:inline-block;width:20%"><input type="checkbox" name="reviewconfirm" value="ON"<?php if(($rsAdmin['adminEmailConfirm'] & 8)==8) print 'checked="checked"'?>> :<strong><?php print "New Review"?></strong></div>
			</td>
		</tr>
		<tr class="maintablehidden">
			<td colspan="2"><?php print $yyCEAddr?></td>
		</tr>
		<tr class="maintablehidden">
			<td><strong><?php print $yyEmail?>:</strong></td>
			<td><input type="text" name="xxemaddr" size="30" value="<?php print $rsAdmin['adminEmail']?>" placeholder="Eg: you@yourstore.com"></td>
		</tr>
		<tr class="maintablehidden">
			<td><strong>Email &quot;From&quot; Name:</strong></td>
			<td><input type="text" name="emailfromname" size="30" value="<?php print $rsAdmin['emailfromname']?>" placeholder="Eg: Your Store Name"></td>
		</tr>
		<tr class="maintablehidden">
			<td><strong><?php print 'Email SMTP Service'?>: </strong></td>
			<td><select name="usemailer" id="usemailer" size="1" onchange="showhidesmtpservice(this)">
				<option value="">Use default PHP mail() function</option>
				<option value="phpmailer"<?php if($rsAdmin['usemailer']=='phpmailer') print ' selected'?>>Use PHP Mailer</option>
				<option value="none"<?php if($rsAdmin['usemailer']=='none') print ' selected'?>>None (No Emails)</option>
				</select>
			</td>
		</tr>
		<tr class="maintablehidden" id="smtp1"<?php if($rsAdmin['usemailer']!='phpmailer') print ' style="display:none"'?>>
			<td><strong>SMTP Username: </strong></td>
			<td><input type="text" size="30" name="emailUser" value="<?php print $rsAdmin['emailUser']?>" placeholder="Eg: you@yourstore.com"></td>
		</tr>
		<tr class="maintablehidden" id="smtp2"<?php if($rsAdmin['usemailer']!='phpmailer') print ' style="display:none"'?>>
			<td><strong>SMTP Password: </strong></td>
			<td><input type="text" size="15" name="emailpass" id="emailpass" value=""<?php if(trim($rsAdmin['emailPass'])=='') print 'disabled="disabled" '?>>
				<select size="1" name="deleteemailpass" onchange="document.getElementById('emailpass').disabled=this.selectedIndex==1"><option value="">Set: YES</option><option value="delete"<?php if(trim($rsAdmin['emailPass'])=='') print ' selected'?>>Set: NO (Or Delete)</option></select>
				<div style="font-size:11px">(Enter new value to change)</div>
			</td>
		</tr>
		<tr class="maintablehidden" id="smtp3"<?php if($rsAdmin['usemailer']!='phpmailer') print ' style="display:none"'?>>
			<td><strong>SMTP Host: </strong></td>
			<td><input type="text" size="30" name="smtpserver" value="<?php print $rsAdmin['smtpserver']?>" placeholder="Eg: smtp.yourhost.com"></td>
		</tr>
		<tr class="maintablehidden" id="smtp4"<?php if($rsAdmin['usemailer']!='phpmailer') print ' style="display:none"'?>>
			<td><strong>SMTP Port: </strong></td>
			<td><input type="text" size="15" name="smtpport" value="<?php print $rsAdmin['smtpport']?>" placeholder="Eg: 587"></td>
		</tr>
		<tr class="maintablehidden" id="smtp5"<?php if($rsAdmin['usemailer']!='phpmailer') print ' style="display:none"'?>>
			<td><strong>SMTP Secure: </strong></td>
			<td><select name="smtpsecure" size="1">
				<option value="">None</option>
				<option value="ssl"<?php if($rsAdmin['smtpsecure']=='ssl') print ' selected'?>>SSL</option>
				<option value="tls"<?php if($rsAdmin['smtpsecure']=='tls') print ' selected'?>>TLS</option>
				</select></td>
		</tr>
		<tr class="maintablehidden">
			<td><strong>Email Format: </strong></td>
			<td><select name="htmlemails" size="1">
				<option value="0">Text Format Emails</option>
				<option value="1"<?php if($rsAdmin['htmlemails']!=0) print ' selected'?>>HTML Format Emails</option>
				</select></td>
		</tr>
		<tr class="maintablehidden">
			<td colspan="2"><div class="mainshow"><button class="mainbuttonbottom" type="button" onclick="hidetablerows(2)"><?php print $yyCliHid?> &#9650;</button> <button class="mainbuttonbottom" type="submit"><?php print $yySubmit?></button></div></td>
		</tr>
	</table>

<?php
	$prodfilter=array($rsAdmin['prodFilter'],$rsAdmin['sideFilter']);
	$filtertext=array(explode('&',trim_($rsAdmin['prodFilterText'])),explode('&',trim_($rsAdmin['sideFilterText'])));
	$filtertext2=array(explode('&',trim_($rsAdmin['prodFilterText2'])),explode('&',trim_($rsAdmin['sideFilterText2'])));
	$filtertext3=array(explode('&',trim_($rsAdmin['prodFilterText3'])),explode('&',trim_($rsAdmin['sideFilterText3'])));
	for($numfilters=0; $numfilters<=1; $numfilters++){
		for($index=0; $index<9; $index++){
			$filtertext[$numfilters][$index]=strreplace("%26","&",@$filtertext[$numfilters][$index]);
			$filtertext2[$numfilters][$index]=strreplace("%26","&",@$filtertext2[$numfilters][$index]);
			$filtertext3[$numfilters][$index]=strreplace("%26","&",@$filtertext3[$numfilters][$index]);
		}
	}
	$sortoptions=$rsAdmin['sortOptions'];
?>
	<input type="hidden" name="prodfilterorder0" id="prodfilterorder0" value="<?php print $prodfilterorder?>">
	<input type="hidden" name="prodfilterorder1" id="prodfilterorder1" value="<?php print $sidefilterorder?>">
	<h3 class="round_top half_top"><button class="mainbutton" id="mainbutton3" type="button" onclick="showtablerows(3,'<?php print jsescape($yyPrFiBr)?>')"><?php print $yyPrFiBr?> <div style="float:right">&#9660;</div></button></h3>
	<table class="admin-table-b keeptable mainsettings" id="maintable3">
		<tr>
			<th colspan="2"><?php print 'Filter products by attributes, keyword, price, keywords'?></th>
		</tr>
		<tr class="maintablehidden">
			<td colspan="2">
<?php
	for($numfilters=0; $numfilters<=1; $numfilters++){
		?><div class="mainfilterdiv">
				<table class="admin-table-b keeptable" id="filtertable<?php print $numfilters?>">
					<tr>
						<th colspan="3"><?php print ($numfilters==0?$yyFilSec:'Configuration for side filter bar (<a href="https://www.ecommercetemplates.com/proddetail.asp?prod=ECT-Side-Filter-Bar" style="color:#FF9966;font-weight:bold">IF INSTALLED</a>).')?></th>
					</tr>
<?php	if($numfilters==0) $filterorderarray=explode(',',$prodfilterorder); else $filterorderarray=explode(',',$sidefilterorder);
		for($indexfilterorder=0; $indexfilterorder<count($filterorderarray); $indexfilterorder++){
			switch($filterorderarray[$indexfilterorder]){
			case 2: ?>
					<tr id="filter<?php print $numfilters?>item2">
						<td width="19"><a href="#"><img src="adminimages/uparrow.png" alt="Move Up" onclick="return swapfilteritems(<?php print $numfilters?>,2)"></a></td>
						<td><strong><?php print $yyFilScr?>: </strong></td>
						<td><input type="checkbox" name="filtercb<?php print $numfilters?>_1" value="ON"<?php if(($prodfilter[$numfilters] & 2)==2) print ' checked'?>> <?php print $yyLabOpt?> <input type="text" name="filtertext<?php print $numfilters?>_1" class="smallinput" size="20" maxlength="50" value="<?php print htmlspecials($filtertext[$numfilters][1])?>">
<?php			if(($adminlangsettings & 262144)==262144){
					if($adminlanguages>=1)	print '<input type="text" name="filtertext'.$numfilters.'_1x2" class="smallinput" size="20" maxlength="50" value="'.htmlspecials($filtertext2[$numfilters][1]).'"> ';
					if($adminlanguages>=2)	print '<input type="text" name="filtertext'.$numfilters.'_1x3" class="smallinput" size="20" maxlength="50" value="'.htmlspecials($filtertext3[$numfilters][1]).'"> ';
				}	?></td>
					</tr>
<?php		break;
			case 4: ?>
		<tr id="filter<?php print $numfilters?>item4">
			<td width="19"><a href="#"><img src="adminimages/uparrow.png" alt="Move Up" onclick="return swapfilteritems(<?php print $numfilters?>,4)"></a></td>
			<td><strong><?php print $yyFilPri?>: </strong></td>
			<td><input type="checkbox" name="filtercb<?php print $numfilters?>_2" value="ON"<?php if(($prodfilter[$numfilters] & 4)==4) print ' checked'?>> <?php print $yyLabOpt?> <input type="text" name="filtertext<?php print $numfilters?>_2" class="smallinput" size="20" maxlength="50" value="<?php print htmlspecials($filtertext[$numfilters][2])?>">
		<?php	if(($adminlangsettings & 262144)==262144){
					if($adminlanguages>=1)	print '<input type="text" name="filtertext'.$numfilters.'_2x2" class="smallinput" size="20" maxlength="50" value="'.htmlspecials($filtertext2[$numfilters][2]).'"> ';
					if($adminlanguages>=2)	print '<input type="text" name="filtertext'.$numfilters.'_2x3" class="smallinput" size="20" maxlength="50" value="'.htmlspecials($filtertext3[$numfilters][2]).'"> ';
				} ?></td>
		</tr>
<?php		break;
			case 8: ?>
		<tr id="filter<?php print $numfilters?>item8">
			<td width="19"><a href="#"><img src="adminimages/uparrow.png" alt="Move Up" onclick="return swapfilteritems(<?php print $numfilters?>,8)"></a></td>
			<td><strong><?php print $yyCusSor?>: </strong></td>
			<td><input type="checkbox" name="filtercb<?php print $numfilters?>_3" value="ON"<?php if(($prodfilter[$numfilters] & 8)==8) print ' checked'?>> <?php print $yyLabOpt?> <input type="text" name="filtertext<?php print $numfilters?>_3" class="smallinput" size="20" maxlength="50" value="<?php print htmlspecials($filtertext[$numfilters][3])?>">
		<?php	if(($adminlangsettings & 262144)==262144){
					if($adminlanguages>=1)	print '<input type="text" name="filtertext'.$numfilters.'_3x2" class="smallinput" size="20" maxlength="50" value="'.htmlspecials($filtertext2[$numfilters][3]).'"> ';
					if($adminlanguages>=2)	print '<input type="text" name="filtertext'.$numfilters.'_3x3" class="smallinput" size="20" maxlength="50" value="'.htmlspecials($filtertext3[$numfilters][3]).'"> ';
				} ?></td>
		</tr>
<?php		break;
			case 16: ?>
		<tr id="filter<?php print $numfilters?>item16">
			<td width="19"><a href="#"><img src="adminimages/uparrow.png" alt="Move Up" onclick="return swapfilteritems(<?php print $numfilters?>,16)"></a></td>
			<td><strong><?php print $yyProPag?>: </strong></td>
			<td><input type="checkbox" name="filtercb<?php print $numfilters?>_4" value="ON"<?php if(($prodfilter[$numfilters] & 16)==16) print ' checked'?>> <?php print $yyLabOpt?> <input type="text" name="filtertext<?php print $numfilters?>_4" class="smallinput" size="20" maxlength="50" value="<?php print htmlspecials($filtertext[$numfilters][4])?>">
		<?php	if(($adminlangsettings & 262144)==262144){
					if($adminlanguages>=1)	print '<input type="text" name="filtertext'.$numfilters.'_4x2" class="smallinput" size="20" maxlength="50" value="'.htmlspecials($filtertext2[$numfilters][4]).'"> ';
					if($adminlanguages>=2)	print '<input type="text" name="filtertext'.$numfilters.'_4x3" class="smallinput" size="20" maxlength="50" value="'.htmlspecials($filtertext3[$numfilters][4]).'"> ';
				} ?></td>
		</tr>
<?php		break;
			case 32: ?>
		<tr id="filter<?php print $numfilters?>item32">
			<td width="19"><a href="#"><img src="adminimages/uparrow.png" alt="Move Up" onclick="return swapfilteritems(<?php print $numfilters?>,32)"></a></td>
			<td><strong><?php print $yyFilKey?>: </strong></td>
			<td><input type="checkbox" name="filtercb<?php print $numfilters?>_5" value="ON"<?php if(($prodfilter[$numfilters] & 32)==32) print ' checked'?>> <?php print $yyLabOpt?> <input type="text" name="filtertext<?php print $numfilters?>_5" class="smallinput" size="20" maxlength="50" value="<?php print htmlspecials($filtertext[$numfilters][5])?>">
		<?php	if(($adminlangsettings & 262144)==262144){
					if($adminlanguages>=1)	print '<input type="text" name="filtertext'.$numfilters.'_5x2" class="smallinput" size="20" maxlength="50" value="'.htmlspecials($filtertext2[$numfilters][5]).'"> ';
					if($adminlanguages>=2)	print '<input type="text" name="filtertext'.$numfilters.'_5x3" class="smallinput" size="20" maxlength="50" value="'.htmlspecials($filtertext3[$numfilters][5]).'"> ';
				} ?></td>
		</tr>
<?php		}
		} ?>
				</table>
			</div><?php
	} ?>
			</td>
		</tr>
		<tr class="maintablehidden">
			<td colspan="2" style="padding-left:20px">Options for Customer Defined Sort: (<a href="https://www.ecommercetemplates.com/phphelp/ecommplus/parameters.asp#filterbar" target="_blank">The text for these can be changed using these parameters...</a>)</td>
		</tr>
		<tr class="maintablehidden">
			<td colspan="2">
				<table width="100%"><tr>
				<td style="font-size:10px;border:0;width:16.66%"><label><input type="checkbox" name="sortid1" value="ON"<?php if(($sortoptions & pow(2,0))!=0) print ' checked'?>> &#x25B2; <?php print $yySortAl?></label></td>
				<td style="font-size:10px;border:0;width:16.66%"><label><input type="checkbox" name="sortid2" value="ON"<?php if(($sortoptions & pow(2,1))!=0) print ' checked'?>> &#x25B2; <?php print $yySortID?></label></td>
				<td style="font-size:10px;border:0;width:16.66%"><label><input type="checkbox" name="sortid14" value="ON"<?php if(($sortoptions & pow(2,13))!=0) print ' checked'?>> &#x25B2; Sort By SKU</label></td>
				<td style="font-size:10px;border:0;width:16.66%"><label><input type="checkbox" name="sortid3" value="ON"<?php if(($sortoptions & pow(2,2))!=0) print ' checked'?>> &#x25B2; <?php print $yySortPA?></label></td>
				<td style="font-size:10px;border:0;width:16.66%"><label><input type="checkbox" name="sortid6" value="ON"<?php if(($sortoptions & pow(2,5))!=0) print ' checked'?>> &#x25B2; <?php print $yySortOA?></label></td>
				<td style="font-size:10px;border:0;width:16.66%"><label><input type="checkbox" name="sortid8" value="ON"<?php if(($sortoptions & pow(2,7))!=0) print ' checked'?>> &#x25B2; <?php print $yySortDA?></label></td>
				</tr><tr>
				<td style="font-size:10px;border:0"><label><input type="checkbox" name="sortid11" value="ON"<?php if(($sortoptions & pow(2,10))!=0) print ' checked'?>> &#x25BC; <?php print $yySortAl?></label></td>
				<td style="font-size:10px;border:0"><label><input type="checkbox" name="sortid12" value="ON"<?php if(($sortoptions & pow(2,11))!=0) print ' checked'?>> &#x25BC; <?php print $yySortID?></label></td>
				<td style="font-size:10px;border:0"><label><input type="checkbox" name="sortid15" value="ON"<?php if(($sortoptions & pow(2,14))!=0) print ' checked'?>> &#x25BC; Sort By SKU</label></td>
				<td style="font-size:10px;border:0"><label><input type="checkbox" name="sortid4" value="ON"<?php if(($sortoptions & pow(2,3))!=0) print ' checked'?>> &#x25BC; <?php print $yySortPA?></label></td>
				<td style="font-size:10px;border:0"><label><input type="checkbox" name="sortid7" value="ON"<?php if(($sortoptions & pow(2,6))!=0) print ' checked'?>> &#x25BC; <?php print $yySortOA?></label></td>
				<td style="font-size:10px;border:0"><label><input type="checkbox" name="sortid9" value="ON"<?php if(($sortoptions & pow(2,8))!=0) print ' checked'?>> &#x25BC; <?php print $yySortDA?></label></td>
				</tr><tr>
				<td style="font-size:10px;border:0"><label><input type="checkbox" name="sortid5" value="ON"<?php if(($sortoptions & pow(2,4))!=0) print ' checked'?>> <?php print $yySortNS?></label></td>
				<td style="font-size:10px;border:0"><label><input type="checkbox" name="sortid10" value="ON"<?php if(($sortoptions & pow(2,9))!=0) print ' checked'?>> <?php print $yySortMa?></label></td>
				<td style="font-size:10px;border:0"><label><input type="checkbox" name="sortid16" value="ON"<?php if(($sortoptions & pow(2,15))!=0) print ' checked'?>> Number of Ratings</label></td>
				<td style="font-size:10px;border:0"><label><input type="checkbox" name="sortid17" value="ON"<?php if(($sortoptions & pow(2,16))!=0) print ' checked'?>> Average Rating</label></td>
				<td style="font-size:10px;border:0"><label><input type="checkbox" name="sortid18" value="ON"<?php if(($sortoptions & pow(2,17))!=0) print ' checked'?>> Number of Sales</label></td>
				<td style="font-size:10px;border:0"><label><input type="checkbox" name="sortid19" value="ON"<?php if(($sortoptions & pow(2,18))!=0) print ' checked'?>> Popularity</label></td>
				</tr></table>
			</td>
		</tr>
		<tr class="maintablehidden">
			<td colspan="2"><div class="mainshow"><button class="mainbuttonbottom" type="button" onclick="hidetablerows(3)"><?php print $yyCliHid?> &#9650;</button> <button class="mainbuttonbottom" type="submit"><?php print $yySubmit?></button></div></td>
		</tr>
	</table>

	<h3 class="round_top half_top"><button class="mainbutton" id="mainbutton4" type="button" onclick="showtablerows(4,'<?php print jsescape($yyShHaSe)?>')"><?php print $yyShHaSe?> <div style="float:right">&#9660;</div></button></h3>
	<table class="admin-table-b keeptable mainsettings" id="maintable4">
		<tr>
			<th colspan="2"><?php print $yyShpMet.', '.'Alternate Rates'.', '.'Product Packing'.', '.'Origin Zip'.', '.$yyHanChg.', '.'Shipping Insurance'?></th>
		</tr>
		<tr class="maintablehidden">
			<td colspan="2"><?php print $yyWAltRa?></td>
		</tr>
		<tr class="maintablehidden">
			<td><strong><?php print $yyUseAlt?>: </strong></td>
			<td><select name="adminAltRates" size="1" onchange="showhidealtrates(this)">
				<option value="0"><?php print $yyNoAltR?></option>
				<option value="1"<?php if($rsAdmin['adminAltRates']==1) print ' selected'?>><?php print $yyAlRaMe?></option>
				<option value="2"<?php if($rsAdmin['adminAltRates']==2) print ' selected'?>><?php print $yyAlRaTo?></option>
				</select>
			</td>
		</tr>
		<tr class="maintablehidden" id="domesticraterow0"<?php if((int)$rsAdmin['adminAltRates']!=0) print ' style="display:none"'?>>
			<td colspan="2"><?php print $yySelShD?></td>
		</tr>
		<tr class="maintablehidden" id="domesticraterow1"<?php if((int)$rsAdmin['adminAltRates']!=0) print ' style="display:none"'?>>
			<td><strong><?php print $yyShpTyp?>: </strong></td>
			<td><select name="shipping" size="1">
					<option value="0"><?php print $yyNoShp?></option>
					<option value="1"<?php if((int)($rsAdmin["adminShipping"])==1) print ' selected'?>><?php print $yyFlatShp?></option>
					<option value="2"<?php if((int)($rsAdmin["adminShipping"])==2) print ' selected'?>><?php print $yyWghtShp?></option>
					<option value="5"<?php if((int)($rsAdmin["adminShipping"])==5) print ' selected'?>><?php print $yyPriShp?></option>
					<option value="3"<?php if((int)($rsAdmin["adminShipping"])==3) print ' selected'?>><?php print $yyUSPS?></option>
					<option value="4"<?php if((int)($rsAdmin["adminShipping"])==4) print ' selected'?>><?php print $yyUPS?></option>
					<option value="11"<?php if((int)($rsAdmin["adminShipping"])==11) print ' selected'?>><?php print 'UPS SurePost'?></option>
					<option value="6"<?php if((int)($rsAdmin["adminShipping"])==6) print ' selected'?>><?php print $yyCanPos?></option>
					<option value="7"<?php if((int)($rsAdmin["adminShipping"])==7) print ' selected'?>><?php print $yyFedex?></option>
					<option value="8"<?php if((int)($rsAdmin["adminShipping"])==8) print ' selected'?>>FedEx SmartPost</option>
					<option value="9"<?php if((int)($rsAdmin["adminShipping"])==9) print ' selected'?>><?php print $yyDHLShp?></option>
					<option value="10"<?php if((int)($rsAdmin["adminShipping"])==10) print ' selected'?>>Australia Post</option>
					</select></td>
		</tr>
		<tr class="maintablehidden" id="domesticraterow2"<?php if((int)$rsAdmin['adminAltRates']!=0) print ' style="display:none"'?>>
			<td colspan="2"><?php print $yySelShI?></td>
		</tr>
		<tr class="maintablehidden" id="domesticraterow3"<?php if((int)$rsAdmin['adminAltRates']!=0) print ' style="display:none"'?>>
			<td><strong><?php print $yyShpTyp?>: </strong></td>
			<td><select name="intshipping" size="1">
					<option value="0"><?php print $yySamDom?></option>
					<option value="1"<?php if((int)($rsAdmin["adminIntShipping"])==1) print ' selected'?>><?php print $yyFlatShp?></option>
					<option value="2"<?php if((int)($rsAdmin["adminIntShipping"])==2) print ' selected'?>><?php print $yyWghtShp?></option>
					<option value="5"<?php if((int)($rsAdmin["adminIntShipping"])==5) print ' selected'?>><?php print $yyPriShp?></option>
					<option value="3"<?php if((int)($rsAdmin["adminIntShipping"])==3) print ' selected'?>><?php print $yyUSPS?></option>
					<option value="4"<?php if((int)($rsAdmin["adminIntShipping"])==4) print ' selected'?>><?php print $yyUPS?></option>
					<option value="6"<?php if((int)($rsAdmin["adminIntShipping"])==6) print ' selected'?>><?php print $yyCanPos?></option>
					<option value="7"<?php if((int)($rsAdmin["adminIntShipping"])==7) print ' selected'?>><?php print $yyFedex?></option>
					<option value="9"<?php if((int)($rsAdmin["adminIntShipping"])==9) print ' selected'?>><?php print $yyDHLShp?></option>
					<option value="10"<?php if((int)($rsAdmin["adminIntShipping"])==10) print ' selected'?>>Australia Post</option>
					</select></td>
		</tr>
		<tr class="maintablehidden" id="altraterowtitle"<?php if($rsAdmin['adminAltRates']==0) print ' style="display:none"'?>>
			<td colspan="2"><?php print $yyAltSel?></td>
		</tr>
		<tr class="maintablehidden" id="altraterow"<?php if($rsAdmin['adminAltRates']==0) print ' style="display:none"'?>>
			<td colspan="2" align="center">
		<input type="hidden" name="altrateids" id="altrateids" value="">
		<input type="hidden" name="altrateidsintl" id="altrateidsintl" value="">
		<input type="hidden" name="altrateuse" id="altrateuse" value="">
		<input type="hidden" name="altrateuseintl" id="altrateuseintl" value="">
		<input type="hidden" name="altratetext" id="altratetext" value="">
		<input type="hidden" name="altratetext2" id="altratetext2" value="">
		<input type="hidden" name="altratetext3" id="altratetext3" value="">
		<table>
		<tr>
		<td valign="top" width="40%">
			<div style="font-weight:bold;text-align:center">Shipping Method Label</div>
			<table>
<?php			$index=1;
				$sSQL = "SELECT altrateid,altratename,altratetext,altratetext2,altratetext3,usealtmethod,usealtmethodintl FROM alternaterates ORDER BY (usealtmethod | usealtmethodintl) DESC,altrateorder,altrateid";
				$result=ect_query($sSQL) or ect_error();
				while($rs2=ect_fetch_assoc($result)){ ?>
				<tr height="40">
					<td><span id="methodname<?php print $index?>"><?php print $rs2['altratename'] ?></span></td>
					<td><input type="text" id="altratetext_<?php print $index?>" size="30" value="<?php print htmlspecials($rs2['altratetext']) ?>"><br>
<?php				for($index2=2; $index2<=3; $index2++){
						if($index2<=($adminlanguages+1) && ($adminlangsettings & 65536)==65536){ ?>
					<input type="text" id="altratetext<?php print $index2?>_<?php print $index?>" size="30" value="<?php print htmlspecials($rs2['altratetext'.$index2]) ?>"><br>
<?php					}else{ ?>
					<input type="hidden" id="altratetext<?php print $index2?>_<?php print $index?>" value="<?php print htmlspecials($rs2['altratetext'.$index2]) ?>">
<?php					}
					} ?></td>
				</tr>
<?php				$index++;
				}
				ect_free_result($result); ?>
			</table>
		</td>
		<td valign="top" width="30%">
			<div style="font-weight:bold;text-align:center">Domestic Shipping Order</div>
			<table>
<?php			$index=1;
				$sSQL = "SELECT altrateid,altratename,usealtmethod FROM alternaterates ORDER BY ABS(usealtmethod | usealtmethodintl) DESC,altrateorder,altrateid";
				$result=ect_query($sSQL) or ect_error();
				while($rs2=ect_fetch_assoc($result)){ ?>
				<tr height="40">
					<td>
					<input type="hidden" id="altrateids<?php print $index?>" value="<?php print $rs2['altrateid']?>">
<?php				if($index==0){
						print '&nbsp;';
					}else{ ?>
					<a href="#"><img src="adminimages/uparrow.png" alt="Move Up" onclick="return swaptbrows(<?php print $index?>)"></a>
<?php				} ?></td>
					<td><input type="checkbox" id="altrateuse<?php print $index?>" value="ON"<?php print ($rs2['usealtmethod']  ? ' checked' : '')?>></td>
					<td><span id="methodnamedom<?php print $index?>"><?php print $rs2['altratename']?></span></td>
				</tr>
<?php				$index++;
				}
				ect_free_result($result); ?>
			</table>
		</td>
		<td valign="top" width="30%">
			<div style="font-weight:bold;text-align:center">International Shipping Order</div>
			<table>
<?php			$index=1;
				$sSQL = "SELECT altrateid,altratename,usealtmethodintl FROM alternaterates ORDER BY ABS(usealtmethodintl | usealtmethod) DESC,altrateorderintl,altrateid";
				$result=ect_query($sSQL) or ect_error();
				while($rs2=ect_fetch_assoc($result)){ ?>
				<tr height="40">
					<td>
					<input type="hidden" id="altrateidsintl<?php print $index?>" value="<?php print $rs2['altrateid']?>">
<?php				if($index==0){
						print '&nbsp;';
					}else{ ?>
					<a href="#"><img src="adminimages/uparrow.png" alt="Move Up" onclick="return swaptbrowsintl(<?php print $index?>)"></a>
<?php				} ?></td>
					<td><input type="checkbox" id="altrateuseintl<?php print $index?>" value="ON"<?php print ($rs2['usealtmethodintl']  ? ' checked' : '')?>></td>
					<td><span id="methodnameintl<?php print $index?>"><?php print $rs2['altratename']?></span></td>
				</tr>
<?php				$index++;
				}
				ect_free_result($result); ?>
			</table>
		</td>
		</tr>
		</table>
			</td>
		</tr>
		<tr class="maintablehidden">
			<td colspan="2"><?php print $yyHowPck?><br><span style="font-size:10px"><?php print $yyOnlyAf?></span></td>
		</tr>
		<tr class="maintablehidden">
			<td><strong><?php print $yyPackPr?>: </strong></td>
			<td><select name="packing" size="1">
					<option value="0"><?php print $yyPckSep?></option>
					<option value="1"<?php if((int)($rsShipAdmin["adminPacking"])==1) print ' selected'?>><?php print $yyPckTog?></option>
					</select></td>
		</tr>
		<tr class="maintablehidden">
			<td colspan="2"><?php print $yyEntZip?></td>
		</tr>
		<tr class="maintablehidden">
			<td><strong><?php print $yyZip?>: </strong></td>
			<td><input type="text" name="zipcode" class="smallinput" size="10" value="<?php print $rsAdmin['adminZipCode']?>"></td>
		</tr>
		<tr class="maintablehidden">
			<td colspan="2"><?php print $yyUPSUnt?></td>
		</tr>
		<tr class="maintablehidden">
			<td><strong><?php print $yyShpUnt?>: </strong><br><br><strong><?php print $yyDims?>: </strong></td>
			<td><select name="adminUnits" size="1">
					<option value="1"<?php if(((int)$rsAdmin["adminUnits"] & 3)==1) print ' selected'?>>LBS</option>
					<option value="0"<?php if(((int)$rsAdmin["adminUnits"] & 3)==0) print ' selected'?>>KGS</option>
				</select><br><br>
				<select name="adminDims" size="1">
					<option value="0"><?php print $yyNotSpe?></option>
					<option value="4"<?php if(((int)$rsAdmin["adminUnits"] & 12)==4) print ' selected'?>>IN</option>
					<option value="8"<?php if(((int)$rsAdmin["adminUnits"] & 12)==8) print ' selected'?>>CM</option>
				</select></td>
		</tr>
		<tr class="maintablehidden">
			<td colspan="2"><ul>
				<li><span style="font-size:10px"><?php print $redasterix.$yyUntNote?></span></li>
			</ul></td>
		</tr>
		<tr class="maintablehidden">
			<td colspan="2"><?php print $yyHandEx?></td>
		</tr>
		<tr class="maintablehidden">
			<td><strong><?php print $yyHanChg?>: </strong><br><br><strong><?php print $yyHanChg . ' (' . $yyPercen . ')'?>: </strong></td>
			<td><input type="text" name="handling" class="smallinput" size="10" value="<?php print $rsAdmin['adminHandling']?>"><br><br><input type="text" name="handlingpercent" class="smallinput" size="10" style="text-align:right" value="<?php print $rsAdmin['adminHandlingPercent']?>">%</td>
		</tr>
		<tr class="maintablehidden">
			<td colspan="2">If you wish to add shipping insurance, please set it below. Please note that the online carriers will calculate insurance automatically. Rates set here will be used in the case of Free Shipping however, and for Weight / Price based shipping.</td>
		</tr>
		<tr class="maintablehidden">
			<td><strong><?php print 'Domestic Shipments Insurance'?>: </strong></td>
			<td><select name="shipinsurancedom" size="1">
					<option value="0">Don't add insurance</option>
					<option value="1"<?php if($rsAdmin['shipInsuranceDom']==1) print ' selected'?>>Automatically add insurance</option>
					<option value="2"<?php if($rsAdmin['shipInsuranceDom']==2) print ' selected'?>>Ask the customer if they would like insurance</option>
					<option value="3"<?php if($rsAdmin['shipInsuranceDom']==3) print ' selected'?>>Force the customer to choose if they want insurance or not</option>
					</select>
			</td>
		</tr>
		<tr class="maintablehidden">
			<td><strong><?php print 'International Shipments Insurance'?>: </strong></td>
			<td><select name="shipinsuranceint" size="1">
					<option value="0">Don't add insurance</option>
					<option value="1"<?php if($rsAdmin['shipInsuranceInt']==1) print ' selected'?>>Automatically add insurance</option>
					<option value="2"<?php if($rsAdmin['shipInsuranceInt']==2) print ' selected'?>>Ask the customer if they would like insurance</option>
					<option value="3"<?php if($rsAdmin['shipInsuranceInt']==3) print ' selected'?>>Force the customer to choose if they want insurance or not</option>
					</select>
			</td>
		</tr>
		<tr class="maintablehidden">
			<td colspan="2">If not using an online shipping rates service (or in some Free Shipping scenarios) please enter the default for insurance</td>
		</tr>
		<tr class="maintablehidden">
			<td>
				<strong><?php print 'Domestic Insurance Cost'?>: </strong>
				<div style="padding-top:10px"><input type="checkbox" value="1" name="nocarrierdomins"<?php print ($rsAdmin['noCarrierDomIns']!=0?' checked="checked"':'')?>> Also use for online carriers.</div>
			</td>
			<td>
				<div style="display:table">
					<div class="ecttablerow"><div style="text-align:right">Percentage:</div><div><input type="text" name="insurancedompercent" class="smallinput" size="10" value="<?php print $rsAdmin['insuranceDomPercent']?>"></div></div>
					<div class="ecttablerow"><div style="text-align:right">Minimum:</div><div><input type="text" name="insurancedommin" class="smallinput" size="10" value="<?php print $rsAdmin['insuranceDomMin']?>"></div></div>
				</div>
			</td>
		</tr>
		<tr class="maintablehidden">
			<td>
				<strong><?php print 'International Insurance Cost'?>: </strong>
				<div style="padding-top:10px"><input type="checkbox" value="1" name="nocarrierintins"<?php print ($rsAdmin['noCarrierIntIns']!=0?' checked="checked"':'')?>> Also use for online carriers.</div>
			</td>
			<td>
				<div style="display:table">
					<div class="ecttablerow"><div style="text-align:right">Percentage:</div><div><input type="text" name="insuranceintpercent" class="smallinput" size="10" value="<?php print $rsAdmin['insuranceIntPercent']?>"></div></div>
					<div class="ecttablerow"><div style="text-align:right">Minimum:</div><div><input type="text" name="insuranceintmin" class="smallinput" size="10" value="<?php print $rsAdmin['insuranceIntMin']?>"></div></div>
				</div>
			</td>
		</tr>
		<tr class="maintablehidden">
			<td colspan="2"><div class="mainshow"><button class="mainbuttonbottom" type="button" onclick="hidetablerows(4)"><?php print $yyCliHid?> &#9650;</button> <button class="mainbuttonbottom" type="submit"><?php print $yySubmit?></button></div></td>
		</tr>
	</table>

	<h3 class="round_top half_top"><button class="mainbutton" id="mainbutton5" type="button" onclick="showtablerows(5,'<?php print jsescape($yyOrdMan)?>')"><?php print $yyOrdMan?> <div style="float:right">&#9660;</div></button></h3>
	<table class="admin-table-b keeptable mainsettings" id="maintable5">
		<tr>
			<th colspan="2"><?php print $yyStock.', '.'Incomplete Order Deletion'.', '.'Vacation Message'?></th>
		</tr>
		<tr class="maintablehidden">
			<td><strong><?php print $yyStock?>: </strong></td>
			<td><select name="stockManage" size="1">
					<option value="0"><?php print $yyNoStk?></option>
					<option value="1"<?php if((int)($rsAdmin['adminStockManage'])!=0) print ' selected'?>> &nbsp;&nbsp; <?php print $yyOn?></option>
					</select></td>
		</tr>
		<tr class="maintablehidden">
			<td colspan="2"><?php print $yyDelUnc?></td>
		</tr>
		<tr class="maintablehidden">
			<td><strong><?php print $yyDelAft?>:</strong></td>
			<td><select name="deleteUncompleted" size="1">
					<option value="0"><?php print $yyNever?></option>
					<option value="1"<?php if((int)($rsAdmin['adminDelUncompleted'])==1) print ' selected'?>>1 <?php print $yyDay?></option>
					<option value="2"<?php if((int)($rsAdmin['adminDelUncompleted'])==2) print ' selected'?>>2 <?php print $yyDays?></option>
					<option value="3"<?php if((int)($rsAdmin['adminDelUncompleted'])==3) print ' selected'?>>3 <?php print $yyDays?></option>
					<option value="4"<?php if((int)($rsAdmin['adminDelUncompleted'])==4) print ' selected'?>>4 <?php print $yyDays?></option>
					<option value="7"<?php if((int)($rsAdmin['adminDelUncompleted'])==7) print ' selected'?>>1 <?php print $yyWeek?></option>
					<option value="14"<?php if((int)($rsAdmin['adminDelUncompleted'])==14) print ' selected'?>>2 <?php print $yyWeeks?></option>
					<option value="28"<?php if((int)$rsAdmin['adminDelUncompleted']==28) print ' selected'?>>4 <?php print $yyWeeks?></option>
					<option value="70"<?php if((int)$rsAdmin['adminDelUncompleted']==70) print ' selected'?>>10 <?php print $yyWeeks?></option>
					<option value="140"<?php if((int)$rsAdmin['adminDelUncompleted']==140) print ' selected'?>>20 <?php print $yyWeeks?></option>
					<option value="210"<?php if((int)$rsAdmin['adminDelUncompleted']==210) print ' selected'?>>30 <?php print $yyWeeks?></option>
					<option value="364"<?php if((int)$rsAdmin['adminDelUncompleted']==364) print ' selected'?>>52 <?php print $yyWeeks?></option>
					<option value="525"<?php if((int)$rsAdmin['adminDelUncompleted']==525) print ' selected'?>>75 <?php print $yyWeeks?></option>
					<option value="728"<?php if((int)$rsAdmin['adminDelUncompleted']==728) print ' selected'?>>104 <?php print $yyWeeks?></option>
					</select><?php
			if(! @$GLOBALS['enableclientlogin']) writehiddenvar("adminClearCart",$rsAdmin['adminClearCart']) ?></td>
		</tr>
<?php			if(@$GLOBALS['enableclientlogin']){ ?>
		<tr class="maintablehidden">
			<td colspan="2"><?php print $yyRemLII?></td>
		</tr>
		<tr class="maintablehidden">
			<td><strong><?php print $yyDelAft?>:</strong></td>
			<td><select name="adminClearCart" size="1">
					<option value="0"><?php print $yyNever?></option>
					<option value="14"<?php if((int)$rsAdmin['adminClearCart']==14) print ' selected'?>>2 <?php print $yyWeeks?></option>
					<option value="28"<?php if((int)$rsAdmin['adminClearCart']==28) print ' selected'?>>4 <?php print $yyWeeks?></option>
					<option value="70"<?php if((int)$rsAdmin['adminClearCart']==70) print ' selected'?>>10 <?php print $yyWeeks?></option>
					<option value="140"<?php if((int)$rsAdmin['adminClearCart']==140) print ' selected'?>>20 <?php print $yyWeeks?></option>
					<option value="210"<?php if((int)$rsAdmin['adminClearCart']==210) print ' selected'?>>30 <?php print $yyWeeks?></option>
					<option value="364"<?php if((int)$rsAdmin['adminClearCart']==364) print ' selected'?>>52 <?php print $yyWeeks?></option>
					<option value="525"<?php if((int)$rsAdmin['adminClearCart']==525) print ' selected'?>>75 <?php print $yyWeeks?></option>
					<option value="728"<?php if((int)$rsAdmin['adminClearCart']==728) print ' selected'?>>104 <?php print $yyWeeks?></option>
					</select></td>
		</tr>
<?php			} ?>
		<tr class="maintablehidden">
			<td colspan="2">Temporarily close your store for a vacation, for instance</td>
		</tr>
		<tr class="maintablehidden">
			<td><strong>On vacation:</strong></td>
			<td><select name="onvacation" size="1" onchange="document.getElementById('vacationmessage').style.display=this.selectedIndex==0?'none':''"><option value="0">No</option><option value="1"<?php if($rsAdmin['onvacation']!=0) print ' selected'?>>Yes, close my store</option></select></td>
		</tr>
		<tr id="vacationmessage"<?php if($rsAdmin['onvacation']==0) print ' style="display:none"'?>>
			<td><strong><?php print 'Vacation Message'?>: </strong></td>
			<td><textarea name="vacationmessage" cols="58" rows="5"><?php print htmlspecials($rsAdmin['vacationmessage'])?></textarea></td>
		</tr>
		<tr class="maintablehidden">
			<td colspan="2"><div class="mainshow"><button class="mainbuttonbottom" type="button" onclick="hidetablerows(5)"><?php print $yyCliHid?> &#9650;</button> <button class="mainbuttonbottom" type="submit"><?php print $yySubmit?></button></div></td>
		</tr>
	</table>

	<h3 class="round_top half_top"><button class="mainbutton" id="mainbutton6" type="button" onclick="showtablerows(6,'<?php print jsescape($yyLaSet)?>')"><?php print $yyLaSet?> <div style="float:right">&#9660;</div></button></h3>
	<table class="admin-table-b keeptable mainsettings" id="maintable6">
		<tr><th colspan="2">Admin Language and Store Languages</th></tr>
		<tr class="maintablehidden">
			<td><strong>Admin Language: </strong></td>
			<td><select name="adminlang" size="1">
				<option value="">English</option>
				<option value="fr"<?php if($rsAdmin['adminlang']=='fr') print ' selected'?>>French / Fran&ccedil;ais</option>
				<option value="de"<?php if($rsAdmin['adminlang']=='de') print ' selected'?>>German / Deutsch</option>
				<option value="it"<?php if($rsAdmin['adminlang']=='it') print ' selected'?>>Italian / Italiano</option>
				<option value="nl"<?php if($rsAdmin['adminlang']=='nl') print ' selected'?>>Nederlands / Dutch</option>
				<option value="es"<?php if($rsAdmin['adminlang']=='es') print ' selected'?>>Spanish / Espa&ntilde;ol</option>
				</select></td>
		</tr>
		<tr class="maintablehidden">
			<td><strong>Store Language: </strong></td>
			<td><?php
				$storelang1=$storelang2=$storelang3='';
				$storelangarr=explode('|',$rsAdmin['storelang']);
				$storelang1=@$storelangarr[0];
				$storelang2=@$storelangarr[1];
				$storelang3=@$storelangarr[2];
				?><div><select name="storelang1" size="1">
				<option value="">English</option>
				<option value="dk"<?php if($storelang1=='dk') print ' selected'?>>Danish / Dansk</option>
				<option value="fr"<?php if($storelang1=='fr') print ' selected'?>>French / Fran&ccedil;ais</option>
				<option value="de"<?php if($storelang1=='de') print ' selected'?>>German / Deutsch</option>
				<option value="it"<?php if($storelang1=='it') print ' selected'?>>Italian / Italiano</option>
				<option value="nl"<?php if($storelang1=='nl') print ' selected'?>>Nederlands / Dutch</option>
				<option value="pt"<?php if($storelang1=='pt') print ' selected'?>>Portugese / Portugu&ecirc;s</option>
				<option value="es"<?php if($storelang1=='es') print ' selected'?>>Spanish / Espa&ntilde;ol</option>
				</select></div>
				<div id="storelang2"<?php if((int)$rsAdmin['adminlanguages']<1) print ' style="display:none"' ?>><select name="storelang2" size="1">
				<option value="">English</option>
				<option value="dk"<?php if($storelang2=='dk') print ' selected'?>>Danish / Dansk</option>
				<option value="fr"<?php if($storelang2=='fr') print ' selected'?>>French / Fran&ccedil;ais</option>
				<option value="de"<?php if($storelang2=='de') print ' selected'?>>German / Deutsch</option>
				<option value="it"<?php if($storelang2=='it') print ' selected'?>>Italian / Italiano</option>
				<option value="nl"<?php if($storelang2=='nl') print ' selected'?>>Nederlands / Dutch</option>
				<option value="pt"<?php if($storelang2=='pt') print ' selected'?>>Portugese / Portugu&ecirc;s</option>
				<option value="es"<?php if($storelang2=='es') print ' selected'?>>Spanish / Espa&ntilde;ol</option>
				</select></div>
				<div id="storelang3"<?php if((int)$rsAdmin['adminlanguages']<2) print ' style="display:none"' ?>><select name="storelang3" size="1">
				<option value="">English</option>
				<option value="dk"<?php if($storelang3=='dk') print ' selected'?>>Danish / Dansk</option>
				<option value="fr"<?php if($storelang3=='fr') print ' selected'?>>French / Fran&ccedil;ais</option>
				<option value="de"<?php if($storelang3=='de') print ' selected'?>>German / Deutsch</option>
				<option value="it"<?php if($storelang3=='it') print ' selected'?>>Italian / Italiano</option>
				<option value="nl"<?php if($storelang3=='nl') print ' selected'?>>Nederlands / Dutch</option>
				<option value="pt"<?php if($storelang3=='pt') print ' selected'?>>Portugese / Portugu&ecirc;s</option>
				<option value="es"<?php if($storelang3=='es') print ' selected'?>>Spanish / Espa&ntilde;ol</option>
				</select></div></td>
		</tr>
		<tr class="maintablehidden"><td colspan="2"><?php print $yyHowLan?></td></tr>
		<tr class="maintablehidden">
			<td><strong><?php print $yyNumLan?>: </strong></td>
			<td><select name="adminlanguages" size="1" onchange="document.getElementById('storelang3').style.display=this.selectedIndex<2?'none':'';document.getElementById('storelang2').style.display=this.selectedIndex<1?'none':'';">
							<option value="0">1</option>
							<option value="1"<?php if((int)($rsAdmin["adminlanguages"])==1) print ' selected'?>>2</option>
							<option value="2"<?php if((int)($rsAdmin["adminlanguages"])==2) print ' selected'?>>3</option>
							</select></td>
		</tr>
		<tr class="maintablehidden">
			<td colspan="2"><?php print $yyWhMull?><br>
				<span style="font-size:10px"><?php print $yyLonrel?></span></td>
		</tr>
		<tr class="maintablehidden">
			<td><strong><?php print $yyLaSet?>: </strong></td>
			<td><select name="adminlangsettings[]" size="5" multiple="multiple">
				<option value="1"<?php if(((int)$rsAdmin['adminlangsettings'] & 1)==1) print ' selected'?>><?php print $yyPrName?></option>
				<option value="2"<?php if(((int)$rsAdmin['adminlangsettings'] & 2)==2) print ' selected'?>><?php print $yyDesc?></option>
				<option value="4"<?php if(((int)$rsAdmin['adminlangsettings'] & 4)==4) print ' selected'?>><?php print $yyLnDesc?></option>
				<option value="1048576"<?php if(((int)$rsAdmin['adminlangsettings'] & 1048576)==1048576) print ' selected'?>><?php print $yyStaNam?></option>
				<option value="8"<?php if(((int)$rsAdmin['adminlangsettings'] & 8)==8) print ' selected'?>><?php print $yyCntNam?></option>
				<option value="16"<?php if(((int)$rsAdmin['adminlangsettings'] & 16)==16) print ' selected'?>><?php print $yyPOName?></option>
				<option value="32"<?php if(((int)$rsAdmin['adminlangsettings'] & 32)==32) print ' selected'?>><?php print $yyPOChoi?></option>
				<option value="64"<?php if(((int)$rsAdmin['adminlangsettings'] & 64)==64) print ' selected'?>><?php print $yyOrdSta?></option>
				<option value="128"<?php if(((int)$rsAdmin['adminlangsettings'] & 128)==128) print ' selected'?>><?php print $yyPayMet?></option>
				<option value="256"<?php if(((int)$rsAdmin['adminlangsettings'] & 256)==256) print ' selected'?>><?php print $yyCatNam?></option>
				<option value="512"<?php if(((int)$rsAdmin['adminlangsettings'] & 512)==512) print ' selected'?>><?php print $yyCatDes?></option>
				<option value="524288"<?php if(((int)$rsAdmin['adminlangsettings'] & 524288)==524288) print ' selected'?>>Category Header</option>
				<option value="1024"<?php if(((int)$rsAdmin['adminlangsettings'] & 1024)==1024) print ' selected'?>><?php print $yyDisTxt?></option>
				<option value="2048"<?php if(((int)$rsAdmin['adminlangsettings'] & 2048)==2048) print ' selected'?>><?php print $yyCatURL?></option>
				<option value="4096"<?php if(((int)$rsAdmin['adminlangsettings'] & 4096)==4096) print ' selected'?>><?php print $yyEmlHdr?></option>
				<option value="8192"<?php if(((int)$rsAdmin['adminlangsettings'] & 8192)==8192) print ' selected'?>><?php print $yyManURL?></option>
				<option value="16384"<?php if(((int)$rsAdmin['adminlangsettings'] & 16384)==16384) print ' selected'?>><?php print $yyManDsc?></option>
				<option value="32768"<?php if(((int)$rsAdmin['adminlangsettings'] & 32768)==32768) print ' selected'?>><?php print $yyContReg?></option>
				<option value="65536"<?php if(((int)$rsAdmin['adminlangsettings'] & 65536)==65536) print ' selected'?>><?php print $yyAltShM?></option>
				<option value="131072"<?php if(((int)$rsAdmin['adminlangsettings'] & 131072)==131072) print ' selected'?>><?php print $yySeaCri?></option>
				<option value="262144"<?php if(((int)$rsAdmin['adminlangsettings'] & 262144)==262144) print ' selected'?>>Filter Bar</option>
				<option value="2097152"<?php if(((int)$rsAdmin['adminlangsettings'] & 2097152)==2097152) print ' selected'?>>Page Title / Meta Description</option>
				<option value="4194304"<?php if(((int)$rsAdmin['adminlangsettings'] & 4194304)==4194304) print ' selected'?>><?php print $yyAddSrP?></option>
				<option value="8388608"<?php if(((int)$rsAdmin['adminlangsettings'] & 8388608)==8388608) print ' selected'?>>Static URLs</option>
			</select></td>
		</tr>
		<tr class="maintablehidden">
			<td colspan="2"><div class="mainshow"><button class="mainbuttonbottom" type="button" onclick="hidetablerows(6)"><?php print $yyCliHid?> &#9650;</button> <button class="mainbuttonbottom" type="submit"><?php print $yySubmit?></button></div></td>
		</tr>
	</table>

	<h3 class="round_top half_top"><button class="mainbutton" id="mainbutton7" type="button" onclick="showtablerows(7,'<?php print jsescape($yyCurenc)?>')"><?php print $yyCurenc?> <div style="float:right">&#9660;</div></button></h3>
	<table class="admin-table-b keeptable mainsettings" id="maintable7">
		<tr>
			<th colspan="2"><?php print $yy3CurCon?><br><span style="font-size:10px"><?php print $yyNo3Con?></span></th>
		</tr>
		<tr class="maintablehidden">
			<td><strong><?php print $yyConv?> 1: </strong></td>
			<td>&nbsp;<?php print $yyRate?> <input type="text" name="currRate1" class="smallinput" size="10" value="<?php if($rsAdmin["currRate1"] != 0) print $rsAdmin["currRate1"]?>">&nbsp;&nbsp;&nbsp;Symbol <select name="currSymbol1" size="1"><option value="">None</option>
<?php							for($index=0; $index<$numcurrencies; $index++){
									print "<option value='" . $allcurrencies[$index]['countryCurrency'] . "'";
									if($rsAdmin["currSymbol1"]==$allcurrencies[$index]['countryCurrency']) print ' selected';
									print ">" . $allcurrencies[$index]['countryCurrency'] . "</option>\n";
								} ?></select></td>
		</tr>
		<tr class="maintablehidden">
			<td><strong><?php print $yyConv?> 2: </strong></td>
			<td>&nbsp;<?php print $yyRate?> <input type="text" name="currRate2" class="smallinput" size="10" value="<?php if($rsAdmin["currRate2"] != 0) print $rsAdmin["currRate2"]?>">&nbsp;&nbsp;&nbsp;Symbol <select name="currSymbol2" size="1"><option value="">None</option>
<?php							for($index=0; $index<$numcurrencies; $index++){
									print "<option value='" . $allcurrencies[$index]['countryCurrency'] . "'";
									if($rsAdmin["currSymbol2"]==$allcurrencies[$index]['countryCurrency']) print ' selected';
									print ">" . $allcurrencies[$index]['countryCurrency'] . "</option>\n";
								} ?></select></td>
		</tr>
		<tr class="maintablehidden">
			<td><strong><?php print $yyConv?> 3: </strong></td>
			<td>&nbsp;<?php print $yyRate?> <input type="text" name="currRate3" class="smallinput" size="10" value="<?php if($rsAdmin["currRate3"] != 0) print $rsAdmin["currRate3"]?>">&nbsp;&nbsp;&nbsp;Symbol <select name="currSymbol3" size="1"><option value="">None</option>
<?php							for($index=0; $index<$numcurrencies; $index++){
									print "<option value='" . $allcurrencies[$index]['countryCurrency'] . "'";
									if($rsAdmin["currSymbol3"]==$allcurrencies[$index]['countryCurrency']) print ' selected';
									print ">" . $allcurrencies[$index]['countryCurrency'] . "</option>\n";
								} ?></select></td>
		</tr>
		<tr class="maintablehidden">
			<td><strong>Update rates automatically: </strong></td>
			<td>&nbsp;<select name="currConvUser" size="1"><option value="">Do not update automatically</option>
							<option value="y"<?php if($rsAdmin["currConvUser"]!='') print ' selected'; ?>>Yes, update rates automatically</option></select></td>
		</tr>
		<tr class="maintablehidden">
			<td colspan="2"><div class="mainshow"><button class="mainbuttonbottom" type="button" onclick="hidetablerows(7)"><?php print $yyCliHid?> &#9650;</button> <button class="mainbuttonbottom" type="submit"><?php print $yySubmit?></button></div></td>
		</tr>
	</table>

	<h3 class="round_top half_top"><button class="mainbutton" id="mainbutton9" type="button" onclick="showtablerows(9,'<?php print jsescape('Google reCaptcha + Analytics 4')?>')"><?php print "Google reCaptcha + Analytics 4"?> <div style="float:right">&#9660;</div></button></h3>
	<table class="admin-table-b keeptable mainsettings" id="maintable9">
		<tr><th colspan="2">Google keys for reCAPTCHA and Global Site Tag for Google Analytics 4.</th></tr>
		<tr class="maintablehidden">
			<td><strong><?php print "Global Site Tag"?>: </strong></td>
			<td><input type="text" name="googletagid" size="30" value="<?php print htmlspecials($rsAdmin['googleTagID'])?>"><?php
			if(@$GLOBALS['iswordpress']){ ?>
				<input type="checkbox" name="googletagnohead" value="1"<?php print $rsAdmin['googleTagNoHead']==1?' checked="checked"':''?>>
				<div style="display:inline-block;vertical-align:top">
					<div>Check this box if you do not wish to add header tags.</div>
					<div style="font-size:11px">You would do this if you are using another wordpress plugin to produce your Google Tags and just want cart metrics.</div>
				</div>
<?php		}
			?></td>
		</tr>
		<tr class="maintablehidden"><td colspan="2">Automatically integrate Google's reCAPTCHA security system on your website.</td></tr>
		<tr class="maintablehidden">
			<td><strong><?php print "reCaptcha Site key"?>: </strong></td>
			<td><input type="text" name="reCAPTCHAsitekey" size="30" value="<?php print htmlspecials($rsAdmin['reCAPTCHAsitekey'])?>"></td>
		</tr>
		<tr class="maintablehidden">
			<td><strong><?php print "reCaptcha Secret key"?>: </strong></td>
			<td><input type="text" name="reCAPTCHAsecret" size="30" value="<?php print htmlspecials($rsAdmin['reCAPTCHAsecret'])?>"></td>
		</tr>
		<tr class="maintablehidden">
			<td colspan="2" style="padding-left:40px"><?php print "Use recaptcha on"?>:</td>
		</tr>
		<tr class="maintablehidden">
			<td colspan="2" style="padding-left:40px">
				<table><tr>
				<td width="125" style="font-size:10px;border:0"><label><input type="checkbox" name="recaptcha1" value="ON"<?php print (($rsAdmin['reCAPTCHAuseon'] & 1)==1?' checked':'')?>> <?php print "Card Entry"?></label></td>
				<td width="125" style="font-size:10px;border:0"><label><input type="checkbox" name="recaptcha2" value="ON"<?php print (($rsAdmin['reCAPTCHAuseon'] & 2)==2?' checked':'')?>> <?php print "Ask A Question"?></label></td>
				<td width="125" style="font-size:10px;border:0"><label><input type="checkbox" name="recaptcha3" value="ON"<?php print (($rsAdmin['reCAPTCHAuseon'] & 4)==4?' checked':'')?>> <?php print "New Affiliate"?></label></td>
				<td width="125" style="font-size:10px;border:0"><label><input type="checkbox" name="recaptcha4" value="ON"<?php print (($rsAdmin['reCAPTCHAuseon'] & 8)==8?' checked':'')?>> <?php print "New Account"?></label></td>
				</tr><tr>
				<td width="125" style="font-size:10px;border:0"><label><input type="checkbox" name="recaptcha5" value="ON"<?php print (($rsAdmin['reCAPTCHAuseon'] & 16)==16?' checked':'')?>> <?php print "Admin Login"?></label></td>
				<td width="125" style="font-size:10px;border:0"><label><input type="checkbox" name="recaptcha6" value="ON"<?php print (($rsAdmin['reCAPTCHAuseon'] & 32)==32?' checked':'')?>> <?php print "Post Review"?></label></td>
				<td width="125" style="font-size:10px;border:0"><label><input type="checkbox" name="recaptcha7" value="ON"<?php print (($rsAdmin['reCAPTCHAuseon'] & 64)==64?' checked':'')?>> <?php print "Gift Certificate"?></label></td>
				<td width="125" style="font-size:10px;border:0"><label><input type="checkbox" name="recaptcha9" value="ON"<?php print (($rsAdmin['reCAPTCHAuseon'] & 256)==256?' checked':'')?>> <?php print "Email Orders"?></label></td>
				</tr></table>
			</td>
		</tr>
		<tr class="maintablehidden">
			<td colspan="2"><div class="mainshow"><button class="mainbuttonbottom" type="button" onclick="hidetablerows(9)"><?php print $yyCliHid?> &#9650;</button> <button class="mainbuttonbottom" type="submit"><?php print $yySubmit?></button></div></td>
		</tr>
	</table>

<?php	if(! @$GLOBALS['isectstore']) { ?>
	<h3 class="round_top half_top"><button class="mainbutton" id="mainbutton10" type="button" onclick="showtablerows(10,'<?php print jsescape('Image File Uploads')?>')"><?php print 'Image File Uploads'?> <div style="float:right">&#9660;</div></button></h3>
	<table class="admin-table-b keeptable mainsettings" id="maintable10">
		<tr>
			<th colspan="2"><?php
				print 'If you wish to allow file or image uploads, you need to set the upload directory location. You are recommended to make this location outside of the web root so it cannot be accessed via HTTP.';
				print 'To help set this value, this is the location of the web root: ' . @$_SERVER['DOCUMENT_ROOT'];
			?></th>
		</tr>
		<tr class="maintablehidden">
			<td><strong><?php print "File Upload Directory"?>: </strong></td>
			<td><input type="text" name="uploaddir" size="50" value="<?php print htmlspecials($rsAdmin['uploadDir'])?>"></td>
		</tr>
		<tr class="maintablehidden">
			<td colspan="2"><div class="mainshow"><button class="mainbuttonbottom" type="button" onclick="hidetablerows(10)"><?php print $yyCliHid?> &#9650;</button> <button class="mainbuttonbottom" type="submit"><?php print $yySubmit?></button></div></td>
		</tr>
	</table>
<?php	} ?>

<script>
function avataxcallback(){
	if(ajaxobj.readyState==4){
		var restxt=ajaxobj.responseText;
		alert(restxt);
	}
}
function testavataxconnection(){
	var tstate=document.getElementById('avalarastate')[document.getElementById('avalarastate').selectedIndex].value;
	if(tstate==0)
		alert('Please select Sandbox or Production environment');
	else{
		var endpt='https://' + (tstate==1?'sandbox-':'') + 'rest.avatax.com/api/v2/utilities/ping';
		var postdata="avalarastate=" + tstate +
				'&avalaraacctno=' + document.getElementById('avalaraacctno').value +
				'&avalaralicensekey=' + document.getElementById('avalaralicensekey').value;
		ajaxobj=window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("MSXML2.XMLHTTP");
		ajaxobj.onreadystatechange=avataxcallback;
		ajaxobj.open("POST",'ajaxservice.php?action=avataxping', true);
		ajaxobj.setRequestHeader('Content-type','application/x-www-form-urlencoded');
		ajaxobj.send(postdata);
	}
}
</script>
	<h3 class="round_top half_top"><button class="mainbutton" id="mainbutton11" type="button" onclick="showtablerows(11,'<?php print jsescape('Avalara Tax / AvaTax')?>')"><?php print 'Avalara Tax / AvaTax'?> <div style="float:right">&#9660;</div></button></h3>
	<table class="admin-table-b keeptable mainsettings" id="maintable11">
		<tr><th colspan="2"><?php print 'Avalara software automates tax compliance and can help improve accuracy while reducing costs. Please enter your Avalara account details here to automatically calculate taxes.'?></th></tr>
		<tr class="maintablehidden">
			<td><strong><?php print "Avalara Status"?>: </strong></td>
			<td><select size="1" id="avalarastate" name="avalarastate">
				<option value="0">Disabled</option>
				<option value="1"<?php if(trim($rsAdmin['avalarastate'])=='1') print ' selected'?>>Enabled (Sandbox)</option>
				<option value="2"<?php if(trim($rsAdmin['avalarastate'])=='2') print ' selected'?>>Enabled (Production)</option>
				<option value="-1"<?php if(trim($rsAdmin['avalarastate'])=='-1') print ' selected'?>>Enabled (Sandbox) - Disable Recording</option>
				<option value="-2"<?php if(trim($rsAdmin['avalarastate'])=='-2') print ' selected'?>>Enabled (Production) - Disable Recording</option>
			</select></td>
		</tr>
		<tr class="maintablehidden">
			<td><strong><?php print "Avalara Account No."?>: </strong></td>
			<td><input type="text" id="avalaraacctno" name="avalaraacctno" size="30" value="<?php print htmlspecials($rsAdmin['avalaraacctno'])?>"></td>
		</tr>
		<tr class="maintablehidden">
			<td><strong><?php print "Avalara License Key"?>: </strong></td>
			<td><input type="password" id="avalaralicensekey" name="avalaralicensekey" size="30" value="<?php print htmlspecials($rsAdmin['avalaralicensekey'])?>"></td>
		</tr>
		<tr class="maintablehidden">
			<td><strong><?php print "Avalara Company Code"?>: </strong></td>
			<td><input type="text" id="avalaracompanycode" name="avalaracompanycode" size="30" value="<?php print htmlspecials($rsAdmin['avalaracompanycode'])?>" placeholder="DEFAULT (optional)"></td>
		</tr>
		<tr class="maintablehidden">
			<td>&nbsp;</td>
			<td><button type="button" onclick="testavataxconnection()">Test Connection</button></td>
		</tr>
		<tr class="maintablehidden">
			<td colspan="2"><div class="mainshow"><button class="mainbuttonbottom" type="button" onclick="hidetablerows(11)"><?php print $yyCliHid?> &#9650;</button> <button class="mainbuttonbottom" type="submit"><?php print $yySubmit?></button></div></td>
		</tr>
	</table>
	
	<h3 class="round_top half_top"><button class="mainbutton" id="mainbutton12" type="button" onclick="showtablerows(12,'<?php print jsescape('Cardinal Commerce')?>')"><?php print 'Cardinal Commerce'?> <div style="float:right">&#9660;</div></button></h3>
	<table class="admin-table-b keeptable mainsettings" id="maintable12">
		<tr><th colspan="2"><?php print $yyCaCoAc?></th></tr>
		<tr class="maintablehidden">
			<td><strong><?php print "Cardinal Processor ID"?>: </strong></td>
			<td><input type="text" name="cardinalprocessor" size="30" value="<?php print htmlspecials($rsAdmin['cardinalProcessor'])?>"></td>
		</tr>
		<tr class="maintablehidden">
			<td><strong><?php print "Cardinal Merchant ID"?>: </strong></td>
			<td><input type="text" name="cardinalmerchant" size="30" value="<?php print htmlspecials($rsAdmin['cardinalMerchant'])?>"></td>
		</tr>
		<tr class="maintablehidden">
			<td><strong><?php print "Cardinal Transaction Password"?>: </strong></td>
			<td><input type="text" name="cardinalpwd" size="30" value="<?php print htmlspecials($rsAdmin['cardinalPwd'])?>"></td>
		</tr>
		<tr class="maintablehidden">
			<td colspan="2"><div class="mainshow"><button class="mainbuttonbottom" type="button" onclick="hidetablerows(12)"><?php print $yyCliHid?> &#9650;</button> <button class="mainbuttonbottom" type="submit"><?php print $yySubmit?></button></div></td>
		</tr>
	</table>
</form>
<script>
var hash = window.location.hash.substr(1);
if(hash.substr(0,10)=='mainbutton'){
	document.getElementById(hash).click();
}
</script>
<?php } ?>
