//<!-- 
function AddToCartWar(itemID, WarID, Qty, strUrl) {
    var npx = document.getElementById('inp1');
    var war = document.getElementById(WarID)
    if(war!=null && war.checked) {
	    npx.name = "txt" + itemID + 'Z';
		if (Qty)
			npx.value = Qty;
	}
	AddToCart(itemID, Qty, strUrl);
}

var maxheight = 0;
var minheight = 24;
function SetTab(tab) {
	var i;
	var maxht = 0;
	for(i=1; i<=TabCnt; i++) {
		var ObjHtml = document.getElementById('ProdTab' + i);
		ObjHtml.style.display = (i==tab) ? 'block' : 'none';
		var td = document.getElementById('TabData' + i + 'TD');
		if(maxheight==0) {
			if(td.offsetHeight)
				maxht = Math.max(maxht, td.offsetHeight); 
			else if(td.style.pixelHeight)
				maxht = Math.max(maxht, td.style.pixelHeight); 
		} else {
			td.height = maxheight+minheight+'px';
		}
	}
	if(TabCnt>0 && maxheight==0 && maxht>0) {
		maxheight = maxht;
		SetTab(tab);
	}
}

function WritePersonalizationCookie(val, url) {
	var strItems = Get_Cookie("personalization");
	var qs = new SubCookie(strItems);
	qs.SetValue("vp", val);
	var newQs = qs.ToString();
	var expireDate = new Date();
	expireDate.setYear(expireDate.getFullYear() + 1);
	Set_Cookie2("personalization", newQs, expireDate, "/", null, null); 
    if( url != '' )
        window.location=url;
}
function Set_Cookie2(name,value,expires,path,domain,secure) {
    document.cookie = name + "=" + value +
        ( (expires) ? ";expires=" + expires.toGMTString() : "") +
        ( (path) ? ";path=" + path : "") +
        ( (domain) ? ";domain=" + domain : "") +
        ( (secure) ? ";secure" : "");
}
function SubCookie(valString) {
	var data = [];
	var aPairs, aTmp;
	if(valString!=null && valString!="")
		aPairs = valString.split("&");
	if(aPairs!=null)
	for (var i=0 ; i<aPairs.length; i++) {
		aTmp = aPairs[i].split("=");
		data[aTmp[0]] = aTmp[1];
	}
	this.GetValue = function( key ) {
		return data[key];
	}
	this.SetValue = function( key, value ) {
		if (value == null)
			delete data[key];
		else 
			data[key] = value;
	}
	this.ToString = function() {
		var qString = new String("");
		for (var key in data) {
			if (qString != "")
				qString += "&";
			if (data[key])
				qString += key + "=" + data[key];		
		}
		return qString;
	}
	this.Clear = function() {
		delete data;
		data = [];
	}
}

function SH_PopOpen(theURL,winName,features) {
  if(theURL.charAt(0)!='/' && theURL.toLowerCase().substr(0,7)!='http://' && theURL.toLowerCase().substr(0,8)!='https://'){
    theURL = '/' + theURL;
  }
  window.open(theURL,winName,features);
}

/*
function AddToWishList(itemId) {
	document.location = "https://" + document.domain + "/MyAccount/MyWishList.aspx?ItemIdWl=" + itemId +  "&shopurlWl=" + escape(window.location.href);
}*/

// -->

