// JScript source code
strDownloadURL = "test.asp";
var searchFor = "";	
var noInput= "Please include a word or phrase in your search.";
var searchlocale = "";
var isV5 = false;
var isIE = false;
var flag = false;
objId = 1;
if (parseInt(navigator.appVersion) >= 5) isV5 = true;
if (navigator.appVersion.indexOf("MSIE") != -1) isIE = true;

function MouseOutMenu(Item) {
	if (isV5) {
		var MenuItem = document.getElementById(Item);
		MenuItem.setAttribute("style", "");
	}
	eval(Item + ".style.borderColor = '#E7E7E7';");	
}
function MouseOverMenu(Item) {
	if (isV5) {
		var MenuItem = document.getElementById(Item);
		MenuItem.setAttribute("style", "border-width:2px;border-style:solid;border-color:#000080;");
	}
	eval(Item + ".style.borderColor = '#000080';");
}
function confirmSubmit()
{
	var agree=confirm("Are you sure you want to continue?  Please note that these changes cannot be undone!");
	if (agree)
		return true ;
	else
	return false ;
}

function redirect(){
	window.open("get_order_all.asp")						
}

function openWin( windowURL, windowName, windowFeatures ) { 
	return window.open( windowURL, windowName, windowFeatures ) ; 
} 

function something()
{	
	var agree=confirm("Are you sure you want to continue?  Please note that these changes cannot be undone!");
	if (agree)
		return true ;
	else
	return false ;
}

function newWindow(file,window) {
	msgWindow=open(file,window,'resizable=no,width=400,height=200');
	if (msgWindow.opener == null) msgWindow.opener = self;
}

function downloadToOnlineStorage(strProvider)
{
if(strProvider == "xdrive")
{
	var strXDriveRedirURL = '';
	strXDriveRedirURL += '/onlinestorage/redir_xdrive_download.asp';
	strXDriveRedirURL += ('?' + strDownloadURL);
	window.open(strXDriveRedirURL,'','toolbar=no,menubar=no,scrollbars=no,fullscreen=no,resizable=no,width=575,height=200');
}

}

function change(ID){
		window.location.href = "tax_edit.asp?ID=" + ID
}

function deleterate(ID){
		window.location.href = "tax_delete_confirm.asp?ID=" + ID	
}

function batchdelete() {
		if (window.confirm("Are you sure you want to continue? Deletions cannot be undone!")) 
			{  document.forms[0].Action.value = "Delete";
				document.forms[0].submit();
		} 
    }
function confirmAction(Message)
{
	var agree=confirm(Message);
	if (agree)
		return 1 ;
	else
	return 0 ;
}
function getClearText( strSrc ) 
{
	//Insert HTML Strign, and Get clear String
	return  strSrc.replace( /<[^<|>]+?>/gi,'' );
}
function Left(str, n){
	if (n <= 0)
	    return "";
	else if (n > String(str).length)
	    return str;
	else
	    return String(str).substring(0,n);
}
function Right(str, n){
    if (n <= 0)
       return "";
    else if (n > String(str).length)
       return str;
    else {
       var iLen = String(str).length;
       return String(str).substring(iLen, iLen - n);
    }
}
function GetXmlHttpObject(handler)
{ 
	var objXmlHttp=null
	if (navigator.userAgent.indexOf("Opera")>=0)
	{
		alert("This example doesn't work in Opera") 
		return 
	}
	if (navigator.userAgent.indexOf("MSIE")>=0)
	{ 
		var strName="Msxml2.XMLHTTP"
		if (navigator.appVersion.indexOf("MSIE 5.5")>=0)
		{
		strName="Microsoft.XMLHTTP"
		} 
		try
		{ 
		objXmlHttp=new ActiveXObject(strName)
		objXmlHttp.onreadystatechange=handler 
		return objXmlHttp
		} 
		catch(e)
		{ 
		alert("Error. Scripting for ActiveX might be disabled") 
		return 
		} 
	} 
	if (navigator.userAgent.indexOf("Mozilla")>=0)
	{
	objXmlHttp=new XMLHttpRequest()
	objXmlHttp.onload=handler
	objXmlHttp.onerror=handler 
	return objXmlHttp
	}
} 

function Validate(sId,eId)
{
	for(var i=sId;i<eId;i++)
	{
		if(document.getElementById(i).value == "")
		{
			alert(document.getElementById(i).title + ' should not be empty');
			document.getElementById(i).focus();
			return false;
		}
		if(i == eId)
		{
			return true;
		}
	}
}

function Validates(Prefix,sId,eId)
{
	for(var i=sId;i<eId;i++)
	{
		if(document.getElementById(Prefix+i).value == '')
		{
			alert(document.getElementById(Prefix+i).title + ' should not be empty');
			document.getElementById(Prefix+i).focus();
			return false;
		}
		if(i == eId)
		{
			return true;
		}
	}
}


function Radio_Validate(Obj,message)
{
		var counter;
		counter = 0
		for (var i=0; i < Obj.length; i++)
 		{
			if(Obj[i].checked == false)
				counter = counter + 1
		}
		if(counter == Obj.length)
		{
			alert(message);
			Obj[0].focus()
			return false;
		}
}
function numberOnly(e,txt)
{
	if(e.keyCode == 46)
	{
		var i;
		var dotcount = 0 ;
		for(i=0;i<txt.length;i++)
		{
			if(txt.charAt(i) == ".")
			{
				dotcount = dotcount + 1;
				if(parseInt(dotcount) >= 1)
				{
					e.keyCode = 0;
					alert("Decimal point should not be more then one");
				}
			}
		}
	}
	else if ((!(e.keyCode >= 48 && e.keyCode <= 57)) && (!(e.keyCode == 46 )) && (!(e.keyCode == 13 )))
	{
		e.keyCode = 0;
		//alert(e.keyCode);
		alert("Amount should be in digit 0 to 9");
	}
}
function allowChars(Chars,Obj,Msg)
{
	var checkOK = Chars;
	var checkStr = Obj.value;
	var allValid = true;
	var allNum = "";
	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;
		}
		allNum += ch;
	}
	if (!allValid)
	{
		alert(Msg);
		Obj.focus();
		return false;
	}
	else
		return true;
}
function LimitLength(obj,length,msg)
{
	if(obj.value.length >= length)
	{
		obj.value = obj.value.substring(0,length-1);
		alert(msg);
		obj.focus();
		return false;
	}
}
function reloadCaptcha()
{
	document.getElementById("imgCaptcha").src = "/aspcaptcha.asp?p=" + new Date().getTime();
}

function AddToCart(ID,URL)
{
	var icol, scol, isize, ssize, sres, indc, inds, lenc,strIDs, lens ;
	var colFlag, sizeFlag;
	colorFlag = false;
	sizeFlag = false;
	if(document.getElementById('SelColor'))
	{
		lenc = document.getElementById('SelColor').length;
	}
	if(document.getElementById('SelSize'))
	{
		lens = document.getElementById('SelSize').length;
	}
	if (lenc > 0)
	{
	  indc = document.getElementById('SelColor').selectedIndex;
	  icol = document.getElementById('SelColor').value.toString();
	  scol = document.getElementById('SelColor').options[indc].text;			  
		  if(icol == "")
		  {
				$(".flora > ul").tabs("select", "#detail_options");
				alert("Please Select Color Option");
				document.getElementById('detail_options').style.display = 'block';
				document.getElementById('SelColor').focus();
				colorFlag = false;
		  }
		  else
				colorFlag = true;
	}
	else
	{
	  icol = "0";
	  scol = "";
	  colorFlag = true;
	}
	if(colorFlag == true)
	{
		if (lens > 0)
		{
		  inds  = document.getElementById('SelSize').selectedIndex;			  
		  isize = document.getElementById('SelSize').value.toString();
		  ssize = document.getElementById('SelSize').options[inds].text;
			  if(isize == "")
			  {
					$(".flora > ul").tabs("select", "#detail_options");
					alert("Please Select Size Option");
					document.getElementById('detail_options').style.display = 'block';
					document.getElementById('SelSize').focus();
					sizeFlag = false;
			  }
			  else
					sizeFlag = true;
		}
		else
		{
		  isize = "0";
		  ssize = "";
		  sizeFlag = true;
		}
		var iQuantity =	eval(document.getElementById('Qty').value);
		var chkcount = eval(document.getElementById('sim').value);
		var strIDs='';
		for(var i=1;i<chkcount+1;i++)
		{
			if(document.getElementById(i).checked == true)
			{
				strIDs += '&AddID' + i + '=' + eval(document.getElementById(i).value);
			}
		}
		strIDs += '&NumCheckboxes=' + chkcount;
	}
	if(colorFlag == true && sizeFlag == true)
	{
		alert("Your selection has been added to cart. Click OK to continue.");
		window.location.href = "http://www.medical-supplies-equipment-company.com/product/add_to_shop_cart.asp?ID=" + ID + "&color=" + icol + "&scol=" + scol + "&size=" + isize + "&ssize=" + ssize + "&Quantity=" + iQuantity + strIDs + "&Go=" + URL;	
	}				
}

function getSearchTxt(txt,e)

{
	if((e.keyCode == 40 || e.keyCode == 38) && (document.getElementById('suggestSearch').innerHTML.length > 0) )
	{
		if(flag == false)
		{
			document.getElementById(objId).style.backgroundColor = "#FFFFFF";
			flag = true;
		}
		else
		{
			var Rows = parseInt(document.getElementById('Rows').value);
			for(var i=1;i<=Rows;i++)
			{
				document.getElementById(i).style.backgroundColor = "#FFFFFF";
				document.getElementById(i+'a').className= "suggestOff";
			}
			if(e.keyCode == 40 && objId < Rows)
			{
				objId = objId + 1
				document.getElementById(objId).style.backgroundColor = "#990000";
				document.getElementById(objId+'a').className= "suggestOn";
				document.getElementById('txtword').value = document.getElementById(objId).title;
			}
			else if(e.keyCode == 40 && objId >= Rows)
			{
				objId = 1
				document.getElementById(objId).style.backgroundColor = "#990000";
				document.getElementById(objId+'a').className= "suggestOn";
				document.getElementById('txtword').value = document.getElementById(objId).title;
			} 
			else if(e.keyCode == 38 && objId > 1)
			{
				objId = objId - 1
				document.getElementById(objId).style.backgroundColor = "#990000";
				document.getElementById(objId+'a').className= "suggestOn";
				document.getElementById('txtword').value = document.getElementById(objId).title;		
			}
			else if(e.keyCode == 38 && objId <= 1)
			{
				objId = Rows
				document.getElementById(objId).style.backgroundColor = "#990000";
				document.getElementById(objId+'a').className= "suggestOn";
				document.getElementById('txtword').value = document.getElementById(objId).title;
			} 
		}
	}
	else if(e.keyCode != 37 || e.keyCode != 38 || e.keyCode != 39 || e.keyCode != 40)
	{
		if(txt.length > 3)
		{
			var url="/product/suggest_search.asp?searchstr=" + txt +'&randid='+Math.random()
			xmlHttp=GetXmlHttpObject(stateChanged) 
			xmlHttp.open("GET", url , true) 
			xmlHttp.send(null) 
		}
	}
	else
		document.getElementById('suggestSearch').style.display = 'none';
		
	function stateChanged() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{
			document.getElementById('suggestSearch').style.display = 'block';
			document.getElementById('suggestSearch').innerHTML=xmlHttp.responseText;
		} 
		else
			document.getElementById('suggestSearch').style.display = 'none';
	}			
}
function closebox(obj)
{
	document.getElementById('txtword').value = obj.title;
	document.getElementById('suggestSearch').style.display = 'none'
	document.quicksearch.submit();
}

function Swatch()
{
	document.getElementById('Swatch').style.display = 'block';
}

function SwatchX()
{
	document.getElementById('Swatch').style.display = 'none';
}

	function AskTheFriend(Product_Id)
	{
		if(document.getElementById("Mail").innerHTML == '<IMG src="/images/loading.gif">' || document.getElementById("Mail").innerHTML == '<img src="/images/loading.gif">')
		{
			var url="/includes/AskTheFriend.asp?Product_Id="+Product_Id;
			xmlHttp=GetXmlHttpObject(stateChanged) 
			xmlHttp.open("GET", url , true) 
			xmlHttp.send(null) 
		}
		function stateChanged() 
		{ 
			if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
			{
				document.getElementById("Mail").innerHTML = xmlHttp.responseText;
			}
		}
	}
	
	function EMail_Friend(product_id)
	{
		if(Validate(501,506) == false)
			return false;
		else
		{
			var str = "Name="+document.getElementById("501").value+"&eMail="+document.getElementById("502").value;
			str = str + "&fname="+document.getElementById("503").value+"&femail="+document.getElementById("504").value;
			str = str + "&product_id="+product_id+"&msg="+document.getElementById("506").value;
			str = str + "&captcha="+document.getElementById("505").value;
			var url="/product/Email_Friend.asp?"+str+'&randid='+Math.random();
			xmlHttp=GetXmlHttpObject(stateChanged) 
			xmlHttp.open("GET", url , true) 
			xmlHttp.send(null)
			return false;		
		}
		function stateChanged() 
		{ 
			if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
			{
				alert(xmlHttp.responseText);
				$("#Mail").slideToggle("normal");
			}
		}
	}

	function Validate_ATE(frm,StartId,EndId)
	{
		if(Validate(StartId,EndId) == false)
			return false;
		else
		{
			var qString = "";
			for (var i=StartId; i<EndId; i++)			
			{
				qString = qString + "&" + document.getElementById(i).name + "=";
				qString = qString + document.getElementById(i).value;
			}
			var url="/includes/AskThePros_Insert.asp?qString=" + qString + "&randid="+Math.random();
			xmlHttp=GetXmlHttpObject(stateChanged) 
			xmlHttp.open("GET", url , true) 
			xmlHttp.send(null) 
			return false;		
			function stateChanged() 
			{ 
				if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
				{
					document.getElementById("askprostab").innerHTML = xmlHttp.responseText;
					return false;
				}
			}
		}
	}

	function AskThePrice(ProductName,Product_Id)
	{
		if(document.getElementById("requestbox").innerHTML == '<IMG src="/images/loading.gif">' || document.getElementById("requestbox").innerHTML == '<img src="/images/loading.gif">')
		{
			var url="/includes/AskThePrice.asp?ProductName="+ProductName+"&Product_Id="+Product_Id;
			xmlHttp=GetXmlHttpObject(stateChanged) 
			xmlHttp.open("GET", url , true) 
			xmlHttp.send(null) 
		}
		function stateChanged() 
		{ 
			if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
			{
				document.getElementById("requestbox").innerHTML = xmlHttp.responseText;
			}
		}
	}

	function Volume_Pricing(product_id)
	{
		if(Validate(201,205) == false)
			return false;
		else
		{
			var str = "name="+document.getElementById("201").value+"&email="+document.getElementById("202").value;
			str = str + "&phone="+document.getElementById("txtphone").value+"&product_id="+product_id;
			str = str + "&qty="+document.getElementById("203").value+"&msg="+document.getElementById("205").value;
			str = str + "&captcha="+document.getElementById("204").value;
			var url="/product/Volume_pricing.asp?"+str+'&randid='+Math.random();
			xmlHttp=GetXmlHttpObject(stateChanged) 
			xmlHttp.open("GET", url , true) 
			xmlHttp.send(null)
			return false;
		}
		function stateChanged() 
		{ 
			if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
			{
				alert(xmlHttp.responseText);
				$("#requestbox").slideToggle("normal");
			}
			
		}
	}

function hideText(obj)
{
	if(obj.value == "Keyword Search, Item# or SKU...")
		obj.value = ""
}

	function AddToShopCart(ID,URL,Size,Swatch,Color,Trim)
	{
		if(Color == "True" && document.getElementById('SelColor').value.toString() == "")
		{
			$(".flora > ul").tabs("select", "#detail_options");
			alert("Please Select Color Option");
			document.getElementById('detail_options').style.display = 'block';
			document.getElementById('SelColor').focus();
		}
		else if(Size == "True" && document.getElementById('SelSize').value.toString() == "")
		{
			$(".flora > ul").tabs("select", "#detail_options");
			alert("Please Select Size Option");
			document.getElementById('detail_options').style.display = 'block';
			document.getElementById('SelSize').focus();
		}
		else if(Swatch == "True" && document.getElementById('SelSwatches').value.toString() == "")
		{
			$(".flora > ul").tabs("select", "#detail_options");
			alert("Please Select Product Option");
			document.getElementById('detail_options').style.display = 'block';
			document.getElementById('SelSwatches').focus();
		}
		else if(Trim == "True" && document.getElementById('SelTrims').value.toString() == "")
		{
			$(".flora > ul").tabs("select", "#detail_options");
			alert("Please Select Product Option");
			document.getElementById('detail_options').style.display = 'block';
			document.getElementById('SelTrims').focus();
		}
		else
		{
			var Color_Id,Size_Id,Swatch_Id,Trim_Id;
			var url = "http://www.medical-supplies-equipment-company.com/product/add_to_cart.asp?Product_Id="+ID
			if(Color == "True")
			{
				Color_Id = document.getElementById('SelColor').value.toString();
				url = url + "&Color_Id=" + Color_Id 
			}
			if(Size == "True")
			{
				Size_Id = document.getElementById('SelSize').value.toString();
				url = url + "&Size_Id=" + Size_Id 
			}
			if(Swatch == "True")
			{
				Swatch_Id = document.getElementById('SelSwatches').value.toString();
				url = url + "&Swatch_Id=" + Swatch_Id
			}
			if(Trim == "True")
			{
				Trim_Id = document.getElementById('SelTrims').value.toString();
				url = url + "&Trim_Id=" + Trim_Id
			}
			var Quantity = document.getElementById('Qty').value;
			url = url + "&Quantity=" + Quantity + "&go="+URL;
			alert("Your selection has been added to cart. Click OK to continue.");
			window.location.href = url;
		}
	}

	function AskThePros(ProductName,ItemNo)
	{
		if(document.getElementById("askprostab").innerHTML == '<IMG src="/images/loading.gif">' || document.getElementById("askprostab").innerHTML == '<img src="/images/loading.gif">')
		{
			var url= "/includes/AskThePros.asp?ProductName="+ProductName+"&ItemNo="+ItemNo+"&randid="+Math.random();
			xmlHttp=GetXmlHttpObject(stateChanged) 
			xmlHttp.open("GET", url , true) 
			xmlHttp.send(null) 
		}
		function stateChanged() 
		{
			if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
			{
				document.getElementById('askprostab').innerHTML = xmlHttp.responseText;
			}
		}
	}

	function OrderHistory()
	{
		if(document.getElementById("order-history").innerHTML == '<IMG src="/images/loading.gif">' || document.getElementById("order-history").innerHTML == '<img src="/images/loading.gif">')
		{
			var url= "/members/order_history.asp?randid="+Math.random();
			xmlHttp=GetXmlHttpObject(stateChanged) 
			xmlHttp.open("GET", url , true) 
			xmlHttp.send(null) 
		}
		function stateChanged() 
		{
			if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
				document.getElementById('order-history').innerHTML = xmlHttp.responseText;
		}
	}


	function Preview_Swatch(Product_Id)
	{
		document.getElementById('preview').style.display = 'block';
		var url="/includes/preview_swatch.asp?product_Id="+Product_Id+'&randid='+Math.random();
		xmlHttp=GetXmlHttpObject(stateChanged) 
		xmlHttp.open("GET", url , true) 
		xmlHttp.send(null) 
		function stateChanged() 
		{ 
			if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
			{
				document.getElementById('preview-td').innerHTML = xmlHttp.responseText;
			}
		}
	}
	function Select_Swatch(index)
	{
		document.getElementById('SelSwatches').selectedIndex = index;
	}

	function Preview_Trim(Product_Id)
	{
		document.getElementById('preview_trim').style.display = 'block';
		var url="/includes/preview_trim.asp?product_Id="+Product_Id+'&randid='+Math.random();
		xmlHttp=GetXmlHttpObject(stateChanged) 
		xmlHttp.open("GET", url , true) 
		xmlHttp.send(null) 
		function stateChanged() 
		{ 
			if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
			{
				document.getElementById('preview-trim-td').innerHTML = xmlHttp.responseText;
			}
		}
	}
	function Select_Trim(index)
	{
		document.getElementById('SelTrims').selectedIndex = index;
	}

// Date check for holiday logos
var d=new Date();
var day=d.getDate();
var month=d.getMonth(); // jan.=0, feb.=1, mar.=2, etc.
var year=d.getFullYear();
var hClass;
//Checks the date and compares it to specific annual holidays and updates main logo if date matches those holidays.
//Checks for floating holidays as well: President's Day, Memorial Day, Labor Day, Thanksgiving.
function checkDay()
{
	timedCount();
	if (month==0 && day <= 2) //check new year
	{
		changeLogo("hol-newy");
	}
	else if (month==1 && day == 14) //check valentine's day
	{
		changeLogo("hol-stval");
	}
	else if (month==1) // check for Pres. Day
	{
		var hDate=float(year,month,1,3,0,"hol-pres");// Get Pres. day date (year,month,day 0-6,nth of day,class)
	}
	else if (month==2 && day == 17) //check st. patrick's day
	{
		changeLogo("hol-stpat");
	}
	else if (month==4) // Check memorial day
	{
		var nDays=weekdayMonth(year,month,1); //Find number of Mondays in May
		var hDate=float(year,month,1,4,nDays,"hol-memor"); // Get Memorial Day date, assumes it is 4th Monday
	}	
	else if (month==6 && day == 4) //check fourth of july
	{
		changeLogo("hol-july4");
	}
	else if (month==8) // Check for Labor Day
	{
		var hDate=float(year,month,1,1,0,"hol-labor");// Get Labor Day date (1st Mon.)
	}
	else if (month==9 && day == 31) //check halloween
	{
		changeLogo("hol-hallo");
	}
	else if (month==10 && day == 11) //check veteran's day
	{
		changeLogo("hol-vets");
	}
	else if (month==10) // Check for Thanksgiving
	{
		var hDate=float(year,month,4,4,0,"hol-thanks");// Get Thanksgiving Day date (4th Thr.)
	}
	else if (month==11 && day >= 22 && day <= 29) //check winter holidays
	{
		changeLogo("hol-wint");
	}
	else 
	{
		changeLogo("logo-default"); //show default logo
	}
}
function timedCount()
{
	if (typeof msg != "undefined") 
	{
		var t=setTimeout("document.getElementById('msg').className=''",3000);
		var t=setTimeout("document.getElementById('msg').innerHTML=''",3000);
	}
}
function weekdayMonth(y,m,w) {
//Checks if there are 5 or 4 of a particular day
//Only needed for Memorial Day (last Monday in May)
//http://javascript.about.com/library/bldaymth.htm
	var m = m+1; // function assumes jan. = 1, not jan. = 0
	var dd = new Date(y,m,0);
	return (dd.getDate() -(dd.getDay() - w + 7) % 7 > 28) ? 5 : 4;
}

function float(nYear,nMonth,nTargetday,nTh,nDays,hClass) {
//Modified from original function http://michaelthompson.org/technikos/holidays.php
//nDays: only needed for Memorial Day, hClass: class to be applied to logo
	var nEarliestDate = 1 + (7 * (nTh - 1));
	var d = new Date(nYear,nMonth,nEarliestDate);
	var nWeekday = d.getDay();

	if( nTargetday==nWeekday ) nOffset = 0;
	else {
		if( nTargetday<nWeekday ) nOffset = nTargetday + (7 - nWeekday);
		else nOffset = (nTargetday + (7 - nWeekday)) - 7;
	}
	if (nMonth==4 && nDays==5) { //Check if it's May and if there are 5 Mondays this year.
		var nEarliestDate = nEarliestDate + 7; //Add 7 for 5th Monday
	}
	var tHolidayDate = new Date(nYear,nMonth,nEarliestDate + nOffset);
	var tDate = tHolidayDate.getDate();
	if (tDate == day) changeLogo(hClass); 
	// Compare floating date to today's date
	// If equal, then change to holiday logo
	else {
		changeLogo("logo-default");
	}
}

function changeLogo(hClass) // Adds class value to #logo
{
var elem1 = document.getElementById("logo");
elem1.className = hClass;
}


	function Add_Bill(frm)
	{
		var url= "/members/Add_Bill.asp?randid="+Math.random();
		xmlHttp=GetXmlHttpObject(stateChanged) 
		xmlHttp.open("GET", url , true) 
		xmlHttp.send(null)
		function stateChanged() 
		{
			if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
				document.getElementById('Bill-Info').innerHTML = xmlHttp.responseText;
		}
	}
	function Add_Ship(frm)
	{
		var url= "/members/Add_Ship.asp?randid="+Math.random();
		xmlHttp=GetXmlHttpObject(stateChanged) 
		xmlHttp.open("GET", url , true) 
		xmlHttp.send(null)
		function stateChanged() 
		{
			if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
				document.getElementById('Ship-Info').innerHTML = xmlHttp.responseText;
		}
	}
	function Update_Bill(frm)
	{
		if(Validate(1,6) == false)
			return false;
		else if(Radio_Validate(frm.OptDefault,"Please select default option") == false)
			return false;
		else
			return true;
	}

	function Update_Ship(frm)
	{
		if(Validate(6,10) == false)
			return false;
		else if(Radio_Validate(frm.OptDefault,"Please select default option") == false)			
			return false;
		else
			return true;
	}

	function Edit_Contact(Contact_Id,Bill)
	{
		if (Contact_Id == "" && Bill == "")
			alert("Invalid contact information");
		else
			window.location.href = "/members/Edit_User_Contact.asp?Bill=" + Bill + "&Contact_Id=" + Contact_Id + "&randid="+Math.random();
	}

	function Remove_Contact(Contact_Id,Bill)
	{
		if (Contact_Id == "" && Bill == "" )
			alert("Invalid contact information");
		else
		{
			var flag = confirm("Are you sure you want to delete this address?")
			if(flag == true)
			{
				window.location.href = "/members/Remove_Contact.asp?Bill=" + Bill + "&Contact_Id=" + Contact_Id + "&randid="+Math.random();
			}
		}
	}
	
	function Validate_CP(frm)
	{
		if(Validate(100,103) == false)
			return false;
		else
			return true;
	}	
	
	function Validate_Profile(frm,sid,eid)
	{
		if(Validates("Profile_Field_",sid,eid) == false)
			return false;
		else
			return true;
	}	
    function genColor()
    {
	    colors = new Array(14)
	    colors[0]="0"
	    colors[1]="1"
	    colors[2]="2"
	    colors[3]="3"
	    colors[4]="4"
	    colors[5]="5"
	    colors[5]="6"
	    colors[6]="7"
	    colors[7]="8"
	    colors[8]="9"
	    colors[9]="a"
	    colors[10]="b"
	    colors[11]="c"
	    colors[12]="d"
	    colors[13]="e"
	    colors[14]="f"
    	
	    digit = new Array(5)
	    color=""
	    for (i=0;i<6;i++)
	    {
		    digit[i]=colors[Math.round(Math.random()*14)]
		    color = color+digit[i]
	    }
	    return color;
    }

	function isObjectExists(val)
	{
		if(document.getElementById(val) != null)
			return true
		else
			return false;
	}
