
var tdcol = "#7EB4C2";
var isNav4, isIE4
if (parseInt(navigator.appVersion) >= 4) {
	isNav4 = (navigator.appName == "Netscape")
	isIE4 = (navigator.appName.indexOf("Microsoft") !=-1)
}

function submitIt(whichForm)
{
	document.forms[whichForm].submit();
	return false;
}

function addIt(Sid)
{
	formname="buy_it_"+Sid;
	document.forms[formname].submit();
}		

// goto manufacturer's page
function goManuf(srcElement) {
	if (isIE4) { 
		if (srcElement.value != "") {
			window.location.href='/easyconsole.cfm?page=manufacturers_ts&c_id='+srcElement.value;	
		}
	}
}

function openWishList(p_id)
{		  		
  popupwindow=window.open('/easyconsole.cfm?page=wish_list&p_id='+p_id,'popupwindow','width=640,height=400,scrollbars=yes');
  popupwindow.focus();
  return true;
}

function currency(curr,amount,lang) { 
  wn=window.open('/utils/currency.cfm?currency='+curr+'&amount='+amount+'&lang='+lang,'currency','width=270,height=240');
}	

function OpenCertDetails()
{
thewindow = window.open('http://www.thawte.com/cgi/server/certdetails.exe?code=CYTECH1', 'anew', config='height=400,width=480,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,directories=no,status=yes');
}

function deleteCartItem(r, title, indexPosition, tableName, linkname){
	
     var choice = confirm(title);
	 
     if (choice == true) {
	 
        var i = r.parentNode.parentNode.rowIndex;
		
		if(tableName)
		{
        	document.getElementById(tableName).deleteRow(i);
		}
		else
		{
			document.getElementById('cart').deleteRow(i);
		}
     	easyAjax(linkname+'?indexPosition=' + indexPosition,'displayScreen');
     }
}

function addCartQuantity(indexPosition, r, linkname){
	var qty = document.getElementById(r);
	var new_qty = parseInt(qty.value) + 1;
	
	qty.value = new_qty;
	updateCartItem(indexPosition, r, linkname)
}

function removeCartQuantity(indexPosition, r, linkname){
	var qty = document.getElementById(r);
	var new_qty = parseInt(qty.value) - 1;
	
	qty.value = new_qty;
	updateCartItem(indexPosition, r, linkname)
}

function updateCartItem(indexPosition, r, linkname)
{	
	var i = document.getElementById(r).value;
    easyAjax(linkname+'?indexPosition=' + indexPosition+'&value='+i,'displayScreen');
}

function NewPage(url) {
  document.location.href= url;
}


