function GetDropDownList(input_obj,output_obj,intial_opt_val,intial_opt_text,vPassUrl)
	{
	  output_obj=(eval(output_obj));
	  input_obj=(eval(input_obj));
	  for(i=output_obj.options.length-1;i>=0;i--)
		output_obj.options[i]=null;
	
		if (window.XMLHttpRequest)
			  {
			  xmlhttp=new XMLHttpRequest()
			xmlhttp.open("GET",vPassUrl + input_obj.value ,false)
			  xmlhttp.send(null)
			  }
			// code for IE
			else if (window.ActiveXObject)
			  {
			  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
				if (xmlhttp)
				{
				xmlhttp.open("GET",vPassUrl + input_obj.value ,false)
				xmlhttp.send()
				}
			  }
			var Opt=xmlhttp.responseText.split(",");
	
			if (xmlhttp.responseText.length==0)
			{
				output_obj.options[0]=new Option(intial_opt_val,intial_opt_text);
			}
			else
				if(intial_opt_text!="")	output_obj.options[0]=new Option(intial_opt_text,intial_opt_val);	
				for (i=0;i<Opt.length-1;i++)
				{
					opt_val=Opt[i];
					opt_text=Opt[i+1];
					k=output_obj.options.length-1;
					
					if (opt_val.length>0 && opt_text.length>0)
					{
						output_obj.options[k+1]=new Option(opt_text,opt_val);
					}
					i++; 
				}
				output_obj.options[0].selected=true;
		
	}
/*==========left manu function-------------------*/
	var nn4 = (document.layers) ? true : false
	var ie = (document.all) ? true : false
	var TotComps,tmp_d;
	
	function getAbsoluteTop(objectId) {
		o = document.getElementById(objectId)
		oTop = o.offsetTop            
		while(o.offsetParent!=null) { 
			oParent = o.offsetParent  
			oTop += oParent.offsetTop
			o = oParent
		}
		// Return top position
		return oTop
	}
	
	function getAbsoluteLeft(objectId) {
		o = document.getElementById(objectId)
		oLeft = o.offsetLeft            
		while(o.offsetParent!=null) {  
			oParent = o.offsetParent   
			oLeft += oParent.offsetLeft 
			o = oParent
		}
		return oLeft
	}
	/*=========right menu javascript===========*/
	function SetPageWidth()
	{
		varPagMaxWidth=getAbsoluteWidth('header');	varPagCenterWidth=getAbsoluteWidth('leftmenu')+getAbsoluteWidth('centercontent')+getAbsoluteWidth('rightmenu') + varMaxWidthExtra ;
		if(varPagCenterWidth>varPagMaxWidth){varPagMaxWidth=varPagCenterWidth}
		varPagMaxWidth=varPagMaxWidth+'px';
		document.getElementById('header').style.width=varPagMaxWidth;
		document.getElementById('footer').style.width=varPagMaxWidth;
	}
function isNotEmptyText(objField)
	{
		if (allTrim(objField.value).length==0)
		 {return false;}
		 else
		 {return true;}
	}
	
	function validEmail(objValue) {
		if (objValue.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1) {
			return true;
		} else {
			return false;
		}
	}
// --------------------- Triming string from both sides Function ----------------------
	function allTrim(atrimvalue) {
		return(rightTrim(leftTrim(atrimvalue))) ;
	}		
	// --------------------- Triming string from right sides Function ----------------------
	function rightTrim(rtrimvalue) {
		while(rtrimvalue.charAt(rtrimvalue.length-1)==' ')
			rtrimvalue = rtrimvalue.substr(0,rtrimvalue.length-1);
		
		return(rtrimvalue) ;
	}
	 function leftTrim(ltrimvalue) {
		while(ltrimvalue.charAt(0)==' ')
			ltrimvalue = ltrimvalue.substr(1,ltrimvalue.length-1);
			
		return(ltrimvalue) ;
	}
function Replace(strText,vReplaceWord,vReplaceWith)
{
	var strReplaceAll = strText;
	var intIndexOfMatch = strReplaceAll.indexOf(vReplaceWord);
	 
	
	// Loop over the string value replacing out each matching
	// substring.
	while (intIndexOfMatch != -1){
	// Relace out the current instance.
	strReplaceAll = strReplaceAll.replace(vReplaceWord,vReplaceWith)
	 
	
	// Get the index of any next matching substring.
	intIndexOfMatch = strReplaceAll.indexOf(vReplaceWord);
	}
	return strReplaceAll;
}
	function getAbsoluteHeight(objectId) {
		o = document.getElementById(objectId)
		if(o) {
			oHeight = o.offsetHeight;
		} else {
			oHeight = -1;
		}
		return oHeight;
	}
	
	function setAbsoluteHeight(objectId, val) {
		o = document.getElementById(objectId)
		if(o) {
			o.style.height = val;
		}
	}
	
	function getAbsoluteWidth(objectId) {
		o = document.getElementById(objectId)
		if(o) {
			oWidth = o.offsetWidth;
		} else {
			oWidth = -1;
		}
		return oWidth;
	}
	
	function setAbsoluteWidth(objectId, val) {
		o = document.getElementById(objectId)
		if(o) {
			o.style.width = val;
		}
	}
	
	function getAbsoluteTop(objectId) {
		o = document.getElementById(objectId)
		if(o) {
			oTop = o.offsetTop			
			while(o.offsetParent!=null) { 
				oParent = o.offsetParent	
				oTop += oParent.offsetTop 
				o = oParent
			}
		} else {
			oTop = -1;
		}
		// Return top position
		return oTop
	}
	
	function setAbsoluteTop(objectId, val) {
		o = document.getElementById(objectId)
		if(o) {
			o.style.top = val;
		}
	}
	
	function getAbsoluteLeft(objectId) {
		o = document.getElementById(objectId)
		if(o) {
			oLeft = o.offsetLeft			
			while(o.offsetParent!=null) {	
				oParent = o.offsetParent	
				oLeft += oParent.offsetLeft
				o = oParent
			}
		} else {
			oLeft = -1;
		}
		return oLeft
	}
	
	function setAbsoluteLeft(objectId, val) {
		o = document.getElementById(objectId)
		if(o) {
			o.style.left = val;
		}
	}
	
function SameAsBillingAddress()
{
	if(document.all.ChkBox_SameAsBillingInfo.checked==true)
	{
		document.all.TxtShippingFirstName.value=document.all.TxtBillingFirstName.value
		document.all.TxtShippingLastName.value=document.all.TxtBillingLastName.value
		document.all.TxtShippingCompanyName.value=document.all.TxtBillingCompanyName.value
		document.all.TxtShippingCity.value=document.all.TxtBillingCity.value
		document.all.DrpListShippingCountry.value=document.all.DrpListBillingCountry.value
		if(document.all.DrpListBillingCountry.value=="US" || document.all.DrpListBillingCountry.value=="CA")
		{
			document.all.DrpListShippingState.value=document.all.DrpListBillingState.value
			document.all.hidden_ShippingState.value=document.all.DrpListBillingState.value
		}
		else
		{
			document.all.TxtShippingState.value=document.all.TxtBillingState.value
			document.all.hidden_ShippingState.value=document.all.TxtBillingState.value
		}
		
		document.all.TxtShippingZipCode.value=document.all.TxtBillingZipCode.value
		document.all.TxtShippingAddress.value=document.all.TxtBillingAddress.value
	}
	else
	{
		document.all.TxtShippingFirstName.value=""
		document.all.TxtShippingLastName.value=""
		document.all.TxtShippingCompanyName.value=""
		document.all.TxtShippingCity.value=""
		document.all.DrpListShippingCountry.value=document.all.DrpListBillingCountry.value
		document.all.DrpListShippingState.value=""
		document.all.TxtShippingZipCode.value=""
		document.all.TxtShippingAddress.value=""
	}
}
var vOldShippingCountryCode,vOldShippingStateCode,vOldShippingZipCode, vShippingLoading=false

function GetShippingOptions(DrpListShippingObj,vShippingCountryCode,vShippingStateCode,vShippingZipCode,vPassUrl)
{
  DrpListShippingObj=(eval(DrpListShippingObj));
  //alert();
  //DrpListShippingObj.options[0]=new Option("Loading...","Loading...");
  //alert(vPassUrl + '?ShippingCountryCode=' + vShippingCountryCode + '&ShippingStateCode=' + vShippingStateCode + '&ShippingZipCode=' + vShippingZipCode) 
		if (window.XMLHttpRequest)
		  {
		  xmlhttp=new XMLHttpRequest()
		  xmlhttp.open("GET",vPassUrl + '?ShippingCountryCode=' + vShippingCountryCode + '&ShippingStateCode=' + vShippingStateCode + '&ShippingZipCode=' + vShippingZipCode ,false)
		  xmlhttp.send(null)
		  }
		// code for IE
		else if (window.ActiveXObject)
		  {
		  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
			if (xmlhttp)
			{
			xmlhttp.open("GET",vPassUrl + '?ShippingCountryCode=' + vShippingCountryCode + '&ShippingStateCode=' + vShippingStateCode + '&ShippingZipCode=' + vShippingZipCode ,false)
			xmlhttp.send()
			}
		  }
		var Opt=xmlhttp.responseText.split(",");
		for(i=DrpListShippingObj.options.length-1;i>=1;i--)
		DrpListShippingObj.options[i]=null;
	
		if (xmlhttp.responseText.length==0)
		{
			DrpListShippingObj.options[0]=new Option("Select Shipping Method","");
		}
		else
			//if(intial_opt_text!="")	output_obj.options[0]=new Option(intial_opt_text,intial_opt_val);
			DrpListShippingObj.options[0]=new Option("Select Shipping Method","");
			for (i=0;i<Opt.length-1;i++)
			{
				opt_val=Opt[i];
				opt_text=Opt[i+1];
				k=DrpListShippingObj.options.length-1;
				
				//alert("opt_val="+opt_val);
				//alert("opt_text="+opt_text);
				//output_obj.options[i]=new Option(Opt[i],Opt[i]);
				if (opt_val.length>0 && opt_text.length>0)
				{
					DrpListShippingObj.options[k+1]=new Option(opt_text,opt_val);
				}
				i++; // for loop i values 1,3,5,7 etc.
				
			}
			DrpListShippingObj.options[0].selected=true;
	//}
	//else
	//{
		//output_obj.options[0]=new Option(intial_opt_val,intial_opt_text);			
	//}
}
function FlushShippingOptions()
{
	if(document.all.DrpListShippingCountry.value=="" || document.all.DrpListShippingState.value=="" || document.all.TxtShippingZipCode.value=="")
	{
		alert("Please specify all billing & shipping details");
		return false;
	}
	if(vOldShippingCountryCode!=document.all.DrpListShippingCountry.value || vOldShippingStateCode!=document.all.DrpListShippingState.value || vOldShippingZipCode!=document.all.TxtShippingZipCode.value)
	{
		vShippingLoading=true;
		vOldShippingCountryCode=document.all.DrpListShippingCountry.value;
		vOldShippingStateCode=document.all.DrpListShippingState.value;
		vOldShippingZipCode=document.all.TxtShippingZipCode.value;
	}
	else
	{
		vShippingLoading=false;
	}
	if(vShippingLoading==true)
	{
		for(i=document.all.DrpListShippingOptions.options.length-1;i>=1;i--)
		document.all.DrpListShippingOptions.options[i]=null;
		
		document.all.DrpListShippingOptions.options[0]=new Option('','');
		document.all.DrpListShippingOptions.options[1]=new Option('Loading...','');
		document.all.DrpListShippingOptions.options[1].selected=true;
	}
}
function CallShippingOptions()
{
	if(vShippingLoading==true)
	{
		setTimeout("GetShippingOptions(document.all.DrpListShippingOptions,document.all.DrpListShippingCountry.value,document.all.DrpListShippingState.value,document.all.TxtShippingZipCode.value,'AjaxFiles/AjaxGetShipping.aspx')",5000);
	}
}
function DisplayShippingMethodAndRate(vObj)
{
	if(vObj.value!="")
	{
		Split_vShippigText=document.getElementById("DrpListShippingOptions").options[document.getElementById("DrpListShippingOptions").selectedIndex].text.split(" - $");
		document.getElementById("DisplayShippingHandlingText").style.display="inline"
		document.getElementById("DisplayShippingRate").style.display="inline"
		document.getElementById("DisplayShippingRate").innerHTML=vObj.value
		document.all.hiddenShippingMethod.value=Split_vShippigText[0]
		
		document.getElementById("OrderTotalSpan").innerHTML=(parseFloat(document.getElementById("OrderTotalWithoutShippingSpan").innerHTML,2)+parseFloat(vObj.value)).toFixed(2)
	}
	else
	{
		document.getElementById("OrderTotalSpan").innerHTML=(parseFloat(document.getElementById("OrderTotalWithoutShippingSpan").innerHTML,2)).toFixed(2)
		document.getElementById("DisplayShippingHandlingText").style.display="none"
		document.getElementById("DisplayShippingRate").style.display="none"
	}
}
// ---------------------at mailing list Character validation Function ----------------------
function addtomaillist(FormObj) {
	var ErrMsg = "";
	var Obj = ""
	//try {
		var email;
		email=FormObj.email.value;
		if (email=="" ) {
			alert("* Please specify a valid email address");
		}
		else if(allTrim(FormObj.email.value).length==0) {
			alert("* Please specify your email address.\n");
		}//else if(!validEmail(allTrim(FormObj.email.value))) {
			//alert("* Please specify a valid email address.\n");
			//return false;
		//} 
		else {
			hwnd=window.open("mail-list-add.aspx?email="+email + "&name=" + FormObj.name.value,null,"width=250,height=160,left=50,top=50,resizable=no,location=no,toolbar=no,status=no,menubar=no");
		}
		
		//if(Obj != "")
		//	Obj.focus();
		//if(ErrMsg != "") {
			///throw new Exception();
		//} else {
			//return true;
		//}
	//} catch(e) {
		//window.alert(e);
		//window.alert(ErrMsg);
		//return false;
	//}
}	
// --------------------- Triming string from both sides Function ----------------------