Subversion Repositories SmartDukaan

Rev

Rev 2036 | Rev 2235 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2036 Rev 2228
Line 37... Line 37...
37
				 }			}
37
				 }			}
38
		});
38
		});
39
	});
39
	});
40
	
40
	
41
	$("#colorselector").change(function(){
41
	$("#colorselector").change(function(){
42
		var output = "";
-
 
43
		var itemid = $("#colorselector option:selected").val();
42
		var itemid = $("#colorselector option:selected").val();
44
 
43
 
45
		$('#sp').html(PARAMETERS[itemid].SP);
44
		$('#sp').html(PARAMETERS[itemid].SP);
46
		$('#mrp').html(PARAMETERS[itemid].MRP);
45
		$('#mrp').html(PARAMETERS[itemid].MRP);
47
		$('#saving').html(PARAMETERS[itemid].SAVING);
46
		$('#saving').html(PARAMETERS[itemid].SAVING);
Line 58... Line 57...
58
		$('#mrp').html(" "+PARAMETERS[itemid].MRP);
57
		$('#mrp').html(" "+PARAMETERS[itemid].MRP);
59
		$('#saving').html(PARAMETERS[itemid].SAVING);
58
		$('#saving').html(PARAMETERS[itemid].SAVING);
60
		$("#item_id").val(itemid);
59
		$("#item_id").val(itemid);
61
		return false;
60
		return false;
62
	});
61
	});
-
 
62
 
-
 
63
	$("#util_compare").click(function() {
-
 
64
		$.fn.colorbox({inline:true, href:".colorSelLightBoxColor", open:true, onComplete:function(){
-
 
65
			var posLeft = (document.documentElement.clientWidth / 2) - (parseInt($('#colorbox').css('width')) / 2);
-
 
66
			var posTop = (document.documentElement.clientHeight / 2) - (parseInt($('#colorbox').css('height')) / 2);
-
 
67
	
-
 
68
			$('#colorbox').css('top', posTop);
-
 
69
			$('#colorbox').css('left', posLeft);
-
 
70
		}});
-
 
71
	});
-
 
72
 
-
 
73
	/* This code is for compare with button */
-
 
74
	var availableNames = [];
-
 
75
	for (var k in productIdNames)availableNames.push(k);
-
 
76
    $("#mobilename").autocomplete({  autoFocus: true, 
-
 
77
        source: availableNames
-
 
78
    });
-
 
79
 
-
 
80
 
-
 
81
    $("#compare_continue").click(function() {
-
 
82
    	var productName = $("#mobilename").val();
-
 
83
    	var productTwo = productIdNames[productName];
-
 
84
    	if(typeof productTwo == 'undefined'){
-
 
85
    		alert("Please select a valid product");
-
 
86
    		return;
-
 
87
    	}
-
 
88
    	var productOne = $("#catelog_id").val();
-
 
89
    	window.location = "/compare-mobile-phones?p1="+productOne+"&p2="+productTwo;	
-
 
90
    });
-
 
91
    
63
});
92
});
64
 
93
 
65
function changeSignInClass(){
94
function changeSignInClass(){
66
	if(document.getElementById("signinClass").className.indexOf("signin1") > -1)	{
95
	if(document.getElementById("signinClass").className.indexOf("signin1") > -1)	{
67
		document.getElementById("signinClass").className = 'signin';
96
		document.getElementById("signinClass").className = 'signin';
68
	} else	{
97
	} else	{
69
		document.getElementById("signinClass").className = 'signin1';
98
		document.getElementById("signinClass").className = 'signin1';
70
	}
99
	}
71
}
100
}
72
 
101
 
-
 
102
 
73
function updateEstimate(itemId)	{
103
function updateEstimate(itemId)	{
74
	itemId = itemId || $("#item_id").val();
104
	itemId = itemId || $("#item_id").val();
75
	
105
	
76
	jQuery.ajax({
106
	jQuery.ajax({
77
		type: "GET",
107
		type: "GET",
Line 81... Line 111...
81
		},
111
		},
82
		success: function(msg)	{
112
		success: function(msg)	{
83
			$("#shipping_time").html(msg);
113
			$("#shipping_time").html(msg);
84
		}
114
		}
85
	});
115
	});
86
}
-
 
87
116
}
-
 
117
 
-
 
118