function encpass(theID, theID2)
{
	var theElement = null;
	var theElementHidden = null;
	var g = null;
	theElement = document.getElementById(theID);
	theElementHidden = document.getElementById(theID2);	
	//alert(theElement);
	if (theElement != null)
	{
		g = hex_md5(theElement.value);
		//alert(g);
		if (theElementHidden != null)
		{
			theElementHidden.value = g;
		}
	}
}

function productDetails(productID, num)
{
	var c = null;
	c = document.getElementById(''+productID);
	//alert(c);
	if (c!=null)
	{
		switch (num)
		{
			case 0: c.innerHTML = '&nbsp;'; break;
			case 1: c.innerHTML = 'Ask&nbsp;Us!'; break;
			case 2: c.innerHTML = 'Brochure'; break;
			case 3: c.innerHTML = 'Manual'; break;			
		}
	}
}

function bookmarksite(title, url){
if (document.all)
window.external.AddFavorite(url, title);
else if (window.sidebar)
window.sidebar.addPanel(title, url, "")
}

function clickGalleryItem(itemNum, itemType)
{
	var item = null;
	if (itemType == 'photo')
	{
		 item = document.getElementById("glp"+itemNum);
		 if (item != null)
		 {
			 item.click();
		 }
	}
}

function checkModifiedDate(theDate)
{
	var lm = null;
	lm = document.getElementById('lastUpdate');
	//alert(lm);
	if (lm != null) { lm.innerHTML = ""+theDate; }
}

function updateSortOrder(sortType, theValue)
{
	//alert(theValue);
	var theLocation = document.location.href;
	var theQuestionMark = -1;
	//alert(theLocation);
	theQuestionMark = theLocation.indexOf('?');
	if (theQuestionMark != -1)
	{
		theLocation = theLocation+"&"+sortType+"="+theValue;
	}
	else
	{
		theLocation = theLocation+"?"+sortType+"="+theValue;		
	}
	document.location.href = theLocation;	
//	alert(theLocation);
}

function printWindow(url)
{
	pagePrint = window.open(url, 'print', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=1,resizable=1,width=700,height=580,left = 0,top = 0,modal=no');
}
