<!--//
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
var X=0;
var Y=0;
function doDelete(urls,msg,section){
var bOk=false;
	bOk=confirm("To delete the "+section+" "+msg+" click 'OK' otherwise 'Cancel'.");
	if(bOk==true) document.location.href=urls;
}
function doCancel(urls){
var bOk=false;
	bOk=confirm("You are about to cancel your order. To continue click 'OK' otherwise 'Cancel'.");
	if(bOk==true) document.location.href=urls;
}
function doDropDowns(sForm,Major,Minor,MajorID,MinorID){
	// ---- clear minor drop down ----
	eval('var i=document.'+sForm+'.'+Minor+'.length');
	while(i>0){eval('document.'+sForm+'.'+Minor+'.options[i-1]=null');i--;}
	  
	var i=0;
	var bSet=false;
	var iIndex=0;
	// ---- populate minor drop down with new selection ----
	for(var j=0;j<mySelection.length;j++){
	  var myDrops = (mySelection[j].toString()).split("|");
		if(myDrops[0]==MajorID){
			eval('iIndex=document.'+sForm+'.'+Minor+'.length');
			if(myDrops[2]!='') eval('document.'+sForm+'.'+Minor+'.options[iIndex] = new Option(myDrops[3],myDrops[2])');
			if(myDrops[2]==MinorID&&isNaN(MinorID)==false){bSet=true; i=iIndex;}
		}
	}
  if(bSet==true) eval('document.'+sForm+'.'+Minor+'.options[i].selected=true');
}
function doOpen(sForm,sTag,dDate){
var win = '';
	eval('var dDate = document.'+sForm+'.'+sTag+'.value');
	if(win.closed==true){win.close}
	win = window.open('/admin/includes/calender.asp?sForm='+sForm+'&sTag='+sTag+'&dDate='+dDate,'Calendar','titlebar=no, toolbar=no, width=220, height=160');
	win.focus();
}
function ForgotPassword(){
	if(document.login.fm_forgotten_password.checked==true){
		if(document.login.fm_email.value==''){
			alert('If you are a registered user, please enter your email address before continuing.');
			document.login.fm_email.focus();
			return false;
		}
		else{
			document.login.fm_password.disabled=true;
			return true;
		}
	}
	return true;
}
function doSelectAll(forms){
var bAction=bSelected==false?true:false;
	for(var i=0;i<eval('document.'+forms+'.length');i++){
		if(eval('document.'+forms+'.elements[i].type=="checkbox"')&&eval('(document.'+forms+'.elements[i].name).indexOf("ch_")!=-1')){
			eval('document.'+forms+'.elements[i].checked=bAction');
		}
	}
	bSelected=bAction==true?true:false;
}
function doVerify(sForm){
	var bOption = confirm("- - - W A R N I N G - - - \n\nYou are about to to settled all selected orders, there is no undo.\n\nTo abort click 'Cancel' otherwise 'Ok' to continue ..");
	if(bOption==true) eval('document.'+sForm+'.submit()');
}
function showBlock(inId){	
	var el = document.getElementById(inId);
	if (el.style.display) {
		if (el.style.display=='none'){
			el.style.display='block';
		}
	}
}
function doCurrencyPop(url){
var winObj='';
	winObj=window.open(url,'','width=400,height=300');
}
function hideBlock(inId){	
	var el = document.getElementById(inId);
	if (el.style.display) {
		if (el.style.display=='block'){
			el.style.display='none';
		}
	}
}
function doClearCardMessage(form, x,y,z){
var iOption = confirm("Your message will be lost! \n\nTo abort click 'Cancel' otherwise 'Ok' to continue ..");
	if(iOption==true){
			hideBlock('Card'); 
			eval('document.'+form+'.'+x+'.value=""'); 
			eval('document.'+form+'.'+y+'.value=""'); 
			eval('document.'+form+'.'+z+'.value=""'); 
	}
}
//-->