/////////////////////////////////////////////////
var domain = "http://www.israeli-forces.com/html" ;
var cgi_domain = "http://www.israeli-forces.com/cgi-local" ;
var openedWindow  = null ;
/////////////////////////////////////////////////
function imagePopup(Id,pictureField){	

	if(openedWindow) openedWindow.close();
	openedWindow =window.open(cgi_domain+"/product_image.pl?pictureField="+pictureField+"&Id="+Id,"an","toolbar=no,member=no,location=no,directories=no,scrollbars=no,status=no,copyhistory=no,resizable=no,height=328,width=300,left=0,top=0");
}
/////////////////////////////////////////////////
function dynamicImagePopup(Id,pictureField,width,height){	
	if(openedWindow) openedWindow.close();
	var intHeight = parseInt(height) + 28 ;
	openedWindow = window.open(cgi_domain+"/product_image.pl?pictureField="+pictureField+"&Id="+Id+"&width="+width+"&height="+height,"an","toolbar=no,member=no,location=no,directories=no,scrollbars=no,status=no,copyhistory=no,resizable=no,height="+intHeight+",width="+width+",left=0,top=0");
}
/////////////////////////////////////////////////
function open_full_description(id){
	if(openedWindow) openedWindow.close();
	openedWindow = window.open("/cgi-local/full_description_popup.pl?Id="+id,"an",
	"toolbar=no,member=no,location=no,directories=no,scrollbars=yes,status=no,copyhistory=no,resizable=no,height=330,width=320,left=0,top=0");
}
/////////////////////////////////////////////////
function setSize(productId){
	var currentValue = document.getElementById("SizeOf"+productId) ;
	var aobj = document.getElementById("sizeSpan"+productId) ;
	alert(findPosY(aobj));

}
/////////////////////////////////////////////////
function findPosX(obj)
{
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}
/////////////////////////////////////////////////
function findPosY(obj)
{
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	return curtop;
}
/////////////////////////////////////////////////
function swapMenuClasses_on(item_id){
	var menu_item = document.getElementById(item_id);
	menu_item.style.backgroundColor = '#133879';
	menu_item.style.color  = "#FCCA6C";
}
/////////////////////////////////////////////////
function swapMenuClasses_off(item_id){
	var menu_item = document.getElementById(item_id);
	menu_item.style.backgroundColor = '#FCCA6C';
	menu_item.style.color  = "#133879";
}
/////////////////////////////////////////////////