// JavaScript Document
function showNavigationMenu(showMenu, hideMenu, showImage, hideImage) {
	document.getElementById(showMenu).style.display ='';
	document.getElementById(hideMenu).style.display ='none';
	document.getElementById(showImage).style.display ='';
	document.getElementById(hideImage).style.display ='none';
}

function showTitleTooltips(divId) {
	document.getElementById(divId).style.display='';
}


function Paging(start)
{
showcart(start);
}

//FOR CLOSING THE CART BOX  START BY PRIYABRATA 23.06.08
/*function zxcCkEventObj(zxce,zxcprop)
{
	if (!zxce) var zxce=window.event;
	zxce.cancelBubble=true;
	if (zxce.stopPropagation) zxce.stopPropagation();
	if (zxce.target) zxceobj=zxce.target;
	else if (zxce.srcElement) zxceobj=zxce.srcElement;
	if (zxceobj.nodeType==3) zxceobj=zxceobj.parentNode;
	var zxceobj=(zxce.relatedTarget)?zxce.relatedTarget:(zxce.type=='mouseout')?zxce.toElement:zxce.fromElement;
	if (zxceobj[zxcprop]) return false;
	while (zxceobj.parentNode){
	if (zxceobj.offsetWidth==zxcprop) return false;  // change the conditional to meet the application requirement
	zxceobj=zxceobj.parentNode;
	}
	return true;
}

function hidecart(prop)
{
	var zxcevt=window.event||arguments.callee.caller.arguments[0];
	if (zxcCkEventObj(zxcevt,prop)) 
	{
	document.getElementById("cart").style.display = "none";
	}
}*/

function hidecart()
{
document.getElementById("cart").style.display = "none";
}



//FOR CLOSING THE CART BOX  END BY PRIYABRATA 23.06.08



function showTechSpecs(showDiv, showTab, id) { 
	for (var i=1; i <= 3; i++)
	{
		
		if(i == id) {
			document.getElementById(showDiv+"_"+i).style.display ='';
			document.getElementById(showTab+"_"+i).className ='active';
		} else {	
			document.getElementById(showDiv+"_"+i).style.display ='none';
			document.getElementById(showTab+"_"+i).className ='';
		}	
	}
	
}

// EVENT HANDLERS
function pressButton(btName, btSrc) { 
 if (document.images)
  eval('document.'+btName+'.src='+btSrc+'_down.src');
}

function releaseButton(btName, btSrc) {
 if (document.images)
  eval('document.'+btName+'.src='+btSrc+'_up.src');
}


//Create a boolean variable to check for a valid Internet Explorer instance.
var xmlhttpC = false;
//Check if we are using IE.
try {
//If the Javascript version is greater than 5.
xmlhttpC = new ActiveXObject("Msxml2.XMLHTTP");
//alert ("You are using Microsoft Internet Explorer.");
} catch (e) {
//If not, then use the older active x object.
try {
//If we are using Internet Explorer.
xmlhttpC = new ActiveXObject("Microsoft.XMLHTTP");
//alert ("You are using Microsoft Internet Explorer");
} catch (E) {
//Else we must be using a non-IE browser.
xmlhttpC = false;
}
}
//If we are using a non-IE browser, create a javascript instance of the object.
if (!xmlhttpC && typeof XMLHttpRequest != 'undefined') {
xmlhttpC = new XMLHttpRequest();
//alert ("You are not using Microsoft Internet Explorer");
}
function updateCart(serverPage, id, formField) {
	//var obj = document.getElementById(objID);
	xmlhttpC.open("GET", serverPage);	
	xmlhttpC.onreadystatechange = function() {
		if (xmlhttpC.readyState==4 || xmlhttpC.readyState=="complete"){
			var allData = xmlhttpC.responseText.split("~");
			formField.value = allData[0];
			document.getElementById("price_"+id).innerHTML = allData[1];
			document.getElementById("subTotal").innerHTML  = allData[2];
			document.getElementById("vatCharge").innerHTML = allData[3];
			document.getElementById("exVat").innerHTML     = allData[4];
			document.getElementById("cartTotal").innerHTML = allData[2];
			document.getElementById("cartTotals").innerHTML = allData[2];
		}
	}
	xmlhttpC.send(null);
}

function changeQty(formField, operation, id) {
	var qtyValue = document.getElementById("cartvalue").value;
	updateCart('addtocart.php?action=ajaxupdate&qty='+qtyValue+'&id='+id, id, formField);
}