	function zxcWWHS()
	{
     if (document.all)
     {
      zxcCur='hand';
      zxcWH=document.documentElement.clientHeight;
      zxcWW=document.documentElement.clientWidth;
      zxcWS=document.documentElement.scrollTop;
      if (zxcWH==0)
      {
       zxcWS=document.body.scrollTop;
       zxcWH=document.body.clientHeight;
       zxcWW=document.body.clientWidth;
      }
     }
     else if (document.getElementById){
      zxcCur='pointer';
      zxcWH=window.innerHeight-15;
      zxcWW=window.innerWidth-15;
      zxcWS=window.pageYOffset;
     }
     zxcWC=Math.round(zxcWW/2);
     return [zxcWW,zxcWH,zxcWS];
    }


//window.onscroll=function(){
// var img=document.getElementById('myProgress');
// if (!document.all){ img.style.position='fixed'; window.onscroll=null; return; }
// if (!img.pos){ img.pos=img.offsetTop; }
// img.style.top=(zxcWWHS()[2]+img.pos)+'px';
//}

	function isEmailAddr(email)
	{
		var result = false;
		var theStr = new String(email);
		var index = theStr.indexOf("@");
		if (index > 0)
		{
			var pindex = theStr.indexOf(".",index);
			if ((pindex > index+1) && (theStr.length > pindex+1))
			result = true;
		}
		return result;
	}
	
	function validRequired(formField,fieldLabel)
	{
		var result = true;
		
		if (formField.value == "")
		{
			alert('Please enter a value for the "' + fieldLabel +'" field.');
			formField.focus();
			result = false;
		}
		
		return result;
	}
	
	function validEmail(formField,fieldLabel,required)
	{
		var result = true;
		
		if (required && !validRequired(formField,fieldLabel))
			result = false;

		if (result && ((formField.value.length < 3) || !isEmailAddr(formField.value)) )
		{
			alert("Invalid email. Please check your email.");
			formField.focus();
			result = false;
		}	   
		return result;
	}
	
	function validateForm(theForm)
	{
		if (!validEmail(theForm.inputEmail,"Email Address",false))
		{
			return false;
		}
		else
		{
			return true;
		}
	}
	
	function RedirectScript(Link)
	{
		window.location.replace(Link);
	}
	
	function FeedbackClick(inForm)
	{
		var newwin = window.open(inForm,'printVer','left=50,top=50,width=400,height=450,scrollbars=0');		
	}
	
	function AdviceClick(inForm)
	{
		var newwin = window.open(inForm,'printVer','left=50,top=50,width=500,height=550,scrollbars=0');		
	}
	
	function OpenPopUp(inForm,thisTop,thisLeft,thisWidth,thisHeight,isScrollbar)
	{
		var newwin = window.open(inForm,'printVer','left=' + thisLeft + ',top=' + thisTop + ',width=' + thisWidth + ',height=' + thisHeight + ',scrollbars=' + isScrollbar);		
	}
	
	function OpenNormalWindow(inForm)
	{
		day = new Date();
		id = day.getTime();
		eval("page" + id + " = window.open(inForm);");
	}
	
	function popUp(URL) {
		day = new Date();
		id = day.getTime();
		eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=600,height=380,left = 212,top = 194');");
	}
	
	function popBig(URL) {
		day = new Date();
		id = day.getTime();
		eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=650,height=700,left = 187,top = 34');");
	}

	function popCard(URL) {
		day = new Date();
		id = day.getTime();
		eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=680,height=680,left = 172,top = 44');");
	}
	
	function popReview(URL) {
		day = new Date();
		id = day.getTime();
		eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=250,height=300,left = 387,top = 234');");
	}
	function popWish(URL) {
		day = new Date();
		id = day.getTime();
		eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=250,height=300,left = 387,top = 234');");
	}
	function popShipping(URL) {
		day = new Date();
		id = day.getTime();
		eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=250,height=280,left = 387,top = 244');");
	}
	function popOrder(URL) {
		day = new Date();
		id = day.getTime();
		eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=450,height=500,left = 287,top = 134');");
	}
	
	function popCountry(URL) {
		day = new Date();
		id = day.getTime();
		eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=432,height=469,left = 296,top = 149.5');");
	}
	
	
	function loadfile(fname) {
		
		obj = document.getElementById("iframeid");
		obj.setAttribute("src",fname);		
	}

	function adjustIFrameSize (iframeWindow) {
		var frameHeight = 300;
		if (iframeWindow.document.height) {
			var iframeElement = parent.document.getElementById(iframeWindow.name);
			frameHeight = iframeWindow.document.height;
		}
		else if (document.all) {
			var iframeElement = parent.document.all[iframeWindow.name];
			if (iframeWindow.document.compatMode &&
				iframeWindow.document.compatMode != 'BackCompat') 
			{
			frameHeight = iframeWindow.document.documentElement.scrollHeight + 20;
			}
			else {
			frameHeight = iframeWindow.document.body.scrollHeight + 20;
			}
		}
		if (frameHeight<300) {
			iframeElement.style.height = 300 + 'px';
		}
		else {
			iframeElement.style.height = frameHeight + 'px';
		}	    
	}
	
	function select_deselectAll (chkVal, idVal) 
{ 
	var frm = document.forms[0];
	// Loop through all elements
	for (i=0; i<frm.length; i++) 
	{
		// Look for our Header Template's Checkbox
		if (idVal.indexOf ('CheckAll') != -1) 
		{

			// Check if main checkbox is checked, then select or deselect datagrid checkboxes 
			if(chkVal == true) 
			{
				frm.elements[i].checked = true;
			} 
			else 
			{
				frm.elements[i].checked = false;
			}
		}
		// Work here with the Item Template's multiple checkboxes
		else if (idVal.indexOf ('CheckBox1') != -1) 
		{
			// Check if any of the checkboxes are not checked, and then uncheck top select all checkbox 
			if(frm.elements[i].checked == false) 
			{
				frm.elements[1].checked = false; //Uncheck main select all checkbox
			}
		}
	}
}

 function MM_reloadPage(init) {  //reloads the window if Nav4 resized
      if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
        document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
      else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
    }
    MM_reloadPage(true);
