function changeDay(_1){
if(_1){
document.getElementsByTagName("body")[0].className=_1;
}else{
var d=new Date();
var h=d.getHours();
if(h>=4&&h<=17){
document.getElementsByTagName("body")[0].className="day";
_1="day";
}else{
document.getElementsByTagName("body")[0].className="night";
_1="night";
}
}
if(_1=="day"){
document.getElementById("dayIndicator").style.textDecoration="underline";
document.getElementById("nightIndicator").style.textDecoration="none";
}else{
document.getElementById("nightIndicator").style.textDecoration="underline";
document.getElementById("dayIndicator").style.textDecoration="none";
}
};
function nextLanguage(_2){
document.getElementById("langIndextype").value=_2;
document.frmVivalite.submit();
};
function nextImage(){
document.getElementById("hidSelectedImg").value=document.getElementById("hidSelectedImg").value+1;
document.frmVivalite.submit();
};
function getHTTPObject(){
var _3;
/*@cc_on  @if (@_jscript_version >= 5)    try {      _3 = new ActiveXObject("Msxml2.XMLHTTP");    } catch (e) {      try {        _3 = new ActiveXObject("Microsoft.XMLHTTP");      } catch (E) {        _3 = false;      }    }  @else  _3 = false;  @end @*/ 
if(!_3&&typeof XMLHttpRequest!="undefined"){
try{
_3=new XMLHttpRequest();
}
catch(e){
_3=false;
}
}
return _3;
};
function loadProductDetails(_4,_5,_6){
document.getElementById("addtocartqty").style.display="";
document.getElementById("inshoppingcart").style.display="none";
params="hidAction=loadProduct&";
params+="productId="+_4+"&";
params+="optionId="+_5;
url=window.location.pathname;
http=getHTTPObject();
http.open("POST",url,true);
http.setRequestHeader("Content-type","application/x-www-form-urlencoded");
http.setRequestHeader("Content-length",params.length);
http.setRequestHeader("Connection","close");
http.onreadystatechange=function(){
HttpProductResponse(_6),HttpProductImagesResponse(_6),HttpOptionResponse(_6),HttpPriceResponse(),HttpInShoppingCartResponse(),HttpRelatedProductResponse(_6),HttpProductReviewResponse(_6);
};
http.send(params);
};
function HttpProductResponse(_7){
document.getElementById("prodQty").value=1;
var _8="";
if(http.readyState==4){
if(http.status==200){
var sr=eval("("+http.responseText+")");
if((sr["productArray"].length)>0){
prodId=sr.productArray[0].prodId;
optionId=sr.productArray[0].optionId;
prodName=sr.productArray[0].prodName;
prodShortDescr=sr.productArray[0].prodShortDescr;
prodFeatures=sr.productArray[0].prodFeatures;
prodDetailDescr=sr.productArray[0].prodDetailDescr;
prodImage=sr.productArray[0].prodImage;
imageTitle=sr.productArray[0].imageTitle;
imageAlt=sr.productArray[0].imageAlt;
qRating=sr.productArray[0].qualityRating;
pageTitle=sr.productArray[0].pageTitle;
prodSubTitle=sr.productArray[0].prodSubTitle;
fileId=sr.productArray[0].fileId;
document.frmVivalite.hidProductName.value=prodName;
if(prodSubTitle){
prodName=prodName+", "+prodSubTitle;
}else{
prodName=prodName;
}
document.getElementById("hidProdId").value=prodId;
document.getElementById("hidOptionId").value=optionId;
document.getElementById("productName").innerHTML=prodName;
document.getElementById("productShortDescr").innerHTML=prodShortDescr;
if(prodDetailDescr!=""){
document.getElementById("productDetailDescrMainDiv").style.display="";
document.getElementById("productDetailDescr").innerHTML=prodDetailDescr;
}else{
document.getElementById("productDetailDescrMainDiv").style.display="none";
document.getElementById("productDetailDescr").innerHTML="";
}
if(prodFeatures!="<li/>"){
document.getElementById("productFeatureHead").style.display="block";
document.getElementById("productFeatures").style.display="block";
document.getElementById("productFeatures").innerHTML=prodFeatures;
}else{
document.getElementById("productFeatureHead").style.display="none";
document.getElementById("productFeatures").style.display="none";
}
document.title=pageTitle;
if(fileId&&typeof (sr.productLargeImageArray[0][fileId])!="undefined"){
largeImgName=sr.productLargeImageArray[0][fileId][0].bigImgName;
if(largeImgName!=""){
_8="<a rel='lightbox' title='"+document.frmVivalite.hidProductName.value+"' style='cursor:pointer;'  href="+_7+"/large/"+largeImgName+"><img src="+_7+"/small/"+prodImage+" height='200' width='200' align='middle' alt="+imageAlt+" title="+imageTitle+" style='cursor:pointer;' border='0'/></a>";
}
}else{
_8="<img src="+_7+"/small/"+prodImage+" height='200' width='200' align='middle' alt="+imageAlt+" title="+imageTitle+" />";
}
document.getElementById("productImage").innerHTML=_8;
$(function(){
$("#productImage a").lightBox();
});
document.getElementById("navBar").innerHTML=sr.productArray[0].prodName;
if(sr["relatedProductArray"].length>0||sr["productReviewArray"].length>0){
document.getElementById("bottomLine").className="customerfeed";
}else{
document.getElementById("bottomLine").className="";
}
document.getElementById("qualityRatingAvg").style.width=(qRating>0)?(qRating*13.5+3)+"px":"0px";
window.location.hash="product";
}
}
}
};
function HttpProductImagesResponse(_9){
var _a="";
var _b="";
var _c="";
if(http.readyState==4){
if(http.status==200){
var sr=eval("("+http.responseText+")");
for(var i in sr.productLargeImageArray[0]){
_b+=sr.productLargeImageArray[0][i][0].bigImgName+";";
_c+=i+";";
}
var _d=(typeof (sr.productArray)=="undefined")?sr.productOptionArray[0].fileId:sr.productArray[0].fileId;
for(i=0;i<sr["productImageArray"].length;i++){
prodImage=sr.productImageArray[i].imageName;
imageTitle=sr.productImageArray[i].imageTitle;
imageAlt=sr.productImageArray[i].imageAlt;
fileId=sr.productImageArray[i].fileId;
if(fileId&&typeof (sr.productLargeImageArray[0][fileId])!="undefined"){
largeImgName=sr.productLargeImageArray[0][fileId][0].bigImgName;
if(largeImgName!=""){
_a+="<div class='thumbnailimg'><img src="+_9+"/small/"+prodImage+" height='50' width='43' align='middle' alt='"+imageAlt+"' title='"+imageTitle+"' onmouseover=changeProductImage('"+_9+"','"+prodImage+"','"+imageTitle+"','"+imageAlt+"','"+largeImgName+"','"+_b+"','"+_c+"','"+fileId+"')></div>";
if(_d!=fileId){
document.getElementById("productImage").innerHTML+="<a href="+_9+"/large/"+largeImgName+" title=\""+document.frmVivalite.hidProductName.value+"\"></a>";
}
}
}else{
_a+="<div class='thumbnailimg'><img src="+_9+"/small/"+prodImage+" height='50' width='43' align='middle' alt='"+imageAlt+"' title='"+imageTitle+"' onmouseover=changeProductImage('"+_9+"','"+prodImage+"','"+imageTitle+"','"+imageAlt+"','') /></div>";
}
}
$(function(){
$("#productImage a").lightBox();
});
document.getElementById("prodImages").innerHTML=_a;
}
}
};
function HttpProductReviewResponse(_e){
if(http.readyState==4&&http.status==200){
var sr=eval("("+http.responseText+")");
l=sr["productReviewArray"].length;
if(l>0){
document.getElementById("seeAllReviews").style.display="";
}else{
document.getElementById("seeAllReviews").style.display="none";
}
document.getElementById("productReviewsDiv").innerHTML="";
if(l==0){
document.getElementById("productReviewsDiv").style.display="none";
return false;
}
var _f="";
_f+=(sr["relatedProductArray"].length>0)?"<div class=\"customerfeed1\"><div class=\"customerfeed\"></div></div>":"";
_f+="<div class=\"continueshopping\"><div class=\"titleleft\"><h1>"+alerts["_CUSTOMER_REVIEWS"]+"</h1></div>";
for(i=0;i<l;i++){
customer_name=sr.productReviewArray[i].customer_name;
email_id=sr.productReviewArray[i].email_id;
txt_opinion=sr.productReviewArray[i].txt_opinion;
quality_rating=sr.productReviewArray[i].quality_rating;
post_date=sr.productReviewArray[i].post_date;
width=(quality_rating>0)?quality_rating*13.5+3:0;
_f+="<div class=\"reviews\"><div class=\"reviewPosted\"><span style=\"float:left;width:180px;\">"+alerts["_POSTED_BY"]+": "+customer_name+"</span><span>"+alerts["_POSTED_ON"]+": "+post_date+"</span><div class=\"light\"><div>&nbsp;</div><div class=\"quality\"><h5>"+alerts["_QUALITY"]+"</h5></div><div class=\"starfade\"><div class=\"staractive\" id=\"qualityRating\" style=\"width:"+width+"px;\"></div></div></div><div>&nbsp;</div><div style=\"float:left;width:500px;text-align:left;padding-left:80px;\">"+txt_opinion+"</div></div></div>";
}
_f+="</div></div>";
document.getElementById("productReviewsDiv").innerHTML=_f;
document.getElementById("productReviewsDiv").style.display="block";
}
};
function HttpRelatedProductResponse(_10){
var _11="";
if(http.readyState==4){
if(http.status==200){
var sr=eval("("+http.responseText+")");
if((sr["relatedProductArray"].length)>0){
for(i=0;i<sr["relatedProductArray"].length;i++){
relProdId=sr.relatedProductArray[i].relProdId;
prodName=sr.relatedProductArray[i].prodName;
prodPrice=sr.relatedProductArray[i].prodPrice;
optionId=sr.relatedProductArray[i].optionId;
imageName=sr.relatedProductArray[i].imageName;
imgTitle=sr.relatedProductArray[i].imgTitle;
imgAlt=sr.relatedProductArray[i].imgAlt;
qRating=sr.relatedProductArray[i].qualityRate;
_11+=" <a href='javascript:void(0)' onclick=loadProductDetails('"+relProdId+"','"+optionId+"','"+_10+"')>";
_11+=" <div class='img'><img  src="+_10+"/small/"+imageName+" height='80' width='80'  alt='"+imgAlt+"' title='"+imgTitle+"' border='0' >";
_11+="\t<div class='slideProductname'>"+prodName+"</div>";
_11+="\t<div class='slideProductprice'>"+prodPrice+"</div>";
width=(qRating>0)?(qRating*13.5+3)+"px;":"0px;";
_11+="<div class='starfade' style='margin-left:15px;'><div class='staractive' style='width:"+width+"'></div></div>";
_11+="</div></a>";
}
_11+="<div id='slideEnd_rel'></div>";
document.getElementById("relatedProd").style.display="";
document.getElementById("theImages_rel").innerHTML=_11;
if((sr["relatedProductArray"].length)>5){
initSlideShow_rel("arrow_left_rel","arrow_right_rel","theImages_rel","galleryContainer_rel","slideEnd_rel");
}
if((sr["relatedProductArray"].length)>2){
document.getElementById("scrollAmount_rel").style.display="";
document.getElementById("totalProd_rel").innerHTML=sr["relatedProductArray"].length;
}else{
document.getElementById("scrollAmount_rel").style.display="none";
}
if((sr["relatedProductArray"].length)<5){
document.getElementById("scrollEndAmt_rel").innerHTML=sr["relatedProductArray"].length;
}
}else{
document.getElementById("relatedProd").style.display="none";
}
}
}
};
function changeProductImage(_12,_13,_14,_15){
if(arguments[4]){
document.getElementById("productImage").innerHTML="<a rel='lightbox' title='"+document.frmVivalite.hidProductName.value+"' style='cursor:pointer;' href="+_12+"/large/"+arguments[4]+"><img src="+_12+"/small/"+_13+" height='200' width='200' align='middle' alt="+_15+" title="+_14+" style='cursor:pointer;' border='0'/></a>";
imgNames=arguments[5].split(";");
imgNames.pop();
fileIds=arguments[6].split(";");
fileIds.pop();
fileId=arguments[7];
for(var i in imgNames){
if(fileId!=fileIds[i]){
document.getElementById("productImage").innerHTML+="<a href="+_12+"/large/"+imgNames[i]+" title=\""+document.frmVivalite.hidProductName.value+"\"></a>";
}
}
$(function(){
$("#productImage a").lightBox();
});
}else{
document.getElementById("productImage").innerHTML="<img src="+_12+"/small/"+_13+" height='200' width='200' align='middle' alt="+_15+" title="+_14+"/>";
}
};
function HttpOptionResponse(_16){
var _17="";
if(http.readyState==4){
if(http.status==200){
var sr=eval("("+http.responseText+")");
if((sr["productOptionArray"].length)>1){
_17+="<div class='availproductopt'>";
_17+="<select style='width:220px'  name='productOption' id='productOption' onchange=changeOptions('"+_16+"')>";
for(i=0;i<sr["productOptionArray"].length;i++){
optionValue=sr.productOptionArray[i].optionId;
optionText=sr.productOptionArray[i].optionText;
_17+="<option value="+optionValue+" >"+optionText+"</option>";
}
_17+="</select></div>";
document.getElementById("productOptionDiv").style.display="";
document.getElementById("productOptionDiv").innerHTML=_17;
}else{
document.getElementById("productOptionDiv").innerHTML="<input type='hidden' id='productOption'>";
}
}
}
};
function HttpPriceResponse(){
var _18="";
if(http.readyState==4){
if(http.status==200){
var sr=eval("("+http.responseText+")");
rrPrice=sr.productPriceRanges[0].rrPriceRange;
prodPrice=sr.productPriceRanges[0].prodPriceRange;
savePrice=sr.productPriceRanges[0].savePriceRange;
prodPriceGreater=sr.productPriceRanges[0].prodPriceGreater;
if(prodPriceGreater=="true"){
document.getElementById("productrrPrice").innerHTML="";
document.getElementById("prodListPrice").style.display="none";
document.getElementById("productPrice").innerHTML=prodPrice;
document.getElementById("productsavePrice").innerHTML="";
document.getElementById("prodSavePrice").style.display="none";
}else{
document.getElementById("productrrPrice").innerHTML=rrPrice;
document.getElementById("productPrice").innerHTML=prodPrice;
document.getElementById("productsavePrice").innerHTML=savePrice;
document.getElementById("prodListPrice").style.display="";
document.getElementById("prodSavePrice").style.display="";
}
}
}
};
function changeOptions(_19,host){
//document.getElementById("prodQty").value=1;
if(document.getElementById("productOption").selectedIndex!="0"){
optionId=document.getElementById("productOption").value;
prodId=document.getElementById("hidProdId").value;
params="hidAction=loadProductOption&";
params+="productId="+prodId+"&";
params+="optionId="+optionId;
url=window.location.pathname;
http=getHTTPObject();
http.open("POST",url,true);
http.setRequestHeader("Content-type","application/x-www-form-urlencoded");
http.setRequestHeader("Content-length",params.length);
http.setRequestHeader("Connection","close");
http.onreadystatechange=function(){
HttpProductOptionResponse(_19,host),HttpProductImagesResponse(_19),HttpInShoppingCartResponse();
};
http.send(params);
}
};
function HttpInShoppingCartResponse(){
var _1a="";
if(http.readyState==4){
if(http.status==200){
var sr=eval("("+http.responseText+")");
cartId=sr.shoppingCartArray[0].cartId;
if(cartId&&document.getElementById("productOption").selectedIndex!=0){
document.getElementById("addtocartqty").style.display="none";
document.getElementById("inshoppingcart").style.display="";
}else{
document.getElementById("addtocartqty").style.display="";
document.getElementById("inshoppingcart").style.display="none";
}
}
}
};
function showCartToolTip(id){
if(document.getElementById("productOption").selectedIndex=="0"){
toolTip(alerts["_SELECT_OPTION"],"addToCartToolTip",170,100);
}else{
if(document.getElementById("prodQty").value=="0"||document.getElementById("prodQty").value==""){
toolTip(alerts["_SPECIFY_QUANTITY"],"addToCartToolTip",170,100);
}else{
document.getElementById(id).title="";
}
}
};
function addToCart(_1b,_1c,_1d,_1e){
if(document.getElementById("productOption").selectedIndex!="0"){
document.getElementById("addtocartqty").style.display="none";
}
if(document.getElementById("productOption").selectedIndex!="0"&&document.getElementById("prodQty").value>"0"){
optionId=document.getElementById("productOption").value;
prodId=document.getElementById("hidProdId").value;
prodQty=document.getElementById("prodQty").value;
hidOptionId=document.getElementById("hidOptionId").value;
params="hidAction=addToCart&";
params+="productId="+prodId+"&";
params+="prodQty="+prodQty+"&";
params+="hidOptionId="+hidOptionId+"&";
params+="optionId="+optionId;
url=window.location.pathname;
http=getHTTPObject();
http.open("POST",url,true);
http.setRequestHeader("Content-type","application/x-www-form-urlencoded");
http.setRequestHeader("Content-length",params.length);
http.setRequestHeader("Connection","close");
http.onreadystatechange=function(){
HttpAddToCartResponse(_1b,_1c,_1d,_1e);
};
http.send(params);
}
};
function HttpAddToCartResponse(_1f,_20,_21,_22){
var _23;
var _24=document.getElementById("tbCart");
var _25=_24.getElementsByTagName("div");
if(_25[0]){
_25[0].className="";
}
//var _26=http.responseText;
if(http.readyState==4&&http.status==200){
	if( http.responseText =='false'){
				alert(alerts['_ERROR_OCCURED']);
				return;
				}

var sr=eval("("+http.responseText+")");
if((sr["cartArray"].length)>0){
cartId=sr.cartArray[0].cartId;
prodId=sr.cartArray[0].prodId;
optionId=sr.cartArray[0].optionId;
optionValue=sr.cartArray[0].optionValue;
prodName=sr.cartArray[0].prodName;
prodQty=sr.cartArray[0].prodQty;
prodPrice=sr.cartArray[0].prodPrice;
totalprodPrice=sr.cartArray[0].totalprodPrice;
currency=sr.cartArray[0].currency;
itemNo=sr.cartArray[0].itemNo;
prodImg=sr.cartArray[0].prodImg;
imgAlt=sr.cartArray[0].imgAlt;
imgTitle=sr.cartArray[0].imgTitle;
prodUrl=sr.cartArray[0].prodUrl;
totalPrice=sr.cartArray[0].totalPrice;
_23="<div id='tbCart'>";
_23+="<div id='cart_"+cartId+"' name='cart_"+cartId+"' style='border:0px solid;blue;height:50px;margin:5px 0px 5px 0px'>";
_23+="<div style='border:0px solid;float:left;width:150px;'>&nbsp;<a href='"+prodUrl+"' id='cartImage_"+cartId+"'>";
_23+="<img  src='"+_1f+"/small/"+prodImg+"' border='0' height='45' alt='"+imgAlt+"' title='"+imgTitle+"' ></a></div>";
_23+="<div style='border:0px solid;float:left;width:80px;margin-top:17px'>&nbsp;<a href='"+prodUrl+"'  id='cartItem_"+cartId+"' >"+itemNo+"</a></div>";
_23+="<div style='border:0px solid;float:left;width:190px;margin-top:17px'>&nbsp;<a href='"+prodUrl+"'>"+prodName+"</a>";
if((sr["productOptionArray"].length)>0){
_23+=" <select style='width:175px;' class='browse' onchange=changeCartProdOption('"+cartId+"',this.options[this.selectedIndex].value,'"+_1f+"')>";
for(i=0;i<sr["productOptionArray"].length;i++){
prodoptionId=sr.productOptionArray[i].optionId;
optionText=sr.productOptionArray[i].optionText;
if(optionId==prodoptionId){
_23+="<option value="+prodoptionId+" selected>"+optionText+"</option>";
}else{
_23+="<option value="+prodoptionId+" >"+optionText+"</option>";
}
}
_23+="</select>";
}
_23+="</div>";
_23+="<div style='border:0px solid;float:left;width:90px;margin-top:17px'>&nbsp;"+currency+"  <font id='prodPrice_"+cartId+"'>"+prodPrice+"</font></div>";
_23+="<div style='border:0px solid;float:left;width:75px;margin-top:17px'>&nbsp;&nbsp;<input type='text' id='prodqty_"+cartId+"' value='"+prodQty+"' style='width:40px;height:20px' onblur=updateQuantity('"+cartId+"','"+prodPrice+"','"+prodId+"','"+escape(prodName)+"') /></div>";
_23+="<div style='border:0px solid;float:left;width:90px;margin-top:17px'>&nbsp;"+currency+" <font id='totPrice__"+cartId+"'>"+totalprodPrice+"</font></div>";
_23+="<div style='border:0px solid;float:left;width:110px;margin-top:17px;text-align:center'>&nbsp;<img width='14' height='14' style='cursor: pointer;' alt='Delete'  src='themes/vivaliteTheme/images/delete.png'  onclick=removeShoppingCartItem('"+cartId+"','"+totalprodPrice+"','"+prodId+"','"+_21+"','"+_22+"') ></div>";
_23+="</div>";
_23+="</div>";
setCookie("cartStatus","max");
document.getElementById("resizeBtn").innerHTML="<div class='shoppingarrowup"+_20+"' title='minimize' onclick=minimizeShoppingCart('"+_20+"')></div>";
document.getElementById("checkoutlink").style.display="none";
document.getElementById("innerCart").style.display="";
document.getElementById("cartStrip").style.display="";
document.getElementById("cartSection").style.display="";
document.getElementById("cartTable").innerHTML=_23+document.getElementById("cartTable").innerHTML;
document.getElementById("inshoppingcart").style.display="";
document.getElementById("addtocartqty").style.display="none";
document.getElementById("pricetable").style.display="";
document.getElementById("priceCurrency").innerHTML=currency;
document.getElementById("totalProdPrice").innerHTML=totalPrice;
document.getElementById("prodCount").innerHTML=parseInt(document.getElementById("prodCount").innerHTML)+parseInt(1);
if(document.getElementById("prodCount").innerHTML==1){
document.getElementById("prodCountMessage").innerHTML=_21;
}else{
document.getElementById("prodCountMessage").innerHTML=_22;
}
document.getElementById("hidProductCount").value=document.getElementById("prodCount").innerHTML;
var _24=document.getElementById("tbCart");
var _25=_24.getElementsByTagName("div");
window.location.hash="cart";
alert(alerts["_ADDED_TO_CART"]);
}
}
/*else{
if(_26=="false"){
alert(alerts["_ERROR_OCCURED"]);
}
} */
};
function validateQuantity(id,_27,prodid,prodname){

vivatubes = document.getElementById('hidVivalitetubes').value;
if(vivatubes.indexOf(prodid) >=0){
	if(_27 =='1'){
		alert(alerts['_MIN_ORDER']+ ' '+prodname+' '+alerts['_MIN_ORDER_IS']+ ' '+2  );
		document.getElementById('prodQty').value='2';
	}
}
if(isNaN(_27)||_27.match(/\.+/)||_27==""||_27<1){
alert(alerts["_INVALID_QUANTITY"]);
checkEl=document.getElementById(id);
setTimeout(function(){
if(checkEl){
checkEl.focus();
}
checkEl.select();
},100);
return false;
}
return true;
};
function HttpProductOptionResponse(_28,host){
var _29="";
if(http.readyState==4){
if(http.status==200){
var sr=eval("("+http.responseText+")");
if((sr["productOptionArray"].length)>0){
prodPrice=sr.productOptionArray[0].prodPrice;
prodrrPrice=sr.productOptionArray[0].prod_rr_Price;
prodsavePrice=sr.productOptionArray[0].prod_save_Price;
prodImage=sr.productOptionArray[0].prodImage;
imageTitle=sr.productOptionArray[0].imageTitle;
imageAlt=sr.productOptionArray[0].imageAlt;
prod_pricewithoutcurrsymbol=sr.productOptionArray[0].prod_Price_nosymbol;
rr_pricewithoutcurrsymbol=sr.productOptionArray[0].rr_Price_nosymbol;
stockhandling= sr.productOptionArray[0].stockhandling;
stockstatus	= sr.productOptionArray[0].stockstatus;


greenmsg  = document.getElementById("hidStockGreenMsg").value;
yellowmsg = document.getElementById("hidStockYellowMsg").value;
redmsg    = document.getElementById("hidStockRedMsg").value;



if(stockhandling == 'm' && stockstatus =='y' ){ // manual and reordered => yellow image

	document.getElementById("stockstatusimage").style.color="orange";
	stockimage= yellowmsg;

}else if(stockhandling == 'm' && stockstatus =='r'){ // manual and not in stock  => red image
	document.getElementById("stockstatusimage").style.color="red";
	stockimage= redmsg;

}else{ // else in all cases => green image

	document.getElementById("stockstatusimage").style.color="green";
	stockimage= greenmsg;
}


document.getElementById("stockstatusimage").innerHTML = '<b>&nbsp;&nbsp;'+stockimage+'</b>';

			if((rr_pricewithoutcurrsymbol*1.0 < prod_pricewithoutcurrsymbol*1.0)  || host=='www.viva-lite.se' ){
document.getElementById("productPrice").innerHTML=prodPrice;
document.getElementById("productrrPrice").innerHTML="";
document.getElementById("productsavePrice").innerHTML="";
document.getElementById("prodListPrice").style.display="none";
document.getElementById("prodSavePrice").style.display="none";
}else{
document.getElementById("productPrice").innerHTML=prodPrice;
document.getElementById("productrrPrice").style.display="";
document.getElementById("productrrPrice").innerHTML=prodrrPrice;
document.getElementById("productsavePrice").style.display="";
document.getElementById("productsavePrice").innerHTML=prodsavePrice;
document.getElementById("prodListPrice").style.display="";
document.getElementById("prodSavePrice").style.display="";
}
fileId=sr.productOptionArray[0].fileId;
if(fileId&&typeof (sr.productLargeImageArray[0][fileId])!="undefined"){
largeImgName=sr.productLargeImageArray[0][fileId][0].bigImgName;
if(largeImgName!=""){
result="<a rel='lightbox' title='"+document.frmVivalite.hidProductName.value+"' style='cursor:pointer;'  href="+_28+"/large/"+largeImgName+"><img src="+_28+"/small/"+prodImage+" height='200' width='200' align='middle' alt="+imageAlt+" title="+imageTitle+" style='cursor:pointer;' border='0'/></a>";
}
}else{
result="<img src="+_28+"/small/"+prodImage+" height='200' width='200' align='middle' alt="+imageAlt+" title="+imageTitle+" />";
}
document.getElementById("productImage").innerHTML=result;
$(function(){
$("#productImage a").lightBox();
});
}
}
}
};
function removeShoppingCartItem(_2a,_2b,_2c,_2d,_2e){
result=confirm(alerts["_DELETE_CONFIRM"]);
if(result){
params="hidAction=removeShoppingCartItem&";
params+="cartId="+_2a;
url="shopping_cart.html";
http=getHTTPObject();
http.open("POST",url,true);
http.setRequestHeader("Content-type","application/x-www-form-urlencoded");
http.setRequestHeader("Content-length",params.length);
http.setRequestHeader("Connection","close");
http.onreadystatechange=function(){
HttpRemoveShoppingCartResponse(_2a,_2b,_2c,_2d,_2e);
};
http.send(params);
}
};
function HttpRemoveShoppingCartResponse(_2f,_30,_31,_32,_33){
//var _34=http.responseText;
if(http.readyState==4&&http.status==200){


					if (http.responseText=='false'){
					document.getElementById("cartmsg").style.display = '';
					document.getElementById("cartmsg").innerHTML = "Can't delete,please try again.";

					return ;
				}


document.getElementById("prodCount").innerHTML=(document.getElementById("prodCount").innerHTML)-1;
if(document.getElementById("prodCount").innerHTML==1){
document.getElementById("prodCountMessage").innerHTML=_32;
}else{
document.getElementById("prodCountMessage").innerHTML=_33;
}
document.getElementById("hidProductCount").value=document.getElementById("prodCount").innerHTML;
var _35="cart_"+_2f;
document.getElementById(_35).style.display="none";
if(document.getElementById("prodCount").innerHTML<="0"){
if(document.getElementById("cartcountmsg")){
document.getElementById("cartcountmsg").style.display="";
}
document.getElementById("pricetable").style.display="none";
if(document.getElementById("totalProdPrice")){
document.getElementById("totalProdPrice").innerHTML=0;
}
if(document.getElementById("cartSection")){
document.getElementById("cartSection").style.display="none";
}
if(document.getElementById("cartStrip")){
document.getElementById("cartStrip").style.display="none";
}
var _36=document.getElementById("hidRequestedPage").value;
if(_36=="login.html"){
document.getElementById("frmVivalite").submit();
}
if(document.getElementById("hidShippingCost")){
document.getElementById("hidTotalCost").value=0;
document.getElementById("totalCostWithShip").innerHTML=0;
}
}
if(document.getElementById("prodCount").innerHTML!="0"){
var sr=eval("("+http.responseText+")");
TotalPrice=sr.cartpriceArray[0].prodTotalPrice;
PriceWithShip=sr.cartpriceArray[0].totalPriceWithShip;
totalCost=sr.cartpriceArray[0].totalCost;
shippingCost=sr.cartpriceArray[0].shippingCost;
shippingCostDelim=sr.cartpriceArray[0].shippingCostDelim;
taxwithdelim     = sr.cartpriceArray[0].taxwithdelim;
paypaltotalCost     = sr.cartpriceArray[0].paypaltotalCost;
document.getElementById("totalProdPrice").innerHTML=TotalPrice;
if(document.getElementById("hidShippingCost")){
document.getElementById("hidTotalCost").value=totalCost;
document.getElementById("totalCostWithShip").innerHTML=PriceWithShip;
document.getElementById("hidIpaymentTotalCost").value=totalCost*100;
document.getElementById("hidPaypalTotalCost").value = paypaltotalCost;
document.getElementById("hidShippingCost").innerHTML=shippingCost;
document.getElementById("setShippingCost").innerHTML=shippingCostDelim;
if(document.getElementById("setProductTax")){
document.getElementById("setProductTax").innerHTML = taxwithdelim;
}
}
}
if(document.getElementById("hidProdId")&&document.getElementById("hidProdId").value==_31){
document.getElementById("addtocartqty").style.display="";
document.getElementById("inshoppingcart").style.display="none";
}
}

/*else{
if(_34=="false"){
document.getElementById("cartmsg").style.display="";
document.getElementById("cartmsg").innerHTML="Can't delete,please try again.";
}
} */
};
function GeneralSearch(_37,e){
var key;
if(window.event){
e=window.event;
key=e.keyCode;
}else{
if(e.which){
key=e.which;
}
}
if(key=="13"){
showSearchResults(1);
return false;
}else{
return true;
}
};
function showSearchResults(_38){
if(document.getElementById("txtSearch").value.match(/^ *$/)){
alert(alerts["_ENTER_KEYWORD"]);
document.getElementById("txtSearch").focus();
return;
}else{
if(document.getElementById("txtSearch").value==document.getElementById("searchword").value){
alert(alerts["_ENTER_KEYWORD"]);
document.getElementById("txtSearch").focus();
return;
}
}
searchTxt=document.getElementById("txtSearch").value;
document.frmVivalite.action="search_results.html?q="+searchTxt+"&p="+_38;
location.replace("search_results.html?q="+searchTxt+"&p="+_38);
};
function changePage(_39){
document.getElementById("hidPageIndex").value=_39;
document.getElementById("frmVivalite").submit();
};
function hidemenu(e){
var _3a=document.getElementById("navcontainer1");
var ie4=document.all;
var ns6=document.getElementById&&!document.all;
if(typeof _3a!="undefined"){
if(ie4||ns6){
_3a.style.visibility="hidden";
}
}
};
function createCartLayer(_3b,_3c){
var _3d;
_3d="shopping_cart.html?hidAction=createCartLayer";
http=getHTTPObject();
http.open("GET",_3d,true);
http.onreadystatechange=function(){
HttpCartResponse(_3b,_3c);
};
http.send(null);
};
function HttpCartResponse(_3e,_3f){
if(http.readyState==4){
if(http.status==200){
var sr=eval("("+http.responseText+")");
result="<div>";
if((sr["cartArray"].length)>0){
for(i=0;i<sr["cartArray"].length;i++){
prodName=sr.cartArray[i].prodName;
imageName=sr.cartArray[i].imageName;
imageTitle=sr.cartArray[i].imageTitle;
imageAlt=sr.cartArray[i].imageAlt;
prodUrl=sr.cartArray[i].prodUrl;
prodPrice=sr.cartArray[i].prodPrice;
prodQty=sr.cartArray[i].prodQty;
result+="<div style='float:left;border:0px solid;margin-top:5px;'><a style='width:195px;float:left'href="+prodUrl+"><div style='float:left;width:30px;margin-left:5px'><img style='float:left' src="+_3f+"/small/"+imageName+" border='0' height='30' width='30' alt="+imageAlt+" title="+imageTitle+" /></div>";
result+="<div style='float:left;margin:10px 0px 0px 5px'>"+prodQty+" x "+prodName+"</div></a></div>";
result+="<div style='clear:both'></div>";
}
}else{
result+="<p>Your Shopping Cart is empty.</p>";
}
result+="</div>";
document.getElementById("loadingImg").style.display="none";
document.getElementById(_3e).innerHTML=result;
}
}
};
function funChangeLang(_40){
if("undefined"!=typeof (blogtop)){
blogtop.document.getElementById("frmVivalite").action=blogtop.location.href+"?url="+window.location.href;
blogtop.document.getElementById("hidLangIndex").value=_40;
blogtop.document.getElementById("frmVivalite").submit();
}else{
document.getElementById("hidLangIndex").value=_40;
document.getElementById("frmVivalite").submit();
}
};
function funChangeDomain(_41){
document.getElementById("hidDomainIndex").value=_41;
document.getElementById("frmVivalite").submit();
};
function showShippingAddress(_42,_43){
document.getElementById(_42).style.display="";
document.getElementById(_43).style.display="none";
};
function hideShippingAddress(_44,_45){
document.getElementById(_44).style.display="none";
document.getElementById(_45).style.display="";
};
function minimizeShoppingCart(_46){
setCookie("cartStatus","min");
document.getElementById("resizeBtn").innerHTML="<div class='shoppingarrow"+_46+"' title='maximize' onclick=maximizeShoppingCart('"+_46+"')></div>";
if(document.getElementById("checkoutlink")){
document.getElementById("checkoutlink").style.display="";
}
document.getElementById("innerCart").style.display="none";
};
function maximizeShoppingCart(_47){
setCookie("cartStatus","max");
document.getElementById("resizeBtn").innerHTML="<div class='shoppingarrowup"+_47+"' title='minimize' onclick=minimizeShoppingCart('"+_47+"')></div>";
if(document.getElementById("checkoutlink")){
document.getElementById("checkoutlink").style.display="none";
}
document.getElementById("innerCart").style.display="";
};
function setCookie(_48,_49){
var _4a=new Date();
var _4b=new Date();
_4b.setTime(_4a.getTime()+2*7*24*60*60);
document.cookie=_48+"="+escape(_49)+";expires="+_4b.toGMTString();
};
function updateQuantity(id,_4c,prodid,prodname){
var _4d;
var _4e="prodqty_"+id;
_4d=document.getElementById(_4e).value;

	vivatubes = document.getElementById('hidVivalitetubes').value;
	if(vivatubes.indexOf(prodid) >=0){
	//if(prodid=='4' || prodid=='2'){
		if(_4d =='1'){
		alert(alerts['_MIN_ORDER']+ ' '+unescape(prodname)+' '+alerts['_MIN_ORDER_IS']+ ' '+2  );
			_4d ='2';
			document.getElementById(_4e).value='2';
		}
	}


if(!validateQuantity(_4e,_4d,prodid,prodname)){
return false;
}
var _4f="totPrice__"+id;
var _50;
var _51=document.getElementById(_4f).innerHTML;
_50=_4d*_4c;
var url="shopping_cart.html?hidAction=updateProductQuantity&cartId="+id+"&prodqty="+_4d;
http=getHTTPObject();
http.open("GET",url,true);
http.onreadystatechange=function(){
HttpUpdateQuantityResponse(_4f,_50,_51);
};
http.send(null);
};
function HttpUpdateQuantityResponse(_52,_53,_54){
var _55=http.responseText;
if(http.readyState==4&&http.status==200){
var sr=eval("("+http.responseText+")");
price=sr.cartpriceArray[0].prodPrice;
TotalPrice=sr.cartpriceArray[0].prodTotalPrice;
PriceWithShip=sr.cartpriceArray[0].totalPriceWithShip;
totalCost=sr.cartpriceArray[0].totalCost;
shippingCost=sr.cartpriceArray[0].shippingCost;
shippingCostDelim=sr.cartpriceArray[0].shippingCostDelim;
		taxwithdelim     = sr.cartpriceArray[0].taxwithdelim;
		paypaltotalCost     = sr.cartpriceArray[0].paypaltotalCost;
document.getElementById(_52).innerHTML=price;
document.getElementById("totalProdPrice").innerHTML=TotalPrice;
if(document.getElementById("hidShippingCost")){
document.getElementById("hidTotalCost").value=totalCost;
document.getElementById("totalCostWithShip").innerHTML=PriceWithShip;
document.getElementById("hidIpaymentTotalCost").value=totalCost*100;
document.getElementById("hidShippingCost").innerHTML=shippingCost;
			document.getElementById("hidPaypalTotalCost").value = paypaltotalCost;
document.getElementById("setShippingCost").innerHTML=shippingCostDelim;
			if(document.getElementById("setProductTax")){
				document.getElementById("setProductTax").innerHTML = taxwithdelim;
			}
}
}
};
function changeCartProdOption(_56,_57,_58){
var url;
url="shopping_cart.html?hidAction=changeProductOption&cartId="+_56+"&cartOptionId="+_57;
http=getHTTPObject();
http.open("GET",url,true);
http.onreadystatechange=function(){
HttpChangeCartOptionResponse(_56,_57,_58);
};
http.send(null);
};
function HttpChangeCartOptionResponse(_59,_5a,_5b){
var _5c;
if(http.readyState==4){
if(http.status==200){
var _5c=http.responseText;
if(_5c=="false"){
alert(alerts["_ERROR_OCCURED"]);
}else{
var sr=eval("("+http.responseText+")");
if((sr["cartArray"].length)>0){
prodPrice=sr.cartArray[0].prodPrice;
totalprodPrice=sr.cartArray[0].totalprodPrice;
currency=sr.cartArray[0].currency;
itemNo=sr.cartArray[0].itemNo;
prodImg=sr.cartArray[0].prodImg;
imgAlt=sr.cartArray[0].imgAlt;
imgTitle=sr.cartArray[0].imgTitle;
TotalPrice=sr.cartArray[0].prodTotalPrice;
totalCost=sr.cartArray[0].totalCost;
PriceWithShip=sr.cartArray[0].totalPriceWithShip;
				taxwithdelim   = sr.cartArray[0].taxwithdelim;   
				paypaltotalCost   = sr.cartArray[0].paypaltotalCost;   
var _5d="cartImage_"+_59;
var _5e="cartItem_"+_59;
_5c="<img   src="+_5b+"/small/"+prodImg+"  border='0' height='45' alt="+imgAlt+" title="+imgTitle+" />";
document.getElementById(_5d).innerHTML=_5c;
document.getElementById(_5e).innerHTML=itemNo;
var _5f="prodPrice_"+_59;
var _60;
var _61="prodqty_"+_59;
var _62="totPrice__"+_59;
var _63;
document.getElementById(_5f).innerHTML=prodPrice;
var _64=document.getElementById(_62).innerHTML;
_60=document.getElementById(_61).value;
_63=_60*prodPrice;
document.getElementById(_62).innerHTML=totalprodPrice;
document.getElementById("totalProdPrice").innerHTML=TotalPrice;
if(document.getElementById("hidShippingCost")){
document.getElementById("hidTotalCost").value=totalCost;
document.getElementById("hidIpaymentTotalCost").value = totalCost*100;
document.getElementById("hidPaypalTotalCost").value = paypaltotalCost;
document.getElementById("totalCostWithShip").innerHTML=PriceWithShip;
					if(document.getElementById("setProductTax")){
						document.getElementById("setProductTax").innerHTML = taxwithdelim;
					}
}
}
}
}
}
};
var CreditPayment="1";
var DebitPayment="2";
var PrePaid="12";
var PayPal="14";
var Sofort="17";
var Cheque="15";
var DirectDeposit="18";
function changePayTypes(){
var _65=document.forms[0].paymentType.value;
if(_65=="new"){
document.getElementById("creditcard").style.display="none";
document.getElementById("debitcard").style.display="none";
document.getElementById("prepaid").style.display="none";
document.getElementById("cheque").style.display="none";
document.getElementById("directdeposit").style.display="none";
}else{
if(_65==CreditPayment){
document.getElementById("creditcard").style.display="";
document.getElementById("debitcard").style.display="none";
document.getElementById("prepaid").style.display="none";
document.getElementById("cheque").style.display="none";
document.getElementById("directdeposit").style.display="none";
}else{
if(_65==DebitPayment){
document.getElementById("creditcard").style.display="none";
document.getElementById("prepaid").style.display="none";
document.getElementById("cheque").style.display="none";
document.getElementById("directdeposit").style.display="none";
document.getElementById("debitcard").style.display="";
}else{
if(_65==PrePaid){
document.getElementById("creditcard").style.display="none";
document.getElementById("debitcard").style.display="none";
document.getElementById("directdeposit").style.display="none";
document.getElementById("cheque").style.display="none";
document.getElementById("prepaid").style.display="";
}else{
if(_65==Cheque){
document.getElementById("creditcard").style.display="none";
document.getElementById("debitcard").style.display="none";
document.getElementById("directdeposit").style.display="none";
document.getElementById("cheque").style.display="";
document.getElementById("prepaid").style.display="none";
}else{
if(_65==DirectDeposit){
document.getElementById("creditcard").style.display="none";
document.getElementById("debitcard").style.display="none";
document.getElementById("directdeposit").style.display="";
document.getElementById("cheque").style.display="none";
document.getElementById("prepaid").style.display="none";
}else{
document.getElementById("creditcard").style.display="none";
document.getElementById("debitcard").style.display="none";
document.getElementById("prepaid").style.display="none";
document.getElementById("cheque").style.display="none";
document.getElementById("directdeposit").style.display="none";
}
}
}
}
}
}
params="hidAction=getPaymentValues&";
params+="paymentType="+_65;
url="checkout_process.html";
http=getHTTPObject();
http.open("POST",url,true);
http.setRequestHeader("Content-type","application/x-www-form-urlencoded");
http.setRequestHeader("Content-length",params.length);
http.setRequestHeader("Connection","close");
http.onreadystatechange=function(){
if(http.readyState==4){
var _66=http.responseText;
document.getElementById("paymentDetailValues").innerHTML=_66;
}
};
http.send(params);
};
function confirmOrder(_67){
if(_67<1||document.getElementById("prodCount").innerHTML=="0"){
alert(alerts["_EMPTY_SHOPPINGCART"]);
return false;
}
var _68=false;
if(document.getElementById("shippingMsg").style.display==""){
_68=true;
}
if(!validateOrder(_68)){
return false;
}
var _69="1";
var _6a="2";
var _6b=document.forms[0].paymentType.value;
if(_6b==_69){
if(!CreditCardValidation()){
return false;
}
}else{
if(_6b==_6a){
if(!BankValidation()){
return false;
}
}
}
if(document.forms[0].credit_expyear.value.length==2){
ccexpyr="20"+document.forms[0].credit_expyear.value;
}else{
ccexpyr=document.forms[0].credit_expyear.value;
}
var _6c=getRandom(1111,9999);
var _6d=parseInt(document.getElementById("credit_number").value)+1111111111+_6c;
_6d+=":"+_6c;
var _6e=parseInt(document.getElementById("bank_account").value)+1111111111+_6c;
_6e+=":"+_6c;
params="hidAction=createCSV&";
params+="sameDeliveyAdd="+_68+"&";
params+="invoice_add_indx="+document.getElementById("hidValInvAddIndx").value+"&";
params+="shipment_add_indx="+document.getElementById("hidValShipAddIndx").value+"&";
params+="invoice_fname="+document.getElementById("invoice_fname").value+"&";
params+="invoice_lname="+document.getElementById("invoice_lname").value+"&";
params+="invoice_gender="+document.getElementById("invoice_gender").value+"&";
params+="invoice_street="+document.getElementById("invoice_street").value+"&";
params+="invoice_additional="+document.getElementById("invoice_additional").value+"&";
params+="invoice_zip="+document.getElementById("invoice_zip").value+"&";
params+="invoice_city="+document.getElementById("invoice_city").value+"&";
params+="invoice_country="+document.getElementById("invoice_country").value+"&";
params+="invoice_region="+document.getElementById("invoice_region").value+"&";
params+="hidValPhoneIndx="+document.getElementById("hidValPhoneIndx").value+"&";
params+="hidValMobilePhoneIndx="+document.getElementById("hidValMobilePhoneIndx").value+"&";
params+="hidValEmailIdIndx="+document.getElementById("hidValEmailIdIndx").value+"&";
if(_68){
params+="shipment_street="+document.getElementById("invoice_street").value+"&";
params+="shipment_additional="+document.getElementById("invoice_additional").value+"&";
params+="shipment_zip="+document.getElementById("invoice_zip").value+"&";
params+="shipment_city="+document.getElementById("invoice_city").value+"&";
params+="shipment_country="+document.getElementById("invoice_country").value+"&";
params+="shipment_region="+document.getElementById("invoice_region").value+"&";
}else{
params+="shipment_street="+document.getElementById("shipment_street").value+"&";
params+="shipment_additional="+document.getElementById("shipment_additional").value+"&";
params+="shipment_zip="+document.getElementById("shipment_zip").value+"&";
params+="shipment_city="+document.getElementById("shipment_city").value+"&";
params+="shipment_country="+document.getElementById("shipment_country").value+"&";
params+="shipment_region="+document.getElementById("shipment_region").value+"&";
}
params+="contact_phone_cntry="+document.getElementById("contact_phone_cntry").value+"&";
params+="contact_phone_area="+document.getElementById("contact_phone_area").value+"&";
params+="contact_phone_no="+document.getElementById("contact_phone_no").value+"&";
params+="contact_mobile_cntry="+document.getElementById("contact_mobile_cntry").value+"&";
params+="contact_mobile_no="+document.getElementById("contact_mobile_no").value+"&";
params+="contact_email="+document.getElementById("contact_email").value+"&";
params+="credit_name="+document.getElementById("credit_name").value+"&";
params+="credit_number="+_6d+"&";
params+="credit_expmonth="+document.getElementById("credit_expmonth").value+"&";
params+="credit_expyear="+ccexpyr+"&";
params+="credit_code="+document.getElementById("credit_code").value+"&";
params+="bank_account="+_6e+"&";
params+="bank_code_1="+document.getElementById("bank_code_1").value+"&";
params+="bank_name_1="+document.getElementById("bank_name_1").value+"&";
params+= "OrderComment="+document.getElementById('OrderComment').value+"&";
params+="paymentType="+_6b;
url="checkout_process.html";
http=getHTTPObject();
http.open("POST",url,true);
http.setRequestHeader("Content-type","application/x-www-form-urlencoded");
http.setRequestHeader("Content-length",params.length);
http.setRequestHeader("Connection","close");
http.onreadystatechange=function(){
if(http.readyState==4){
switch(_6b){
case "1":
ccno=document.getElementById("credit_number").value;
if(document.forms[0].credit_expyear.value.length==2){
ccexpyr="20"+document.forms[0].credit_expyear.value;
}else{
ccexpyr=document.forms[0].credit_expyear.value;
}
ccexpmon=document.getElementById("credit_expmonth").value;
cctypename=document.getElementById("credit_expmonth").value;
name=document.getElementById("invoice_fname").value+" "+document.getElementById("invoice_lname").value;
document.getElementById("credit_invoice_text").value="Viva-Lite";
document.getElementById("credit_trx_amount").value=(document.getElementById("hidIpaymentTotalCost").value);
document.getElementById("credit_cc_expdate_month").value=ccexpmon;
document.getElementById("credit_cc_expdate_year").value=ccexpyr;
document.getElementById("credit_cc_number").value=ccno;
document.getElementById("credit_cc_checkcode").value=document.getElementById("credit_code").value;
document.getElementById("credit_addr_name").value=name;
document.getElementById("credit_addr_street").value=document.getElementById("invoice_street").value;
document.getElementById("credit_addr_country").value=document.getElementById("hidCountryISOCode2").value;
document.getElementById("credit_addr_zip").value=document.getElementById("invoice_zip").value;
document.getElementById("credit_addr_city").value=document.getElementById("invoice_city").value;
document.getElementById("credit_addr_email").value=document.getElementById("contact_email").value;
document.getElementById("credit_redirect_url").value=document.getElementById("credit_redirect_url").value+"&ccn="+ccno+"&expyr="+ccexpyr+"&expmon="+ccexpmon+"&cctype="+cctypename;
document.forms[0].action="checkout_process.html?hidvalaction=confirm&success=true";
break;
case "2":
bankcode=document.getElementById("bank_code_1").value;
bankname=document.getElementById("bank_name_1").value;
acno=document.getElementById("bank_account").value;
name=document.getElementById("invoice_fname").value+" "+document.getElementById("invoice_lname").value;
document.getElementById("debit_trx_amount").value=(document.getElementById("hidIpaymentTotalCost").value);
document.getElementById("debit_bank_name").value=bankname;
document.getElementById("debit_bank_code").value=bankcode;
document.getElementById("debit_bank_accountnumber").value=acno;
document.getElementById("debit_addr_name").value=name;
document.getElementById("debit_addr_street").value=document.getElementById("invoice_street").value;
document.getElementById("debit_addr_country").value=document.getElementById("hidCountryISOCode2").value;
document.getElementById("debit_addr_zip").value=document.getElementById("invoice_zip").value;
document.getElementById("debit_addr_city").value=document.getElementById("invoice_city").value;
document.getElementById("debit_addr_email").value=document.getElementById("contact_email").value;
document.getElementById("debit_redirect_url").value=document.getElementById("debit_redirect_url").value+"&bankcode="+bankcode+"&bankname="+bankname+"&bankaccno="+acno;
document.forms[0].action="checkout_process.html?hidvalaction=confirm&success=true";
break;
case "10":
case "12":
case "15":
case "18":
case '20'://Purchase order 
document.forms[0].action="checkout_process.html?hidvalaction=confirm&success=true";
break;
case "13":
address=document.getElementById("invoice_street").value+" "+document.getElementById("invoice_additional").value;
document.getElementById("money_booker_firstname").value=document.getElementById("invoice_fname").value;
document.getElementById("money_booker_lastname").value=document.getElementById("invoice_lname").value;
document.getElementById("money_booker_address").value=address;
document.getElementById("money_booker_country").value=document.getElementById("hidCountryISOCode3").value;
document.getElementById("money_booker_postal_code").value=document.getElementById("invoice_zip").value;
document.getElementById("money_booker_city").value=document.getElementById("invoice_city").value;
document.getElementById("money_booker_amount").value=parseFloat(document.getElementById("hidTotalCost").value);
document.forms[0].action="https://www.moneybookers.com/app/payment.pl";
break;
case "14":
document.getElementById("paypal_first_name").value=document.getElementById("invoice_fname").value;
document.getElementById("paypal_last_name").value=document.getElementById("invoice_lname").value;
document.getElementById("paypal_address1").value=document.getElementById("invoice_street").value;
document.getElementById("paypal_address2").value=document.getElementById("invoice_additional").value;
document.getElementById("paypal_country").value=document.getElementById("hidCountryISOCode2").value;
document.getElementById("paypal_zip").value=document.getElementById("invoice_zip").value;
document.getElementById("paypal_city").value=document.getElementById("invoice_city").value;
document.getElementById("paypal_email").value=document.getElementById("contact_email").value;
document.getElementById("paypal_amount").value=parseFloat(document.getElementById("hidPaypalTotalCost").value);
document.getElementById("paypal_night_phone_a").value=document.getElementById("contact_phone_cntry").value;
document.getElementById("paypal_night_phone_b").value=document.getElementById("contact_phone_area").value;
document.getElementById("paypal_night_phone_c").value=document.getElementById("contact_phone_no").value;
if(document.getElementById('hidValCustomerNo').value){
var itemname= document.getElementById('paypal_item_name').value+' - '+document.getElementById('hidValCustomerNo').value;
}else{
var itemname= document.getElementById('paypal_item_name').value;
}
document.getElementById('paypal_item_name').value = itemname;
document.forms[0].action="https://www.paypal.com/cgi-bin/webscr";
document.forms[0].method="GET";
break;
case "17":
/*name=document.getElementById("invoice_fname").value+" "+document.getElementById("invoice_lname").value;
document.getElementById("sofort_von_konto_inhaber").value=name;
document.getElementById("sofort_betrag").value=parseFloat(document.getElementById("hidTotalCost").value);
document.getElementById("sofort_v_zweck_2").value="Customer Number:-"+document.getElementById("hidValCustomerNo").value;
document.forms[0].action="https://www.sofort-ueberweisung.de/payment.php";
break;
*/
					name= document.getElementById('invoice_fname').value+' '+document.getElementById('invoice_lname').value
					//document.getElementById('sofort_von_konto_inhaber').value = name
					document.getElementById('sofort_betrag').value = parseFloat(document.getElementById('hidTotalCost').value)
					document.getElementById('sofort_v_zweck_2').value = 'Customer Number:-'+document.getElementById('hidValCustomerNo').value;

					sofortvalue  =  document.getElementById('sofort_kdnr').value +"|"
					sofortvalue +=	document.getElementById('sofort_projekt').value+"|||||"
					sofortvalue +=	parseFloat(document.getElementById('hidTotalCost').value)+"|"
					sofortvalue +=	document.getElementById('hidValCurrencyCode').value+"|"
					sofortvalue +=	document.getElementById('sofort_v_zweck_1').value+"|"
					sofortvalue +=  "Customer Number:-"+document.getElementById('hidValCustomerNo').value+"|"
					sofortvalue +=  document.getElementById('user_variable_0').value+"|||||"
					sofortvalue +=  document.getElementById('user_variable_5').value+"|"
					sofortvalue += 	document.getElementById('user_variable_5').value

					params  = 'hidAction=getSofortHashValue&';     
					params += "sofortvalue="+sofortvalue;	
					url = "checkout_process.html";
					http = getHTTPObject(); // We create the HTTP Object
					http.open("POST", url, true);
					http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
					http.setRequestHeader("Content-length", params.length);
					http.setRequestHeader("Connection", "close");
					http.onreadystatechange = function (){
						if(http.readyState==4){
							var Values = http.responseText;
							document.getElementById('sofort_hash').value = Values;
							document.getElementById('frmVivalite').action = "https://www.directebanking.com/payment/start";
							document.getElementById('frmVivalite').submit();


						}
					};
					http.send(params);
					return;
					break;

case '19'://iclear 
document.forms[0].action = "checkout_process.html?hidvalaction=iclearSendOrder";
break;
default:
break;
}
document.forms[0].submit();
}
};
http.send(params);
};
function validateOrder(_6f){
if(document.forms[0].invoice_fname.value.match(/^ *$/)){
alert(alerts["_ENTER_FIRSTNAME"]);
document.forms[0].invoice_fname.focus();
return false;
}else{
if(document.forms[0].invoice_lname.value.match(/^ *$/)){
alert(alerts["_ENTER_LASTNAME"]);
document.forms[0].invoice_lname.focus();
return false;
}else{
if(document.forms[0].invoice_street.value.match(/^ *$/)){
alert(alerts["_ENTER_STREET"]);
document.forms[0].invoice_street.focus();
return false;
}else{
if(document.forms[0].invoice_zip.value.match(/^ *$/)){
alert(alerts["_ENTER_ZIP"]);
document.forms[0].invoice_zip.focus();
return false;
}else{
if(document.forms[0].invoice_city.value.match(/^ *$/)){
alert(alerts["_ENTER_CITY"]);
document.forms[0].invoice_city.focus();
return false;
}else{
if(document.forms[0].invoice_country.value=="new"){
alert(alerts["_SELECT_COUNTRY"]);
document.forms[0].invoice_country.focus();
return false;
}else{
if(document.forms[0].invoice_region.value.match(/^ *$/)){
}
}
}
}
}
}
}
if(!_6f){
if(document.forms[0].shipment_street.value.match(/^ *$/)){
alert(alerts["_ENTER_STREET"]);
document.forms[0].shipment_street.focus();
return false;
}else{
if(document.forms[0].shipment_zip.value.match(/^ *$/)){
alert(alerts["_ENTER_ZIP"]);
document.forms[0].shipment_zip.focus();
return false;
}else{
if(document.forms[0].shipment_city.value.match(/^ *$/)){
alert(alerts["_ENTER_CITY"]);
document.forms[0].shipment_city.focus();
return false;
}else{
if(document.forms[0].shipment_country.value=="new"){
alert(alerts["_SELECT_COUNTRY"]);
document.forms[0].shipment_country.focus();
return false;
}else{
if(document.forms[0].shipment_region.value.match(/^ *$/)){
}
}
}
}
}
}
if(document.forms[0].contact_phone_cntry.value.match(/^ *$/)){
alert(alerts["_ENTER_PHONECNTRY"]);
document.forms[0].contact_phone_cntry.focus();
return false;
}else{
if(document.forms[0].contact_phone_area.value.match(/^ *$/)){
alert(alerts["_ENTER_PHONEAREA"]);
document.forms[0].contact_phone_area.focus();
return false;
}else{
if(document.forms[0].contact_phone_no.value.match(/^ *$/)){
alert(alerts["_ENTER_PHONENO"]);
document.forms[0].contact_phone_no.focus();
return false;
}else{
if(document.forms[0].contact_email.value.match(/^ *$/)){
alert(alerts["_ENTER_EMAIL"]);
document.forms[0].contact_email.focus();
return false;
}else{
if(!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w+)+$/.test(document.forms[0].contact_email.value))){
alert(alerts["_INVALID_EMAIL"]);
document.forms[0].contact_email.focus();
return false;
}
}
}
}
}
if(document.forms[0].paymentType.value=="new"){
alert(alerts["_SELECT_PAYMENT"]);
document.forms[0].paymentType.focus();
return false;
}
return true;
};
function validateContactDetails(_70){
if(document.forms[0].l_invoice_fname.value.match(/^ *$/)){
alert(alerts["_ENTER_FIRSTNAME"]);
document.forms[0].l_invoice_fname.focus();
return false;
}else{
if(document.forms[0].l_invoice_lname.value.match(/^ *$/)){
alert(alerts["_ENTER_LASTNAME"]);
document.forms[0].l_invoice_lname.focus();
return false;
}else{
if(document.forms[0].l_invoice_street.value.match(/^ *$/)){
alert(alerts["_ENTER_STREET"]);
document.forms[0].l_invoice_street.focus();
return false;
}else{
if(document.forms[0].l_invoice_additional.value.match(/^ *$/)){
alert(alerts["_ENTER_ADDITIONAL"]);
document.forms[0].l_invoice_additional.focus();
return false;
}else{
if(document.forms[0].l_invoice_zip.value.match(/^ *$/)){
alert(alerts["_ENTER_ZIP"]);
document.forms[0].l_invoice_zip.focus();
return false;
}else{
if(document.forms[0].l_invoice_city.value.match(/^ *$/)){
alert(alerts["_ENTER_CITY"]);
document.forms[0].l_invoice_city.focus();
return false;
}else{
if(document.forms[0].l_invoice_country.value=="new"){
alert(alerts["_SELECT_COUNTRY"]);
document.forms[0].l_invoice_country.focus();
return false;
}else{
if(document.forms[0].l_invoice_region.value.match(/^ *$/)){
}
}
}
}
}
}
}
}
if(!_70){
if(document.forms[0].l_shipment_street.value.match(/^ *$/)){
alert(alerts["_ENTER_STREET"]);
document.forms[0].l_shipment_street.focus();
return false;
}else{
if(document.forms[0].l_shipment_additional.value.match(/^ *$/)){
alert(alerts["_ENTER_ADDITIONAL"]);
document.forms[0].l_shipment_additional.focus();
return false;
}else{
if(document.forms[0].l_shipment_zip.value.match(/^ *$/)){
alert(alerts["_ENTER_ZIP"]);
document.forms[0].l_shipment_zip.focus();
return false;
}else{
if(document.forms[0].l_shipment_city.value.match(/^ *$/)){
alert(alerts["_ENTER_CITY"]);
document.forms[0].l_shipment_city.focus();
return false;
}else{
if(document.forms[0].l_shipment_country.value=="new"){
alert(alerts["_SELECT_COUNTRY"]);
document.forms[0].l_shipment_country.focus();
return false;
}else{
if(document.forms[0].l_shipment_region.value.match(/^ *$/)){
}
}
}
}
}
}
}
if(document.forms[0].l_phone_country.value.match(/^ *$/)){
alert(alerts["_ENTER_PHONECNTRY"]);
document.forms[0].l_phone_country.focus();
return false;
}else{
if(document.forms[0].l_phone_area.value.match(/^ *$/)){
alert(alerts["_ENTER_PHONEAREA"]);
document.forms[0].l_phone_area.focus();
return false;
}else{
if(document.forms[0].l_phone_number.value.match(/^ *$/)){
alert(alerts["_ENTER_PHONENO"]);
document.forms[0].l_phone_number.focus();
return false;
}else{
if(document.forms[0].l_mobile_country.value.match(/^ *$/)){
alert(alerts["_ENTER_PHONECNTRY"]);
document.forms[0].l_mobile_country.focus();
return false;
}else{
if(document.forms[0].l_mobile_number.value.match(/^ *$/)){
alert(alerts["_ENTER_MOB"]);
document.forms[0].l_mobile_number.focus();
return false;
}else{
if(document.forms[0].l_contact_email.value.match(/^ *$/)){
alert(alerts["_ENTER_EMAIL"]);
document.forms[0].l_contact_email.focus();
return false;
}else{
if(!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w+)+$/.test(document.forms[0].l_contact_email.value))){
alert(alerts["_INVALID_EMAIL"]);
document.forms[0].l_contact_email.focus();
return false;
}else{
if(document.forms[0].l_contact_password.value.match(/^ *$/)){
alert(alerts["_ENTER_PASSWD"]);
document.forms[0].l_contact_password.focus();
return false;
}else{
if(document.forms[0].l_contact_confirmpassword.value.match(/^ *$/)){
alert(alerts["_ENTER_PASSWD"]);
document.forms[0].l_contact_confirmpassword.focus();
return false;
}else{
if(document.forms[0].l_contact_password.value!=document.forms[0].l_contact_confirmpassword.value){
alert(alerts["_PASSWD_NOMATCH"]);
document.forms[0].l_contact_confirmpassword.focus();
return false;
}else{
if(document.getElementById("loginExistMsg").style.display=="block"){
alert(alerts["_ENTER_EMAIL"]);
document.forms[0].l_contact_email.focus();
return false;
}
}
}
}
}
}
}
}
}
}
}
return true;
};
function CreditCardValidation(){
if(document.forms[0].credit_name.value.match(/^ *$/)){
alert(alerts["_ENTER_NAME"]);
document.forms[0].credit_name.focus();
document.forms[0].credit_name.select();
return false;
}else{
if(document.forms[0].credit_number.value.match(/^ *$/)){
alert(alerts["_ENTER_CC"]);
document.forms[0].credit_number.focus();
document.forms[0].credit_number.select();
return false;
}else{
if(isNaN(document.forms[0].credit_number.value)){
alert(alerts["_ENTER_NUMERIC"]);
document.forms[0].credit_number.focus();
document.forms[0].credit_number.select();
return false;
}else{
if(document.forms[0].credit_number.value.length>19){
alert(alerts["_INVALID_NUMBER"]);
document.forms[0].credit_number.focus();
document.forms[0].credit_number.select();
return false;
}else{
if(document.forms[0].credit_expmonth.value=="0"){
alert(alerts["_SELECT_MONTH"]);
document.forms[0].credit_expmonth.focus();
return false;
}else{
if(document.forms[0].credit_expyear.value.match(/^ *$/)){
alert(alerts["_ENTER_YEAR"]);
document.forms[0].credit_expyear.focus();
return false;
}else{
if(isNaN(document.forms[0].credit_expyear.value)){
alert(alerts["_ENTER_NUMERIC"]);
document.forms[0].credit_expyear.focus();
document.forms[0].credit_expyear.select();
return false;
}else{
if((document.forms[0].credit_expyear.value.length>4)||(document.forms[0].credit_expyear.value.length<2)||(document.forms[0].credit_expyear.value.length==3)){
alert(alerts["_INCORRECT_FORMAT"]);
document.forms[0].credit_expyear.focus();
document.forms[0].credit_expyear.select();
return false;
}else{
var _71=(document.forms[0].credit_number.value);
var _72=CCValidation(_71);
if(_72){
if(document.forms[0].credit_expyear.value.length==2){
credit_expyear="20"+document.forms[0].credit_expyear.value;
}else{
credit_expyear=document.forms[0].credit_expyear.value;
}
var _73=ValidateExpiry(document.forms[0].credit_expmonth.value,credit_expyear);
if(_73){
return true;
}else{
alert(alerts["_INVALID_EXPIRY"]);
return false;
}
}else{
return false;
}
}
}
}
}
}
}
}
}
};
function CCValidation(_74){
var _75=_74.substr(0,4);
var _76=_74.length;
var _77;
var _78;
var _79="";
if((_75>=4000)&&(_75<=4999)){
_79="Visa";
if(_76>14){
_77=16;
}else{
if(_76<14){
_77=13;
}
}
}else{
if((_75>=5100)&&(_75<=5599)){
_79="MasterCard";
_77=16;
}else{
}
}
if(_76!=_77){
if(_79!=""){
alert(alerts["_ENTER_CC"]+_79);
document.forms[0].credit_number.focus();
document.forms[0].credit_number.select();
}else{
alert(alerts["_NO_SUPPORT"]);
document.forms[0].credit_number.focus();
document.forms[0].credit_number.select();
}
return false;
}
if(Mod10Solution(_74)){
document.forms[0].hidvalccname.value=_79;
return true;
}else{
alert(alerts["_ENTER_CC"]+_79);
return false;
}
};
function Mod10Solution(_7a){
var _7b=_7a.length;
var _7c=0;
var _7d;
var _7e;
for(_7d=1-(_7b%2);_7d<_7b;_7d+=2){
_7c+=parseInt(_7a.substr(_7d,1));
}
for(_7d=(_7b%2);_7d<_7b;_7d+=2){
_7e=_7a.substr(_7d,1)*2;
if(_7e<10){
_7c+=parseInt(_7e);
}else{
_7c+=parseInt(_7e)-9;
}
}
return (_7c%10==0);
};
function ValidateExpiry(_7f,_80){
var _81;
var _82;
_81=parseInt(_80);
var _83=new Date();
if(_83.getYear()==_81){
if(_83.getMonth()+1<=_7f){
_82=1;
}else{
_82=0;
}
}else{
if(_83.getYear()>_81){
_82=0;
}else{
_82=1;
}
}
return _82;
};
function BankValidation(){
if(document.forms[0].bank_name_1.value.match(/^ *$/)){
alert(alerts["_ENTER_BANK"]);
document.forms[0].bank_name_1.focus();
return false;
}else{
if(document.forms[0].bank_code_1.value.match(/^ *$/)){
alert(alerts["_ENTER_BANKCODE"]);
document.forms[0].bank_code_1.focus();
return false;
}else{
if(document.forms[0].bank_account.value.match(/^ *$/)){
alert(alerts["_ENTER_BANKACC"]);
document.forms[0].bank_account.focus();
return false;
}else{
return true;
}
}
}
};
var DDSPEED=10;
var DDTIMER=15;
function ddMenu(id,d){
var h=document.getElementById(id+"-ddheader");
var c=document.getElementById(id+"-ddcontent");
clearInterval(c.timer);
if(d==1){
clearTimeout(h.timer);
if(c.maxh&&c.maxh<=c.offsetHeight){
return;
}else{
if(!c.maxh){
c.style.display="block";
c.style.height="auto";
c.maxh=c.offsetHeight;
c.style.height="0px";
}
}
c.timer=setInterval(function(){
ddSlide(c,1);
},DDTIMER);
}else{
h.timer=setTimeout(function(){
ddCollapse(c);
},50);
}
};
function ddCollapse(c){
c.timer=setInterval(function(){
ddSlide(c,-1);
},DDTIMER);
if($.browser.mozilla&&document.getElementById("orange-ddcontent").childNodes[0].childNodes.length==1&&c.id=="orange-ddcontent"){
c.style.height="0px";
}
};
function cancelHide(id){
var h=document.getElementById(id+"-ddheader");
var c=document.getElementById(id+"-ddcontent");
clearTimeout(h.timer);
clearInterval(c.timer);
if(c.offsetHeight<c.maxh){
c.timer=setInterval(function(){
ddSlide(c,1);
},DDTIMER);
}
};
function ddSlide(c,d){
var _84=c.offsetHeight;
var _85;
if(d==1){
_85=(Math.round((c.maxh-_84)/DDSPEED));
}else{
_85=(Math.round(_84/DDSPEED));
}
if(_85<=1&&d==1){
_85=1;
}
if(d==1){
c.style.height=_84+(_85*d)+"px";
}else{
var _86=navigator.appName;
if((_86=="Microsoft Internet Explorer")){
c.style.height=parseInt(_84+(_85*d))-parseInt("0")+"px";
}else{
c.style.height=parseInt(_84+(_85*d))-parseInt("4")+"px";
}
}
c.style.opacity=_84/c.maxh;
c.style.filter="alpha(opacity="+(_84*100/c.maxh)+")";
if((_84<2&&d!=1)||(_84>(c.maxh-2)&&d==1)){
clearInterval(c.timer);
}
if($.browser.mozilla&&document.getElementById("orange-ddcontent").childNodes[0].childNodes.length==1&&c.id=="orange-ddcontent"){
c.style.opacity=1;
}
};
var OP=(navigator.userAgent.indexOf("Opera")!=-1);
var IE=(navigator.userAgent.indexOf("MSIE")!=-1&&!OP);
var GK=(navigator.userAgent.indexOf("Gecko")!=-1);
var SA=(navigator.userAgent.indexOf("Safari")!=-1);
var DOM=document.getElementById;
var tooltip=null;
function TOOLTIP(){
this.text="";
this.height=0;
this.obj=null;
this.active=false;
this.cursorDistance=5;
this.create=function(){
if(!this.obj){
this.init();
}
var t="<div class="+this.cssclass+">"+this.text+"</div>";
if(DOM||IE){
this.obj.innerHTML=t;
}
if(DOM){
this.height=this.obj.offsetHeight;
}else{
if(IE){
this.height=this.obj.style.pixelHeight;
}
}
if(this.bgColor){
this.obj.style.backgroundColor=this.bgColor;
}
this.setOpacity();
this.move();
this.show();
};
this.init=function(){
if(DOM){
this.obj=document.getElementById("ToolTip");
}else{
if(IE){
this.obj=document.all.ToolTip;
}
}
};
this.move=function(){
if(!this.moveWithMouse){
return false;
}
var _87=getWinX()-(((GK&&!SA)||OP)?17:0);
var _88=getWinY()-(((GK&&!SA)||OP)?17:0);
var x=mouseX;
var y=mouseY;
if(x+this.width+this.cursorDistance>_87+getScrX()){
x-=this.width+this.cursorDistance;
}else{
x+=this.cursorDistance;
}
if(y+this.height+this.cursorDistance>_88+getScrY()){
y-=this.height;
}else{
y+=this.cursorDistance;
}
this.obj.style.left=x+"px";
this.obj.style.top=y+"px";
};
this.show=function(){
this.obj.style.zIndex=69;
this.active=true;
this.obj.style.visibility="visible";
};
this.hide=function(){
this.obj.style.zIndex=-1;
this.active=false;
this.obj.style.visibility="hidden";
};
this.setOpacity=function(){
this.obj.style.opacity=this.opacity/100;
this.obj.style.MozOpacity=this.opacity/100;
this.obj.style.KhtmlOpacity=this.opacity/100;
this.obj.style.filter="alpha(opacity="+this.opacity+")";
};
};
function getScrX(){
var _89=0;
if(window.pageXOffset){
_89=window.pageXOffset;
}else{
if(document.documentElement&&document.documentElement.scrollLeft){
_89=document.documentElement.scrollLeft;
}else{
if(document.body&&document.body.scrollLeft){
_89=document.body.scrollLeft;
}
}
}
return _89;
};
function getScrY(){
var _8a=0;
if(window.pageYOffset){
_8a=window.pageYOffset;
}else{
if(document.documentElement&&document.documentElement.scrollTop){
_8a=document.documentElement.scrollTop;
}else{
if(document.body&&document.body.scrollTop){
_8a=document.body.scrollTop;
}
}
}
return _8a;
};
function getWinX(){
var _8b=0;
if(window.innerWidth){
_8b=window.innerWidth;
}else{
if(document.documentElement&&document.documentElement.clientWidth){
_8b=document.documentElement.clientWidth;
}else{
if(document.body&&document.body.clientWidth){
_8b=document.body.clientWidth;
}else{
_8b=screen.width;
}
}
}
return _8b;
};
function getWinY(){
var _8c=0;
if(window.innerHeight){
_8c=window.innerHeight;
}else{
if(document.documentElement&&document.documentElement.clientHeight){
_8c=document.documentElement.clientHeight;
}else{
if(document.body&&document.body.clientHeight){
_8c=document.body.clientHeight;
}else{
_8c=screen.height;
}
}
}
return _8c;
};
function getMouseXY(e){
if(e&&e.pageX!=null){
mouseX=e.pageX;
mouseY=e.pageY;
}else{
if(event&&event.clientX!=null){
mouseX=event.clientX+getScrX();
mouseY=event.clientY+getScrY();
}
}
if(mouseX<0){
mouseX=0;
}
if(mouseY<0){
mouseY=0;
}
if(tooltip&&tooltip.active){
tooltip.move();
}
};
function toolTip(_8d,_8e,_8f,_90){
if(_8d){
tooltip=new TOOLTIP();
tooltip.text=_8d;
tooltip.moveWithMouse=(arguments[4]==false)?arguments[4]:true;
if(_8e&&_8e!=""){
tooltip.cssclass=_8e;
}
if(_8f&&_8f!=""){
tooltip.width=_8f;
}
if(_90&&_90!=""){
tooltip.opacity=_90;
}
tooltip.create();
}else{
if(tooltip){
tooltip.hide();
}
}
};
document.write("<div id=\"ToolTip\" style=\"position:absolute; visibility:hidden\"></div>");
var mouseX=mouseY=0;
document.onmousemove=getMouseXY;
var cssdropdown={disappeardelay:250,dropdownindicator:"",enableswipe:1,enableiframeshim:1,dropmenuobj:null,asscmenuitem:null,domsupport:document.all||document.getElementById,standardbody:null,iframeshimadded:false,swipetimer:undefined,bottomclip:0,getposOffset:function(_91,_92){
var _93=(_92=="left")?_91.offsetLeft:_91.offsetTop;
var _94=_91.offsetParent;
while(_94!=null){
_93=(_92=="left")?_93+_94.offsetLeft:_93+_94.offsetTop;
_94=_94.offsetParent;
}
return _93;
},swipeeffect:function(){
if(this.bottomclip<parseInt(this.dropmenuobj.offsetHeight)){
this.bottomclip+=10+(this.bottomclip/10);
this.dropmenuobj.style.clip="rect(0 auto "+this.bottomclip+"px 0)";
}else{
return;
}
this.swipetimer=setTimeout("cssdropdown.swipeeffect()",25);
},css:function(el,_95,_96){
var _97=new RegExp("(^|\\s+)"+_95+"($|\\s+)","ig");
if(_96=="check"){
return _97.test(el.className);
}else{
if(_96=="remove"){
el.className=el.className.replace(_97,"");
}else{
if(_96=="add"&&!_97.test(el.className)){
el.className+=" "+_95;
}
}
}
},showhide:function(obj,e){
this.dropmenuobj.style.left=this.dropmenuobj.style.top="-500px";
if(this.enableswipe==1){
if(typeof this.swipetimer!="undefined"){
clearTimeout(this.swipetimer);
}
obj.clip="rect(0 auto 0 0)";
this.bottomclip=0;
this.swipeeffect();
}
obj.visibility="visible";
this.css(this.asscmenuitem,"selected","add");
},clearbrowseredge:function(obj,_98){
var _99=0;
if(_98=="rightedge"){
var _9a=document.all&&!window.opera?this.standardbody.scrollLeft+this.standardbody.clientWidth-15:window.pageXOffset+window.innerWidth-15;
this.dropmenuobj.contentmeasure=this.dropmenuobj.offsetWidth;
if(_9a-this.dropmenuobj.x<this.dropmenuobj.contentmeasure){
_99=this.dropmenuobj.contentmeasure-obj.offsetWidth;
}
}else{
var _9b=document.all&&!window.opera?this.standardbody.scrollTop:window.pageYOffset;
var _9a=document.all&&!window.opera?this.standardbody.scrollTop+this.standardbody.clientHeight-15:window.pageYOffset+window.innerHeight-18;
this.dropmenuobj.contentmeasure=this.dropmenuobj.offsetHeight;
if(_9a-this.dropmenuobj.y<this.dropmenuobj.contentmeasure){
_99=this.dropmenuobj.contentmeasure+obj.offsetHeight;
if((this.dropmenuobj.y-_9b)<this.dropmenuobj.contentmeasure){
_99=this.dropmenuobj.y+obj.offsetHeight-_9b;
}
}
}
return _99;
},dropit:function(obj,e,_9c){
if(this.dropmenuobj!=null){
this.hidemenu();
}
this.clearhidemenu();
this.dropmenuobj=document.getElementById(_9c);
this.asscmenuitem=obj;
this.showhide(this.dropmenuobj.style,e);
this.dropmenuobj.x=this.getposOffset(obj,"left");
this.dropmenuobj.y=this.getposOffset(obj,"top");
this.dropmenuobj.style.left=this.dropmenuobj.x-this.clearbrowseredge(obj,"rightedge")+"px";
this.dropmenuobj.style.top=this.dropmenuobj.y-this.clearbrowseredge(obj,"bottomedge")+obj.offsetHeight+1+"px";
this.positionshim();
},positionshim:function(){
if(this.enableiframeshim&&typeof this.shimobject!="undefined"){
if(this.dropmenuobj.style.visibility=="visible"){
this.shimobject.style.width=this.dropmenuobj.offsetWidth+"px";
this.shimobject.style.height=this.dropmenuobj.offsetHeight+"px";
this.shimobject.style.left=this.dropmenuobj.style.left;
this.shimobject.style.top=this.dropmenuobj.style.top;
}
this.shimobject.style.display=(this.dropmenuobj.style.visibility=="visible")?"block":"none";
}
},hideshim:function(){
if(this.enableiframeshim&&typeof this.shimobject!="undefined"){
this.shimobject.style.display="none";
}
},isContained:function(m,e){
var e=window.event||e;
var c=e.relatedTarget||((e.type=="mouseover")?e.fromElement:e.toElement);
while(c&&c!=m){
try{
c=c.parentNode;
}
catch(e){
c=m;
}
}
if(c==m){
return true;
}else{
return false;
}
},dynamichide:function(m,e){
if(!this.isContained(m,e)){
this.delayhidemenu();
}
},delayhidemenu:function(){
this.delayhide=setTimeout("cssdropdown.hidemenu()",this.disappeardelay);
},hidemenu:function(){
this.css(this.asscmenuitem,"selected","remove");
this.dropmenuobj.style.visibility="hidden";
this.dropmenuobj.style.left=this.dropmenuobj.style.top=0;
this.hideshim();
},clearhidemenu:function(){
if(this.delayhide!="undefined"){
clearTimeout(this.delayhide);
}
},addEvent:function(_9d,_9e,_9f){
if(_9d.addEventListener){
_9d.addEventListener(_9f,_9e,false);
}else{
if(_9d.attachEvent){
_9d.attachEvent("on"+_9f,function(){
return _9e.call(_9d,window.event);
});
}
}
},startchrome:function(){
if(!this.domsupport){
return;
}
this.standardbody=(document.compatMode=="CSS1Compat")?document.documentElement:document.body;
for(var ids=0;ids<arguments.length;ids++){
var _a0=document.getElementById(arguments[ids]).getElementsByTagName("a");
for(var i=0;i<_a0.length;i++){
if(_a0[i].getAttribute("rel")){
var _a1=_a0[i].getAttribute("rel");
var _a2=document.getElementById(_a1);
this.addEvent(_a2,function(){
cssdropdown.clearhidemenu();
},"mouseover");
this.addEvent(_a2,function(e){
cssdropdown.dynamichide(this,e);
},"mouseout");
this.addEvent(_a2,function(){
cssdropdown.delayhidemenu();
},"click");
try{
_a0[i].innerHTML=_a0[i].innerHTML+" "+this.dropdownindicator;
}
catch(e){
}
this.addEvent(_a0[i],function(e){
if(!cssdropdown.isContained(this,e)){
var _a3=window.event||e;
cssdropdown.dropit(this,_a3,this.getAttribute("rel"));
}
},"mouseover");
this.addEvent(_a0[i],function(e){
cssdropdown.dynamichide(this,e);
},"mouseout");
this.addEvent(_a0[i],function(){
cssdropdown.delayhidemenu();
},"click");
}
}
}
if(window.createPopup&&!window.XmlHttpRequest&&!this.iframeshimadded){
document.write("<IFRAME id=\"iframeshim\"  src=\"\" style=\"display: none; left: 0; top: 0; z-index: 90; position: absolute; filter: progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)\" frameBorder=\"0\" scrolling=\"no\"></IFRAME>");
this.shimobject=document.getElementById("iframeshim");
this.iframeshimadded=true;
}
}};
var displayWaitMessage=true;
var activeImage=false;
var imageGalleryLeftPos=false;
var imageGalleryWidth=false;
var imageGalleryObj=false;
var maxGalleryXPos=false;
var slideSpeed=0;
var imageGalleryCaptions=new Array();
function startSlide(e){
if(document.all){
e=event;
}
var id=this.id;
if(this.id=="arrow_right"||this.id=="arrow_right_rel"){
slideSpeedMultiply=Math.floor((e.clientX-this.offsetLeft)/5);
slideSpeed=-1*slideSpeedMultiply;
slideSpeed=Math.max(-10,slideSpeed);
}else{
slideSpeedMultiply=10-Math.floor((e.clientX-this.offsetLeft)/5);
slideSpeed=1*slideSpeedMultiply;
slideSpeed=Math.min(10,slideSpeed);
if(slideSpeed<0){
slideSpeed=10;
}
}
};
function releaseSlide(){
var id=this.id;
slideSpeed=0;
};
function gallerySlide(){
if(slideSpeed!=0){
var _a4=imageGalleryObj.offsetLeft;
_a4=_a4/1+slideSpeed;
if(_a4>maxGalleryXPos){
_a4=maxGalleryXPos;
slideSpeed=0;
}
if(_a4<minGalleryXPos){
_a4=minGalleryXPos;
slideSpeed=0;
}
imageGalleryObj.style.left=_a4+"px";
}
getScrollAmount();
setTimeout("gallerySlide()",20);
};
function showImage(){
activeImage=this;
};
function initSlideShow(_a5,_a6,_a7,_a8,_a9){
document.getElementById(_a5).onmousemove=startSlide;
document.getElementById(_a5).onmouseout=releaseSlide;
document.getElementById(_a6).onmousemove=startSlide;
document.getElementById(_a6).onmouseout=releaseSlide;
imageGalleryObj=document.getElementById(_a7);
imageGalleryLeftPos=imageGalleryObj.offsetLeft;
imageGalleryWidth=document.getElementById(_a8).offsetWidth-80;
maxGalleryXPos=imageGalleryObj.offsetLeft;
minGalleryXPos=imageGalleryWidth-document.getElementById(_a9).offsetLeft;
var _aa=imageGalleryObj.getElementsByTagName("IMG");
for(var no=0;no<_aa.length;no++){
_aa[no].onmouseover=showImage;
}
var _ab=imageGalleryObj.getElementsByTagName("DIV");
for(var no=0;no<_ab.length;no++){
if(_ab[no].className=="imageCaption"){
imageGalleryCaptions[imageGalleryCaptions.length]=_ab[no].innerHTML;
}
}
gallerySlide();
};
function showPreview(_ac,_ad){
var _ae=document.getElementById("previewPane").getElementsByTagName("IMG");
if(_ae.length==0){
var img=document.createElement("IMG");
document.getElementById("previewPane").appendChild(img);
}else{
img=_ae[0];
}
img.src=_ac;
};
function hideWaitMessageAndShowCaption(_af){
document.getElementById("waitMessage").style.display="none";
};
var displayWaitMessage_rel=true;
var activeImage_rel=false;
var imageGalleryLeftPos_rel=false;
var imageGalleryWidth_rel=false;
var imageGalleryObj_rel=false;
var maxGalleryXPos_rel=false;
var slideSpeed_rel=0;
var imageGalleryCaptions_rel=new Array();
function startSlide_rel(e){
if(document.all){
e=event;
}
var id=this.id;
if(this.id=="arrow_right"||this.id=="arrow_right_rel"){
slideSpeedMultiply_rel=Math.floor((e.clientX-this.offsetLeft)/5);
slideSpeed_rel=-1*slideSpeedMultiply_rel;
slideSpeed_rel=Math.max(-10,slideSpeed_rel);
}else{
slideSpeedMultiply_rel=10-Math.floor((e.clientX-this.offsetLeft)/5);
slideSpeed_rel=1*slideSpeedMultiply_rel;
slideSpeed_rel=Math.min(10,slideSpeed_rel);
if(slideSpeed_rel<0){
slideSpeed_rel=10;
}
}
};
function releaseSlide_rel(){
var id=this.id;
slideSpeed_rel=0;
};
function gallerySlide_rel(){
if(slideSpeed_rel!=0){
var _b0=imageGalleryObj_rel.offsetLeft;
_b0=_b0/1+slideSpeed_rel;
if(_b0>maxGalleryXPos_rel){
_b0=maxGalleryXPos_rel;
slideSpeed_rel=0;
}
if(_b0<minGalleryXPos_rel){
_b0=minGalleryXPos_rel;
slideSpeed_rel=0;
}
imageGalleryObj_rel.style.left=_b0+"px";
}
getScrollAmount_rel();
setTimeout("gallerySlide_rel()",20);
};
function showImage_rel(){
activeImage_rel=this;
};
function initSlideShow_rel(_b1,_b2,_b3,_b4,_b5){
document.getElementById(_b1).onmousemove=startSlide_rel;
document.getElementById(_b1).onmouseout=releaseSlide_rel;
document.getElementById(_b2).onmousemove=startSlide_rel;
document.getElementById(_b2).onmouseout=releaseSlide_rel;
imageGalleryObj_rel=document.getElementById(_b3);
imageGalleryLeftPos_rel=imageGalleryObj_rel.offsetLeft;
imageGalleryWidth_rel=document.getElementById(_b4).offsetWidth-80;
maxGalleryXPos_rel=imageGalleryObj_rel.offsetLeft;
minGalleryXPos_rel=imageGalleryWidth_rel-document.getElementById(_b5).offsetLeft;
var _b6=imageGalleryObj_rel.getElementsByTagName("IMG");
for(var no=0;no<_b6.length;no++){
_b6[no].onmouseover=showImage_rel;
}
var _b7=imageGalleryObj_rel.getElementsByTagName("DIV");
for(var no=0;no<_b7.length;no++){
if(_b7[no].className=="imageCaption_rel"){
imageGalleryCaptions_rel[imageGalleryCaptions_rel.length]=_b7[no].innerHTML;
}
}
gallerySlide_rel();
};
function showPreview_rel(_b8,_b9){
var _ba=document.getElementById("previewPane").getElementsByTagName("IMG");
if(_ba.length==0){
var img=document.createElement("IMG");
document.getElementById("previewPane").appendChild(img);
}else{
img=_ba[0];
}
img.src=_b8;
};
function hideWaitMessageAndShowCaption(_bb){
document.getElementById("waitMessage_rel").style.display="none";
};
function getScrollAmount(){
var _bc;
var _bd;
var _be=document.getElementById("totalProd").innerHTML;
imageGalleryObj=document.getElementById("theImages");
imageGalleryLeftPos=imageGalleryObj.offsetLeft;
_bc=Math.abs(imageGalleryLeftPos);
_bd=Math.ceil(_bc/128);
if(_bd>0){
document.getElementById("scrollStartAmt").innerHTML=_bd;
if(_be<5){
document.getElementById("scrollEndAmt").innerHTML=_be;
}else{
document.getElementById("scrollEndAmt").innerHTML=_bd+4;
}
}
};
function getScrollAmount_rel(){
var _bf;
var _c0;
var _c1=document.getElementById("totalProd_rel").innerHTML;
imageGalleryObj_rel=document.getElementById("theImages_rel");
imageGalleryLeftPos_rel=imageGalleryObj_rel.offsetLeft;
_bf=Math.abs(imageGalleryLeftPos_rel);
_c0=Math.ceil(_bf/128);
if(_c0>0){
document.getElementById("scrollStartAmt_rel").innerHTML=_c0;
if(_c1<5){
document.getElementById("scrollEndAmt_rel").innerHTML=_c1;
}else{
document.getElementById("scrollEndAmt_rel").innerHTML=_c0+4;
}
}
};
function openReviewLayer(){
emailwindow=dhtmlmodal.open("EmailBox","div","productreview","Write a review","width=425px,height=470px,center=1,resize=0,scrolling=0");
document.getElementById("reviewProdName").innerHTML=document.getElementById("productName").innerHTML;
document.getElementById("hidAction").value="showSearchResults";
document.getElementById("cust_name").focus();
};
function changeRatingImages(_c2){
var i=j=0;
for(i=1;i<=_c2;i++){
document.getElementById("ratingImg_"+i).src="themes/vivaliteTheme/images/star_rating.jpg";
}
for(j=_c2+1;j<=5;j++){
document.getElementById("ratingImg_"+j).src="themes/vivaliteTheme/images/star_fade.jpg";
}
document.getElementById("hidCustomerRating").value=i-1;
};
function saveCustomerReview(){
if(document.getElementById("cust_name").value.match(/^ *$/)){
alert(alerts["_ENTER_NAME"]);
document.getElementById("cust_name").focus();
return;
}
if(document.getElementById("cust_email").value.match(/^ *$/)){
alert(alerts["_ENTER_EMAIL"]);
document.getElementById("cust_email").focus();
return;
}
if(!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w+)+$/.test(document.getElementById("cust_email").value))){
alert(alerts["_INVALID_EMAIL"]);
document.getElementById("cust_email").focus();
return;
}
if(document.getElementById("cust_review").value.match(/^ *$/)){
alert(alerts["_ENTER_REVIEW"]);
document.getElementById("cust_review").focus();
return;
}
params="hidAction=saveCustomerReview&";
params+="hidProdId="+document.getElementById("hidProdId").value+"&";
params+="hidOptionId="+document.getElementById("hidOptionId").value+"&";
params+="cust_name="+document.getElementById("cust_name").value+"&";
params+="cust_email="+document.getElementById("cust_email").value+"&";
params+="cust_review="+document.getElementById("cust_review").value+"&";
params+="hidCustomerRating="+document.getElementById("hidCustomerRating").value+"&";
params+="publish_review="+document.getElementById("publish_review").checked;
url=window.location.pathname;
http=getHTTPObject();
http.open("POST",url,true);
http.setRequestHeader("Content-type","application/x-www-form-urlencoded");
http.setRequestHeader("Content-length",params.length);
http.setRequestHeader("Connection","close");
http.onreadystatechange=function(){
if(http.readyState==4){
dhtmlmodal.close(emailwindow);
openReviewConfirmationLayer();
}
};
http.send(params);
};


function openReviewConfirmationLayer(){
//Open a modal window populated with the contents of a hidden DIV, and assign the result to a global variable called "emailwindow"
	emailwindow = dhtmlmodal.open('EmailBox', 'div', 'productreviewMsg', document.getElementById("hidProductName").value, 'width=400px,height=100px,center=1,resize=0,scrolling=0');
}

function showDisplayLogin(){
document.getElementById("accountalready").style.display="";
};
function hideDisplayLogin(){
document.getElementById("accountalready").style.display="none";
};
function continueOrder(){
if(document.getElementById("loginnewaccount").checked){
document.getElementById("login_hidValAction").value="loginnewaccount";
document.forms[0].submit();
}else{
if(document.getElementById("loginoldaccount").checked){
if(document.getElementById("user_login").value.match(/^ *$/)){
alert(alerts["_ENTER_EMAIL"]);
document.getElementById("user_login").focus();
return;
}
if(!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w+)+$/.test(document.getElementById("user_login").value))){
alert(alerts["_INVALID_EMAIL"]);
document.getElementById("user_login").focus();
return;
}
if(document.getElementById("user_password").value.match(/^ *$/)){
alert(alerts["_ENTER_PASSWD"]);
document.getElementById("user_password").focus();
return;
}
checkLogin();
}else{
if(document.getElementById("loginwithoutaccount").checked){
document.getElementById("login_hidValAction").value="loginwithoutaccount";
document.forms[0].submit();
}
}
}
};
checkLogin=function(){
params="hidValAction=checkLogin&";
params+="&loginId="+document.getElementById("user_login").value;
params+="&passwd="+document.getElementById("user_password").value;
url="login.html";
http=getHTTPObject();
http.open("POST",url,true);
http.setRequestHeader("Content-type","application/x-www-form-urlencoded");
http.setRequestHeader("Content-length",params.length);
http.setRequestHeader("Connection","close");
http.onreadystatechange=function(){
if(http.readyState==4){
if(!http.responseText){
if(document.getElementById("incorrectLogin")){
document.getElementById("incorrectLogin").style.visibility="visible";
}else{
alert(alerts["_INCORRECT_LOGIN"]);
}
document.getElementById("user_login").focus();
document.getElementById("user_login").select();
}else{
if(document.getElementById("incorrectLogin")){
document.getElementById("incorrectLogin").style.visibility="hidden";
}
if(document.getElementById("hidProductCount").value>0){
document.forms[0].action="http://"+http.responseText+"/checkout_process.html?PHPSESSID="+getCookie("PHPSESSID");
}else{
document.forms[0].action="http://"+http.responseText+"/my-account.html?PHPSESSID="+getCookie("PHPSESSID");
}
document.forms[0].submit();
}
}
};
http.send(params);
};
clearMessage=function(){
document.getElementById("incorrectLogin").style.visibility="hidden";
};
function catchEnterKey(e,_c3){
var key;
if(window.event){
e=window.event;
key=e.keyCode;
}else{
if(e.which){
key=e.which;
}
}
if(key=="13"){
eval(_c3)();
}
};
function createAccount(){
var _c4=false;
if(document.getElementById("shippingMsg").style.display==""){
_c4=true;
}
if(!validateContactDetails(_c4)){
return false;
}
document.getElementById("account_hidValAction").value="createaccount";
document.forms[0].submit();
};
checkLoginId=function(_c5){
if(_c5==""){
return false;
}
params="hidValAction=checkLoginId&";
params+="login="+_c5;
url="create_account.html";
http=getHTTPObject();
http.open("POST",url,true);
http.setRequestHeader("Content-type","application/x-www-form-urlencoded");
http.setRequestHeader("Content-length",params.length);
http.setRequestHeader("Connection","close");
http.onreadystatechange=function(){
if(http.readyState==4){
if(!http.responseText){
document.getElementById("loginExistMsg").style.display="block";
document.getElementById("l_contact_email").focus();
document.getElementById("l_contact_email").select();
}else{
document.getElementById("loginExistMsg").style.display="none";
}
}
};
http.send(params);
};
requestPassword=function(){
emailId=document.getElementById("forgotPasswdEmail").value;
if(!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w+)+$/.test(emailId))){
alert(alerts["_INVALID_EMAIL"]);
document.getElementById("forgotPasswdEmail").blur();
return false;
}
params="hidValAction=requestPassword&";
params+="forgotPasswdEmail="+emailId;
url="login.html";
http=getHTTPObject();
http.open("POST",url,true);
http.setRequestHeader("Content-type","application/x-www-form-urlencoded");
http.setRequestHeader("Content-length",params.length);
http.setRequestHeader("Connection","close");
http.onreadystatechange=function(){
if(http.readyState==4){
switch(http.responseText){
case "mailsendSuccess":
document.getElementById("mailsendSuccess").style.display="block";
document.getElementById("mailsendFailed").style.display="none";
document.getElementById("emailIdNotExist").style.display="none";
break;
case "mailsendFailed":
document.getElementById("mailsendSuccess").style.display="none";
document.getElementById("mailsendFailed").style.display="block";
document.getElementById("emailIdNotExist").style.display="none";
break;
case "emailIdNotExist":
document.getElementById("mailsendSuccess").style.display="none";
document.getElementById("mailsendFailed").style.display="none";
document.getElementById("emailIdNotExist").style.display="block";
break;
default:
break;
}
}
};
http.send(params);
};
showRollDescLayer=function(_c6,_c7,_c8,_c9,_ca){
var _cb="<div>"+"<div class='rollDescToolTipTop'>"+"<div class='rollDescToolTipTopText'><strong>"+_c6+"</strong></div>"+"<span class='rollDescToolTipTopText'>"+_c7+"</span>"+"</div>"+"<img src='"+_c8+"/small/"+_c9+"'>"+"<div class='rollDescToolTipBottomText'>"+_ca+"</div>"+"</div>";
toolTip(_cb,"productRollDescToolTip");
delete _cb;
};
function calculateEnergy(_cc){
current_wattage=document.getElementById("current_wattage").value;
number_hours_day=document.getElementById("number_hours_day").value;
number_bulbs=document.getElementById("number_bulbs").value;
energy_cost=document.getElementById("energy_cost").value;
energy_cost=energy_cost.replace(",",".");
if(number_hours_day>24){
alert("Please enter a number between 1 and 24");
return;
}
anualCost=roundNumber(((current_wattage*number_hours_day*number_bulbs*energy_cost*365)/1000),2);
new_cost=anualCost/5;
document.getElementById("old_cost").innerHTML=anualCost;
document.getElementById("equivalent_bulb").innerHTML=(current_wattage*_cc/100);
document.getElementById("new_cost").innerHTML=roundNumber(new_cost,2);
document.getElementById("saving").innerHTML=roundNumber(anualCost-new_cost,2);
document.getElementById("cur_wat").innerHTML=current_wattage+"W";
};
function roundNumber(_cd,_ce){
return Math.round(_cd*Math.pow(10,_ce))/Math.pow(10,_ce);
};
googleMapLayer=function(){
mapWindow=dhtmlmodal.open("googleMapBox","div","googleMap",alerts["_RESELLER_MAP"],"width=600px,height=300px,center=1,resize=0,scrolling=0");
initialize(arguments);
};
function initialize(_cf){
var map=new GMap2(document.getElementById("googleMapDiv"));
new GKeyboardHandler(map);
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
var _d0=new GClientGeocoder();
for(var i=0;i<_cf.length-1;i++){
setCityMarker(_cf[i],_cf,map,_d0,i);
}
};
function setCityMarker(_d1,_d2,map,_d3,_d4){
_d3.getLatLng(_d1,function(_d5){
if(_d5){
map.setCenter(_d5,2);
var _d6=new GMarker(_d5);
map.addOverlay(_d6);
_d6.bindInfoWindowHtml(_d2[_d4]);
}else{
_d3.getLatLng(_d1,function(_d7){
if(_d7){
map.setCenter(_d7,2);
var _d8=new GMarker(_d7);
map.addOverlay(_d8);
_d8.bindInfoWindowHtml(_d2[_d4]);
}else{
}
});
}
});
};
var scrollerwidth="100px";
var scrollerheight="106px";
var scrollerbgcolor="white";
var pausebetweenimages=0;
function move1(_d9){
tlayer=eval(_d9);
if(tlayer.left>0&&tlayer.left<=5){
tlayer.left=0;
setTimeout("move1(tlayer)",pausebetweenimages);
setTimeout("move2(document.main.document.second)",pausebetweenimages);
return;
}
if(tlayer.left>=tlayer.document.width*-1){
tlayer.left-=5;
setTimeout("move1(tlayer)",50);
}else{
tlayer.left=parseInt(scrollerwidth)+5;
tlayer.document.write(slideimages[i]);
tlayer.document.close();
if(i==slideimages.length-1){
i=0;
}else{
i++;
}
}
};
function move2(_da){
tlayer2=eval(_da);
if(tlayer2.left>0&&tlayer2.left<=5){
tlayer2.left=0;
setTimeout("move2(tlayer2)",pausebetweenimages);
setTimeout("move1(document.main.document.first)",pausebetweenimages);
return;
}
if(tlayer2.left>=tlayer2.document.width*-1){
tlayer2.left-=5;
setTimeout("move2(tlayer2)",50);
}else{
tlayer2.left=parseInt(scrollerwidth)+5;
tlayer2.document.write(slideimages[i]);
tlayer2.document.close();
if(i==slideimages.length-1){
i=0;
}else{
i++;
}
}
};
function move3(_db){
tdiv=eval(_db);
if(parseInt(tdiv.style.left)>0&&parseInt(tdiv.style.left)<=5){
tdiv.style.left=0+"px";
setTimeout("move3(tdiv)",pausebetweenimages);
setTimeout("move4(scrollerdiv2)",pausebetweenimages);
return;
}
if(parseInt(tdiv.style.left)>=tdiv.offsetWidth*-1){
tdiv.style.left=parseInt(tdiv.style.left)-5+"px";
setTimeout("move3(tdiv)",50);
}else{
tdiv.style.left=scrollerwidth;
pausebetweenimages=7000;
tdiv.innerHTML=slideimages[i];
if(slidingProductNames[j]){
document.getElementById("slidingProductNameDiv").innerHTML=slidingProductNames[j];
}else{
document.getElementById("slidingProductNameDiv").innerHTML="";
}
if(slidingProductshortDesc[j]){
document.getElementById("slidingProductDescDiv").innerHTML=slidingProductshortDesc[j];
}else{
document.getElementById("slidingProductDescDiv").innerHTML="";
}
if(slidingProductUrl[j]){
document.getElementById("readModeLink").href=slidingProductUrl[j];
}else{
document.getElementById("readModeLink").href="#";
}
if(j==slidingProductNames.length-1){
j=0;
}else{
j++;
}
if(i==slideimages.length-1){
i=0;
}else{
i++;
}
}
};
function move4(_dc){
tdiv2=eval(_dc);
if(parseInt(tdiv2.style.left)>0&&parseInt(tdiv2.style.left)<=5){
tdiv2.style.left=0+"px";
setTimeout("move4(tdiv2)",pausebetweenimages);
setTimeout("move3(scrollerdiv1)",pausebetweenimages);
return;
}
if(parseInt(tdiv2.style.left)>=tdiv2.offsetWidth*-1){
tdiv2.style.left=parseInt(tdiv2.style.left)-5+"px";
setTimeout("move4(scrollerdiv2)",50);
}else{
tdiv2.style.left=scrollerwidth;
pausebetweenimages=7000;
tdiv2.innerHTML=slideimages[i];
if(slidingProductNames[j]){
document.getElementById("slidingProductNameDiv").innerHTML=slidingProductNames[j];
}else{
document.getElementById("slidingProductNameDiv").innerHTML="";
}
if(slidingProductshortDesc[j]){
document.getElementById("slidingProductDescDiv").innerHTML=slidingProductshortDesc[j];
}else{
document.getElementById("slidingProductDescDiv").innerHTML="";
}
if(slidingProductUrl[j]){
document.getElementById("readModeLink").href=slidingProductUrl[j];
}else{
document.getElementById("readModeLink").href="#";
}
if(j==slidingProductNames.length-1){
j=0;
}else{
j++;
}
if(i==slideimages.length-1){
i=0;
}else{
i++;
}
}
};
function startscroll(){
if(ie||dom){
scrollerdiv1=ie?first2:document.getElementById("first2");
scrollerdiv2=ie?second2:document.getElementById("second2");
move3(scrollerdiv1);
scrollerdiv2.style.left=scrollerwidth;
}else{
if(document.layers){
document.main.visibility="show";
move1(document.main.document.first);
document.main.document.second.left=parseInt(scrollerwidth)+5;
document.main.document.second.visibility="show";
}
}
};
showCountries=function(id1,id2){
document.getElementById("entersiteheader_middletext").style.display="none";
document.getElementById("countrylist1").style.display="none";
document.getElementById("countrylist2").style.display="none";
document.getElementById("countrylist3").style.display="none";
document.getElementById("countrylist4").style.display="none";
document.getElementById("connection1").style.visibility="hidden";
document.getElementById("connection2").style.visibility="hidden";
document.getElementById("connection3").style.visibility="hidden";
document.getElementById("connection4").style.visibility="hidden";
document.getElementById(id1).style.display="block";
document.getElementById(id2).style.visibility="visible";
};
hideCountries=function(id1,id2){
document.getElementById("entersiteheader_middletext").style.display="block";
document.getElementById(id1).style.display="none";
document.getElementById(id2).style.visibility="hidden";
};
userLogin=function(e){
if(e.type=="keypress"&&(e.keyCode!=13&&e.keyCode!=9)){
return false;
}else{
if(document.getElementById("user_login").value.match(/^ *$/)){
alert(alerts["_ENTER_EMAIL"]);
document.getElementById("user_login").focus();
return false;
}else{
if(!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w+)+$/.test(document.getElementById("user_login").value))){
alert(alerts["_INVALID_EMAIL"]);
document.getElementById("user_login").focus();
return false;
}else{
if(document.getElementById("user_password").value.match(/^ *$/)){
alert(alerts["_ENTER_PASSWD"]);
document.getElementById("user_password").focus();
return false;
}else{
checkLogin();
}
}
}
}
};
function setCountry(_dd){
document.getElementById("hidValCountryAction").value="changecountry";
document.getElementById("hidValCountryId").value=_dd;
document.getElementById("frmVivalite").submit();
};
function clickSwitch(_de){
switch(_de.id){
case "switch-vivalite":
var _df=document.getElementById("vivalite_img").className;
if(_df=="vivalite_on"){
_de.className="deact";
document.getElementById("vivalite_img").className="vivalite_off";
}else{
_de.className="act";
document.getElementById("vivalite_img").className="vivalite_on";
}
break;
case "switch-standard":
var _df=document.getElementById("std_img").className;
if(_df=="std_on"){
document.getElementById("std_img").className="std_off";
_de.className="deact";
}else{
document.getElementById("std_img").className="std_on";
_de.className="act";
}
break;
}
};
beforeAfterExample=function(_e0){
if(typeof (imageIndx)=="undefined"){
imageIndx=2;
}
if(imageIndx==_e0.length){
imageIndx=0;
}
document.getElementById("afterEgImg").src="themes/vivaliteTheme/images/"+_e0[imageIndx++];
document.getElementById("beforeEgImg").src="themes/vivaliteTheme/images/"+_e0[imageIndx++];
};
showQuotes=function(_e1,_e2){
if(typeof (quoteIndx)=="undefined"&&typeof (namesIndx)=="undefined"){
quoteIndx=1;
namesIndx=1;
}
if(quoteIndx==_e1.length&&quoteIndx==_e2.length){
quoteIndx=0;
namesIndx=0;
}
document.getElementById("quoteText").innerHTML=_e1[quoteIndx++];
document.getElementById("quoteName").innerHTML=_e2[namesIndx++];
};
showAllChartLayer=function(){
var br=navigator.appName;
var src;
if(br=="Microsoft Internet Explorer"){
src=arguments[0].srcElement;
}else{
src=arguments[0].target;
}
var top=src.offsetHeight;
var _e3=src.offsetLeft-110;
switch(arguments[1]){
case "s1":
top+=466;
break;
case "s2":
top+=654;
break;
case "s3":
top+=836;
break;
case "m":
top+=550;
break;
default:
break;
}
imagePath=arguments[2];
if(br=="Microsoft Internet Explorer"){
top+=60;
_e3+=145;
var _e4="<div style='width:100px;height:200px;margin-top:"+top+"px;margin-left:"+_e3+"px'>";
}else{
var _e4="<div style='width:100px;height:200px;margin-top:10px;position:absolute;top:"+top+"px;left:"+_e3+"px;'>";
}
for(var _e5=3;_e5<arguments.length;_e5++){
_e4+="<img style='width:100px;height:200px;margin-top:5px;' src='"+imagePath+arguments[_e5]+"'/>";
}
_e4+="</div>";
toolTip(_e4,"","","",false);
delete _e4;
};
function changeImages(){
try{
clearTimeout(to);
}
catch(e){
}
to=setTimeout("nextImage();",6000);
};
function nextImage(){
if(typeof (teamImages_i)=="undefined"){
teamImages_i=1;
}
if(teamImages_i<4){
teamImages_i=teamImages_i+1;
}else{
teamImages_i=1;
}
for(var _e6=1;_e6<5;_e6++){
if(_e6==teamImages_i){
document.getElementById("box"+teamImages_i).style.display="";
}else{
document.getElementById("box"+_e6).style.display="none";
}
}
changeImages();
};
function so_init(){
if(!d.getElementById||!d.createElement){
return;
}
css=d.createElement("link");
css.setAttribute("href","slideshow2.css");
css.setAttribute("rel","stylesheet");
css.setAttribute("type","text/css");
d.getElementsByTagName("head")[0].appendChild(css);
imgs=d.getElementById("rotator").getElementsByTagName("div");
for(i=1;i<imgs.length;i++){
imgs[i].xOpacity=0;
}
imgs[0].style.display="block";
imgs[0].xOpacity=0.99;
setTimeout(so_xfade,3000);
};
function so_xfade(){
cOpacity=imgs[current].xOpacity;
nIndex=imgs[current+1]?current+1:0;
nOpacity=imgs[nIndex].xOpacity;
cOpacity-=0.05;
nOpacity+=0.05;
imgs[nIndex].style.display="block";
imgs[current].xOpacity=cOpacity;
imgs[nIndex].xOpacity=nOpacity;
_e7(imgs[current]);
_e7(imgs[nIndex]);
if(cOpacity<=0){
imgs[current].style.display="none";
current=nIndex;
setTimeout(so_xfade,3000);
}else{
setTimeout(so_xfade,50);
}
function _e7(obj){
if(obj.xOpacity>0.99){
obj.xOpacity=0.99;
return;
}
obj.style.opacity=obj.xOpacity;
obj.style.MozOpacity=obj.xOpacity;
obj.style.filter="alpha(opacity="+(obj.xOpacity*100)+")";
};
};
showFeedBacks=function(_e8,_e9,_ea){
if(typeof (fb_counter)=="undefined"){
fb_counter=0;
}
f=_e8[fb_counter];
n=_e9[fb_counter];
c=_ea[fb_counter];
document.getElementById("customereedBack_1").innerHTML=f;
document.getElementById("customereedBack_2").innerHTML=n;
if(c!=""){
document.getElementById("customereedBack_2").innerHTML+=", "+c;
}
if(fb_counter==_e8.length-1){
fb_counter=0;
}else{
fb_counter++;
}
setTimeout("showFeedBacks(feedBack,cust,country)",5000);
};
function fadeImage(_eb,_ec,_ed,_ee){
var _ef=Math.round(_ee/100);
var _f0=0;
document.getElementById(_eb).style.backgroundImage="url("+document.getElementById(_ec).src+")";
changeOpac(0,_ec);
document.getElementById(_ec).src=_ed;
for(fadeImage_i=0;fadeImage_i<=100;fadeImage_i++){
setTimeout("changeOpac("+fadeImage_i+",'"+_ec+"')",(_f0*_ef));
_f0++;
}
};
function changeOpac(_f1,id){
var _f2=document.getElementById(id).style;
_f2.opacity=(_f1/100);
_f2.MozOpacity=(_f1/100);
_f2.KhtmlOpacity=(_f1/100);
_f2.filter="alpha(opacity="+_f1+")";
};
interactiveLayer=function(){
intLayer=dhtmlmodal.open("iLayer","div","interactiveLayerDiv",alerts["_INTERACTIVE_ELEMENT"],"width=600px,height=130px,center=1,resize=0,scrolling=0");
if($.browser.msie){
intLayer.childNodes[3].style.marginLeft="20px";
}
};
openWindow=function(url){
window.open(url);
};
copyrightSend=function(url){
if(validateCopyright()){
document.getElementById("url_lookingfor").value=url;
document.getElementById("hidAction").value="sendMail";
document.getElementById("frmVivalite").submit();
}else{
return false;
}
};
validateCopyright=function(){
var a=parseInt(document.forms[0].random1.value);
var b=parseInt(document.forms[0].random2.value);
var sum=a+b;
if(document.forms[0].copyemail.value.match(/^ *$/)){
alert(alerts["_ENTER_EMAIL"]);
document.forms[0].copyemail.focus();
return false;
}else{
if(!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w+)+$/.test(document.forms[0].copyemail.value))){
alert(alerts["_INVALID_EMAIL"]);
document.forms[0].copyemail.focus();
return false;
}else{
if(document.forms[0].emailconfirm.value.match(/^ *$/)){
alert(alerts["_REENTER_EMAIL"]);
document.forms[0].emailconfirm.focus();
return false;
}else{
if(document.forms[0].copyemail.value!=document.forms[0].emailconfirm.value){
alert(alerts["_NO_MATCH_EMAIL"]);
document.forms[0].emailconfirm.focus();
return false;
}else{
if(document.forms[0].copydaysel.value==0){
alert(alerts["_SELECT_DAY"]);
document.forms[0].copydaysel.focus();
return false;
}else{
if(document.forms[0].copymonthsel.value==0){
alert(alerts["_SELECT_MONTH"]);
document.forms[0].copymonthsel.focus();
return false;
}else{
if(document.forms[0].copyyearsel.value==0){
alert(alerts["_SELECT_YEAR"]);
document.forms[0].copyyearsel.focus();
return false;
}else{
if(document.forms[0].publisher.value.match(/^ *$/)){
alert(alerts["_PUBLICATION_NAME"]);
document.forms[0].publisher.focus();
return false;
}else{
if(document.forms[0].coverprice.value.match(/^ *$/)){
alert(alerts["_NO_COVERPRICE"]);
document.forms[0].coverprice.focus();
return false;
}else{
if(document.forms[0].copyright_comment.value.match(/^ *$/)){
alert(alerts["_ENTER_DESCRIPTION"]);
document.forms[0].copyright_comment.focus();
return false;
}else{
if(sum!=document.forms[0].copysum.value){
alert(alerts["_INVALID_SUM"]);
document.forms[0].copysum.focus();
return false;
}else{
return true;
}
}
}
}
}
}
}
}
}
}
}
};
function resellerMap(_f3,_f4){
var _f4=(arguments[1])?arguments[1]:5;
map=new google.maps.Map2(document.getElementById("resellerLocation"));
new GKeyboardHandler(map);
map.addControl(new GSmallMapControl());
map.addControl(new GMenuMapTypeControl());
var _f5=new GClientGeocoder();
_f5.getLatLng(_f3,function(_f6){
/*if(_f6==""||_f6==null){
document.getElementById("resellerLocation").style.display="none";
return;
}*/
map.setCenter(_f6,_f4);
var _f7=new GMarker(_f6);
map.addOverlay(_f7);
_f7.bindInfoWindowHtml(_f3);
});
};
function shownotfoundresults(){
if(document.getElementById("txtnotfoundSearch").value.match(/^ *$/)){
alert(alerts["_ENTER_KEYWORD"]);
document.getElementById("txtnotfoundSearch").focus();
return false;
}
searchTxt=document.getElementById("txtnotfoundSearch").value;
location.replace("search_results.html?q="+searchTxt+"&p=1");
};
noSearchResultSend=function(_f8){
var a=parseInt(document.forms[0].searchrandom1.value);
var b=parseInt(document.forms[0].searchrandom2.value);
var sum=a+b;
if(document.forms[0].emailId.value.match(/^ *$/)){
alert(alerts["_ENTER_EMAIL"]);
document.forms[0].emailId.focus();
return;
}else{
if(!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w+)+$/.test(document.forms[0].emailId.value))){
alert(alerts["_INVALID_EMAIL"]);
document.forms[0].emailId.focus();
return;
}else{
if(sum!=document.forms[0].searchsum.value){
alert(alerts["_INVALID_SUM"]);
document.forms[0].searchsum.focus();
return;
}else{
document.getElementById("hidAction").value="noSearchResultMail";
document.getElementById("hidSearchFor").value=_f8;
document.frmVivalite.action="search_results.html";
document.getElementById("frmVivalite").submit();
}
}
}
};
function getMapDirection(e,_f9){
var key;
if(window.event){
e=window.event;
key=e.keyCode;
}else{
if(e.which){
key=e.which;
}
}
if(key=="13"){
getContactMapDirection(_f9);
}
};
getContactMapDirection=function(_fa){
to_location=document.getElementById("contactDirLocation").value;
document.getElementById("route").style.visibility="visible";
document.getElementById("route").innerHTML="";
if(typeof (directions)!="undefined"){
directions.clear();
}
directionsPanel=document.getElementById("route");
directions=new GDirections(contactmap,directionsPanel);
directions.load("from: "+to_location+" to: "+_fa+"");
};
showCheckOther=function(_fb){
if(_fb=="other"){
document.getElementById("otherSubjectDiv").style.display="inline";
}else{
document.getElementById("otherSubjectDiv").style.display="none";
}
return;
};
sendContactUs=function(){
if(validateContactUs()){
document.getElementById("hidAction").value="sendFeedback";
document.getElementById("hidCountryName").value=document.forms[0].country.options[document.forms[0].country.options.selectedIndex].text;
if(document.forms[0].subject.value=="other"){
document.getElementById("hidSubjectName").value=document.forms[0].otherSubject.value;
}else{
document.getElementById("hidSubjectName").value=document.forms[0].subject.options[document.forms[0].subject.options.selectedIndex].text;
}
document.getElementById("frmVivalite").submit();
}else{
return false;
}
};
validateContactUs=function(){
var a=parseInt(document.forms[0].contactrandom1.value);
var b=parseInt(document.forms[0].contactrandom2.value);
var sum=a+b;
var _fc=document.forms[0].trialinstallation.value;
if(document.forms[0].emailId.value.match(/^ *$/)){
alert(alerts["_ENTER_EMAIL"]);
document.forms[0].emailId.focus();
return false;
}else{
if(!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w+)+$/.test(document.forms[0].emailId.value))){
alert(alerts["_INVALID_EMAIL"]);
document.forms[0].emailId.focus();
return false;
}else{
if(document.forms[0].firstName.value.match(/^ *$/)){
alert(alerts["_ENTER_FIRSTNAME"]);
document.forms[0].firstName.focus();
return false;
}else{
if(document.forms[0].lastName.value.match(/^ *$/)){
alert(alerts["_ENTER_LASTNAME"]);
document.forms[0].lastName.focus();
return false;
}else{
if(document.forms[0].country.value=="new"){
alert(alerts["_SELECT_COUNTRY"]);
document.forms[0].country.focus();
return false;
}else{
if(document.forms[0].subject.value=="new"){
alert(alerts["_SELECT_SUBJECT"]);
document.forms[0].subject.focus();
return false;
}else{
if((document.forms[0].subject.value=="other")&&document.forms[0].otherSubject.value.match(/^ *$/)){
alert(alerts["_ENTER_SUBJECT"]);
document.forms[0].otherSubject.focus();
return false;
}else{
if((_fc=="y")&&(document.forms[0].noOfLamps.value.match(/^ *$/))){
alert(alerts["_ENTER_NO_LAMPS"]);
document.forms[0].noOfLamps.focus();
return false;
}else{
if((_fc=="y")&&(!document.forms[0].noOfLamps.value.match(/^\s*\d+\s*$/))){
alert(alerts["_ENTER_NUMERIC"]);
document.forms[0].noOfLamps.focus();
return false;
}else{
if((_fc=="y")&&(document.forms[0].noOfLamps.value<1)){
alert(alerts["_INVALID_QUANTITY"]);
document.forms[0].noOfLamps.focus();
return false;
}else{
if(document.forms[0].detailDesc.value.match(/^ *$/)){
alert(alerts["_ENTER_MESSAGE"]);
document.forms[0].detailDesc.focus();
return false;
}else{
if(sum!=document.forms[0].contactsum.value){
alert(alerts["_INVALID_SUM"]);
document.forms[0].contactsum.focus();
return;
}else{
return true;
}
}
}
}
}
}
}
}
}
}
}
}
};
addTocarInacticeLayer=function(e){
var top;
var _fd;
if((typeof (e.pageX)!="undefined")&&(typeof (e.pageY)!="undefined")){
top=e.pageY-250;
_fd=e.pageX-250;
}else{
if((typeof (e.clientX)!="undefined")&&(typeof (e.clientY)!="undefined")){
_fd=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft-250;
top=e.clientY+document.body.scrollTop+document.documentElement.scrollTop-250;
}
}
var _fe="<div style='text-align:left;top:"+top+";left:"+_fd+";' id='addeventinactive'>";
_fe+="<div style='text-align:right;cursor:pointer;font-weight:bold' onclick='toolTip()'>X</div>";
_fe+="<p style='margin-top:-3px;'>The Viva-Lite International Online Store will be active from May 2009 onwards. We apologize for the inconvenience and hope for your patience.</p><p>If you want to be notified once the store is fully operational, please enter your email address and we shall inform you at the earliest possible time.</p>";
_fe+="Email: <input type='text' id='addcartemailtext' name='addcartemailtext' value='' onkeyup='catchEnterKey(event,\"submitEmail\")'>";
_fe+="<input type='button' name='addcartemailsubmit' value='Submit' onclick='submitEmail()'/>";
_fe+="<p>Thank you and kind regards,</p>";
_fe+="<p>Viva-Lite International Limited.</p>";
_fe+="</div>";
toolTip(_fe,"addTocarInacticeLayer","","",false);
document.getElementById("ToolTip").style.top=top;
document.getElementById("ToolTip").style.left=_fd;
var br=navigator.appName;
if(br=="Microsoft Internet Explorer"){
document.getElementById("ToolTip").attachEvent("onmouseleave",closeLayer);
}else{
document.getElementById("ToolTip").addEventListener("mouseout",closeLayer,false);
}
delete _fe;
};
closeLayer=function(e){
if(!e){
var e=window.event;
}
var tg=(window.event)?e.srcElement:e.target;
if(tg.nodeName!="DIV"){
return;
}
var _ff=(e.relatedTarget)?e.relatedTarget:e.toElement;
while(_ff!=tg&&_ff.nodeName!="BODY"){
_ff=_ff.parentNode;
}
if(_ff==tg){
return;
}
toolTip();
};
submitEmail=function(){
if(document.getElementById("addcartemailtext").value.match(/^ *$/)){
alert(alerts["_ENTER_EMAIL"]);
document.getElementById("addcartemailtext").focus();
return false;
}
if(!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w+)+$/.test(document.getElementById("addcartemailtext").value))){
alert(alerts["_INVALID_EMAIL"]);
document.getElementById("addcartemailtext").focus();
return false;
}
var _100=document.getElementById("addcartemailtext").value;
var _101="hidAction=addtocartInactiveEmailIds&";
_101+="emailId="+_100;
var url=window.location.pathname;
http=getHTTPObject();
http.open("POST",url,true);
http.setRequestHeader("Content-type","application/x-www-form-urlencoded");
http.setRequestHeader("Content-length",_101.length);
http.setRequestHeader("Connection","close");
http.onreadystatechange=function(){
toolTip();
if(http.readyState==4){
alert("Thank you! We will inform you once the store is fully operational.");
}
};
http.send(_101);
};
googleDirectionLayer=function(_102){
document.getElementById("dirFrom").value=_102;
dirWindow=dhtmlmodal.open("googleDirBox","div","googleDirectionMap",alerts["_DIRECTION"],"width=600px,height=300px,center=1,resize=0,scrolling=0");
resellerMap(_102,13);
};
function geteventDirection(e){
var key;
if(window.event){
e=window.event;
key=e.keyCode;
}else{
if(e.which){
key=e.which;
}
}
if(key=="13"){
getEventDirectionMap();
}
};
getEventDirectionMap=function(){
fromLocation=document.getElementById("dirFrom").value;
toLocation=document.getElementById("eventDirLocation").value;
document.getElementById("route").style.visibility="visible";
document.getElementById("route").innerHTML="";
if(typeof (directions)!="undefined"){
directions.clear();
}
directionsPanel=document.getElementById("route");
directions=new GDirections(map,directionsPanel);
directions.load("from: "+toLocation+" to: "+fromLocation+"");
};
saveChanges=function(_103){
var _104=false;
if(document.getElementById("shippingMsg").style.display==""){
_104=true;
}
if(!validateAccountDetails(_104,_103)){
return false;
}
document.getElementById("hidAction").value="updateMyAccount";
document.getElementById("hidSameDelAdd").value=_104;
document.frmVivalite.submit();
};
validateAccountDetails=function(_105,_106){
if(document.forms[0].fname.value.match(/^ *$/)){
alert(alerts["_ENTER_FIRSTNAME"]);
document.forms[0].fname.focus();
return false;
}else{
if(document.forms[0].lname.value.match(/^ *$/)){
alert(alerts["_ENTER_LASTNAME"]);
document.forms[0].lname.focus();
return false;
}else{
if(document.forms[0].phoneCntry.value.match(/^ *$/)){
alert(alerts["_ENTER_PHONECNTRY"]);
document.forms[0].phoneCntry.focus();
return false;
}else{
if(document.forms[0].phoneArea.value.match(/^ *$/)){
alert(alerts["_ENTER_PHONEAREA"]);
document.forms[0].phoneArea.focus();
return false;
}else{
if(document.forms[0].phoneNo.value.match(/^ *$/)){
alert(alerts["_ENTER_PHONENO"]);
document.forms[0].phoneNo.focus();
return false;
}else{
if(document.forms[0].mobCntry.value.match(/^ *$/)){
alert(alerts["_ENTER_PHONECNTRY"]);
document.forms[0].mobCntry.focus();
return false;
}else{
if(document.forms[0].mobNo.value.match(/^ *$/)){
alert(alerts["_ENTER_MOB"]);
document.forms[0].mobNo.focus();
return false;
}else{
if(document.forms[0].email.value.match(/^ *$/)){
alert(alerts["_ENTER_EMAIL"]);
document.forms[0].email.focus();
return false;
}else{
if(!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w+)+$/.test(document.forms[0].email.value))){
alert(alerts["_INVALID_EMAIL"]);
document.forms[0].email.focus();
return false;
}else{
if(document.forms[0].invStreet.value.match(/^ *$/)){
alert(alerts["_ENTER_STREET"]);
document.forms[0].invStreet.focus();
return false;
}else{
if(document.forms[0].invAdditional.value.match(/^ *$/)){
alert(alerts["_ENTER_ADDITIONAL"]);
document.forms[0].invAdditional.focus();
return false;
}else{
if(document.forms[0].invZip.value.match(/^ *$/)){
alert(alerts["_ENTER_ZIP"]);
document.forms[0].invZip.focus();
return false;
}else{
if(document.forms[0].invCity.value.match(/^ *$/)){
alert(alerts["_ENTER_CITY"]);
document.forms[0].invCity.focus();
return false;
}
}
}
}
}
}
}
}
}
}
}
}
}
if(!_105){
if(document.forms[0].shipStreet.value.match(/^ *$/)){
alert(alerts["_ENTER_STREET"]);
document.forms[0].shipStreet.focus();
return false;
}else{
if(document.forms[0].shipAdditional.value.match(/^ *$/)){
alert(alerts["_ENTER_ADDITIONAL"]);
document.forms[0].shipAdditional.focus();
return false;
}else{
if(document.forms[0].shipZip.value.match(/^ *$/)){
alert(alerts["_ENTER_ZIP"]);
document.forms[0].shipZip.focus();
return false;
}else{
if(document.forms[0].shipCity.value.match(/^ *$/)){
alert(alerts["_ENTER_CITY"]);
document.forms[0].shipCity.focus();
return false;
}
}
}
}
}
if(!document.forms[0].oldPasswd.value.match(/^ *$/)){
if(checkOldPasswd(_106)){
if(document.forms[0].newPasswd.value.match(/^ *$/)){
alert(alerts["_ENTER_PASSWD"]);
document.forms[0].newPasswd.focus();
return false;
}else{
if(document.forms[0].newPasswdCnfd.value.match(/^ *$/)){
alert(alerts["_ENTER_PASSWD"]);
document.forms[0].newPasswdCnfd.focus();
return false;
}else{
if(document.forms[0].newPasswd.value!=document.forms[0].newPasswdCnfd.value){
alert(alerts["_PASSWD_NOMATCH"]);
document.forms[0].newPasswdCnfd.focus();
return false;
}
}
}
}else{
alert(alerts["_INCORRECT_PASSWD"]);
document.forms[0].oldPasswd.focus();
return false;
}
}
return true;
};
checkOldPasswd=function(_107){
params="hidAction=checkOldPasswd&";
params+="md5passwd="+_107+"&";
params+="enteredPasswd="+document.getElementById("oldPasswd").value+"&";
url="my-account.html";
http=getHTTPObject();
http.open("POST",url,false);
http.setRequestHeader("Content-type","application/x-www-form-urlencoded");
http.setRequestHeader("Content-length",params.length);
http.setRequestHeader("Connection","close");
http.send(params);
return http.responseText;
};
showRateWindow=function(){
rateWindow=dhtmlmodal.open("rateWindowBox","div","rateWindowDiv","Rate this page","width=610px,height=485px,center=1,resize=0,scrolling=0");
};
changePurpose=function(_108){
if(_108=="other"){
document.getElementById("purposeText").style.display="";
}else{
document.getElementById("purposeText").style.display="none";
}
};
submitRate=function(_109){
commentVal=document.getElementById("comments").value;
if(commentVal==_109||commentVal.match(/^ *$/)){
alert(alerts["_ENTER_MESSAGE"]);
document.getElementById("comments").focus();
return false;
}
params="hidAction=saveRate&";
radios=document.getElementsByName("overall");
var i=0;
for(;i<radios.length;i++){
if(radios[i].checked){
params+="webRate="+radios[i].value+"&";
break;
}
}
if(i==radios.length){
alert(alerts["_RATE_VIVA"]);
return false;
}
params+="comments="+commentVal+"&";
params+="emailId="+document.getElementById("rateEmailId").value+"&";
purpose=(document.getElementById("purposeSelect").value!="other")?document.getElementById("purposeSelect").value:document.getElementById("purposeText").value;
params+="purpose="+purpose+"&";
params+="likelyReturn="+document.getElementById("likelyReturn").value+"&";
params+="likelyRecommend="+document.getElementById("likelyRecommend").value+"&";
params+="fromUrl="+document.URL+"&";
radios=document.getElementsByName("content");
for(var i in radios){
if(radios[i].checked){
params+="pageRate="+radios[i].value+"&";
break;
}
}
url="rate-page.html";
http=getHTTPObject();
http.open("POST",url,true);
http.setRequestHeader("Content-type","application/x-www-form-urlencoded");
http.setRequestHeader("Content-length",params.length);
http.setRequestHeader("Connection","close");
http.onreadystatechange=function(){
if(http.readyState==4){
dhtmlmodal.close(rateWindow);
}
};
http.send(params);
};
funChangeCurrency=function(_10a){
if("undefined"!=typeof (blogtop)){
blogtop.document.getElementById("frmVivalite").action=blogtop.location.href+"?url="+window.location.href;
blogtop.document.getElementById("hidCurrencyIndex").value=_10a;
blogtop.document.getElementById("frmVivalite").submit();
}else{
document.getElementById("hidCurrencyIndex").value=_10a;
document.getElementById("frmVivalite").submit();
}
};
showLargeImage=function(_10b,size){
};
toggleFAQ=function(_10c){
if(document.getElementById(_10c).style.display=="none"){
document.getElementById(_10c).style.display="block";
document.getElementById(_10c).previousSibling.className="minus";
}else{
document.getElementById(_10c).style.display="none";
document.getElementById(_10c).previousSibling.className="plus";
}
};
toggleAll=function(_10d,_10e){
for(var i=1;i<=_10d;i++){
document.getElementById("p_"+i).style.display=_10e;
document.getElementById("p_"+i).previousSibling.className=(_10e=="none")?"plus":"minus";
}
};
submitNewsLetter=function(){
if(validateNewsLetter()){
document.getElementById("hidAction").value="subscribe";
document.getElementById("frmVivalite").submit();
}else{
return false;
}
};
validateNewsLetter=function(){
if(document.getElementById("newsLetterFname").value.match(/^ *$/)){
alert(alerts["_ENTER_FIRSTNAME"]);
document.getElementById("newsLetterFname").focus();
return false;
}else{
if(document.getElementById("newsLetterLname").value.match(/^ *$/)){
alert(alerts["_ENTER_LASTNAME"]);
document.getElementById("newsLetterLname").focus();
return false;
}else{
if(document.getElementById("newsLetterEmail").value.match(/^ *$/)){
alert(alerts["_ENTER_EMAIL"]);
document.getElementById("newsLetterEmail").focus();
return false;
}else{
if(!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w+)+$/.test(document.getElementById("newsLetterEmail").value))){
alert(alerts["_INVALID_EMAIL"]);
document.getElementById("newsLetterEmail").focus();
return false;
}else{
return true;
}
}
}
}
};
submitNewsLetterAjax=function(){
if(validateNewsLetter()){
email=document.getElementById("newsLetterEmail").value;
params="hidAction=subscribe&";
msg=alerts["_MAIL_SEND"];
params+="newsLetterGender="+document.getElementById("newsLetterGender").value+"&";
params+="newsLetterFname="+document.getElementById("newsLetterFname").value+"&";
params+="newsLetterLname="+document.getElementById("newsLetterLname").value+"&";
params+="newsLetterEmail="+email+"&";
params+="frmJs=y";
url="newsletter.html";
http=getHTTPObject();
http.open("POST",url,true);
http.setRequestHeader("Content-type","application/x-www-form-urlencoded");
http.setRequestHeader("Content-length",params.length);
http.setRequestHeader("Connection","close");
http.onreadystatechange=function(){
if(http.readyState==4){
if(http.responseText=="alreadySubscribed"){
alert(alerts["_ALREADY_SUBSCRIBED"]);
}else{
alert(msg);
}
document.getElementById("newsLetterFname").value="";
document.getElementById("newsLetterLname").value="";
document.getElementById("newsLetterEmail").value="";
}
};
http.send(params);
}else{
return false;
}
};
submitReurnOrders=function(){
if(validateReturnOrders()){
if(document.frmVivalite.returnILike[0].checked){
returnILike=document.frmVivalite.returnILike[0].value;
}else{
if(document.frmVivalite.returnILike[1].checked){
returnILike=document.frmVivalite.returnILike[1].value;
}else{
if(document.frmVivalite.returnILike[2].checked){
returnILike=document.frmVivalite.returnILike[2].value;
}
}
}
var _10f=(document.frmVivalite.returnPickup.checked==true)?"on":"off";
params="hidAction=sendForm&";
params+="returnILike="+returnILike+"&";
params+="returnEmail="+document.frmVivalite.returnEmail.value+"&";
params+="returnName="+document.frmVivalite.returnName.value+"&";
params+="returnPhone="+document.frmVivalite.returnPhone.value+"&";
params+="returnDate="+document.frmVivalite.returnDate.value+"&";
params+="returnMonth="+document.frmVivalite.returnMonth.value+"&";
params+="returnYear="+document.frmVivalite.returnYear.value+"&";
params+="returnOrderNo="+document.frmVivalite.returnOrderNo.value+"&";
params+="returnReason="+document.frmVivalite.returnReason.value+"&";
params+="returnComment="+document.frmVivalite.returnComment.value+"&";
params+="returnMailTo="+document.frmVivalite.returnMailTo.value+"&";
params+="returnPickup="+_10f+"&";
url="returns.html";
http=getHTTPObject();
http.open("POST",url,true);
http.setRequestHeader("Content-type","application/x-www-form-urlencoded");
http.setRequestHeader("Content-length",params.length);
http.setRequestHeader("Connection","close");
http.onreadystatechange=function(){
if(http.readyState==4){
if(http.responseText){
alert(alerts["_MAIL_SENT"]);
document.frmVivalite.returnILike[0].checked=true;
document.frmVivalite.returnEmail.value="";
document.frmVivalite.returnName.value="";
document.frmVivalite.returnPhone.value="";
document.frmVivalite.returnOrderNo.value="";
document.frmVivalite.returnDate.options[0].selected=true;
document.frmVivalite.returnMonth.options[0].selected=true;
document.frmVivalite.returnYear.options[0].selected=true;
document.frmVivalite.returnReason.options[0].selected=true;
document.frmVivalite.returnComment.value="";
document.frmVivalite.returnPickup.checked=false;
}else{
alert(alerts["_ERROR_OCCURED"]);
}
}
};
http.send(params);
}else{
return false;
}
};
validateReturnOrders=function(){
if(document.frmVivalite.returnEmail.value.match(/^ *$/)){
alert(alerts["_ENTER_EMAIL"]);
document.frmVivalite.returnEmail.focus();
return false;
}else{
if(!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w+)+$/.test(document.frmVivalite.returnEmail.value))){
alert(alerts["_INVALID_EMAIL"]);
document.frmVivalite.returnEmail.focus();
return false;
}else{
if(document.frmVivalite.returnName.value.match(/^ *$/)){
alert(alerts["_ENTER_NAME"]);
document.frmVivalite.returnName.focus();
return false;
}else{
if(document.frmVivalite.returnPhone.value.match(/^ *$/)){
alert(alerts["_ENTER_PHONENO"]);
document.frmVivalite.returnPhone.focus();
return false;
}else{
if((document.frmVivalite.returnOrderNo.value.match(/^ *$/))&&(document.forms[0].returnDate.value==0)&&(document.forms[0].returnMonth.value==0&&(document.forms[0].returnYear.value==0))){
alert(alerts["_ENTER_ORDERNO"]);
document.frmVivalite.returnOrderNo.focus();
return false;
}else{
if((document.forms[0].returnDate.value==0)&&(document.frmVivalite.returnOrderNo.value.match(/^ *$/))){
alert(alerts["_SELECT_DAY"]);
document.forms[0].returnDate.focus();
return false;
}else{
if((document.forms[0].returnMonth.value==0)&&(document.frmVivalite.returnOrderNo.value.match(/^ *$/))){
alert(alerts["_SELECT_MONTH"]);
document.forms[0].returnMonth.focus();
return false;
}else{
if((document.forms[0].returnYear.value==0)&&(document.frmVivalite.returnOrderNo.value.match(/^ *$/))){
alert(alerts["_SELECT_YEAR"]);
document.forms[0].returnYear.focus();
return false;
}else{
if(document.forms[0].returnComment.value.match(/^ *$/)){
alert(alerts["_ENTER_COMMENT"]);
document.forms[0].returnComment.focus();
return false;
}else{
return true;
}
}
}
}
}
}
}
}
}
};
function getCookie(name){
var c=document.cookie;
var _110=c.match(new RegExp("(?:^|; )"+escapeString(name)+"=([^;]*)"));
return _110?decodeURIComponent(_110[1]):undefined;
};
escapeString=function(str,_111){
return str.replace(/([\.$?*!=:|{}\(\)\[\]\\\/^])/g,function(ch){
if(_111&&_111.indexOf(ch)!=-1){
return ch;
}
return "\\"+ch;
});
};
function changeDomain(el,_112){
if(document.getElementById("cartSection").style.display==""){
var _113=el.getAttribute("href");
var _114=document.domain;
el.setAttribute("href",_113+"?PHPSESSID="+getCookie("PHPSESSID"));
params="hidValAction=changetopdomain&topdomain="+_112+"&currdomain="+_114;
url="login.html";
http=getHTTPObject();
http.open("POST",url,false);
http.setRequestHeader("Content-type","application/x-www-form-urlencoded");
http.setRequestHeader("Content-length",params.length);
http.setRequestHeader("Connection","close");
http.onreadystatechange=function(){
if(http.readyState==4){
return true;
}
};
http.send(params);
}else{
return true;
}
};
var dhtmlwindow={imagefiles:["windowfiles/min.gif","themes/vivaliteTheme/images/5036.gif","windowfiles/restore.gif","windowfiles/resize.gif"],ajaxbustcache:true,ajaxloadinghtml:"<b>Loading Page. Please wait...</b>",minimizeorder:0,zIndexvalue:100,tobjects:[],lastactivet:{},init:function(t){
var _115=document.createElement("div");
_115.id=t;
_115.className="dhtmlwindow";
var _116="";
if($.browser.msie){
_116="<div class=\"dhtml_top_left\"></div><div class=\"dhtml_top\"></div><div class=\"dhtml_top_right\"></div>";
_116+="<div class=\"drag-handle\">";
_116+="DHTML Window <div class=\"drag-controls\"><img src=\""+this.imagefiles[0]+"\" title=\"Minimize\" /><img src=\""+this.imagefiles[1]+"\" title=\"Close\" /></div></div><div class=\"dhtml_left\">";
_116+="</div><div class=\"drag-contentarea\"></div><div class=\"dhtml_right\"></div>";
_116+="<div class=\"drag-statusarea\"><div class=\"drag-resizearea\" style=\"background: transparent url("+this.imagefiles[3]+") top right no-repeat;\">&nbsp;</div></div>";
_116+="<div class=\"dhtml_bottom_left\"></div><div class=\"dhtml_bottom\"></div><div class=\"dhtml_bottom_right\"></div>";
_116+="</div>";
}else{
_116="<div class=\"dhtml_top_left\"></div><div class=\"dhtml_top\"></div><div class=\"dhtml_top_right\"></div>";
_116+="<div class=\"dhtml_left\"><div class=\"drag-handle\">";
_116+="DHTML Window <div class=\"drag-controls\"><img src=\""+this.imagefiles[0]+"\" title=\"Minimize\" /><img src=\""+this.imagefiles[1]+"\" title=\"Close\" /></div></div>";
_116+="</div><div class=\"drag-contentarea\"></div><div class=\"dhtml_right\"></div>";
_116+="<div class=\"drag-statusarea\"><div class=\"drag-resizearea\" style=\"background: transparent url("+this.imagefiles[3]+") top right no-repeat;\">&nbsp;</div></div>";
_116+="<div class=\"dhtml_bottom_left\"></div><div class=\"dhtml_bottom\"></div><div class=\"dhtml_bottom_right\"></div>";
_116+="</div>";
}
_115.innerHTML=_116;
document.getElementById("dhtmlwindowholder").appendChild(_115);
var t=document.getElementById(t);
var divs=t.getElementsByTagName("div");
for(var i=0;i<divs.length;i++){
if(/drag-/.test(divs[i].className)){
t[divs[i].className.replace(/drag-/,"")]=divs[i];
}
}
t.handle._parent=t;
t.resizearea._parent=t;
t.controls._parent=t;
t.onclose=function(){
return true;
};
t.onmousedown=function(){
dhtmlwindow.setfocus(this);
};
t.handle.onmousedown=dhtmlwindow.setupdrag;
t.resizearea.onmousedown=dhtmlwindow.setupdrag;
t.controls.onclick=dhtmlwindow.enablecontrols;
t.show=function(){
dhtmlwindow.show(this);
};
t.hide=function(){
dhtmlwindow.hide(this);
};
t.close=function(){
dhtmlwindow.close(this);
};
t.setSize=function(w,h){
dhtmlwindow.setSize(this,w,h);
};
t.moveTo=function(x,y){
dhtmlwindow.moveTo(this,x,y);
};
t.isResize=function(bol){
dhtmlwindow.isResize(this,bol);
};
t.isScrolling=function(bol){
dhtmlwindow.isScrolling(this,bol);
};
t.load=function(_117,_118,_119){
dhtmlwindow.load(this,_117,_118,_119);
};
this.tobjects[this.tobjects.length]=t;
return t;
},open:function(t,_11a,_11b,_11c,attr,_11d){
var d=dhtmlwindow;
function _11e(Name){
var _11f=new RegExp(Name+"=([^,]+)","i");
return (_11f.test(attr))?parseInt(RegExp.$1):0;
};
if(document.getElementById(t)==null){
t=this.init(t);
}else{
t=document.getElementById(t);
}
this.setfocus(t);
t.setSize(_11e(("width")),(_11e("height")));
var xpos=_11e("center")?"middle":_11e("left");
var ypos=_11e("center")?"middle":_11e("top");
if(typeof _11d!="undefined"&&_11d=="recal"&&this.scroll_top==0){
if(window.attachEvent&&!window.opera){
this.addEvent(window,function(){
setTimeout(function(){
t.moveTo(xpos,ypos);
},400);
},"load");
}else{
this.addEvent(window,function(){
t.moveTo(xpos,ypos);
},"load");
}
}
t.isResize(_11e("resize"));
t.isScrolling(_11e("scrolling"));
t.style.visibility="visible";
t.style.display="block";
t.contentarea.style.display="block";
t.moveTo(xpos,ypos);
t.load(_11a,_11b,_11c);
if(t.state=="minimized"&&t.controls.firstChild.title=="Restore"){
t.controls.firstChild.setAttribute("src",dhtmlwindow.imagefiles[0]);
t.controls.firstChild.setAttribute("title","Minimize");
t.state="fullview";
}
return t;
},setSize:function(t,w,h){
w=Math.max(parseInt(w),150);
t.style.width=w+"px";
h=Math.max(parseInt(h),100);
t.contentarea.style.width=(w-91)+"px";
t.childNodes[1].style.width=(w-92)+"px";
if($.browser.msie){
t.handle.style.width=(w-67)+"px";
t.contentarea.style.height=(h+8)+"px";
t.childNodes[9].style.width=(w-92)+"px";
t.contentarea.previousSibling.style.height=(h+7)+"px";
t.contentarea.nextSibling.style.height=(h+7)+"px";
}else{
t.contentarea.previousSibling.style.height=(h+8)+"px";
t.contentarea.nextSibling.style.height=(h+8)+"px";
t.handle.style.width=(w-85)+"px";
t.contentarea.style.height=(h)+"px";
t.childNodes[8].style.width=(w-92)+"px";
}
},moveTo:function(t,x,y){
this.getviewpoint();
t.style.left=(x=="middle")?this.scroll_left+(this.docwidth-t.offsetWidth)/2+"px":this.scroll_left+parseInt(x)+"px";
t.style.top=(y=="middle")?this.scroll_top+(this.docheight-t.offsetHeight)/2+"px":this.scroll_top+parseInt(y)+"px";
},isResize:function(t,bol){
t.statusarea.style.display=(bol)?"block":"none";
t.resizeBool=(bol)?1:0;
},isScrolling:function(t,bol){
t.contentarea.style.overflow=(bol)?"auto":"hidden";
},load:function(t,_120,_121,_122){
if(t.isClosed){
alert("DHTML Window has been closed, so no window to load contents into. Open/Create the window again.");
return;
}
var _120=_120.toLowerCase();
if(typeof _122!="undefined"){
t.handle.firstChild.nodeValue=_122;
}
if(_120=="inline"){
t.contentarea.innerHTML=_121;
}else{
if(_120=="div"){
var _123=document.getElementById(_121);
t.contentarea.innerHTML=(_123.defaultHTML||_123.innerHTML);
if(!_123.defaultHTML){
_123.defaultHTML=_123.innerHTML;
}
_123.innerHTML="";
_123.style.display="none";
}else{
if(_120=="iframe"){
t.contentarea.style.overflow="hidden";
if(!t.contentarea.firstChild||t.contentarea.firstChild.tagName!="IFRAME"){
t.contentarea.innerHTML="<iframe src=\"\" style=\"margin:0; padding:0; width:100%; height: 100%\" name=\"_iframe-"+t.id+"\"></iframe>";
}
window.frames["_iframe-"+t.id].location.replace(_121);
}else{
if(_120=="ajax"){
this.ajax_connect(_121,t);
}
}
}
}
t.contentarea.datatype=_120;
},setupdrag:function(e){
var d=dhtmlwindow;
var t=this._parent;
d.etarget=this;
var e=window.event||e;
d.initmousex=e.clientX;
d.initmousey=e.clientY;
d.initx=parseInt(t.offsetLeft);
d.inity=parseInt(t.offsetTop);
d.width=parseInt(t.offsetWidth);
d.contentheight=parseInt(t.contentarea.offsetHeight);
if(t.contentarea.datatype=="iframe"){
t.style.backgroundColor="#F8F8F8";
t.contentarea.style.visibility="hidden";
}
document.onmousemove=d.getdistance;
document.onmouseup=function(){
if(t.contentarea.datatype=="iframe"){
t.contentarea.style.backgroundColor="white";
t.contentarea.style.visibility="visible";
}
d.stop();
};
return false;
},getdistance:function(e){
var d=dhtmlwindow;
var _124=d.etarget;
var e=window.event||e;
d.distancex=e.clientX-d.initmousex;
d.distancey=e.clientY-d.initmousey;
if(_124.className=="drag-handle"){
d.move(_124._parent,e);
}else{
if(_124.className=="drag-resizearea"){
d.resize(_124._parent,e);
}
}
return false;
},getviewpoint:function(){
var ie=document.all&&!window.opera;
var _125=document.documentElement&&parseInt(document.documentElement.clientWidth)||100000;
this.standardbody=(document.compatMode=="CSS1Compat")?document.documentElement:document.body;
this.scroll_top=(ie)?this.standardbody.scrollTop:window.pageYOffset;
this.scroll_left=(ie)?this.standardbody.scrollLeft:window.pageXOffset;
this.docwidth=(ie)?this.standardbody.clientWidth:(/Safari/i.test(navigator.userAgent))?window.innerWidth:Math.min(_125,window.innerWidth-16);
this.docheight=(ie)?this.standardbody.clientHeight:window.innerHeight;
},rememberattrs:function(t){
this.getviewpoint();
t.lastx=parseInt((t.style.left||t.offsetLeft))-dhtmlwindow.scroll_left;
t.lasty=parseInt((t.style.top||t.offsetTop))-dhtmlwindow.scroll_top;
t.lastwidth=parseInt(t.style.width);
},move:function(t,e){
t.style.left=dhtmlwindow.distancex+dhtmlwindow.initx+"px";
t.style.top=dhtmlwindow.distancey+dhtmlwindow.inity+"px";
},resize:function(t,e){
t.style.width=Math.max(dhtmlwindow.width+dhtmlwindow.distancex,150)+"px";
t.contentarea.style.height=Math.max(dhtmlwindow.contentheight+dhtmlwindow.distancey,100)+"px";
},enablecontrols:function(e){
var d=dhtmlwindow;
var _126=window.event?window.event.srcElement:e.target;
if(/Minimize/i.test(_126.getAttribute("title"))){
d.minimize(_126,this._parent);
}else{
if(/Restore/i.test(_126.getAttribute("title"))){
d.restore(_126,this._parent);
}else{
if(/Close/i.test(_126.getAttribute("title"))){
d.close(this._parent);
}
}
}
return false;
},minimize:function(_127,t){
dhtmlwindow.rememberattrs(t);
_127.setAttribute("src",dhtmlwindow.imagefiles[2]);
_127.setAttribute("title","Restore");
t.state="minimized";
t.contentarea.style.display="none";
t.statusarea.style.display="none";
if(typeof t.minimizeorder=="undefined"){
dhtmlwindow.minimizeorder++;
t.minimizeorder=dhtmlwindow.minimizeorder;
}
t.style.left="10px";
t.style.width="200px";
var _128=t.minimizeorder*10;
t.style.top=dhtmlwindow.scroll_top+dhtmlwindow.docheight-(t.handle.offsetHeight*t.minimizeorder)-_128+"px";
},restore:function(_129,t){
dhtmlwindow.getviewpoint();
_129.setAttribute("src",dhtmlwindow.imagefiles[0]);
_129.setAttribute("title","Minimize");
t.state="fullview";
t.style.display="block";
t.contentarea.style.display="block";
if(t.resizeBool){
t.statusarea.style.display="block";
}
t.style.left=parseInt(t.lastx)+dhtmlwindow.scroll_left+"px";
t.style.top=parseInt(t.lasty)+dhtmlwindow.scroll_top+"px";
t.style.width=parseInt(t.lastwidth)+"px";
},close:function(t){
try{
var _12a=t.onclose();
}
catch(err){
var _12a=true;
}
finally{
if(typeof _12a=="undefined"){
alert("An error has occured somwhere inside your \"onclose\" event handler");
var _12a=true;
}
}
if(_12a){
if(t.state!="minimized"){
dhtmlwindow.rememberattrs(t);
}
if(window.frames["_iframe-"+t.id]){
window.frames["_iframe-"+t.id].location.replace("about:blank");
}else{
t.contentarea.innerHTML="";
}
t.style.display="none";
t.isClosed=true;
}
return _12a;
},setopacity:function(_12b,_12c){
if(!_12b){
return;
}
if(_12b.filters&&_12b.filters[0]){
if(typeof _12b.filters[0].opacity=="number"){
_12b.filters[0].opacity=_12c*100;
}else{
_12b.style.filter="alpha(opacity="+_12c*100+")";
}
}else{
if(typeof _12b.style.MozOpacity!="undefined"){
_12b.style.MozOpacity=_12c;
}else{
if(typeof _12b.style.opacity!="undefined"){
_12b.style.opacity=_12c;
}
}
}
},setfocus:function(t){
this.zIndexvalue++;
t.style.zIndex=this.zIndexvalue;
t.isClosed=false;
this.setopacity(this.lastactivet.handle,0.5);
this.setopacity(t.handle,1);
this.lastactivet=t;
},show:function(t){
if(t.isClosed){
alert("DHTML Window has been closed, so nothing to show. Open/Create the window again.");
return;
}
if(t.lastx){
dhtmlwindow.restore(t.controls.firstChild,t);
}else{
t.style.display="block";
}
this.setfocus(t);
t.state="fullview";
},hide:function(t){
t.style.display="none";
},ajax_connect:function(url,t){
var _12d=false;
var _12e="";
if(window.XMLHttpRequest){
_12d=new XMLHttpRequest();
}else{
if(window.ActiveXObject){
try{
_12d=new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e){
try{
_12d=new ActiveXObject("Microsoft.XMLHTTP");
}
catch(e){
}
}
}else{
return false;
}
}
t.contentarea.innerHTML=this.ajaxloadinghtml;
_12d.onreadystatechange=function(){
dhtmlwindow.ajax_loadpage(_12d,t);
};
if(this.ajaxbustcache){
_12e=(url.indexOf("?")!=-1)?"&"+new Date().getTime():"?"+new Date().getTime();
}
_12d.open("GET",url+_12e,true);
_12d.send(null);
},ajax_loadpage:function(_12f,t){
if(_12f.readyState==4&&(_12f.status==200||window.location.href.indexOf("http")==-1)){
t.contentarea.innerHTML=_12f.responseText;
}
},stop:function(){
dhtmlwindow.etarget=null;
document.onmousemove=null;
document.onmouseup=null;
},addEvent:function(_130,_131,_132){
var _132=(window.addEventListener)?_132:"on"+_132;
if(_130.addEventListener){
_130.addEventListener(_132,_131,false);
}else{
if(_130.attachEvent){
_130.attachEvent(_132,_131);
}
}
},cleanup:function(){
for(var i=0;i<dhtmlwindow.tobjects.length;i++){
dhtmlwindow.tobjects[i].handle._parent=dhtmlwindow.tobjects[i].resizearea._parent=dhtmlwindow.tobjects[i].controls._parent=null;
}
window.onload=null;
}};
document.write("<div id=\"dhtmlwindowholder\"><span style=\"display:none\">.</span></div>");
window.onunload=dhtmlwindow.cleanup;
if(typeof dhtmlwindow=="undefined"){
alert("ERROR: Modal Window script requires all files from \"DHTML Window widget\" in order to work!");
}
var dhtmlmodal={veilstack:0,open:function(t,_133,_134,_135,attr,_136){
var d=dhtmlwindow;
this.interVeil=document.getElementById("interVeil");
this.veilstack++;
this.loadveil();
if(_136=="recal"&&d.scroll_top==0){
d.addEvent(window,function(){
dhtmlmodal.adjustveil();
},"load");
}
var t=d.open(t,_133,_134,_135,attr,_136);
t.controls.firstChild.style.display="none";
t.controls.onclick=function(){
dhtmlmodal.close(this._parent,true);
};
t.show=function(){
dhtmlmodal.show(this);
};
t.hide=function(){
dhtmlmodal.close(this);
};
return t;
},loadveil:function(){
var d=dhtmlwindow;
d.getviewpoint();
this.docheightcomplete=(d.standardbody.offsetHeight>d.standardbody.scrollHeight)?d.standardbody.offsetHeight:d.standardbody.scrollHeight;
this.interVeil.style.left=0;
this.interVeil.style.top=0;
this.interVeil.style.visibility="visible";
this.interVeil.style.display="block";
},adjustveil:function(){
if(this.interVeil&&this.interVeil.style.display=="block"){
this.loadveil();
}
},closeveil:function(){
this.veilstack--;
if(this.veilstack==0){
this.interVeil.style.display="none";
}
},close:function(t,_137){
t.contentDoc=(t.contentarea.datatype=="iframe")?window.frames["_iframe-"+t.id].document:t.contentarea;
if(typeof _137!="undefined"){
t.onclose=function(){
return true;
};
}
if(dhtmlwindow.close(t)){
this.closeveil();
}
},show:function(t){
dhtmlmodal.veilstack++;
dhtmlmodal.loadveil();
dhtmlwindow.show(t);
}};
document.write("<div id=\"interVeil\"></div>");
dhtmlwindow.addEvent(window,function(){
if(typeof dhtmlmodal!="undefined"){
dhtmlmodal.adjustveil();
}
},"resize");
function openCO2statsLayer(){
var path=document.location.href;
var pos=path.lastIndexOf("/");
pos++;
var ref=path.substr(pos);
if(pos==path.length&&(ref==""||ref=="blogfooter.html")){
ref="home.html";
}
url="http://www.co2stats.com/certpro.php?s=1025027&ref=http://www.viva-lite.com/"+ref;
window.open(url,"","left=300, top=100, width=532, height=550, location=no, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, googlebar=no, statusbar=yes, screenX=0, screenY=0");
};
searchOrder=function(){
document.frmVivalite.submit();
};
function getRandom(min,max){
return (Math.round(Math.random()*(max-min)))+min;
};

function updateProductService()
{	

	params  = 'hidAction=updateproductservice';       

	url = 'checkout_success.html';
	http = getHTTPObject(); // We create the HTTP Object
	http.open("POST", url, true);
	//With the below lines we are basically saying that the data send is in the format of a form submission.
	http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	http.setRequestHeader("Content-length", params.length);//We also give the length of the parameters we are sending.
	http.setRequestHeader("Connection", "close");
	http.onreadystatechange = function (){
		if(http.readyState==4){
				if(http.responseText){
						 document.getElementById('msgupdateButton').style.display ='none';
						 document.getElementById('msgUpdateService').style.display ='';
				}	
		}
	};
	http.send(params);
}



hideNewsletterInput = function (fieldval){

		if(document.getElementById('hpNewsletterSubscription').value==fieldval){

			document.getElementById('hpNewsletterSubscription').value= '';

		}


}
showNewsletterInput = function (fieldval){

		if(document.getElementById('hpNewsletterSubscription').value==''){

			document.getElementById('hpNewsletterSubscription').value= fieldval;

		}


}


sendNewsletterSubscription = function (){
	var email =  document.getElementById('hpNewsletterSubscription').value;
	 if( email.match(/^ *$/)){
		//no email
		alert(alerts['_ENTER_EMAIL']);
		document.getElementById('hpNewsletterSubscription').focus();
		return false;
	}else if(!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w+)+$/.test(email))){
		//invalid email
		alert(alerts['_INVALID_EMAIL']);
		document.getElementById('hpNewsletterSubscription').focus();
		return false;
	}
	params  = 'hidAction=subscribeNewsLetter';       
	params += "&email="+email;
	url = 'home.html';
	http = getHTTPObject();
	http.open("POST", url, true);
	http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	http.setRequestHeader("Content-length", params.length);//We also give the length of the parameters we are sending.
	http.setRequestHeader("Connection", "close");
	http.onreadystatechange = function (){
		if(http.readyState==4){
			if(http.responseText){
				 $("#newsletterHP").fadeOut("slow",function(){$("#newsletterHP").css('display','none');$("#newsletterHPMessage").css('display','');$("#newsletterHPMessage").fadeIn("slow");});
			}
		}
	};
	http.send(params);
}

chkEnter = function(e){
	var key;
    if (window.event){
		e = window.event;
		key = e.keyCode;
    }else if(e.which){
        key = e.which;
    }
    if ( key == '13' ){
        sendNewsletterSubscription();
        return false;
    }else{
        return true;
    }
}




function openBeforeImageLayer(){
//Open a modal window populated with the contents of a hidden DIV, and assign the result to a global variable called "emailwindow"
	dhtmlmodal.open('layername', 'div', 'beforeImageDiv', 'With Normal Halogen', 'width=350px,height=340px,center=1,resize=0,scrolling=0');
}

function openAfterImageLayer(){
//Open a modal window populated with the contents of a hidden DIV, and assign the result to a global variable called "emailwindow"
	dhtmlmodal.open('layername', 'div', 'afterImageDiv', 'With Viva-Lite® Halogen', 'width=350px,height=340px,center=1,resize=0,scrolling=0');
}
// to make the prod scrool and event scroll number text decoration none
function 	makeTextDecNone(elmtid,count){
	for (i=1; i<=count; i++){
		id= elmtid+i ;
		document.getElementById(id).style.textDecoration  = 'none';
	}
}