jQuery.each(["id","title","name","href","src","rel"],function(i,n){jQuery.fn[n]=function(h){return h==undefined?this.length?this[0][n]:null:this.attr(n,h);};});jQuery.each("top,left,position,float,overflow,color,background".split(","),function(i,n){jQuery.fn[n]=function(h){return h==undefined?(this.length?jQuery.css(this[0],n):null):this.css(n,h);};});var e=("blur,focus,load,resize,scroll,unload,click,dblclick,"+"mousedown,mouseup,mousemove,mouseover,mouseout,change,reset,select,"+"submit,keydown,keypress,keyup,error").split(",");for(var i=0;i<e.length;i++)new function(){var o=e[i];jQuery.fn["un"+o]=function(f){return this.unbind(o,f);};jQuery.fn["one"+o]=function(f){var element=jQuery(this);var handler=function(){element.unbind(o,handler);element=null;return f.apply(this,arguments);};return this.bind(o,handler);};};jQuery.fn.ancestors=jQuery.fn.parents;jQuery.expr[":"]["nth-child"]="jQuery.nth(a.parentNode.firstChild,parseInt(m[3])+1,'nextSibling')==a";jQuery.fn._filter=jQuery.fn.filter;jQuery.fn.filter=function(arr){return this._filter(arr.constructor==Array?arr.join(","):arr);};(function(jQuery){jQuery.each(["eq","lt","gt","contains"],function(i,n){jQuery.fn[n]=function(num,fn){return this.filter(":"+n+"("+num+")",fn);};});jQuery.fn.evalScripts=function(){};jQuery.fn.loadIfModified=function(){var old=jQuery.ajaxSettings.ifModified;jQuery.ajaxSettings.ifModified=true;var ret=jQuery.fn.load.apply(this,arguments);jQuery.ajaxSettings.ifModified=old;return ret;};jQuery.getIfModified=function(){var old=jQuery.ajaxSettings.ifModified;jQuery.ajaxSettings.ifModified=true;var ret=jQuery.get.apply(jQuery,arguments);jQuery.ajaxSettings.ifModified=old;return ret;};jQuery.ajaxTimeout=function(timeout){jQuery.ajaxSettings.timeout=timeout;};})(jQuery);function checkRedeemFields(){if($("input[name='collectionmethod']:checked").val()=='mailing'){if($("input#edit-panes-delivery-delivery-first-name").val()==""){alert('Please select a First Name.');$("input#edit-panes-delivery-delivery-first-name").focus();return false;}else if($("input#edit-panes-delivery-delivery-last-name").val()==""){alert('Please select a Last Name.');$("input#edit-panes-delivery-delivery-last-name").focus();return false;}else if($("input#edit-panes-delivery-delivery-street1").val()==""){alert('Please select a Street Address.');$("input#edit-panes-delivery-delivery-street1").focus();return false;}else if($("input#edit-panes-delivery-delivery-city").val()==""){alert('Please select a City.');$("input#edit-panes-delivery-delivery-city").focus();return false;}else if($("input#edit-panes-delivery-delivery-postal-code").val()==""){alert('Please select a Postal Code.');$("input#edit-panes-delivery-delivery-postal-code").focus();return false;}if($("#shipping").length==0){alert('Calculate first the delivery cost.');return false;}else if($("select#edit-panes-delivery-delivery-zone").val()==""){alert('Please select a Zone.');$("input#edit-panes-delivery-delivery-postal-code").focus();return false;}}else if($("input[name='collectionmethod']:checked").val()=='selfcollection'){if($("input#edit-panes-self-date-redeem").val()==""){alert('Please enter Date of self-collection.');$("input#edit-panes-self-date-redeem").focus();return false;}else if($("input#edit-panes-self-time-redeem").val()==""){alert('Please enter Time of self-collection.');$("input#edit-panes-self-time-redeem").focus();return false;}}var msn="@msn";var hotmail="@hotmail";var live="@live";var email=$("input#edit-Email").val();if($("input#edit-Firstname").val()==""){alert("Please enter your First Name.");return false;}else if($("input#edit-Lastname").val()==""){alert("Please enter your Last Name.");return false;}else if(email.indexOf(hotmail)>-1||email.indexOf(msn)>-1||email.indexOf(live)>-1){alert("We are having issues with this email provider.  Please provide us with alternative email. (eg. Gmail, Yahoo Mail)");return false;}else if($("input#edit-ContactNumber").val()==""){alert("Please enter your Mobile Number.");return false;}else if($("input#edit-MailingAddress").val()==""){alert("Please enter your Address.");return false;}else if($("input#edit-NRIC").val()==""){alert("Please enter your Identification No./Passport No.");return false;}else if($("select#edit-Occupation").val()==""){alert("Please select your Current Occupation.");return false;}else if($("select#edit-Industry").val()==""){alert("Please select your Industry.");return false;}else if($("select#edit-Education").val()==""){alert("Please select your Education Level.");return false;}else if($("select#edit-MonthlyIncome").val()==""){alert("Please select your Monthly Income.");return false;}else{return true;}}function searchResults(){window.location="http://www.cozycot.com/search-results?psps_search="+$('input#searchArticleBox').val();return false;}function searchResults2(){window.location="http://www.cozycot.com/search-results?psps_search="+$('input#searchArticleBox2').val();return false;}function headersearchautobrand(keyword){var options={'keyword':keyword};$.post('http://www.cozycot.com/cozyreview/headersearchautobrand',options,function(contents){var c=contents;if(c==''){$('div#headerbrandlist').hide();}else{$('div#headerbrandlist').html(contents);$('div#headerbrandlist').css("display","block");}});return false;}function setHeaderBrand(word){$('div#searchcomp2 input#searchBox').attr('value',word);$("div#headerbrandlist").hide();return false;}function hideHeaderBrandList(){$("div#headerbrandlist").css('display','none');return false;}function setBrand(word){$('div#cozyreview input#edit-brand').attr('value',word);$('div#autokeybrandlist').hide();return false;}function autokeybrand(keyword){var options={'keyword':keyword};$.post('http://www.cozycot.com/cozyreview/autokeybrandsearch',options,function(contents){var c=contents;if(c==''){$('div#autokeybrandlist').hide();}else{$('div#autokeybrandlist').html(contents);$('div#autokeybrandlist').css("display","block");}});return false;}function reviewComment(nid){var options={'nid':nid};$('div.cozyreviewcomment'+options['nid']).html("<a style='cursor:pointer;' onclick='hideComment("+options['nid']+");'>Hide comments</a>");$.post('http://www.cozycot.com/cozyreview/comment',options,function(contents){$('div#editor_review_content_chatbox'+options['nid']).append(contents);});return false;}function deleteComment(nid){var options={'nid':nid};$.post('http://www.cozycot.com/cozyreview/comment/delete',options,function(contents){$('div.cozyreviewcommentbox'+options['nid']).html(contents);});return false;}function submitComment(nid){$('div#commentbox'+nid).hide();var options={'nid':nid,'comment':$('input#input'+nid).val()};$.post('http://www.cozycot.com/cozyreview/comment/submit',options,function(contents){$('div.cozyreviewcommentbox'+options['nid']).html(contents);});return false;}function hideComment(nid){var options={'nid':nid};$('div.cozyreviewcommentbox'+options['nid']).hide();$('div.cozyreviewcomment'+options['nid']).html("<a style='cursor:pointer;' onclick='reviewComment("+options['nid']+");'>Write a comment</a>");return false;}function reviewYes(nid){var options={'nid':nid};$.post('http://www.cozycot.com/critic/great',options,function(contents){$('div#p'+options['nid']).html(contents);});return false;}function reviewNo(nid){var options={'nid':nid};$.post('http://www.cozycot.com/critic/good',options,function(contents){$('div#p'+options['nid']).html(contents);});return false;}function addtodeletearray(subnumber){alert('Subnumber: '+subnumber);alert('Itemtype: '+$('input#itemtype').val());var options={'subnumber':subnumber,'itemtype':$('input#itemtype').val()};$.post('http://www.cozycot.com/addtodeletearray',options,function(contents){$('div#p'+options['nid']).html(contents);});return false;}function clp(t){var b=document.getElementById("bnrc");b.style.clip=(t==1)?"rect(0,728px,90px,0)":"rect(auto,auto,auto,auto)"}function clplc(t,w){var b=document.getElementById("lrecrc");var tw=w|260;b.style.clip=(t==1)?"rect(auto,auto,250px,"+tw+"px)":"rect(auto,auto,auto,auto)"}