selected=["a1","b1","c1","d1"];function showhide(a,b){for(var c=null,d=null,e=0;e<selected.length;e++)if(a==selected[e].substring(0,1)){c=selected[e];d=e}if(c!=a+b){document.getElementById(a+b).className="active";document.getElementById(a+"div"+b).style.display="block";document.getElementById(a+"div"+c.substring(1)).style.display="none";document.getElementById(c).className=" ";selected[d]=a+b}}function ChangeMe(){document.getElementById("name").value=""} function showdiv(){document.getElementById("sub_layer").style.display="block"}function hidediv(){document.getElementById("sub_layer").style.display="none"}function clr(a){clearInterval(tr);currli=parseInt(a)-1;tmr();tr=setInterval("tmr()",1500)}var currli=0,tr=setInterval("tmr()",1500);function tmr(){currli+=1;if(currli!=1)if(currli!=2)if(currli==3)currli=0}var prev=null;function showCategories(a){document.getElementById(a).style.display="block"} function showhidenav(a){var b=a.split("a")[1];if(prev==null){var c=document.getElementById("a"+b);c=findPos(c);document.getElementById("div"+b).style.display="block";document.getElementById("div"+b).style.left=findPos(document.getElementById("left_navigation"))[0]+document.getElementById("left_navigation").offsetWidth+"px";document.getElementById("div"+b).style.top=c[1]+0+"px"}else{document.getElementById("div"+prev.split("a")[1]).style.display="none";c=document.getElementById("a"+b);c=findPos(c); document.getElementById("div"+b).style.left=findPos(document.getElementById("left_navigation"))[0]+document.getElementById("left_navigation").offsetWidth+"px";document.getElementById("div"+b).style.top=c[1]+0+"px";document.getElementById("div"+b).style.display="block"}prev=a} function showhidemenu(a){var b=a.split("a")[1];if(prev==null){document.getElementById("a"+b);document.getElementById("div"+b).style.display="block";xy=findPos(document.getElementById(a));document.getElementById("div"+b).style.left=xy[1]+"px";document.getElementById("div"+b).style.marginTop="-21px"}else{document.getElementById("div"+prev.split("a")[1]).style.display="none";document.getElementById("a"+b);xy=findPos(document.getElementById(a));document.getElementById("div"+b).style.left=xy[1]+"px";document.getElementById("div"+ b).style.marginTop="-21px";document.getElementById("div"+b).style.display="block"}prev=a}function toggle_div(a,b){obj=document.getElementById(b);if(a==1){if(obj)obj.style.display="block"}else if(obj)obj.style.display="none"}function toggle_layer(a,b){if(a==1){if(b)b.style.display="block"}else if(b)b.style.display="none"}function findPos(a){var b=curtop=0;if(a.offsetParent){do{b+=a.offsetLeft;curtop+=a.offsetTop}while(a=a.offsetParent);return[b,curtop]}} function hide(a){document.getElementById(a).style.display="none"}function hideDiv(a){document.getElementById(a).style.display="none"}function hideall(){}function createRequestObject(){var a;if(window.XMLHttpRequest)a=new XMLHttpRequest;else if(window.ActiveXObject)a=new ActiveXObject("Microsoft.XMLHTTP");else alert("Your browser is not IE 5 or higher, or Firefox or Safari or Opera");return a} function sendRequestAjax(a,b,c){if(a=="get"||a=="GET"){if(c=="promo2"){var d=createRequestObject();d.open(a,b,true);d.onreadystatechange=function(){if(d.readyState==4&&d.status==200){var f=d.responseText;if(f)document.getElementById("homediv2").innerHTML=f}};d.send(null)}if(c=="promo3"){var e=createRequestObject();e.open(a,b,true);e.onreadystatechange=function(){if(e.readyState==4&&e.status==200){var f=e.responseText;if(f)document.getElementById("homediv3").innerHTML=f}};e.send(null)}}} function startTime(){var a=new Date(new Date-offset),b=a.getHours(),c=a.getMinutes();a=a.getSeconds();c=checkTime(c);a=checkTime(a);document.getElementById("clock").innerHTML=b+":"+c+":"+a;t=setTimeout("startTime()",500)}function checkTime(a){if(a<10)a="0"+a;return a}function trimAll(a){for(;a.substring(0,1)==" ";)a=a.substring(1,a.length);for(;a.substring(a.length-1,a.length)==" ";)a=a.substring(0,a.length-1);return a} function Quant(){var a=trimAll(document.getElementById("quantityBox").value);if(isValidNZPosInt(a))document.getElementById("WC_CachedItemDisplay_FormInput_quantity_In_OrderItemAddForm_1").value=a;else{alert("Enter a valid quantity");document.getElementById("quantityBox").value=1}}function isEmpty(a){return typeof a=="string"?!a.match(/[^\s]/):a?false:true}function submitFormReview(){document.ReviewForm.submit()} function showhide5(a){if(a=="c1"){document.getElementById("c1").className="active";document.getElementById("c2").className=" ";document.getElementById("c3").className=" ";document.getElementById("productDetails").style.display="block";document.getElementById("returnPolicy").style.display="none";document.getElementById("sellerInfo").style.display="none"}else if(a=="c2"){document.getElementById("c1").className=" ";document.getElementById("c2").className="active";document.getElementById("c3").className= " ";document.getElementById("productDetails").style.display="none";document.getElementById("returnPolicy").style.display="block";document.getElementById("sellerInfo").style.display="none"}else if(a=="c3"){document.getElementById("c1").className=" ";document.getElementById("c2").className=" ";document.getElementById("c3").className="active";document.getElementById("productDetails").style.display="none";document.getElementById("returnPolicy").style.display="none";document.getElementById("sellerInfo").style.display= "block"}else{document.getElementById("c1").className="active";document.getElementById("c2").className=" ";document.getElementById("c3").className=" ";document.getElementById("productDetails").style.display="block";document.getElementById("returnPolicy").style.display="none";document.getElementById("sellerInfo").style.display="none"}} function priceDiv(a){for(var b=document.getElementById("itemcount").value,c=1;c<=b;c++){var d=document.getElementById("itemA_"+c).value;document.getElementById("listPrice_"+d).style.display="none";document.getElementById("pricediv_"+d).style.display="none";document.getElementById("contractPrice_"+d).style.display="none";document.getElementById("image_"+d).style.display="none";document.getElementById("thumbNail_"+d).style.display="none";document.getElementById("starRating_"+d).style.display="none"; document.getElementById("itemName_"+d).style.display="none";document.getElementById("itemLongDescription_"+d).style.display="none"}document.getElementById("listPrice_"+a).style.display="block";document.getElementById("pricediv_"+a).style.display="block";document.getElementById("contractPrice_"+a).style.display="block";document.getElementById("image_"+a).style.display="block";document.getElementById("thumbNail_"+a).style.display="block";document.getElementById("starRating_"+a).style.display="block"; document.getElementById("itemName_"+a).style.display="block";document.getElementById("itemLongDescription_"+a).style.display="block";if(document.getElementById("hasImage_"+a).value!=""){changeImage(0,a);document.getElementById("hasThumbnailImage_"+a).value!=""&&showThumbnail(a)}} function DisplayAttributes(){for(var a=document.getElementById("itemcount").value,b=document.getElementById("AttrCount").value,c,d=false,e=1;e<=a;e++){var f=true,g=true;if(!d){for(var h=1;h<=b;h++){var l=document.getElementById("attrKey_"+h).value,j=document.getElementById("attrValue_"+h).value;l=document.getElementById(l+"_"+e).value;if(g&&f)if(l==j)f=true;else f=g=false}if(f&&g){c=document.getElementById("itemA_"+e).value;d=true}}}if(d){priceDiv(c);auctionDiv(c);activateCODEMIDiv(c);document.getElementById("catEntryIdOrd").value= c;if(document.getElementById("itemPreOrderable_"+c).value=="1")document.getElementById("maxQtyItem").value=document.getElementById("preOrderMaxQty_"+c).value}else document.getElementById("catEntryIdOrd").value=0} function activateCODEMIDiv(a){var b="",c=false;if(document.getElementById("emiFlag_"+a).value=="Y"){b="<img src='${jspStoreImgDir}images/emi.jpg' width='70' height='37'/>";c=true}if(document.getElementById("codFlag_"+a).value=="Y"){if(b!="")b+="<img src='${jspStoreImgDir}images/cod.jpg' width='70' height='37' />";else b="<img src='${jspStoreImgDir}images/cod.jpg' width='70' height='37'/>";c=true}if(c)document.getElementById("codEMI").innerHTML=b;else document.getElementById("codEMI").innerHTML=""} function proxyCheck(a){var b=a.value;if(a.checked){document.getElementById("Upgrademail_"+b).checked=false;document.getElementById("Upgrademail_"+b).disabled="disabled";document.getElementById("startBid_"+b).style.display="none";document.getElementById("upperlimit_"+b).style.display="";a=document.getElementById("possibleStartLimit_"+b).value;document.getElementById("bidamount_"+b).value=a}else{document.getElementById("Upgrademail_"+b).disabled=false;document.getElementById("bidamount_"+b).value=""; document.getElementById("upperlimit_"+b).value="";document.getElementById("startBid_"+b).style.display="";document.getElementById("upperlimit_"+b).style.display="none"}}function disableUpgradeMail(a){a.Upgrademail.disabled=a.Upgrademail.disabled==true?false:true} function PlaceBidSubmit(a){a.action="UserAuthorityCheck";a.method="post";var b=0,c=a.Quantity.value,d=a.bidamount.value,e=a.upperlimit.value,f=a.maxBidAmount.value,g=a.inc.value,h=a.highBid.value,l=a.availquantity.value,j=a.auctquantity.value,p=a.totalBids.value,o=a.startBid.value,q=a.minQuantity.value,m=parseFloat(e);f=parseFloat(f);var k=parseFloat(d),r=/^[0-9]+$/;if(c==1){if(a.proxybid.checked==true)b=1;a.proxybidcheck.value=b}if(l==1&&b==0)a.Upgrademailcheck.value=a.Upgrademail.checked==true? 1:0;if(e!=""&&b==0)if(confirm("You have entered the upper limit but have not checked the proxy bid option. Do you want to place a proxy bid?")){b=1;a.Upgrademailcheck.value=1}else return;var n=o!=""?o:h;c=m-parseFloat(n);n=k-parseFloat(n);n=parseFloat(n);c=parseFloat(c);parseFloat(g);if(d==""||d==null)alert("Bid Value should not be empty ");else if(isValidDecimal(d)){if(parseFloat(p)==0||parseFloat(j)>1)if(k<parseFloat(o)){alert("Bid Value should be greater than or equal to StartBid Value (Rs."+parseFloat(o).toFixed(2)+ ")");return}if(l==1){if(k!=""||m!="")if(k==m){alert("Bid Value and the Upper Limit cannot be the equal");return}else if(!isValidDecimal(e)){alert("Enter Valid Upper limit");a.upperlimit.focus();return}if(parseFloat(k)<=parseFloat(h)){alert("Bid amount should be greater than highest bid amount (Rs."+parseFloat(h).toFixed(2)+")");a.bidamount.focus();return}if(parseFloat(m)<parseFloat(h)){alert("Upper limit of proxy Bid amount should be greater than highest bid amount(Rs."+parseFloat(h).toFixed(2)+")"); a.upperlimit.focus();return}}if(l!=1){if(j==""){alert("Bid quantity should not be empty ");return}if(!isValidDecimal(parseInt(j))){alert("Enter valid Quantity");return}if(!j.match(r)){alert("Enter valid Quantity,You cannot bid for partial quantity");return}if(parseFloat(j)<parseFloat(q)){alert("Bid Quantity should be greater than or equal to Minimum Bid Quantity");return false}}if(e!=""&&parseFloat(m)<parseFloat(k)){alert("Upper limit of proxy Bid amount should be greater than bid amount");a.upperlimit.focus()}else if(e!= ""&&b==0)alert("please select the proxy bid option");else if(m>f||k>f)alert("Your new bid is greater than the Maximum Allowable Bid amount");else if(k<f&&n%g!=0)alert("Bid increase should be in multiple of minimum bid increase.");else if(m<f&&c%g!=0)alert("Bid increase should be in multiple of minimum bid increase.");else{if(b=="1"){if(e==""||e==null){alert("Upper limit should not be empty for proxy bid");return}m<=f&&c%g==0&&k<=f&&n%g==0&&a.submit()}if(b=="0")if(k<=f&&n%g==0)if(j!=null||j!=""){if(isValidDecimal(j))parseFloat(j)> parseFloat(l)?alert("Bid Quantity should be less than or equal to Auction Quantity"):a.submit()}else a.submit()}}else{alert("Enter Valid BidAmount Data");a.bidamount.focus()}}function isValidDecimal(a){return!isNaN(a)} function auctionDiv(a){for(var b=document.getElementById("itemcount").value,c=1;c<=b;c++){var d="auction_"+document.getElementById("itemA_"+c).value;document.getElementById(d).style.display="none"}document.getElementById("auction_"+a).style.display="block";b=document.getElementById("onAuction_"+a).value;if(b=="C"){checkoutdiv(a);bidRule(a)}else if(b=="F"){b=document.getElementById("onAuctionTime_"+a).value;document.getElementById("auctionTimeLeft").innerHTML='<br><label style="color: rgb(8, 93, 173)">Auction starts on </label><br>'+ b+"&nbsp;hrs<br><br>";document.getElementById("auctionTimeLeft").style.display="block";checkoutdiv(a);bidRule(a)}else{document.getElementById("bidRulesDiv").style.display="none";document.getElementById("bidRulesDivLine").style.display="none";document.getElementById("clock").style.display="none";checkoutdiv(a)}} function bidRule(a){if(document.getElementById("galleryBid_"+a).value==1){var b=document.getElementById("PlaceBid_"+a),c=b.inc.value,d=b.startBid.value,e=b.availquantity.value,f=b.totalBids.value,g=b.highBid.value,h=b.maxBidAmount.value;document.getElementById("BidRulesBidInc").innerHTML="Rs."+parseInt(c);document.getElementById("BidRulesQuantity").innerHTML=parseInt(e);if(f==0||e>1)document.getElementById("BidRulesStartBidPrice").innerHTML="Rs."+parseInt(parseFloat(d));else if(parseFloat(h)>parseFloat(g))document.getElementById("BidRulesStartBidPrice").innerHTML= "Rs."+parseInt(parseFloat(g)+parseFloat(c));else document.getElementById("BidRulesStartBidPrice").innerHTML="Rs."+parseInt(parseFloat(g));document.getElementById("BidRulesNoOfBids").innerHTML=parseInt(f);c=b.timeDiffMinutes.value;d=b.timeDiffHours.value;e=b.timeDiffDays.value;b=b.timeDiffSeconds.value;document.getElementById("BidRulesAutoExtension").innerHTML=document.getElementById("AutoExtension_"+a).value;document.getElementById("TimeLeft").innerHTML=e+"D, "+d+"Hr, "+c+"Min, "+b+" Sec";document.getElementById("bidRulesDiv").style.display= "block";document.getElementById("bidRulesDivLine").style.display="block";document.getElementById("clock").style.display="block"}else{document.getElementById("bidRulesDiv").style.display="none";document.getElementById("bidRulesDivLine").style.display="none";document.getElementById("clock").style.display="none"}} function checkoutdiv(a){if(document.getElementById("markForAuction_"+a).value==0){var b="checkout";document.getElementById(b).style.display="block";document.getElementById("pricediv_"+a).style.display="block";document.getElementById("listPrice_"+a).style.display="block";document.getElementById("contractPrice_"+a).style.display="block";document.getElementById("add2WishListLink").innerHTML='<a href="javascript:Add2WishList(document.OrderItemAddForm);" >Add to Wishlist</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:Add2GiftList(document.OrderItemAddForm);">Add to Giftlist</a>'; document.getElementById("addToCart").disabled=false;document.getElementById("buyNowButton").disabled=false}else{b="checkout";document.getElementById("onAuction_"+a);document.getElementById(b).style.display="none";document.getElementById("addToCart").disabled=true;document.getElementById("add2WishListLink").innerHTML="";document.getElementById("buyNowButton").disabled=true;document.getElementById("pricediv_"+a).style.display="none";document.getElementById("listPrice_"+a).style.display="none";document.getElementById("contractPrice_"+ a).style.display="none"}}function changeImage(a,b){var c=document.getElementById("imageCount_"+b).value;for(i=0;i<=c;i++)document.getElementById("image"+i+"_"+b).style.display="none";document.getElementById("image"+a+"_"+b).style.display="block"}function changeImage(a,b){var c=document.getElementById("imageCount_"+b).value;for(i=0;i<=c;i++)document.getElementById("image"+i+"_"+b).style.display="none";document.getElementById("image"+a+"_"+b).style.display="block"} function showThumbnail(a){var b=document.getElementById("thumbNailCount_"+a).value;for(c=0;c<=b;c++)document.getElementById("thumbNail"+c+"_"+a).style.display="none";b=b<=2?b:2;for(var c=0;c<=b;c++)document.getElementById("thumbNail"+c+"_"+a).style.display="block";document.getElementById("thumbnailPos_"+a).value=b} function moveThumbNailRight(){var a=document.getElementById("catEntryIdOrd").value;if(a!=0){var b=document.getElementById("thumbNailCount_"+a).value,c=document.getElementById("thumbnailPos_"+a).value;if(b>c){for(d=0;d<=b;d++)document.getElementById("thumbNail"+d+"_"+a).style.display="none";b=parseInt(c)+1;for(var d=parseInt(b)-2;d<=b;d++)document.getElementById("thumbNail"+d+"_"+a).style.display="block";document.getElementById("thumbnailPos_"+a).value=b;document.getElementById("movedRight_"+a).value= parseInt(document.getElementById("movedRight_"+a).value)+1}else alert("No more images on the right")}} function moveThumbNailLeft(){var a=document.getElementById("catEntryIdOrd").value;if(a!=0){var b=document.getElementById("thumbNailCount_"+a).value,c=document.getElementById("thumbnailPos_"+a).value;if(document.getElementById("movedRight_"+a).value>0){for(d=0;d<=b;d++)document.getElementById("thumbNail"+d+"_"+a).style.display="none";b=parseInt(c)-1;for(var d=parseInt(b)-2;d<=b;d++)document.getElementById("thumbNail"+d+"_"+a).style.display="block";document.getElementById("thumbnailPos_"+a).value=b; document.getElementById("movedRight_"+a).value=parseInt(document.getElementById("movedRight_"+a).value)-1}else alert("No more images on the left")}}function BuyNowOther(a,b){document.getElementById("catEntryIdOrd").value=a;document.getElementById("sellId").value=b;BuyNow(document.OrderItemAddForm)}function Add2ShopCartOther(a,b){document.getElementById("catEntryIdOrd").value=a;document.getElementById("sellId").value=b;Add2ShopCart(document.OrderItemAddForm)} function Add2ShopCartConfirm(a){Add2ShopCart(a)}function BuyNowConfirm(a){BuyNow(a)}function init(){var a=document.getElementById("ItemOnload").value;priceDiv(a);auctionDiv(a);activateCODEMIDiv(a);if(document.getElementById("itemPreOrderable_"+a).value=="1")document.getElementById("maxQtyItem").value=document.getElementById("preOrderMaxQty_"+a).value} function format(a){var b=a;if(a>=1E3){b=parseInt(a)%1E3;var c=parseInt(a)/1E3,d="";if(c>=100){c=parseInt(a)%100;d=parseInt(a)/100+","+c}else d=c;b=d+","+b}return b} function termsAndConditions(a){if(a.checked){a=a.value;document.getElementById("PlaceBidbutton_"+a).disabled=false;document.getElementById("PlaceBidbutton_"+a).style.color="white";document.getElementById("watchListAddbutton_"+a).disabled=false;document.getElementById("watchListAddbutton_"+a).style.color="white"}else{a=a.value;document.getElementById("PlaceBidbutton_"+a).disabled=true;document.getElementById("PlaceBidbutton_"+a).style.color="grey";document.getElementById("watchListAddbutton_"+a).disabled= true;document.getElementById("watchListAddbutton_"+a).style.color="grey"}}function watchListAdd(a){var b=createRequest();b.onreadystatechange=function(){if(b.readyState==4&&b.status==200){trimString(b.responseText);alert("The item was successfully added to your Watch list");document.getElementById("watchListButton").style.display="none"}};b.open("GET",a,true);b.send(null)} function Add2ShopList(){if(document.getElementById("userLoginStatus").value=="G")alert("Please login to add item to Shopping List");else{var a=document.getElementById("WC_CachedItemDisplay_FormInput_productId_In_OrderItemAddForm_1").value;if(checkSKU(document.getElementById("catEntryIdOrd").value)){var b=document.getElementById("maxWLItemsSite").value;b=parseInt(b);var c=createRequest();c.onreadystatechange=function(){if(c.readyState==4&&c.status==200){var d=c.responseText;d=trimString(d);d=="success"&& alert("The item was successfully added to your shopping list");d=="fail"&&alert("There was an error in adding the product to your shopping list. Please contact Customer care");d=="exists"&&alert("The Item has already been added to the shopping List")}};c.open("GET","ShoppingListAddCmd?productId="+a,true);c.send(null)}else alert("There is no item available for the selected attribute. Please change the attribute before adding to the wish list.")}} function trimString(a){a=a.replace(">","");return a.replace(/^\s*/,"").replace(/^\s*/,"").replace(/^\s+|\s+$/g,"")}function createRequest(){return window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP")} function verifyCertificate(){var a=(new Date).getTime();eval("page"+a+" = window.open('https://seal.verisign.com/splash?form_file=fdf/splash.fdf&lang=en&dn=www.straightline.in', '"+a+"', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=530,height=450');")} function hideit(){if(document.getElementById("WC_CachedHeaderDisplay_FormInput_searchTerm_In_CatalogSearchForm_1").value=="Type your Search Criteria Here...")document.getElementById("WC_CachedHeaderDisplay_FormInput_searchTerm_In_CatalogSearchForm_1").value=""} function searchValidate(a){var b=document.getElementById("WC_CachedHeaderDisplay_FormInput_searchTerm_In_CatalogSearchForm_1").value;if(b==""||b=="Type your Search Criteria Here...")window.location.href=a;else document.CatalogSearchForm.submit()}function search(a){if(document.getElementById("searchTerm").value=="Type your Search Criteria Here...")document.getElementById("searchTerm").value="";a.submit()} function hideShoppingCartDiv(){document.getElementById("MiniShopCartProductsList").style.display="none"}function keepListActive(){document.getElementById("MiniShopCartProductsList").style.display="block"}function hidecartlist(){document.getElementById("MiniShopCartProductsList").style.display="none"};
