


function querySt(ji) {
	hu = window.location.search.substring(1);
	gy = hu.split("&");
	for (i=0;i<gy.length;i++) {
		ft = gy[i].split("=");
		if (ft[0] == ji) {
			return ft[1];
		}
	}
}


jQuery(document).ready(function () {

    //initFormClickTracking();

    jQuery('#insurance_claim').click(function () {
        _gaq.push(['_trackEvent', 'Auto Glass Quotes', 'Link', 'Insurance Claim']);
    });

    jQuery('#state_selector').click(function () {
        _gaq.push(['_trackEvent', 'Header', 'Top Dropdown', 'Search by State']);
    });

    jQuery('#city_selector').click(function () {
        _gaq.push(['_trackEvent', 'Header', 'Top Dropdown', 'Search by Top Cities']);
    });

    jQuery('#productscroller a.next').click(function () {
        _gaq.push(['_trackEvent', 'Home page', 'FAQ Scroller', 'Next Arrow Button']);
    });

    jQuery('#productscroller a.prev').click(function () {
        _gaq.push(['_trackEvent', 'Home page', 'FAQ Scroller', 'Previous Arrow Button']);
    });

    jQuery('#rotator_product h3 a').click(function () {
        _gaq.push(['_trackEvent', 'Home page', 'FAQ Scroller', 'Submit Feedback Button']);
    });



    jQuery('.shop_number .tollfreenumber').click(function () {
        _gaq.push(['_trackEvent', 'Auto Glass Quotes', 'Quote Result page', 'Toll Free Number']);
    });

});

function initFormClickTracking() {

    jQuery('[id$=QuoteForm1_zip]').change(function () {
        _gaq.push(['_trackEvent', 'Auto Glass Quotes', 'Step 1', 'ZIP code']);
    });

    jQuery('[id$=QuoteForm1_Year]').change(function () {
        _gaq.push(['_trackEvent', 'Auto Glass Quotes', 'Step 2', 'Choose car/truck year']);
    });

    jQuery('[id$=QuoteForm1_Make]').change(function () {
        _gaq.push(['_trackEvent', 'Auto Glass Quotes', 'Step 3', 'Car/truck make']);
    });

    jQuery('[id$=QuoteForm1_Model]').change(function () {
        _gaq.push(['_trackEvent', 'Auto Glass Quotes', 'Step 4', 'Car/truck model']);
    });

    jQuery('[id$=QuoteForm1_Opening]').change(function () {
        _gaq.push(['_trackEvent', 'Auto Glass Quotes', 'Step 5', 'Car/truck glass piece']);
    });

    jQuery('[id$=QuoteForm1_Side]').change(function () {
        _gaq.push(['_trackEvent', 'Auto Glass Quotes', 'Step 5', 'Select side']);
    });

    jQuery('[id$=QuoteForm1_DriverSide]').change(function () {
        _gaq.push(['_trackEvent', 'Auto Glass Quotes', 'Step 5', 'Select glass on driver side']);
    });

    jQuery('[id$=QuoteForm1_PassengerSide]').change(function () {
        _gaq.push(['_trackEvent', 'Auto Glass Quotes', 'Step 5', 'Select glass on passenger side']);
    });

    jQuery('[id$=QuoteForm1_Service]').change(function () {
        _gaq.push(['_trackEvent', 'Auto Glass Quotes', 'Step 6', 'Select service']);
    });

    jQuery('[id$=QuoteForm1_numberofchips]').change(function () {
        _gaq.push(['_trackEvent', 'Auto Glass Quotes', 'Step 6', '# of chips']);
    });

    jQuery('[id$=QuoteForm1_btnGetQuote]').click(function () {
        _gaq.push(['_trackEvent', 'Auto Glass Quotes', 'Submit', 'Find shops']);
    });
}
