Subversion Repositories SmartDukaan

Rev

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

$(function(){
        $("#userSelector .default").truncate({addtitle: true});
        
        function submitSeachForm()      {
                var query = $.trim($('#query').val());
                
                if(query != '' && query != 'Search for more items...')  {
                        $('#formSearch').submit();      
                } else  {
                        $('#query').focus();
                }
        }
        
        /** Search in Header **/
        $('#query').val('Search for more items...')
                .focus(function(){
                        $(this).val('');
                })
                .blur(function(){
                        if ($(this).val() == '')        $(this).val('Search for more items...');
                });
        
        $('#searchButton').click(function(){
                submitSeachForm();
        });
        
        $('body').mouseup(function(){
                var userSelector = $('#userSelector');
                var isMouseOnUserSelector = $(userSelector).data('is_mouse_on_user_selector');
                
                if (typeof(isMouseOnUserSelector) == 'boolean'  && !isMouseOnUserSelector)      {
                        $(userSelector).children('ul').hide();
                        $(userSelector).data('usermenustate', false);
                        $(userSelector).removeClass('active');
                }
        });
        
        $('#userSelector').click(function(){
                        
                var userMenuState = $(this).data('usermenustate');
                
                if (typeof(userMenuState) == 'undefined' || !userMenuState)     {
                        $(this).addClass('active');
                        $(this).children('ul').show();
                        $(this).data('usermenustate', true);
                } else  {
                        $(this).removeClass('active');
                        $(this).children('ul').hide();
                        $(this).data('usermenustate', false);
                }
        }).hover(function(){
                $(this).data('is_mouse_on_user_selector', true);
        }, function(){
                $(this).data('is_mouse_on_user_selector', false);
        });

        /** Press Coverage Section **/
        $('#asSeenOnBS').click(function(){
                window.open('http://www.business-standard.com/india/news/spice-launches-online-shopping-portal-saholiccom/434451/', '_blank');
                trackEventWithGA('Press Coverage', 'Logo Click', 'Business Standard');
        });

        $('#asSeenOnTOI').click(function(){
                window.open("http://articles.timesofindia.indiatimes.com/2012-01-25/telecom/30662542_1_nokia-s-windows-phone-nokia-lumia-smartphone", '_blank');
                trackEventWithGA('Press Coverage', 'Logo Click', 'The Times of India');
        });

        $('#asSeenOnWSJ').click(function(){
                window.open('http://online.wsj.com/article/SB10001424052702304447804576412930555639142.html', '_blank');
                trackEventWithGA('Press Coverage', 'Logo Click', 'The Wall Street Journal');
        });
        
        $('#asSeenOnMC').click(function(){
                window.open("http://www.moneycontrol.com/news/technology/nokia-lumia-710-available-for-approximately-rs15700_655601.html", '_blank');
                trackEventWithGA('Press Coverage', 'Logo Click', 'Money Control');
        });
});