
// Get product count for shopcart
function get_product_count(){
	var cookieStr = (document.cookie);
	var cookies = cookieStr.split(';');
	var productCount = 0;
	for(x = 0; x < cookies.length; x++){
		if(cookies[x].indexOf('product[') != -1){
			//alert(cookies[x]);
			productCount++;
		}
	}
	//if(productCount == 0){ productCount = 1; }
	return productCount;
}
productCount = get_product_count();
function getScrollHeight()
{
   var h = window.pageYOffset ||
           document.body.scrollTop ||
           document.documentElement.scrollTop;
           
   return h ? h : 0;
}
function getH(){
	var h;
	if(document.innerHeight){ h=document.innerHeight;
	} else if(document.documentElement.clientHeight){ h=document.documentElement.clientHeight;
	} else if(document.body){ h=document.body.clientHeight; }
	return h;
}
function getW(){
	var w;
	if(document.innerWidth){ w=document.innerWidth;
	} else if(document.documentElement.clientWidth){ w=document.documentElement.clientWidth;
	} else if(document.body){ w=document.body.clientWidth; }
	return w;
}
function show_product(id) {
  var product_window = 'product_win_' + id;
  var scH = getScrollHeight();
  //var winH = getH();
  var winW = getW();
  winTop = 50 + scH;
  winLeft = winW/2;
  $('MapBackground').setOpacity(0.7);
  $('MapBackground').clonePosition('MainBody');
  $('MapBackground').show();
  $(product_window).setStyle({	 position: 'absolute',   top: winTop + 'px',   left: winLeft + 'px'   });
  $(product_window).show();
  Element.absolutize(product_window);
}
function hide_product(id) {
  var product_window = 'product_win_' + id;
  $('MapBackground').hide();
  $(product_window).hide();
}
function showCVCHelp() {
  $("cvc").show();
}
function hideCVCHelp() {
  $("cvc").hide();
}
