Subversion Repositories SmartDukaan

Rev

Rev 12091 | Rev 12628 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1456 varun.gupt 1
$(function(){
7744 amit.gupta 2
	jQuery('.mk_videoclick').click(function(){
3
		var clicked = jQuery(this);
4
	    var scrollTo = jQuery("#recommendedvids");
5
	    if(currentVideoId!=currentVideoIds[clicked.attr("slidecounter")]){
6
	    	scrollTo.find('li[ytid=' + currentVideoIds[clicked.attr("slidecounter")] + ']').click();
7
	    }
8
		trackEventWithGA('Product', 'VideoTabClicked',  $('title').text().split('|')[0].trim()  + "|" + clicked.attr("slidename"));
9
  		jQuery('html, body').animate({ scrollTop: scrollTo.offset().top }, 'medium');
10
    	return false;
11
	});
7853 amit.gupta 12
 
13
	var bankEle = jQuery("#bank-name");
14
	var first = true;
15
	var allBankImgs = {
16
		1:"/images/hdfc-icon.png",
17
		2:"/images/axis-icon.png",
18
	 	3:"/images/icici-icon.png",
19
	 	4:"/images/indusind-icon.png",
20
	 	5:"/images/citi-icon.png",
21
	 	6:"/images/std-chartered-icon.png",
22
	 	7:"/images/hsbc-icon.png",
23
	 	8:"/images/kotak-icon.png",
24
	 	9:"/images/sbi-icon.png",
25
	};
7744 amit.gupta 26
 
7853 amit.gupta 27
 
28
	var minEmi = 999999;
9149 amit.gupta 29
	if(typeof EMI === "undefined"){
30
		EMI={};
31
	}
32
	EMI.lowestEmiBank = 0;
7853 amit.gupta 33
	jQuery.each(emiObj, function(index, opt) {
34
		if(sellingPrice >= opt.minAmount){ 
35
			if(typeof banks[opt.bankId] == "undefined") {
36
				banks[opt.bankId] = {};
37
				banks[opt.bankId].name =  opt.bankName;
38
				banks[opt.bankId].emis =  {};
39
				banks[opt.bankId].active =  true;
40
				banks[opt.bankId].img = allBankImgs[opt.bankId];
41
			}
42
			var bank = banks[opt.bankId];
43
			var bankTenure = {};
44
			bankTenure.tenureDescription = opt.tenureDescription;
8950 amit.gupta 45
			var r = opt.interestRate/12/100;
12031 amit.gupta 46
			var installment = sellingPrice*r*Math.pow(1+r,opt.tenure)/(Math.pow(1+r,opt.tenure) - 1);
8950 amit.gupta 47
			bankTenure.monthlyEmi =  (Math.round(installment*100)/100).toFixed(2);
48
			bankTenure.interestRate = opt.interestRate;
12051 amit.gupta 49
			bankTenure.tenure = opt.tenure;
9149 amit.gupta 50
			if(minEmi > installment){
51
				minEmi = installment;
12026 amit.gupta 52
				EMI.interestRate = r;
53
				EMI.tenure = opt.tenure; 
9149 amit.gupta 54
				EMI.lowestEmiBank = opt.bankId;
7853 amit.gupta 55
			}
56
			bank.emis[opt.id] = bankTenure;
57
		}
58
	});
59
	jQuery.each(banks, function(index, bank){
60
		var style = ' style="background: url(\'' + bank.img + '\') no-repeat right"';
61
		if(first){
62
			bankEle.append('<li title="' + bank.name + '"' + style +'><input type="radio" id="' + index +'" value="' + index +'" name="bankselected"' + (bank.active ? '""' : 'disabled="disabled"') + ' checked="checked"/></li>');
63
			first = false;
64
		}else {
65
			bankEle.append('<li title="' + bank.name +'"' + style +'><input type="radio" id="' + index +'" value="' + index +'" name="bankselected"' + (bank.active ? '""' : 'disabled="disabled"') + ' /></li>');
66
		}
67
	});
68
 
69
	bankEle.find("input[type='radio']").click(onBankClicked);
70
 
12042 amit.gupta 71
	jQuery("#emi_more,#emi_more1").live('click',function(){
7853 amit.gupta 72
 
73
		$.colorbox({
74
			inline:true, 
75
			href:"#emiLightBox",
76
    		width:"600px",
77
    		height:"410px",
78
 
79
    		onComplete: function(){
80
    			$('#emiLightBox').show();
9149 amit.gupta 81
    			if(EMI.lowestEmiBank == 0) {
82
    				bankEle.find("input[type='radio']:first").trigger('click');
83
    			}
84
    			else {
9153 amit.gupta 85
    				bankEle.find("#" + EMI.lowestEmiBank).trigger('click');
9149 amit.gupta 86
    			}
7853 amit.gupta 87
    		},
88
    		onCleanup: function(){
89
    			$('#emiLightBox').hide();
90
    		}
91
    	});
92
    	trackEventWithGA('Product', 'Emi Know More Clicked',  $('title').text().split('|')[0].trim());
93
	});
94
 
1456 varun.gupt 95
	$('#loopedSlider').loopedSlider();
96
 
97
	runEffect();
98
 
99
	$(".controls").tabs();
100
 
101
	$('#forgot_username_link').tipsy({gravity: 'w'});
102
 
103
	$("#zipcode").val($("#defaultpincode").val());
4934 amit.gupta 104
 
105
	if(typeof Entity != 'undefined'){
106
		var select = $("#colorSelector");
5373 rajveer 107
		if(Entity.orderedItems){
5347 amit.gupta 108
			$.each(Entity.orderedItems, function(index, sort) {
109
				select.find('option[value="' + sort + '"]').appendTo(select);
110
			});
111
			$("#item_id").val(Entity.orderedItems[0]);
5889 amit.gupta 112
			onColorSelectorChange(Entity.orderedItems[0]);
11672 anikendra 113
			if(typeof deliveryEstimate != 'undefined') {
114
				$("#shipping_time").show();
115
				$("#shipping_time_1").hide();
116
				//$("#shipping_time .red").html("<img src='/images/loader_l.gif'>");
117
				populateEstimate(deliveryEstimate);
118
			}else{
119
				updateEstimate(Entity.orderedItems[0]);
120
			}
5347 amit.gupta 121
		}
4934 amit.gupta 122
		select.find("option:eq(0)").remove();
123
	}
1456 varun.gupt 124
 
1761 vikas 125
    var prodid = $("#product_id").val();
126
 
127
	add_to_storage_set("histitems", prodid);
128
 
2652 rajveer 129
    load_accessories_widget();
3406 rajveer 130
 
131
    load_most_compared_widget();
2754 rajveer 132
 
2731 varun.gupt 133
 
4489 varun.gupt 134
    // Fix to always show first image's title on page load
4530 mandeep.dh 135
    if ("undefined" != typeof(title_1)){
136
        $('.slides .modelName').html(title_1[0]);
137
    }
4489 varun.gupt 138
 
4530 mandeep.dh 139
 
3830 chandransh 140
    function getSeletectedItemId(){
141
    	 return $("#item_id").val();
142
    }
143
 
144
 
1922 varun.gupt 145
    /**
146
     * Code to track user clicks on Product slides and 'Proceed to Payment' option
147
     */
148
	$('a.vt').click(function(){
149
		trackEventWithGA('Product', $(this).children('span').text(), $('title').text().split('|')[0].trim());
150
	});
151
 
3830 chandransh 152
	$('#computeShippingEstimate').click(function(){
153
		updateEstimate(getSeletectedItemId());
154
	});
155
 
156
    $("#addToCart").click(function(){
12626 amit.gupta 157
    	if($(this).attr("href")!=undefined){
158
    		return true;
159
    	}
2811 rajveer 160
    	jQuery.ajax({
1456 varun.gupt 161
			type: "POST",
1614 rajveer 162
			url: "/addtocart",
3830 chandransh 163
			data: "productid=" + getSeletectedItemId(),
1456 varun.gupt 164
			success: function(msg)	{
4530 mandeep.dh 165
	   			 if(msg == "") {
3830 chandransh 166
	   				 trackEventWithGA('Order', 'Add to Cart', getSeletectedItemId() + '');
2036 rajveer 167
					 window.location = "/cart";
4530 mandeep.dh 168
				 } else {
4934 amit.gupta 169
					 var productDetail =  $("#productDetail");
170
    				 var prodInfo = $(productDetail).find("span.brand").html() + $(productDetail).find("span.product-name").html();
2810 rajveer 171
					 displayRelatedProducts(msg);
4934 amit.gupta 172
					 trackEventWithGA('Order', 'OOS Lightbox', prodInfo);
4530 mandeep.dh 173
				 }
2754 rajveer 174
	   		}
1456 varun.gupt 175
		});
176
	});
177
 
3830 chandransh 178
	$("#colorSelector").change(function(){
179
		var itemid = $("#colorSelector option:selected").val();
5889 amit.gupta 180
		onColorSelectorChange(itemid);
11672 anikendra 181
		updateEstimate(itemid);
1456 varun.gupt 182
		return false;
183
	});
184
 
3830 chandransh 185
	$(".util_compare").click(function() {
2755 rajveer 186
		$.colorbox({
187
			inline:true, 
188
			href:"#compareLightBox",
189
    		width:"350px",
190
    		height:"230px",
191
 
192
    		onComplete: function(){
193
    			$('#compareLightBox').show();
194
    		},
195
    		onCleanup: function(){
196
    			$('#compareLightBox').hide();
197
    		}
198
    	});
2228 rajveer 199
	});
3830 chandransh 200
 
201
	$('.util_addnewresearch').click(function(){
202
		addResearch('', 'single');
203
	});
204
 
2236 rajveer 205
    $('#mobilename').keypress(function(e) {
206
    	if(e.keyCode == 13) {
5347 amit.gupta 207
    		return compareProducts($("#compare_continue").attr("producttype"));
2236 rajveer 208
        }
209
    });
210
 
211
 
2228 rajveer 212
    $("#compare_continue").click(function() {
5347 amit.gupta 213
    	return compareProducts($(this).attr("producttype"));
2228 rajveer 214
    });
2236 rajveer 215
 
3305 rajveer 216
    $('.tooltip').click(function() {
217
    	trackEventWithGA('Product', 'Helpdoc Click', $(this).attr('name'));
218
    });
219
 
2320 rajveer 220
    $('.tooltip').each(function(index) {
221
    	   $(this).qtip({
222
    		style: { width: 300, overflow: 'auto',
223
    			tip: { corner: 'topLeft' }, 
224
    			border: { width: 2, radius: 2, color: '#DDDDDD' } },
225
    		show: { when: { event: 'click' } },
226
    		content: { url: "/helpdocs/" + $(this).attr('name'), title: { text: '&nbsp;', button: 'Close'} },
227
    		hide: { when: { event: 'unfocus' } },
228
    		position: { adjust: {screen: true} }
229
    		});
230
    	});
231
 
232
 
5347 amit.gupta 233
    function compareProducts(productType){
234
		var hyphenatedProductType = productType.replace(/ +/g, '-').toLowerCase();
235
 
236
    	var productName = $("#mobilename").val();
5358 amit.gupta 237
		var hypenatedNameTwo = productName.replace(/ +/g, '-').replace(/\/+/g,'-').replace(/-+/g,'-').toLowerCase();
4143 varun.gupt 238
 
5347 amit.gupta 239
		var productTwo = productIdNames[productType][productName];
2236 rajveer 240
		if(typeof productTwo == 'undefined'){
241
			alert("Please select a valid product");
242
			return false;
243
		}
2827 rajveer 244
		var productOne = $("#catalog_id").val();
5347 amit.gupta 245
		var prodDetail = $("#productDetail");
246
		var productNameOne = $(prodDetail).find("span.brand").html() + " " + $(prodDetail).find("span.product-name").html();  
5358 amit.gupta 247
		var hyphenateNameOne = productNameOne.replace(/ +/g, '-').replace(/\/+/g,'-').replace(/-+/g,'-').toLowerCase();  
5347 amit.gupta 248
		window.location = "/compare-" + hyphenatedProductType + "/" 
5552 phani.kuma 249
			+ hyphenateNameOne + "-vs-" + hypenatedNameTwo + "?p1="+productOne+"&p2="+productTwo+"&fromsrc=product_page";	
2236 rajveer 250
	}
2228 rajveer 251
 
2802 rajveer 252
    $("#accessories table td div a").live('click', function() {
10537 amit.gupta 253
    	var productId = $(this).attr('title');
2802 rajveer 254
    	trackEventWithGA('Widget', 'Accessory Click', productId);
255
    });
256
 
5862 amit.gupta 257
 
258
	$('.nextSlide-anchorLink').live('click', function() {
259
	    var nextSlideLink = $(this).attr('nextSlideId');
260
	    $('a[href="' + nextSlideLink +'"]').click();
261
	    return false;
262
	});
263
 
5552 phani.kuma 264
    $('a.compare-now').live('click', function(){
265
		var productType = $(this).attr('producttype');
266
		productType = productType.replace(/ +/g, '-').toLowerCase();
267
 
268
		var productOne = $("#catalog_id").val();
269
		var prodDetail = $("#productDetail");
270
		var productNameOne = $(prodDetail).find("span.brand").html() + " " + $(prodDetail).find("span.product-name").html();
271
		var hyphenateNameOne = productNameOne.replace(/ +/g, '-').replace(/\/+/g,'-').replace(/-+/g,'-').toLowerCase();
272
 
273
		var productTwo = $(this).attr("value");
274
		var hypenatedNameTwo = $(this).attr("title").replace(/ +/g, '-').replace(/\/+/g,'-').replace(/-+/g,'-').toLowerCase();
275
 
276
		window.location = "/compare-" + productType + "/" + hyphenateNameOne + "-vs-" + hypenatedNameTwo + "?p1="+productOne+"&p2="+productTwo+"&fromsrc=most_compared_widget";
277
    });
278
 
1456 varun.gupt 279
});
280
 
281
function changeSignInClass(){
282
	if(document.getElementById("signinClass").className.indexOf("signin1") > -1)	{
283
		document.getElementById("signinClass").className = 'signin';
284
	} else	{
285
		document.getElementById("signinClass").className = 'signin1';
286
	}
287
}
288
 
11672 anikendra 289
function populateEstimate(msg) {
290
	var response = eval('(' + msg + ')');
291
	var deliveryEstimate = response['delivery_estimate'];
292
	var codDeliveryEstimate = response['cod_delivery_estimate'];
293
	var isCODAvailableForLocation = (response['is_cod_available_for_location'] === 'true');
294
	var isOTG = (response['on_time_guarantee'] === 'true');
295
	var businessDays = response['business_days'];
296
 
297
	if(deliveryEstimate == -1)	{
298
		$("#shipping_time").hide();
299
		$("#shipping_time_1").show();
300
		$('#cod_know_more').hide();
301
	} else	{
302
		$('#cod_know_more').hide();
303
		if($("#shipping_time").html().indexOf('after arrival')>-1){
304
			$("#shipping_time .red").html(businessDays + " Days");
305
		}else{
306
			if(isCODAvailableForLocation && (codDeliveryEstimate != deliveryEstimate)){
307
				$("#shipping_time .cod").html("Cash On Delivery orders is " + codDeliveryEstimate);
308
				$('#cod_know_more').show();
309
			}
310
			$("#shipping_time .red").html(deliveryEstimate);
311
		}
312
	}
313
 
314
	if (isCODAvailableForLocation)	{
315
		$('#cod').show();
316
	} else {
317
		$('#cod').hide();
318
	}
319
 
320
	if (isOTG)	{
321
		$('#otg').show();
322
	} else {
323
		$('#otg').hide();
324
	}
325
}
2228 rajveer 326
 
1456 varun.gupt 327
function updateEstimate(itemId)	{
3830 chandransh 328
	itemId = itemId || $("#colorSelector option:selected").val();
1456 varun.gupt 329
 
330
	jQuery.ajax({
331
		type: "GET",
1919 rajveer 332
		url: "/estimate/" + $("#zipcode").val() + "_" + itemId,
1456 varun.gupt 333
		beforeSend: function()	{
5234 amit.gupta 334
			$("#shipping_time").show();
335
			$("#shipping_time_1").hide();
7893 rajveer 336
			$("#shipping_time .red").html("<img src='/images/loader_l.gif'>");
1456 varun.gupt 337
		},
338
		success: function(msg)	{
11672 anikendra 339
			populateEstimate(msg);
1456 varun.gupt 340
		}
341
	});
2228 rajveer 342
}
343
 
3406 rajveer 344
function load_most_compared_widget(){
10198 amit.gupta 345
	if(Entity.isComparable) {
346
		jQuery.ajax({
347
			type : "GET",
348
			url : "/most-compared-products/" + $("#product_id").val(),
349
			cache: false,
350
			success : function(html) {
351
	   		    $("#mostcompared").html(html);
352
 
353
			    // Product Title
354
			    $("#mostcompared table td div a").each(function() {
355
			    		if($(this).attr('class') != "compare-now"){
356
			    			$(this).truncate({addtitle : true});
357
			    		}
358
			    });
359
 
360
			    // Product Price
361
			    $("#mostcompared table td div div.price").each(function() {
362
						$(this).truncate({addtitle : true});
363
				});
364
 
365
			    // Product Details
366
			    $("#mostcompared table td div div.text").each(function() {
367
						$(this).truncate( {addtitle : true});
368
				});
369
		    }
370
		});
371
	}
5889 amit.gupta 372
}
373
function onColorSelectorChange(itemid){
12626 amit.gupta 374
	$('div.shipping1').remove();
375
	$('div.shipping').show();
376
	$('#addToCart').removeAttr("href");
12026 amit.gupta 377
	if(typeof privateDeals[itemid]== "undefined") {
378
		sellingPrice = Number(PARAMETERS[itemid].SP); 
379
		if($('#sp').length>0){
380
			$('#sp').html(PARAMETERS[itemid].SP);
381
			$('#mrp').html(PARAMETERS[itemid].MRP);
382
			$('#saving').html(PARAMETERS[itemid].SAVING);
383
			$("#item_id").val(itemid);
12626 amit.gupta 384
			var exclusiveAffiliateItem;
385
			if(typeof ExclusiveAffItems != "undefined"){
386
			 	for(i in ExclusiveAffItems){
387
			 		if (ExclusiveAffItems[i].itemId==itemid){
388
			 			exclusiveAffiliateItem = ExclusiveAffItems[i];
389
			 			break;
390
			 		}
391
			 	}
392
			 	sellerImg = {
393
			 		1 : 'flipkart_logo.png',
394
			 		2 : 'amazon_logo.png',
395
			 		3 : 'snapdeal_logo.png'
396
			 	};
397
			 	if(typeof exclusiveAffiliateItem != "undefined"){
398
					var innerhtml = '<div class="shipping1 left"><div style="background-color: #FAFAFA;padding:4px;font-size: 14px;">Available on '
399
						+ exclusiveAffiliateItem.affiliateName+'</div><div style="padding: 10px;background-color:#FFF;padding-left: 136px;background-image: url(\'/images/' + sellerImg[exclusiveAffiliateItem.affiliateId] + '\');background-repeat: no-repeat;background-size: 120px;color: #777777;font-size: 14px;">'
400
						+ (typeof exclusiveAffiliateItem.offerText=="undefined"?'':exclusiveAffiliateItem.offerText) + '</div></div>';
401
					$("#addToCart").attr("href", exclusiveAffiliateItem.affiliateUrl);	
402
					$('div.shipping').hide();
403
					$(innerhtml).insertAfter('div.shipping');
404
				}
405
 
406
			}
12026 amit.gupta 407
		}
12040 amit.gupta 408
		$('div.mk_deal').hide();
12026 amit.gupta 409
		$('div.mk_nodeal').show();
410
	} else {
411
		var itemp = privateDeals[itemid];
412
		sellingPrice = itemp.dealPojo.dealPrice;
12031 amit.gupta 413
		var installment = sellingPrice*EMI.interestRate*Math.pow(1+EMI.interestRate,EMI.tenure)/(Math.pow(1+EMI.interestRate,EMI.tenure) - 1);
12027 amit.gupta 414
		if(typeof itemp.mrp == "undefined" || itemp.mrp =="") itemp.mrp = itemp.sellingPrice
12026 amit.gupta 415
		var percentoff = Math.round((1-itemp.dealPojo.dealPrice/itemp.mrp)*100);
416
		var dealLeft = '';
417
		var dealRight = '';
418
		if(itemp.dealPojo.dealTextOption==0){
419
			dealRight = itemp.bestDealText;
420
		}else if(itemp.dealPojo.dealTextOption==1){
421
			dealLeft=itemp.bestDealText;
422
		}else {
423
			dealRight=itemp.bestDealText;
424
			dealLeft = itemp.dealPojo.dealText
425
		}
426
 
427
		var html = [];
12066 amit.gupta 428
		html.push('<div>');
12081 amit.gupta 429
		html.push('<div class="left rupeeimage"></div><span class="bold" style="text-decoration:line-through;font-size:14px;">'+ itemp.mrp +'</span>');
12066 amit.gupta 430
		if(itemp.mrp!=itemp.sellingPrice) {
12081 amit.gupta 431
			html.push('<span style="text-decoration:line-through;font-size:14px;padding-left:4px">'+ itemp.sellingPrice +'</span>');
12066 amit.gupta 432
		}
433
		if(typeof dealRight != "undefined" && dealRight != ''){
12081 amit.gupta 434
			html.push('<span style="padding-bottom:3px;padding-left:6px;text-decoration:line-through;">' + dealRight +'</span>');
12066 amit.gupta 435
		}
12069 amit.gupta 436
		html.push('</div>');
12073 amit.gupta 437
 
12091 amit.gupta 438
		html.push('<div style="font-size:14px;padding-top:3px"><b>Only for You: </b><span class="red">Rs.' + sellingPrice + '</span> (' + percentoff + '% Off)<span class="red" style="font-weight:bold;font-size:14px;padding-left:10px"> Use Coupon: saholicdeals</span></div>');
12073 amit.gupta 439
 
440
		html.push('<div>');
12049 amit.gupta 441
		if(typeof dealLeft != "undefined" && dealLeft != ''){
12091 amit.gupta 442
			html.push('<span style="padding-right:10px">');
12073 amit.gupta 443
			html.push('<span class="red" style="font-weight:bold;padding-bottom:3px">' + dealLeft +' </span>');
12080 amit.gupta 444
			if($(".mk_best_deal_detail").size()>0){
445
				html.push('<a class="mk_best_deal_detail" href="javascript:void(0)"  style="padding-left:2px"><img src="/images/quesmark.png" style="vertical-align: middle;"></a>');
446
			}
12076 amit.gupta 447
			html.push('</span>');
12026 amit.gupta 448
		}
12073 amit.gupta 449
		html.push('<span class="mk_emi" style="font-size:14px;">EMIs from <span class="red">Rs.' + Math.round(installment) +'</span> per month<a style="padding-left:2px" href="javascript:void(0)" id="emi_more1"><img style="vertical-align: middle;" src="/images/quesmark.png"></a></span>')
450
		html.push('</div>');
12066 amit.gupta 451
 
12026 amit.gupta 452
		html.push('</div>');
12040 amit.gupta 453
		$('div.mk_nodeal').hide();
12091 amit.gupta 454
		$('div.mk_deal').css("background-color","#f2ed69").html(html.join('')).show();
6021 amit.gupta 455
	}
7853 amit.gupta 456
}
457
 
458
banks = {};
459
var first = true;
460
for (obj in PARAMETERS) {
461
   sellingPrice = Number(PARAMETERS[obj].SP);
462
   break;
463
}
464
 
465
function onBankClicked(){
466
	var bankId = jQuery(this).val();
467
	var bank = banks[bankId];
468
	var emiTableEle = jQuery("#emi_options");
469
	var tdHtml=[];
470
	var tenureHtml=[];
8948 amit.gupta 471
	var percentHtml=[];
9145 rajveer 472
	tdHtml.push("<td><b>Installment<br>(Including Interest)</b></td>");
8960 rajveer 473
	percentHtml.push("<td><b>Interest Rate<br>(Annualized)</b></td>");
7853 amit.gupta 474
	jQuery.each(bank.emis, function(key,val){
12050 amit.gupta 475
		var r = val.interestRate/12/100;
12051 amit.gupta 476
		var installment = sellingPrice*r*Math.pow(1+r,val.tenure)/(Math.pow(1+r,val.tenure) - 1);
12050 amit.gupta 477
		val.monthlyEmi =  (Math.round(installment*100)/100).toFixed(2);
7853 amit.gupta 478
		tdHtml.push('<td><span style="font-size:11px" class="rupee-icon"><b>' + val.monthlyEmi+ '</b></span></td>');
479
		tenureHtml.push('<td><span style="font-size:11px"><b>' + val.tenureDescription + '</b></span></td>');
8948 amit.gupta 480
		percentHtml.push('<td><span style="font-size:11px"><b>' + val.interestRate + '%</b></span></td>');
7853 amit.gupta 481
	});
8948 amit.gupta 482
	emiTableEle.find("td.mk_bankname").html(bank.name);
7853 amit.gupta 483
	emiTableEle.find("td.mk_emioptions").attr("colspan", count(bank.emis));
484
	emiTableEle.find("tr.emirow").html(tdHtml.join(""));
485
	emiTableEle.find("tr.mk_tenure").html(tenureHtml.join(""));	
8948 amit.gupta 486
	emiTableEle.find("tr.mk_percent").html(percentHtml.join(""));	
7853 amit.gupta 487
}
488
 
489
function count(obj) {
490
   var count=0;
491
   for(var prop in obj) {
492
      if (obj.hasOwnProperty(prop)) {
493
         ++count;
494
      }
495
   }
496
   return count;
11970 amit.gupta 497
}
12026 amit.gupta 498
privateDeals={};
11970 amit.gupta 499
if(typeof prodJson!="undefined"){
500
	for(i in prodJson.response.itemPojos){
501
		var deal = prodJson.response.itemPojos[i].dealPojo;
502
		if (typeof deal != "undefined"){
12029 amit.gupta 503
			privateDeals[prodJson.response.itemPojos[i].id] = prodJson.response.itemPojos[i];
11970 amit.gupta 504
		}
505
	}
12026 amit.gupta 506
}
507
 
508
function highlightDeal(){
509
 
3406 rajveer 510
}