Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
3830 chandransh 1
$(function(){
4180 rajveer 2
	$("#userSelector .default").truncate({addtitle: true});
3966 varun.gupt 3
 
4
	function submitSeachForm()	{
5
		var query = $.trim($('#query').val());
6
 
7
		if(query != '' && query != 'Search for more items...')	{
8
			$('#formSearch').submit();	
9
		} else	{
10
			$('#query').focus();
11
		}
12
	}
13
 
3830 chandransh 14
	/** Search in Header **/
15
	$('#query').val('Search for more items...')
16
		.focus(function(){
17
			$(this).val('');
18
		})
19
		.blur(function(){
20
			if ($(this).val() == '')	$(this).val('Search for more items...');
21
		});
22
 
23
	$('#searchButton').click(function(){
3966 varun.gupt 24
		submitSeachForm();
3830 chandransh 25
	});
26
 
4180 rajveer 27
	$('body').mouseup(function(){
28
		var userSelector = $('#userSelector');
29
		var isMouseOnUserSelector = $(userSelector).data('is_mouse_on_user_selector');
30
 
31
		if (typeof(isMouseOnUserSelector) == 'boolean'  && !isMouseOnUserSelector)	{
32
			$(userSelector).children('ul').hide();
33
			$(userSelector).data('usermenustate', false);
34
			$(userSelector).removeClass('active');
35
		}
36
	});
37
 
38
	$('#userSelector').click(function(){
39
 
40
		var userMenuState = $(this).data('usermenustate');
41
 
42
		if (typeof(userMenuState) == 'undefined' || !userMenuState)	{
43
			$(this).addClass('active');
44
			$(this).children('ul').show();
45
			$(this).data('usermenustate', true);
46
		} else	{
47
			$(this).removeClass('active');
48
			$(this).children('ul').hide();
49
			$(this).data('usermenustate', false);
50
		}
51
	}).hover(function(){
52
		$(this).data('is_mouse_on_user_selector', true);
53
	}, function(){
54
		$(this).data('is_mouse_on_user_selector', false);
55
	});
56
 
4810 varun.gupt 57
	/** Press Coverage Section **/
58
	$('#asSeenOnBS').click(function(){
59
		window.open('http://www.business-standard.com/india/news/spice-launches-online-shopping-portal-saholiccom/434451/', '_blank');
60
		trackEventWithGA('Press Coverage', 'Logo Click', 'Business Standard');
61
	});
62
 
63
	$('#asSeenOnTOI').click(function(){
64
		window.open("http://articles.timesofindia.indiatimes.com/2012-01-25/telecom/30662542_1_nokia-s-windows-phone-nokia-lumia-smartphone", '_blank');
65
		trackEventWithGA('Press Coverage', 'Logo Click', 'The Times of India');
66
	});
67
 
68
	$('#asSeenOnWSJ').click(function(){
69
		window.open('http://online.wsj.com/article/SB10001424052702304447804576412930555639142.html', '_blank');
70
		trackEventWithGA('Press Coverage', 'Logo Click', 'The Wall Street Journal');
71
	});
72
 
73
	$('#asSeenOnMC').click(function(){
74
		window.open("http://www.moneycontrol.com/news/technology/nokia-lumia-710-available-for-approximately-rs15700_655601.html", '_blank');
75
		trackEventWithGA('Press Coverage', 'Logo Click', 'Money Control');
76
	});
3830 chandransh 77
});