function MM_validateForm() { //v3.0
  var Ci,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (Ci=0; Ci<(args.length-2); Ci+=3) { test=args[Ci+2]; val=MM_findObj(args[Ci]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (val!=''+num) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}

function MM_swapImgRestore() { //v3.0
  var Ci,x,a=document.MM_sr; for(Ci=0;a&&Ci<a.length&&(x=a[Ci])&&x.oSrc;Ci++) x.src=x.oSrc;
}

function MM_preloadImages1() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var Ci,j=d.MM_p.length,a=MM_preloadImages.arguments; for(Ci=0; Ci<a.length; Ci++)
    if (a[Ci].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[Ci];}}
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var Ci,j=d.MM_p.length,a=MM_preloadImages.arguments; for(Ci=0; Ci<a.length; Ci++)
    if (a[Ci].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[Ci];}}
}

function MM_findObj(n, d) { //v3.0
  var p,Ci,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 (Ci=0;!x&&Ci<d.forms.length;Ci++) x=d.forms[Ci][n];
  for(Ci=0;!x&&d.layers&&Ci<d.layers.length;Ci++) x=MM_findObj(n,d.layers[Ci].document); return x;
}

function MM_swapImage() { //v3.0
  var Ci,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(Ci=0;Ci<(a.length-2);Ci+=3)
   if ((x=MM_findObj(a[Ci]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[Ci+2];}
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function FillDetails(id,ParentId,Nam,Flag){
	document.categories.Nam.value = Nam;
	document.categories.ParentId.value = ParentId;
	document.categories.Curid.value = id;
	if(Flag == 'Old'){
		document.categories.Submit[0].disabled = true;
		document.categories.Submit[1].disabled = false;
		document.categories.Submit[2].disabled = false;
		document.categories.New.disabled = false;
	}else{
		document.categories.Submit[0].disabled = false;
		document.categories.Submit[1].disabled = true;
		document.categories.Submit[2].disabled = true;
		document.categories.New.disabled = false;
	}
}

function SubmitPage(val,frm){
	if (val != ''){
		frm.submit();
	}
}

function Filldays(val){
	var da;
	switch (val){
		case "1":
			da = 31;
			break;
		case "3":
			da = 31;
			break;
		case "5":
			da = 31;
			break;
		case "7":
			da = 31;
			break;
		case "8":
			da = 31;
			break;
		case "10":
			da = 31;
			break;
		case "12":
			da = 31;
			break;
		case "2":
			da = 29;
			break;
		case "4":
			da = 30;
			break;
		case "6":
			da = 30;
			break;
		case "9":
			da = 30;
			break;
		case "11":
			da = 30;
			break;
	}
	//alert(val + "," + da);
	for (ix=1;ix<=da;ix++){
		var optn = new Option(ix,ix);
		document.Reminder.listDays.options[document.Reminder.listDays.options.length] = optn;
	}
}
function ShowOther(val){
	if (val == '200'){
		document.all['tdOther'].innerHTML = "<input type=text name=other size=15 class=tb>"
	}else{
		document.all['tdOther'].innerHTML = ""
	}
}
function FillTable(c,r,CurPg,CurrencySign,ConversionRate){
	strDisplay = "<table cellspacing=0 cellpadding=0 border=0 width=100%>"
	strDisplay = strDisplay + "	</tr>"
	if (ubSpecial >= CurPg * c * r){
		LMax = CurPg * c * r}
	else{
		LMax = ubSpecial+1
	}
	for(PIndx = ((CurPg-1)* c * r) + 1; PIndx <= LMax; PIndx++){
		if ((PIndx % c) == 0){
			strTR = "</tr><tr>"
		}else{
			strTR = ""
		}
		switch (arSpecial[PIndx - 1][5] = arSpecial[PIndx - 1][5]){
			case "Medium":
				strPrices = parseFloat(arSpecial[PIndx - 1][4]);//parseFloat(arSpecial[PIndx - 1][3]) + "(Lux)," + parseFloat(arSpecial[PIndx - 1][4])+ "(Reg)";
				break; 
			case "Large":
				strPrices = parseFloat(arSpecial[PIndx - 1][3])
				break;
			case "Small":
				strPrices = parseFloat(arSpecial[PIndx - 1][4])
				break;
		}
		//alert(arSpecial[PIndx - 1][1])
		//alert(arSpecial[PIndx - 1][7] + "," +arSpecial[PIndx - 1][8])
		//strPrices = parseFloat(arSpecial[PIndx - 1][3]) + "," + parseFloat(arSpecial[PIndx - 1][4])
		//if (strPrices.indexOf(",") == 0 || strPrices.indexOf(",") == strPrices.length){
		//	strPrices = strPrices.replace(",", "")
		//}
		//strDisplay = strDisplay + "		<td align=center valign=top><a boder=0 href='#' onclick=\"JavaScript:DetailWindow(" + arSpecial[PIndx-1][0] + ",false);\" ><img border=1 id = PIndx src='" + arSpecial[PIndx-1][2] + "' width=100 height=100></a>"
		strDisplay = strDisplay + "		<td align=center valign=top><a boder=0 href='othercategories.asp?sz="+arSpecial[PIndx-1][5] +"&Id="+ arSpecial[PIndx-1][0]+"'><img border=1 id = PIndx src='" + arSpecial[PIndx-1][2] + "'></a>"
		strDisplay = strDisplay + "		<br><b><font size=1>" + arSpecial[PIndx - 1][1] + "</font></b>"
		strDisplay = strDisplay + "		<br><font size=1>"+ CurrencySign + ":" + strPrices + " </font>"
		strDisplay = strDisplay + "		<br><a href='SaveId.asp?prc="+strPrices+"&sz="+arSpecial[PIndx-1][5] +"&PId="+ arSpecial[PIndx-1][0] +"' onMouseOut=MM_swapImgRestore() onMouseOver=MM_swapImage('orderbutton1','','newimages/order_on.gif',1)><img name='orderbutton1' border='0' src='newimages/order_off.gif' width='100' height='18'></a><br><br></td>" + strTR 
	}
	strDisplay = strDisplay + "	</tr>"
	strDisplay = strDisplay + "</table>"
	document.all['PDisplay'].innerHTML = strDisplay;
}
function fillFlowerdetails(val){
	if (val != ''){
		regExp = /~~/g;
		regExp1 = /!!!!/g;
		document.all['Fname'].value = aFName[val].replace(regExp,"'");
		document.all['Lname'].value = aLName[val].replace(regExp,"'");
		document.all['Oname'].value = aOName[val].replace(regExp,"'");
		Descr = aDescription[val].replace(regExp,"'")
		Descr = Descr.replace(regExp1,"\n");
		document.all['Description'].value = Descr;
		document.all['Seasons'].value = aSeasons[val].replace(regExp,"'");
		if(aPathL[val] != ''){
			strHTML = document.all['tdImage'].innerHTML;
			pos = strHTML.indexOf("type=file>")
			strFixcontent = strHTML.substring(0,pos+10)
			document.all['tdImage'].innerHTML = strFixcontent + "<br><a href='" + aPathL[val] + "' target=new>View Uploaded Image</a>"
		}
		if(aPath[val] != ''){
			strHTML = document.all['tdImage'].innerHTML;
			pos = strHTML.indexOf("type=file>")
			strFixcontent = strHTML.substring(0,pos+10)
			document.all['tdThumbnail'].innerHTML = strFixcontent + "<br><a href='" + aPath[val] + "' target=new>View Uploaded Thumbnail</a>"
		}
	}
}
function frmSubmit(curPage,ScriptName){
	frm = document.forms[0];
	frm.target="_self";
	frm.curPage.value = curPage;
	frm.action = ScriptName;
	frm.submit();
}

function DetailWindow(ProductID,fullPath){
	if (fullPath == "true"){
		DetailPath = "Details.asp?proid=" + ProductID
	}else{
		DetailPath = "Details.asp?proid=" + ProductID
	}
	window.open(DetailPath,'Big_Window','width=605,height=382,resizable=yes,scrollbars=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no');
}