var mainPageCategoryPath=null;var isProdOfTheDayHovered=false;function LoadLogoutDiv(){var url="/Handlers/LogOutH.ashx?Logout=0";CallLogoutHandler(url);return false}function Logout(){var url="/Handlers/LogOutH.ashx?Logout=1";CallLogoutHandler(url);return false}function CallLogoutHandler(url){$.ajax({type:"POST",url:url,data:"",cache:false,async:true,success:SetLogoutDiv})}function SetLogoutDiv(data){if(data!="0"){if(data.indexOf("#name#")>-1){$("#userName").text(data.replace("#name#",""));$("#logOut").show()}else{if(data.indexOf("#url#")>-1){window.location=data.replace("#url#","")}}}}function SetAsHome(){document.body.style.behavior="url(#default#homepage)";document.body.setHomePage(window.location.href)}function HomePageTabClick(tabId,categoryName,cubesCount,region,sortOrder){var mainProductsDiv=$("#main_products_"+region);var mainTabsDiv=$("#main_tabs_"+region);if(document.getElementById("container_"+region+"_"+sortOrder)==null){var newDiv=document.createElement("div");newDiv.id="container_"+region+"_"+sortOrder;$(newDiv).addClass("content");$(newDiv).addClass("AjaxProgress");$(mainProductsDiv).append(newDiv);var url="/Ajax/HomePageProductsData.aspx";var query="?CatName="+categoryName+"&CubesCount="+cubesCount;$(newDiv).load(url+query,function(){$(newDiv).removeClass("AjaxProgress")})}$("#"+$(mainProductsDiv).attr("id")+" > *").hide();$("#container_"+region+"_"+sortOrder).show();$("#"+$(mainTabsDiv).attr("id")+" > * > *").removeClass("current");$("#"+tabId).addClass("current")}function MyCardTabClick(tabId,url,pageNum){var mainMyCardDiv=$("#mycard_data");var mainTabsDiv=$("#mycard_menu");if(document.getElementById("container_"+tabId+"_"+pageNum)==null){var newDiv=document.createElement("div");newDiv.id="container_"+tabId+"_"+pageNum;$(newDiv).addClass("AjaxProgress");$(mainMyCardDiv).append(newDiv);var query="?pNum="+pageNum+"&FunName=MyCardTabClick&tabId="+tabId+"&rnd="+(Math.round(Math.random()*1000000)%100000);$(newDiv).load(url+query,function(){$(newDiv).removeClass("AjaxProgress")})}$("#"+$(mainMyCardDiv).attr("id")+" > *").hide();$("#container_"+tabId+"_"+pageNum).show();$("#"+$(mainTabsDiv).attr("id")+" > * > *").removeClass("current");$("#"+tabId).addClass("current")}function SaleDetailsTabClick(tabId){var mainMyCardDiv=$("#give_price_data");var mainTabsDiv=$("#give_price_menu");$("#"+$(mainMyCardDiv).attr("id")+" > *").hide();$("#container_"+tabId).show();$("#"+$(mainTabsDiv).attr("id")+" > * > *").removeClass("current");$("#"+tabId).addClass("current")}function chkCompareProduct_Click(ctl,auid){var productIds="";if(readCookie("CompareProducts")!=null){productIds=readCookie("CompareProducts")}if($("#"+ctl.id).attr("checked")==true){if(!IsValueExistInCookie("CompareProducts",auid)){if(NumberOfValuesInCookie("CompareProducts")<4){productIds+="#"+auid+"#";createCookie("CompareProducts",productIds,10)}else{alert($("input[class='MaximumLimitOfProductsToCompare']").val());$("#"+ctl.id).attr("checked",false)}}}else{if(IsValueExistInCookie("CompareProducts",auid)){productIds=productIds.replace("#"+auid+"#","");createCookie("CompareProducts",productIds,10)}}}function NumberOfValuesInCookie(cookieName){var count=0;if(readCookie(cookieName)==null){return 0}var allValues=readCookie(cookieName).split("#");for(var i=0;i<allValues.length;i++){if(allValues[i]!=""){count++}}return count}function IsValueExistInCookie(cookieName,valueToSearch){if(readCookie(cookieName)==null){return false}var allValues=readCookie(cookieName).split("#");for(var i=0;i<allValues.length;i++){if(allValues[i]==valueToSearch){return true}}return false}function IsCookieExist(cookieName){if(readCookie(cookieName)==""||readCookie(cookieName)==undefined){return false}else{return true}}function CompareProducts_Click(){if(IsCookieExist("CompareProducts")){if(NumberOfValuesInCookie("CompareProducts")<2){alert($("input[class='NotEnoughProductsToCompare']").val())}else{window.location="/Site/CompareProducts.aspx"}}else{alert($("input[class='NoProductsToCompare']").val())}}function SaleFilter_Click(saleTypeValue){eraseCookie("CompareProducts");var qs=new Querystring();var href="";if(qs.contains("saleType")){href=window.location.href.replace("&saleType="+qs.get("saleType"),"&saleType="+saleTypeValue);if(qs.contains("pNum")){href=href.replace("&pNum="+qs.get("pNum"),"&pNum=1")}}else{href=window.location.href.replace("&pNum="+qs.get("pNum"),"&pNum=1");href=href+"&saleType="+saleTypeValue}window.location=href}function RemoveProductFromCompare(auid){var productIds="";if(readCookie("CompareProducts")!=null){productIds=readCookie("CompareProducts")}if(IsValueExistInCookie("CompareProducts",auid)&&(NumberOfValuesInCookie("CompareProducts")>2)){productIds=productIds.replace("#"+auid+"#","");createCookie("CompareProducts",productIds,10);CompareProducts_Click()}else{alert($("input[class='NotEnoughProductsToCompare']").val())}}function MarkAsInvalid(ctl){$("#"+ctl).addClass("inValid")}function MarkAsValid(ctl){$("#"+ctl).removeClass("inValid")}function IsValidPay(){var _CCfirstName=$.trim($("#"+txtFirstNameCCOwner).val());var _CClastName=$.trim($("#"+txtLastNameCCOwner).val());var _CCid=$.trim($("#"+txtIdCCOwner).val());var _CC3Num=$.trim($("#"+txt3NumberCC).val());var _CCNumber=$.trim($("#"+txtCCNumber).val());var _CCType=$.trim($("#"+ddlCCType).val());var _CCExpirationMonth=$.trim($("#"+ddlCCExpirationMonth).val());var _CCExpirationYear=$.trim($("#"+ddlCCExpirationYear).val());var message="";if(_CCfirstName.length==0){message+=$("#"+MISSING_CC_FIRST_NAME).val()+"\n";MarkAsInvalid(txtFirstNameCCOwner)}else{if(!IsHebrewOrEnglish(_CCfirstName)){message+=$("#"+WRONG_CC_FIRST_NAME).val()+"\n";MarkAsInvalid(txtFirstNameCCOwner)}else{MarkAsValid(txtFirstNameCCOwner)}}if(_CClastName.length==0){message+=$("#"+MISSING_CC_LAST_NAME).val()+"\n";MarkAsInvalid(txtLastNameCCOwner)}else{if(!IsHebrewOrEnglish(_CClastName)){message+=$("#"+WRONG_CC_LAST_NAME).val()+"\n";MarkAsInvalid(txtLastNameCCOwner)}else{MarkAsValid(txtLastNameCCOwner)}}if(_CCid.length==0){message+=$("#"+MISSING_CC_ID_NUMBER).val()+"\n";MarkAsInvalid(txtIdCCOwner)}else{if(!IsIdNumberValid(_CCid)){message+=$("#"+WRONG_CC_ID_NUMBER).val()+"\n";MarkAsInvalid(txtIdCCOwner)}else{MarkAsValid(txtIdCCOwner)}}if(_CC3Num.length==0){message+=$("#"+MISSING_CC_3_NUMBER).val()+"\n";MarkAsInvalid(txt3NumberCC)}else{if(!isValidCvv(_CC3Num)){message+=$("#"+WRONG_CC_3_NUMBER).val()+"\n";MarkAsInvalid(txt3NumberCC)}else{MarkAsValid(txt3NumberCC)}}if(_CCNumber.length==0){message+=$("#"+MISSING_CC_NUMBER).val()+"\n";MarkAsInvalid(txtCCNumber)}else{if(!isValidCCNumber(_CCNumber)){message+=$("#"+WRONG_CC_NUMBER).val()+"\n";MarkAsInvalid(txtCCNumber)}else{MarkAsValid(txtCCNumber)}}if(_CCType.length==0){message+=$("#"+MISSING_CC_TYPE).val()+"\n"}if(_CCExpirationMonth.length==0){message+=$("#"+MISSING_CC_MONTH_EXPIRATION).val()+"\n"}if(_CCExpirationYear.length==0){message+=$("#"+MISSING_CC_YEAR_EXPIRATION).val()+"\n"}if(message.length==0){var url="/Handlers/CCValidatorH.ashx";var NoCache=new Date().getTime();var pData="NC="+NoCache+"&CCNUM="+_CCNumber+"&M="+_CCExpirationMonth+"&Y="+_CCExpirationYear+"&ID="+_CCid+"&CVV="+_CC3Num;$.ajax({type:"POST",url:url,data:pData,cache:false,async:false,success:function(res){if(res=="Blocked"){message+=$("#"+CC_BLOCKED).val()+"\n"}if(res=="Failed"){message+=message+=$("#"+ILLEGAL_CC).val()+"\n"}}})}if(message.length==0){return true}else{alert(message);return false}}function IsValidDeliveryDetails(){var _firstNameAddr=$.trim($("#"+txtFirstNameAddr).val());var _lastNameAddr=$.trim($("#"+txtLastNameAddr).val());var _homePhoneAddr=$.trim($("#"+txtPhoneAddr).val());var _ddlPhonePrefixAddr=$("#"+ddlPhonePrefixAddr).val();var _cellPhoneAddr=$.trim($("#"+txtCellPhoneAddr).val());var _ddlCellPrefixAddr=$("#"+ddlCellPhonePrefixAddr).val();var _streetAddr=$.trim($("#"+txtStreetAddr).val());var _cityAddr=$.trim($("#"+txtCityAddr).val());var _zipCodeAddr=$.trim($("#"+txtZipCodeAddr).val());var message="";if(_firstNameAddr.length==0){message+=$("#"+MISSING_CC_FIRST_NAME).val()+"\n";MarkAsInvalid(txtFirstNameAddr)}else{if(!IsHebrewOrEnglish(_firstNameAddr)){message+=$("#"+WRONG_CC_FIRST_NAME).val()+"\n";MarkAsInvalid(txtFirstNameAddr)}else{MarkAsValid(txtFirstNameAddr)}}if(_lastNameAddr.length==0){message+=$("#"+MISSING_CC_LAST_NAME).val()+"\n";MarkAsInvalid(txtLastNameAddr)}else{if(!IsHebrewOrEnglish(_lastNameAddr)){message+=$("#"+WRONG_CC_LAST_NAME).val()+"\n";MarkAsInvalid(txtLastNameAddr)}else{MarkAsValid(txtLastNameAddr)}}if(_homePhoneAddr.length==0){message+=$("#"+MISSING_PHONE_ADDR).val()+"\n";MarkAsInvalid(txtPhoneAddr)}else{if(!isRegularPhoneValid(_homePhoneAddr,_ddlPhonePrefixAddr)){message+=$("#"+WRONG_PHONE_ADDR).val()+"\n";MarkAsInvalid(txtPhoneAddr)}else{MarkAsValid(txtPhoneAddr)}}if(_cellPhoneAddr.length>0||_ddlCellPrefixAddr!=""){if(_cellPhoneAddr.length==0){message+=$("#"+MISSING_CELL_PHONE_ADDR).val()+"\n";MarkAsInvalid(txtCellPhoneAddr)}else{if(_ddlCellPrefixAddr==""){message+=$("#"+WRONG_CELL_PHONE_ADDR).val()+"\n";MarkAsInvalid(txtCellPhoneAddr)}else{MarkAsValid(txtCellPhoneAddr)}}}else{MarkAsValid(txtCellPhoneAddr)}if(_streetAddr.length==0){message+=$("#"+MISSING_STREET_ADDR).val()+"\n";MarkAsInvalid(txtStreetAddr)}else{if(!IsHebrewOrEnglish(_streetAddr)){message+=$("#"+WRONG_STREET_ADDR).val()+"\n";MarkAsInvalid(txtStreetAddr)}else{MarkAsValid(txtStreetAddr)}}if(_cityAddr.length==0){message+=$("#"+MISSING_CITY_ADDR).val()+"\n";MarkAsInvalid(txtCityAddr)}else{if(!IsHebrewOrEnglish(_cityAddr)){message+=$("#"+WRONG_CITY_ADDR).val()+"\n";MarkAsInvalid(txtCityAddr)}else{MarkAsValid(txtCityAddr)}}if(!isValidZipCode(_zipCodeAddr)){message+=$("#"+WRONG_ZIP_CODE_ADDR).val()+"\n";MarkAsInvalid(txtZipCodeAddr)}else{MarkAsValid(txtZipCodeAddr)}if(message.length==0){return true}else{alert(message);return false}}function IsValidUserDetails(pass_check){var _id=$.trim($("#"+txtId).val());var _email=$.trim($("#"+txtEmail).val());var _firstName=$.trim($("#"+txtFirstName).val());var _lastName=$.trim($("#"+txtLastName).val());var _password=$.trim($("#"+txtPassword).val());var _passwordConfirm=$.trim($("#"+txtPasswordConfirm).val());var _homePhone=$.trim($("#"+txtHomePhone).val());var _mobile=$.trim($("#"+txtMobile).val());var _fax=$.trim($("#"+txtFax).val());var _workPhone=$.trim($("#"+txtWorkPhone).val());var _street=$.trim($("#"+txtStreet).val());var _houseNo=$.trim($("#"+txtHouseNo).val());var _flatNo=$.trim($("#"+txtFlatNo).val());var _city=$.trim($("#"+txtCity).val());var _zipCode=$.trim($("#"+txtZipCode).val());var _cmbPhonePrefixHome=$("#"+cmbPhonePrefixHome).val();var _cmbPhonePrefixCell=$("#"+cmbPhonePrefixCell).val();var _cmbPhonePrefixFax=$("#"+cmbPhonePrefixFax).val();var _cmbPhonePrefixWork=$("#"+cmbPhonePrefixWork).val();var _getMail=$("#"+chkGetMail).attr("checked");var _cmbDay=$("#"+cmbDay).val();var _cmbMonth=$("#"+cmbMonth).val();var _cmbYear=$("#"+cmbYear).val();var _optMale=$("#"+optMale).attr("checked");var _optFemale=$("#"+optFemale).attr("checked");var message="";if(_email.length==0){message+=$("#"+MISSING_EMAIL).val()+"\n";MarkAsInvalid(txtEmail)}else{if(!IsEmailValid(_email)){message+=$("#"+WRONG_EMAIL).val()+"\n";MarkAsInvalid(txtEmail)}else{MarkAsValid(txtEmail)}}if(_password==_passwordConfirm){if(pass_check==false&&_password.length==0){message+=$("#"+MISSING_PASSWORD).val()+"\n";MarkAsInvalid(txtPassword)}else{if(!isValidPassword(_password,pass_check)){message+=$("#"+WRONG_PASSWORD).val()+"\n";MarkAsInvalid(txtPassword)}}}else{message+=$("#"+WRONG_PASSWORD2).val()+"\n";MarkAsInvalid(txtPassword);MarkAsInvalid(txtPasswordConfirm)}if(_firstName.length==0){message+=$("#"+MISSING_FNAME).val()+"\n";MarkAsInvalid(txtFirstName)}else{if(!IsOnlyWord(_firstName)){message+=$("#"+WRONG_FNAME).val()+"\n";MarkAsInvalid(txtFirstName)}else{MarkAsValid(txtFirstName)}}if(_lastName.length==0){message+=$("#"+MISSING_LNAME).val()+"\n";MarkAsInvalid(txtLastName)}else{if(!IsOnlyWord(_lastName)){message+=$("#"+WRONG_LNAME).val()+"\n";MarkAsInvalid(txtLastName)}else{MarkAsValid(txtLastName)}}if(_homePhone.length==0){message+=$("#"+MISSING_HPHONE).val()+"\n";MarkAsInvalid(txtHomePhone)}else{if(!isRegularPhoneValid(_homePhone,_cmbPhonePrefixHome)){message+=$("#"+WRONG_HPHONE).val()+"\n";MarkAsInvalid(txtHomePhone)}else{MarkAsValid(txtHomePhone)}}if(_mobile.length>0||_cmbPhonePrefixCell!=""){if(_mobile.length==0){message+=$("#"+MISSING_CELL_PHONE).val()+"\n";MarkAsInvalid(txtMobile)}else{if(_cmbPhonePrefixCell==""){message+=$("#"+WRONG_CPHONE).val()+"\n";MarkAsInvalid(txtMobile)}else{MarkAsValid(txtMobile)}}}else{MarkAsValid(txtMobile)}if(_city.length==0){message+=$("#"+MISSING_CITY).val()+"\n";MarkAsInvalid(txtCity)}else{if(!IsHebrewOrEnglish(_city)){message+=$("#"+WRONG_CITY).val()+"\n";MarkAsInvalid(txtCity)}else{MarkAsValid(txtCity)}}if(_street.length==0){message+=$("#"+MISSING_STREET).val()+"\n";MarkAsInvalid(txtStreet)}else{if(!IsHebrewOrEnglish(_street)){message+=$("#"+WRONG_STREET).val()+"\n";MarkAsInvalid(txtStreet)}else{MarkAsValid(txtStreet)}}if(!isValidDate(_cmbDay,_cmbMonth,_cmbYear)){message+=$("#"+WRONG_BDATE).val()+"\n"}if(!isRegularPhoneValid(_fax,_cmbPhonePrefixFax)){message+=$("#"+WRONG_FAX).val()+"\n";MarkAsInvalid(txtFax)}else{MarkAsValid(txtFax)}if(!isRegularPhoneValid(_workPhone,_cmbPhonePrefixWork)){message+=$("#"+WRONG_WPHONE).val()+"\n";MarkAsInvalid(txtWorkPhone)}else{MarkAsValid(txtWorkPhone)}if(!isValidZipCode(_zipCode)){message+=$("#"+WRONG_ZIPCODE).val()+"\n";MarkAsInvalid(txtZipCode)}else{MarkAsValid(txtZipCode)}if(message.length==0){UserProfile.CellPhone=_mobile.length==0?"":_cmbPhonePrefixCell+"-"+_mobile;UserProfile.City=_city;UserProfile.Email=_email;UserProfile.Fax=_fax.length==0?"":_cmbPhonePrefixFax+"-"+_fax;UserProfile.FirstName=_firstName;UserProfile.LastName=_lastName;UserProfile.FlatNumber=_flatNo;UserProfile.PhoneNumber=_homePhone.length==0?"":_cmbPhonePrefixHome+"-"+_homePhone;UserProfile.HouseNumber=_houseNo;UserProfile.Id=_id;UserProfile.Street=_street;UserProfile.WorkPhone=_workPhone.length==0?"":_cmbPhonePrefixWork+"-"+_workPhone;UserProfile.ZipCode=_zipCode;UserProfile.IsGetMail=_getMail;if(_password.length>0){UserProfile.Password=_password}else{UserProfile.Password=""}UpdateUserData();return true}else{alert(message);return false}}function UpdateUserData(){var optGender=$("#"+optMale).attr("checked");var isMale=(optGender==true);var branchId=$("#"+hidBranchId).val();var userData=GetUserProfileData();var url="/Handlers/UpdateUserH.ashx";var NoCache=new Date().getTime();var pData=userData+"&im="+isMale+"&br="+branchId+"&NC="+NoCache;$.ajax({type:"POST",url:url,data:pData,cache:false,async:false,success:onSuccess,error:onError})}function GetUserProfileData(){var pData="";pData="cp="+UserProfile.CellPhone+"&c="+UserProfile.City+"&em="+UserProfile.Email+"&fx="+UserProfile.Fax+"&fn="+UserProfile.FirstName+"&ln="+UserProfile.LastName+"&fl="+UserProfile.FlatNumber+"&pn="+UserProfile.PhoneNumber+"&hn="+UserProfile.HouseNumber+"&id="+UserProfile.Id+"&st="+UserProfile.Street+"&wp="+UserProfile.WorkPhone+"&z="+UserProfile.ZipCode+"&igm="+UserProfile.IsGetMail+"&pwd="+UserProfile.Password+"&y="+$("#"+cmbYear).val()+"&m="+$("#"+cmbMonth).val()+"&d="+$("#"+cmbDay).val();return pData}function ValidateID(source,arguments){var IDnum=String(arguments.Value);arguments.IsValid=IsIdNumberValid(IDnum)}function onSuccess(result){if((result=="updatedUser")||(result=="createdUser")){if(result=="updatedUser"){LoadLogoutDiv()}alert($("#"+SUCCESS).val());$("input").removeClass("inValid")}else{if(result=="sameUser"){$("input").removeClass("inValid")}else{window.location="/Sales/"+result}}}function onError(error){alert($("#"+FAILED).val())}function tellAFriendValidate(){var message="";var _txtSendTo=$("#"+txtSendTo).val();var _txtSendFrom=$("#"+txtSendFrom).val();$("#"+txtRemarks).val(strip_tags($("#"+txtRemarks).val()));var _txtRemarks=$("#"+txtRemarks).val();if(_txtSendTo.length==0){message+=$("#"+MISSING_EMAIL_TO).val()+"\n";MarkAsInvalid(txtSendTo)}else{if(!IsEmailValid(_txtSendTo)){message+=$("#"+WRONG_EMAIL_TO).val()+"\n";MarkAsInvalid(txtSendTo)}else{MarkAsValid(txtSendTo)}}if(_txtSendFrom.length==0){message+=$("#"+MISSING_EMAIL_FROM).val()+"\n";MarkAsInvalid(txtSendFrom)}else{if(!IsEmailValid(_txtSendFrom)){message+=$("#"+WRONG_EMAIL_FROM).val()+"\n";MarkAsInvalid(txtSendFrom)}else{MarkAsValid(txtSendFrom)}}if(_txtRemarks.length>1000){message+=$("#"+TOO_LONG).val()+"\n";MarkAsInvalid(txtRemarks)}else{MarkAsValid(txtRemarks)}if(message.length==0){return true}else{alert(message);return false}}function SelfPickUpPopUp(supplierId){var url="/Popups/SelfPickUpDetails.aspx?SupplierId="+supplierId;window.open(url,"","toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=300,height=300,left = 490,top = 362")}function ProtectedPaymentsHelpPopUp(){var url="/Popups/ProtectedPaymentsHelp.aspx";window.open(url,"","toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=300,height=300,left = 490,top = 362")}function ProtectedHelpPopUp(){var url="/Popups/ProtectedHelp.aspx";window.open(url,"","toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=300,height=300,left = 490,top = 362")}function BigImagePopUp(imgFile){var url="/Popups/BigImage.aspx?image_file="+imgFile;window.open(url,"","toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=550,height=550,left = 490,top = 362")}function FullWinnersListPopUp(saleType,productId){var url="/Popups/FullWinnersList.aspx?saleType="+saleType+"&productId="+productId;window.open(url,"","toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=550,height=550,left = 490,top = 362")}function ClientCrossSaleDetailsPopUp(saleId){url="/Popups/CrossSaleProductDetails.aspx?SaleId="+saleId;window.open(url,"","toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=450,height=500,left = 490,top = 150")}function TermsPopUp(){var url="/Popups/Terms.aspx";window.open(url,"","toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=850,height=900,left = 290,top = 362")}function RunOnAllElements(element,propertyName,prefix,cmd){try{var a=document.getElementsByTagName(element),i=a.length,tmp="";while(i--){tmp=cmd;while(tmp.indexOf("{e}")!=-1){tmp=tmp.replace("{e}","a["+i+"]")}var propertyValue=eval("a[i]."+propertyName);if(propertyValue&&propertyValue.indexOf(prefix)==0){eval(tmp)}}}catch(e){return true}return false}function ShowHelpMessage(selector,msg){if(selector!=null){$(selector).hover(function(){if($(this).position().left-350>0){$(this).append($("<div class='helpMessage'>"+msg+"</div>"));$(".helpMessage").addClass("open_left")}else{$(this).append($("<div class='helpMessage'>"+msg+"</div>"));$(".helpMessage").addClass("open_right")}},function(){$(this).find(".helpMessage").remove();$(this).find(".open_right").remove()})}}function RecordVote(){var resultString="";for(var i=0;i<$(":input:checked").length;i++){resultString=resultString==""?$(":input:checked")[i].id.replace("answer_",""):resultString+","+$(":input:checked")[i].id.replace("answer_","")}$("#"+UserVote).val(resultString)}function GetPollData(){var pUrl="/Handlers/PollH.ashx";var pData="vote="+$("#"+UserVote).val()+"&LCID="+currLcid;$.ajax({type:"POST",url:pUrl,data:pData,cache:false,async:true,success:OnVoteSuccess})}function OnVoteSuccess(res){$("#QuestionsHolder").html(res);$(".submit_poll").click(function(){var pUrl="/Handlers/PollH.ashx";var pData="vote="+$("#"+UserVote).val()+"&LCID="+currLcid;$.ajax({type:"POST",url:pUrl,data:pData,cache:false,async:true,success:OnVoteSuccess})});$("#"+UserVote).val("")}function GetSiteSearch(searchId){var searchKey=$("#"+searchId).val();if((searchKey==""||searchKey.length<3)&&(!IsSearchKeyInHotSearchesList(searchKey))){alert("יש להזין לפחות 3 תווים לחיפוש");$("#"+searchId).focus()}else{var searchKey=$.trim($("#"+searchId).val());document.location="/Site/SearchResults.aspx?SearchText="+encodeURI(searchKey)}return false}function IsSearchKeyInHotSearchesList(searchKey){var HotSearchesList="$HP$LG$";if(HotSearchesList.indexOf("$"+searchKey.toUpperCase()+"$")>-1){return true}return false}function fbs_click(){u=location.href;t=document.title;window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(u)+"&t="+encodeURIComponent(t),"sharer","toolbar=0,status=0,width=626,height=436");return false}function HtmldoPostBack(eventTarget,eventArgument){var HtmltheForm=document.forms.aspnetForm;if(!HtmltheForm){HtmltheForm=document.aspnetForm}if(!HtmltheForm.onsubmit||(HtmltheForm.onsubmit()!=false)){var elementEVENTTARGET=document.createElement("input");elementEVENTTARGET.setAttribute("type","hidden");elementEVENTTARGET.setAttribute("value",eventTarget);elementEVENTTARGET.setAttribute("name","__EVENTTARGET");HtmltheForm.appendChild(elementEVENTTARGET);var elementEVENTARGUMENT=document.createElement("input");elementEVENTARGUMENT.setAttribute("type","hidden");elementEVENTARGUMENT.setAttribute("value",eventArgument);elementEVENTARGUMENT.setAttribute("name","__EVENTARGUMENT");HtmltheForm.appendChild(elementEVENTARGUMENT);HtmltheForm.submit()}}function slideShow(speed){if($("ul.slideshow").length==0){return}$("ul.slideshow").append('<li id="slideshow-caption" class="caption"><div class="slideshow-caption-container"><h3></h3></div></li>');$("ul.slideshow li").css({opacity:0});$("ul.slideshow li:first").css({opacity:1});$("#slideshow-caption h3").html($("ul.slideshow a:first").find("img").attr("title"));$("#slideshow-caption").css({opacity:0.7,bottom:0});var timer=setInterval("gallery()",speed);$("ul.slideshow").hover(function(){clearInterval(timer)},function(){timer=setInterval("gallery()",speed)})}function gallery(){var current=($("ul.slideshow li.show")?$("ul.slideshow li.show"):$("#ul.slideshow li:first"));var next=((current.next().length)?((current.next().attr("id")=="slideshow-caption")?$("ul.slideshow li:first"):current.next()):$("ul.slideshow li:first"));var title=next.find("img").attr("title");next.css({opacity:0}).addClass("show").animate({opacity:1},800);$("#slideshow-caption").animate({bottom:-70},100,function(){$("#slideshow-caption h3").html(title);$("#slideshow-caption").animate({bottom:0},500)});current.animate({opacity:0},1000).removeClass("show")}function GetProductOfTheDay(auId){if($("#product_of_the_day").html()==""&&isProdOfTheDayHovered==false){var pData="auId="+auId;var url="/Handlers/ProductOfTheDayH.ashx";$.ajax({type:"POST",url:url,data:pData,cache:true,async:true,success:OnProductOfTheDaySuccess,error:OnProductOfTheDayError})}if(isProdOfTheDayHovered==false){isProdOfTheDayHovered=true;$("#product_of_the_day").show()}}function OnProductOfTheDaySuccess(xml){var AuId=$(xml).find("AuId").text();var ProdId=$(xml).find("ProdId").text();var Description=$(xml).find("Description").text();var Price=$(xml).find("Price").text();var PriceOld=$(xml).find("PriceOld").text();var Quantity=$(xml).find("Quantity").text();var Image=$(xml).find("Image").text();var query="?pProdId="+ProdId+"&pDesc="+encodeURI(Description)+"&pPrice1="+Price+"&pPrice2="+PriceOld+"&pQty="+Quantity+"&pImg="+Image+"&pAuId="+AuId;$("#product_of_the_day").load("/Popups/ProductOfTheDay.aspx"+query+" #container_popup_new",{},function(){$(".close").click(function(){$("#product_of_the_day").hide();isProdOfTheDayHovered=false});ProductOfTheDay_CountDown()});$("#product_of_the_day").mouseleave(function(){isProdOfTheDayHovered=false;$("#product_of_the_day").hide()})}function OnProductOfTheDayError(xhr,status,error){alert(error)}function ProductOfTheDay_CountDown(){$("#potd_count_down").countdown({until:new Date().setTime($(".dateClose").val()),comapct:true,description:"",layout:"נותרו <b>{hnn}:{mnn}:{snn}</b> שעות /",labels:["","","","","","","",""],labels1:["","","","","","","",""],format:"HMS"})}function ProductOfTheDay_PopUpCountDown(){$("#potd_count_down2").countdown({until:new Date().setTime($(".dateClose").val()),comapct:true,description:"",layout:"נותרו <b>{hnn}:{mnn}:{snn}</b> ש /",labels:["","","","","","","",""],labels1:["","","","","","","",""],format:"HMS"})}function OnYnetSubscriberStatusSuccess(msg){$("#"+hidYnetSubscriber).val(msg)}function OnYnetSubscriberStatusError(err){$("#"+hidYnetSubscriber).val(err.msg)}function SetYnetSubscriberValue(){if($("#"+txtYnetSubscriberId).length>0){var url="/Handlers/IsYnetBenefitAllowedH.ashx";var pData="cn="+$("#"+txtYnetSubscriberId).val()+"&p="+$("#"+hidAuctionID).val()+"&title="+Math.floor(Math.random()*9999999999);$.ajax({type:"POST",url:url,data:pData,cache:false,async:false,success:OnYnetSubscriberStatusSuccess,error:OnYnetSubscriberStatusError})}}function OnUseMerchantBenefitSuccess(msg){$("#hidYnetBenefit").val(msg)}function OnUseMerchantBenefitError(err){$("#hidYnetBenefit").val(err.msg)}function CheckYnetBenefit(){if($("#"+txtYnetSubscriberId).length>0){if($("#"+hidYnetSubscriber).val()=="0"){var url="/Handlers/UseMerchantBenefitH.ashx";var pData="cn="+$("#"+txtYnetSubscriberId).val()+"&p="+$("#"+hidAuctionID).val()+"&q="+$("#"+ddlAmount).val();$.ajax({type:"POST",url:url,data:pData,cache:false,async:false,success:OnUseMerchantBenefitSuccess,error:OnUseMerchantBenefitError})}}else{return true}};