Rev 1796 | Rev 1807 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
// Ebizon Move script js into the file$(document).ready(function() {var SelectID;var subtract;var check = 0;var count = $('.comparision-product-column').length;if(count < 4) {if(count == 3) {subtract = 6;} else if(count == 2) {subtract = 3;} else {subtract = 0;}var parentWidth = $('#comparision-right').width();var width = (parentWidth - subtract)/count;var newWidth = parseInt(width);$('.product-name').width(newWidth);$('.comparision-product-column').width(newWidth);}var styleTrack = $('.jspTrack').attr('style');$('.jspTrackbottom').attr('style', styleTrack);var styleDrag = $('.jspDrag').attr('style');$('.jspDragbottom').attr('style', styleDrag);$('.ui-state-default').click(function(){var aID = $("li.ui-state-active").children('a:first').attr('href');var array = aID.split("#");var displayID = array[1];var new_aID = $(this).children('a:first').attr('href');var new_array = new_aID.split("#");var new_displayID = new_array[1];$('.'+displayID).each(function(){this.style.display = 'none';$(this).removeClass("comparision-block").addClass('comparision-hide');});if(new_displayID == 'vtab-1') {// $('#comparision-right').removeClass("product-comparision-internal").addClass('product-comparision-home');// $('.scroller-columns').hide();// $('#comparision-summary-content').show();// $('.comparision-page-title').hide();} else {// $('#comparision-right').removeClass("product-comparision-home").addClass('product-comparision-internal');// $('.scroller-columns').show();// $('#comparision-summary-content').hide();// $('.comparision-page-title').show();}$('.comparision-page-title').html(this.title);$('.ui-state-active').removeClass("ui-tabs-selected ui-state-active");$(this).addClass("ui-tabs-selected ui-state-active");$('.'+new_displayID).each(function() {var new_count = $('.'+new_displayID).length;if(new_count !== count) {$('.comparision-product-column').each(function(){var check_childern = $(this).find('.'+new_displayID).html();if(check_childern == null && check == 0) {$(this).append("<div class='"+new_displayID+" comparision-hide comparision-empty-column'><div class='featureslisting'><ul><li class='mainFeature'>No features listed.</li></ul></div></div>");check = 1;}});}$(this).removeClass("comparision-hide").addClass('comparision-block');this.style.display = 'block';});return false;});$('.comparision-hide').each(function(){this.style.display = 'none';});});$('#frmProceedToPay').submit(function(){//Tracking this click for Google Analytics_gaq.push(['_trackEvent', 'Order', 'Proceed to Pay', "", 2]);return true;});$(document).ready(function(){//For Registration Page$('#frmRegister #email').change(function(){$('#communicationEmail').val($(this).val());});$('#addAdrBtn').click(function(){$('#newShipAdr').show();scrollWin();});var lastQueryType = -1;function scrollWin(){$('html, body').animate({scrollTop: $("#newShipAdr").offset().top}, 2000);}$('.category-tabs').click(function() {var items = this.id;var title = this.title;var url = this.name;var itemsarray = items.split('-');var catId = itemsarray[1];removeLastActiveState();$('a.activeTab').each(function(index) {$('a.activeTab').removeClass('activeTab');});$(this).addClass('category-tabs activeTab');hideShowTabContent("otherTabContent", "show");setContentHeading(title);hideShowTabContent("multifacetedSearch", "hide");hideShowTabContent("browseContent", "hide");// Ajax call to fecth data in page class//alert("Ajax call to get best sellers");jQuery.ajax({url: "../"+url,type: "GET",data: "categoryid="+catId,contentType: "text/html",cache: false,success: function(html){if(html!=1){//alert(html);$('#productListCenter2').html(html);$('#productListCenter2 ul.product-description li').truncate({addtitle: true});}else{//alert("Sorry! Unexpected Error. Try again!");}}});return false;});$('.showBrowse').click(function() {removeLastActiveState();activeTab("catTab1");hideShowTabContent("multifacetedSearch", "show");hideShowTabContent("browseContent", "show");hideShowTabContent("otherTabContent", "hide");});$('#frmLogin').validate({loginEmail: {required: true,email: true},loginPassword: {required: true,minlength: 6,maxlength: 20}});if(document.getElementById("frmRegister")){$("#frmRegister").validate({rules: {nameOfUser: "required",email: {required: true,email: true},txtPassword: {required: true,minlength: 6,maxlength: 20},confirmPassword: {required: true,minlength: 6,maxlength: 20,equalTo: "#txtPassword"},communicationEmail: {required: true,email: true},mobileNumber: {required: false,digits: true,minlength: 10,maxlength: 10},conditions: {required: true}}});}if(document.getElementById("txtDateOfBirth")){$("#txtDateOfBirth").datepicker({inline: true,changeMonth: true,changeYear: true,minDate: -20,maxDate: "+1M +10D"});}if (document.getElementById("frmShippingAddress")) {$("#frmShippingAddress").validate( {rules : {name : "required",line1 : "required",state : {required : true,minlength : 1},city : "required",pincode : {required : true,digits : true,minlength : 6,maxlength : 6},phone : {required : true,digits : true,minlength : 10,maxlength : 10}}});}if(document.getElementById("#frmLogin")) {$("#frmLogin").validate({rules: {email: {required: true,email: true},password: {required: true,minlength: 6,maxlength: 20}}});}if(document.getElementById("#datepicker")) {$("#datepicker").datepicker({ });}// Research "delete" Item$('.add-research-pane5').live('click', function() {addResearch('pane5', 'multi');});$('.add-to-cart-pane5').live('click', function() {addToCart('pane5', 'multi');});$('.add-to-cart-pane1').live('click', function() {addToCart('pane1', 'multi');});$('#signinClass').click(function() {changeSignInClass();});$('.add-to-cart-icon').live('click', function() {var items = this.id;var itemsarray = items.split('-');addToCart(itemsarray[1], itemsarray[0]);return false;});$('.add-to-research-icon').live('click', function() {var items = this.id;var itemsarray = items.split('-');addResearch(itemsarray[1], itemsarray[0]);return false;});$("#research_delete").live('click', function(){var research_tot = $("#research_total").val();var seldata=[];var tot = 0;var saprt = "";var containerdiv = "#pane1";var par = containerdiv + " input[type=checkbox]:checked";$(par).each(function(){seldata.unshift($(this).val());tot ++;});if(tot > 0) {var t = (research_tot * 1) - (tot * 1);$("#research_total").val(t);jQuery.ajax({type: "GET",url: "/deletefromresearch/[" + seldata + "]",success: function(msg){jQuery.each(seldata, function(intIndex, objValue){delete_from_storage_set("resitems", objValue);$("#pane1").find("#" + objValue).fadeOut('slow', function() {$(this).remove();if(t === 0) {$("#research_default").css("display", "block");}});});}});} else {alert("Please select atleast one product");}});$("#research_compare").live('click', function(){var seldata = "";var tot = 1;var saprt = "";var containerdiv = "#pane1";var par = containerdiv + " input[type=checkbox]:checked";$(par).each(function(){if(tot == 1){seldata += "mobile"+tot + "=" + $(this).val();}else{seldata += "&mobile"+tot + "=" + $(this).val();}tot ++;});if(tot > 2) {window.location="/compare-mobile-phones?" + seldata;} else {alert("Please select atleast two products");}});// Clear old cache keys. These two lines can be deleted after June 5, 2011.$.Storage.remove("history");$.Storage.remove("research");// No uid cookieif (!$.cookie("uid")) {// No uid in storageif (!$.Storage.get("uid")) {if (!$.Storage.get("resitems")) {$.Storage.set("resitems", "[]");}if (!$.Storage.get("histitems")) {$.Storage.set("histitems", "[]");}}// uid in storage : logoutelse {$.Storage.remove("uid");$.Storage.set("resitems", "[]");$.Storage.set("histitems", "[]");}load_research_widget();load_history_widget();}// With uid cookieelse {var cookie = $.cookie("uid");// Just logged in merge storage itemsif (!$.Storage.get("uid")) {$.Storage.set("uid", cookie);merge_history_items();load_research_items();}else {// UID changedif ( cookie != $.Storage.get("uid")) {$.Storage.set("uid", cookie);$.Storage.set("resitems", "[]");$.Storage.set("histitems", "[]");merge_history_items();load_research_items();}// Uid is sameelse {if (!$.Storage.get("resitems")) {$.Storage.set("resitems", "[]");load_research_items();}else {load_research_widget();}if (!$.Storage.get("histitems")) {$.Storage.set("histitems", "[]");merge_history_items();}else {load_history_widget();}}}}});