// JavaScript Document

var curr_lb_div;
var is_modal = false;

function hidecartdiv()
{
	if (document.getElementById(curr_lb_div))
	{
		document.getElementById(curr_lb_div).style.display='none';
		document.getElementById('fade').style.display='none';
		curr_lb_div = '';
	}
}

function showcartdiv(subobjstr, isModal) {
	var scrOfX = 0, scrOfY = 0;
	if( typeof( window.pageYOffset ) == 'number' ) {
		scrOfY = window.pageYOffset; scrOfX = window.pageXOffset;
	} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
		scrOfY = document.body.scrollTop; scrOfX = document.body.scrollLeft;
	} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
		scrOfY = document.documentElement.scrollTop; scrOfX = document.documentElement.scrollLeft;
	}
	
	 var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }

	
	var subobj=document.getElementById(subobjstr)
	document.getElementById('fade').style.display='block';
	curr_lb_div = subobjstr;
	if (isModal)
		is_modal = true;
		else is_modal = false;

	
	subobj.style.display=(subobj.style.display!="block")? "block" : "none";

	var xpos = (myWidth/2)-250;
	var ypos = scrOfY;
	subobj.style.left=xpos+"px";
	subobj.style.top=scrOfY+"px";

}




