function getParameterByName(name)
{
  name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
  var regexS = "[\\?&]" + name + "=([^&#]*)";
  var regex = new RegExp(regexS);
  var results = regex.exec(window.location.href);
  if(results == null)
    return "";
  else
    return decodeURIComponent(results[1].replace(/\+/g, " "));
}

var console_debug = true;
debug_mode_str = getParameterByName("debug_mode"); //* any string will do as long as it's not empty
if(debug_mode_str.length == 0){
    console_debug = false;
}
if (console_debug) {
    if($.browser.mozilla && typeof window.loadFirebugConsole != 'undefined'){
        window.loadFirebugConsole();
    }
}
else if($.browser.msie) {
    window.console = {};
    window.console.info =
    window.console.log =
    window.console.warn =
    window.console.error = function(){}
} else {
    try{
        window.console = {};
        window.console.info =
        window.console.log =
        window.console.warn =
        window.console.error = function(){}
    }
    catch(err){
        //* we know about the setting a getter only variable, it only happens on ff3.5 and it's not an issue
    }
}

function isIphone(){
    if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) ||
        (navigator.userAgent.match(/iPad/i)) ) { 
        return true;
    }
}

function breakoutUrlVars(query){
    var vars = [], hash;
    var hashes = query.split('&');
    for(var i = 0; i < hashes.length; i++)
    {
        hash = hashes[i].split('=');
        vars.push(hash[0]);
        vars[hash[0]] = hash[1];
    }
    return vars;
}


function initPanelling(){

    //* initialize the root pane and its immediate subpanes
    nav.initCurrPane( $('#navigator-menu > .pane-root') ); 

    $('#navigator-menu li h5').each(function(i,panel_handle){
        $(panel_handle).mouseover(function(){
	    //$(".date-bar input.cal-btn").each(function(i, e){
            if(!$(panel_handle).hasClass("panel-initd")){
                var target_pane = $(panel_handle).next(".pane");
                target_pane.each(function(i,e){
                    $(panel_handle).addClass("panel-initd");
                    nav.initCurrPane($(e));
                });
            }
		});
	});
}

var nav_timeout = 500;
var nav;
function initNavigator(){
    //if($("#navigator").length <=0){return;}
    nav = new GsdNavigator();
    //nav.domNavButtonHl = $('#navigator-button-hl');
    //console.log(nav);
    
    //$('#bg-screen').css({'height': $(window).height()});
    
    // TEMP: See overlayed menus
    //$('ul.pane').css('opacity', 0.6);
    
    //$('ul.pane').css('display', 'none');
    //$('ul.pane').css('visibility', 'visible');
    
    // Start with First Pane Tier
    // Adjust Top position of first pane element
    // Initialize root pane as depth=0
    $('#navigator-menu > .pane-root')
        .css('top', $('#navigator-menu > .pane-root').innerHeight()*-1 + 1 + "px")
        .attr(nav.depthClass, '0');
    
    //* parse and align pages
    // nav.findPanes( $('#navigator-menu > .pane-root') ); // FIX
    initPanelling();

    //console.log("highest pane depth " + nav.highestPaneDepth);
    
    // Start Up Animation Routine
    /////////////////////////////
    
    //$('#navigator-base').animate({
    var window_height = $(window).height();

    var temp_options = {
        "top": 3*(window_height/4)+"px",
        "bottom":"auto"
    };
    if ( !($.browser.msie )) {
        temp_options["opacity"] = "0.0";
        /*
        $('#navigator').css({
            "top":window_height/2+"px",
            "bottom":"auto",
            "opacity": "0.0"
        });
        */
        $('#navigator').css(temp_options);
        var temp_options = {
            'top':window_height+"px"
        };
        temp_options["opacity"] = "1.0";
        /*
        $('#navigator').animate({
            //'bottom': '20px',
            'top':window_height+"px",
            'opacity': '1.0'
        }*/
        //$('#navigator').delay(2000).animate(temp_options, 1800, 'easeInOutQuart', function(){
        //$('#navigator').delay(1200).animate(temp_options, 2000, 'easeInOutQuart', function(){
        //* having the nav menu slide down
        $('#navigator').delay(10).animate(temp_options, 1200, 'easeInOutQuart', function(){
            //$('#bg-screen').animate({'opacity': 0}, 600, function(){$(this).remove();});
            
            // Begin Pulsating Timer
            nav.blinkNavButton();
            menu_button_timer = setInterval(nav.blinkNavButton, 1500);
            
            $("#navigator").addClass("fixed");
        });
    }
    else{
            nav.blinkNavButton();
            menu_button_timer = setInterval(nav.blinkNavButton, 1500);
            $("#navigator").addClass("fixed");
    }
    
    $('#navigator-home-link').bind('click', function(){
        $('#bg-src').attr('src', './bg/home-1.htm');
        
        $('#navigator-menu').find('.pane').each(function(){
            $(this).css('visibility', 'hidden');
        });
        
        // remove all selected
        $('#navigator-menu').find('.selected').each(function(){
            $(this).removeClass('selected');
        });
    });
    
    $('#navigator-opener').bind('mouseover', function(){
        if (nav.menuOpen) {
            return;
        }
        nav.menuOpen = true;
        //$('ul.pane').css('display', 'block');
        //$('ul.pane').css('visibility', 'visible');
        $('.pane-root')
            .css('visibility', 'visible')
            .find('li > h5, li > a')
                .bind('mouseenter', function(){
                    /*console.log('mouse over');*/
                    var depth_index = parseInt( $(this).closest('.pane').attr(nav.depthClass) );
                    var pane_index  = parseInt( $(this).parent().index() );
                    
                    $(this).closest('.pane').find('.selected').each(function(){
                        $(this).removeClass('selected');
                    });
                    
                    $(this).closest('.pane').find('.pane').each(function(){
                        //console.log("Visible Pane--");
                        //console.log( $(this) );
                        $(this).css('visibility', 'hidden');
                    });
                    
                    $(this).addClass('selected');
                    
                    // Assign Child Pane
                    var child_pane = $(this).siblings('.pane');
                   
                    /* 
                    console.log('Depth Index: ' + depth_index);
                    console.log('P Depth Index: ' + nav.pDepthIndex);
                    console.log(nav.pPaneKeys);
                    console.log(nav.paneHistory);
                    */
                    // Monitor Mouse Events within same pane
                    //if (nav.pPaneKeys[])
                    if (depth_index == nav.pDepthIndex) {
                        //
                        //console.log('Same Index');
                        
                        // Same Depth but different Pane/(+ "selected" item)
                        if (pane_index != nav.pPaneKeys[depth_index]) {
                            //console.log('Different List Item');
                            // Onto different item: take pane previous pane
                            // from same depth and make invisible.
                            //console.log( $(nav.paneHistory[depth_index]).hasClass('pane') );
                            if ( $(nav.paneHistory[depth_index]).hasClass('pane') ) {
                                $(nav.paneHistory[depth_index]).css('visibility', 'hidden');
                            }
                            if ( $(nav.itemHistory[depth_index]).hasClass('selected') ) {
                                nav.itemHistory[depth_index].removeClass('selected');
                            }
                        }
                    } else {
                        //console.log('Different Index');
                        if (depth_index < nav.pDepthIndex) {
                            //console.log('Went down a notch');

                            //console.log("Current Index: " + depth_index);
                            //console.log("Prev Index: " + nav.pDepthIndex);
                            
                            //console.log( $('#navigator-menu').find('ul.pane') );
                            $('#navigator-menu').find('ul.pane').each(function(i){
                                // On each pane higher than the current one with mouse over
                                if ( parseInt($(this).attr(nav.depthClass)) > depth_index ) {
                                    //console.log($(this));
                                    // Remove all Selected
                                    $(this).find('.selected').each(function(){
                                        //console.log("!!!!!!");
                                        //console.log( $(this) );
                                        $(this).removeClass('selected');
                                    });
                                    
                                    $(this).find('.pane').each(function(){
                                        //console.log("Visible Pane--");
                                        //console.log( $(this) );
                                        $(this).css('visibility', 'hidden');
                                    });
                                    
                                }
                            });
                        }
                    }
                    
                    // Keep track of Pane indexes, indexed by pane depth (index)
                    // Snapshot of current state
                    nav.pPaneKeys[depth_index] = pane_index;
                    
                    // Keep references to previous panes
                    nav.paneHistory[depth_index] = child_pane;
                    
                    // References to previous <li>s
                    nav.itemHistory[depth_index] = $(this);
                    
                    // Record Previous Depth
                    nav.pDepthIndex = depth_index;
                    
                    // Show Descendant Pane
                    child_pane.css('visibility', 'visible');
                }); 
    });

    
	//If the body is clicked check if its outside of the navigator, if so close the nav

    var hide_nav = function(){
            $('#navigator-menu').find('.pane').each(function(){
                $(this).css('visibility', 'hidden');
            });

            // remove all selected
            $('#navigator-menu').find('.selected').each(function(){
                $(this).removeClass('selected');
            });
            nav.menuOpen = false;
    }
	
    $('body').click(function(event){
        //console.log(event);
		//console.log($(event.target));
        //console.log($(event.target).parents("#navigator"));
		
        if(nav.menuOpen && !($(event.target).parents("#navigator").length > 0 || 
		$(event.target).parents(".ui-datepicker-header").length > 0  ||
		$(event.target).parents(".ui-datepicker-calendar").length > 0 )
		){
            $('#navigator-menu').find('.pane').each(function(){
                $(this).css('visibility', 'hidden');
            });

            // remove all selected
            $('#navigator-menu').find('.selected').each(function(){
                $(this).removeClass('selected');
            });
            nav.menuOpen = false;
        }
    });

    //setting up mouse events for when the cursor leaves the navigator. 
    //There's a brief timeout that lets the user re-enter the nav without closing it.
    var timeout_id = -1;
    /*
    $('#navigator-opener').mouseleave(function(){
        if(timeout_id == -1){
            timeout_id = setTimeout(hide_nav, nav_timeout/4);
        }
    });
    */
    $('#navigator-menu').mouseleave(function(event){
        if(timeout_id == -1 && !$(event.target).hasClass("ui-selectmenu")){
            timeout_id = setTimeout(hide_nav, nav_timeout);
        }
    });
    $('#navigator-menu').mouseenter(function(event){
        if(timeout_id != -1){
            clearTimeout(timeout_id);
            timeout_id = -1;
        }
    });
    //NOTE: gotta check if you're in some input

}

function initInputs(){
	if($("input[type='text'], textarea").length<=0){return;}
	$("input[type='text'], textarea").each(function(i,e){
		e = $(e);
		//console.log(e.attr("value"));
        /*
		if(e.attr("value") != ""){
			e.attr("rel",e.attr("value"));
			e.focus(function(){
				if(e.attr("value") == e.attr("rel")){
					e.attr("value","");
				}
			});
			e.blur(function(){
				if(e.attr("value") == ""){
					e.attr("value",e.attr("rel"));
				}
			});
		}
        */

        var custom_label = $(e).siblings(".custom-label");
        if(custom_label.length == 0){
            //custom_label = $(e).closest(".rtg-input").siblings(".rtg-label");
        }

        custom_label.click(function(){
            $(e).trigger("focus");
        });
        $(e).focus(function(){
            custom_label.hide();
        });
        $(e).blur(function(){
            if($(e).val().length == 0){
                custom_label.show();
            }
        }).trigger("focus").trigger("blur");



	});
    $("form:not(.calendar-form)").each(function(i,e){
        var form_action = $(e).attr("action");
        var input_field = $(e).find("input[type='text']");
        var submit_btn = $(e).find("input[type='submit']");
        //* construct GET query. ajax=1 is taken care of during AjaxSite.getPageContent call
        //* find the submit button
        submit_btn.click(function(){
            if(input_field.attr("value") != input_field.attr("rel")){
                AjaxSiteObj.gotoPage(form_action+"?"+input_field.attr('name')+"="+input_field.attr("value"));
            }
            return false; 
        });
    });
    
}


function initDatepicker(){
    /*
	$(".datepicker").datepicker({
		disabled:false
		
	});*/
	//$(".ui-datepicker").hide();
	//ui-datepicker
    //* clear out dates
	var all_datepickers = $(".date-bar .hasDatepicker");

    //*************************************************************
    //* setupDatepicker function
    //*************************************************************
    var setupDatepicker = function(e){
		e=$(e);
        var calendar_bit =  e.closest(".calendar-bit");
        e.next(".datepicker").datepicker({
            disabled:false,
            onSelect: function(dateText, inst){
                var parsedDate_selected = Date.parse(dateText);
                //console.log(inst, parsedDate_selected.toString("yyyy-MM-dd"));
                var formatedDate_selected =  parsedDate_selected.toString("yyyy-MM-dd");
                var formatedDate_display =  parsedDate_selected.toString("M/dd/yyyy");
    
                //* finding current values
                var root_el = $(inst.input).closest(".date-bar");
                var startDate_input = root_el.find(".start-date input[type=text]");
                var endDate_input = root_el.find(".end-date input[type=text]");
                var startDate_0 = startDate_input.data("date_encoded");
                var endDate_0 = endDate_input.data("date_encoded");
                console.log(root_el, startDate_input);


                //console.log(startDate_0, endDate_0);
                //* update textbox
                //var textbox = $(inst.input).siblings("input[type=text]");
                var textbox = $(inst.input).siblings(".input-wrapper").find("input[type=text]");
                var formatedDate_prev =  textbox.val();
                textbox.trigger("focus");
                textbox.val(formatedDate_display);
                textbox.data("date_encoded", formatedDate_selected);
                textbox.trigger("blur");
                var startDate_1 = startDate_input.data("date_encoded");
                var endDate_1 = endDate_input.data("date_encoded");
                //console.log(startDate_1, endDate_1);

                //* if the other textbox is filled
                //* note, we don't care if the same date that's already set is clicked on again 
                //* cause the user can close the calendar if he wants to exit, clicking on
                //* the date serves as a way to submit the dates
                
                //if( startDate_1 !== "Start Date" && endDate_1 !== "End Date" // &&
                if( typeof startDate_1 != "undefined" && typeof endDate_1 != "undefined" // &&
                    //(startDate_1 !== startDate_0 ||  endDate_1 !== endDate_0)
                 ){
                    //* we can update window.hash and the hash monitor thing handles the rest
                    var action =  calendar_bit.find("form").attr("action");
                    action += "?start_date="+startDate_1+"&end_date="+endDate_1;
                    //window.location.hash = action;
                    AjaxSiteObj.gotoPage(action);

                }
                
	            $(".ui-datepicker", calendar_bit ).hide();
	            $(".hasDatepicker", calendar_bit).removeClass("active");
            }
        });
        //* on input change and enter
        var cal_form = $("form",calendar_bit);
        console.log($("form",calendar_bit), cal_form.data("cal_form_initd"));
        if(cal_form.data("cal_form_initd") == null){
            cal_form.submit(function(event){
                event.preventDefault();
                return false;
            });
            cal_form.data("cal_form_initd", true);
            cal_form.find("input[type=submit]").click(function(){
                //* finding current values
                var startDate_input = cal_form.find(".start-date input[type=text]");
                var endDate_input = cal_form.find(".end-date input[type=text]");
                var startDate = startDate_input.val();
                var endDate = endDate_input.val();
                var startDate_parsed = Date.parse(startDate);
                var endDate_parsed = Date.parse(endDate);

                //console.log("parsedDates", startDate_parsed, endDate_parsed);

                if(startDate_parsed != null && endDate_parsed != null ){
                    var action =  cal_form.attr("action");
                    action += "?start_date="+startDate_parsed.toString("yyyy-MM-dd")+"&end_date="+endDate_parsed.toString("yyyy-MM-dd");
                    //console.log(action);
                    //window.location.hash = action;
                    AjaxSiteObj.gotoPage(action);
                }
                //console.log("form submit!");

                return false;
            });
        }
	    $(".ui-datepicker").hide();
		e.click(function(event){
			event.preventDefault();
			//var datepicker = $(all_datepickers[i]);
			var datepicker = e.siblings(".hasDatepicker");
			if(datepicker.hasClass("active")){
				datepicker.removeClass("active");
				$(datepicker).find(".ui-datepicker").hide();
			}
			else{
				datepicker.addClass("active");
				$(all_datepickers).find(".ui-datepicker").hide();
				datepicker.find(".ui-datepicker").show();
				//hide other calendar widgets
			}
			
			return false;
		});
        if(!calendar_bit.data("calendar_initd") || typeof calendar_bit.data("calendar_initd") == "undefined"){
            calendar_bit.click(function(event){
                if(!$(event.originalTarget).hasClass("calendar-bit")){return;}
	            $(".ui-datepicker", calendar_bit ).hide();
	            $(".hasDatepicker", calendar_bit).removeClass("active");
            });
            calendar_bit.data("calendar_initd",true);
        }
    };
    //*************************************************************

    /*
    $('#navigator li ul li ul li h5, #navigator li ul.pane-level-1-issues h5').each(function(i,panel_handle){
        console.log(panel_handle);
        $(panel_handle).mouseover(function(){
	    //$(".date-bar input.cal-btn").each(function(i, e){
            if(!$(panel_handle).hasClass("datepicker-initd")){
                var target_input = $(panel_handle).next("ul").find(".date-bar input.cal-btn");
                target_input.each(function(i,e){
                    $(panel_handle).addClass("datepicker-initd");
                    setupDatepicker(e);
                    
                });
            }
		});
	});
    */
    $('#navigator ul li h5').each(function(i,panel_handle){
        var calendar_bit = $(panel_handle).next("ul.pane").children("li.calendar-bit");
        if(calendar_bit.length == 0){return;}

        $(panel_handle).mouseover(function(){
	    //$(".date-bar input.cal-btn").each(function(i, e){
            if(!$(panel_handle).hasClass("datepicker-initd")){
                var target_input = $(panel_handle).next("ul").find(".date-bar input.cal-btn");
                target_input.each(function(i,e){
                    $(panel_handle).addClass("datepicker-initd");
                    setupDatepicker(e);
                    
                });
            }
		});
	});
}

function initDropDowns(){
    if($('select').length <= 0){return;}
    //console.log($("#navigator select.theme_dropdown"));

    var current_dropdown;
    var current_pane;


    //$('select').selectmenu({style:'dropdown', maxHeight:262, width:165 });

        //**************************************************************************
        //* setupDropdown function
        //**************************************************************************
        var setupDropdown = function(e){
            e = $(e);
            e.selectmenu({style:'dropdown'});
            var select_obj = e.next("a.ui-selectmenu");
            var select_id = select_obj.attr("id");
            var temp_index = select_id.indexOf("button");
            var select_id = select_id.substring(0, temp_index);
            var select_menu = $("#"+select_id+"menu");
            //On mousedown, immediately reposition the dropdown as a nested element
            select_obj.mousedown(function(){
                    select_obj.after(select_menu);
                    //reposition dropdown
                var menu_height = select_menu.height();
                var select_position = select_obj.position();
                var select_height = select_obj.height();
                var pane_container = select_obj.closest(".pane");
                var pane_height = pane_container.height();
                if(menu_height + select_position.top > pane_height){
                    //menu would overflow, insert it backwards
                    select_menu.css({
                        top:(select_position.top - menu_height) + "px"
                    });
                }
                else{
                    select_menu.css({
                        top:(select_position.top + select_height) + "px"
                    });
                }
            });
           
            select_obj.click(function(){
                current_dropdown = select_obj;
                current_pane = current_dropdown.closest(".pane").closest("li");
            });

            e.change(function(){
                var new_path = e.val();
                if(new_path != ""){
                    AjaxSiteObj.gotoPage(new_path);
                }
            });
            //* dealing with selecting items in the navigator and changing the breadcrumb on click
            //* this is possibly a temporary piece of code as we would prefer to swap it out via ajax


        };
        //**************************************************************************


  //$('#navigator li ul li h5').each(function(i,panel_handle){
    $('#navigator ul li h5').each(function(i,panel_handle){
        //var multisearch_bit = $(panel_handle).next("ul.pane").children("li.content").has(".multi-search");
        //console.log($(panel_handle).next("ul.pane"),$(panel_handle).next("ul.pane").children("li.content") );
        var dropdown_check = $(panel_handle).next("ul.pane").children("li").has("select");
        //var multisearch_bit = $(panel_handle).next("ul.pane").children("li.content:contains('.multisearch')");
        //console.log(multisearch_bit);
        //if(multisearch_bit.length == 0){return;}
        if(dropdown_check.length == 0){return;}
            //console.log(panel_handle);

        $(panel_handle).mouseover(function(){
            if(!$(panel_handle).hasClass("dropdown-initd")){
                var target_dropdowns = $(panel_handle).next("ul").find("select");
                target_dropdowns.each(function(i,e){
                    $(panel_handle).addClass("dropdown-initd");
                    setupDropdown(e);
                    
                });
            }
    
        });

        //* setting up closing the dorpdown when you leave the pane
        $(".pane > li").each(function(i ,e){
            e = $(e);
            e.mouseover(function(event){
                var target = event.target;
                if($(target).is("ul")){
                    target = $(target).find("li")[0];
                }
                else if(!$(target).is("li")){
                    target = $(target).closest("li");
                }
               
                if( current_dropdown && current_dropdown.hasClass("ui-state-active") && 
                    (current_pane.find(".pane").has(target)).length == 0 && target[0] != current_pane[0] ){
                        //if current dropdown is opened, and the current li is not the current pane's li
                        //AND if the new li is not in the current lane's children of li
                        current_dropdown.trigger("mousedown");
                }

            });
        });
        $('#navigator-menu').mouseleave(function(event){
            if( current_dropdown && current_dropdown.hasClass("ui-state-active")){
                //setTimeout(function(){current_dropdown.trigger("mousedown");}, nav_timeout);
                current_dropdown.trigger("mousedown");
            }
        });

    //}, 100);// lets try 100 ms timeout between each dropdown
  }); //each select loop
}

function initIphone(){
    if(isIphone()){
        $("body").addClass("iphone");
    }
}

var AjaxSiteObj;
    //* setup some css stuff to hide the cells while they're loading, this is only use when js is supported
/*
    $.getCSS('/styles/initjs.css',{
        media : 'all'
    });
*/
function initializePage(){
    var redirect_flag = checkRedirects(); //* first thing we do is to check if we're redirecting
    return;
    $("#list-content").hide();
    $("#list-overlay").hide();
    $("#ajax-loader").show();
    //* first thing is to show the GSD loader with a blank page
    //* then check if it is redirecting
    //* if not, then we fade out the GSD loader/intro
    var redirect_flag = checkRedirects(); //* first thing we do is to check if we're redirecting
    if( !redirect_flag ){
        $("#list-content").show(); //* TODO NOTE: we don't show this, period. Unless we want to show the homepage briefly before a new field being retrieved (maybe)
        $("#list-overlay").show();
        $("#ajax-loader").fadeOut();
    }
}

function initGoogleTrack(){
    //* need to force check for tracker

        function OnLoad(){
            if( typeof _gat != "undefined"){
                pageTracker = _gat._getTracker(GOOGLE_ANALYTICS);
            }
            else{
                setTimeout(OnLoad, 1000);
            }
            console.log("page tracker", pageTracker);
        }
            google.setOnLoadCallback(OnLoad);
}
function IEFix(){
    
    $("#navigator-menu form").each(function(i,e){

        $("input[type='text']",e).submit(function(){
            $("input[type='submit']",e).trigger("click");
            return false;
        });
    });
    
}
//* we start off with the body hidden:
$("#list-content").hide();
$( document ).ready( function () {
    initializePage();

//$(window).load(function(){
    initIphone();
	initInputs();

    //* don't initialize if ruby
    var ruby_index = window.location.hostname.indexOf("ruby");
    if(ruby_index == -1){
        initNavigator();
    }
    else{
        $("#navigator").addClass("fixed"); //* just fix the navigator
    }
    //window.setTimeout(initDropDowns, 500);
    if(isIphone()){
        window.setTimeout(initDropDowns, 500); //timeout for iphone
        //window.setTimeout(initDatepicker, 1000);
    
    }
    else{
        initDropDowns();
    	//initDatepicker();
    }
    	initDatepicker();
        IEFix();

    //* Initializing AjaxSite Object
    AjaxSiteObj = new AjaxSite();
        
        /*
        //$(".pane-root .pane input[type='submit']").click(function(event){
        $(".pane-root input[type='submit']").click(function(event){
            event.preventDefault();
            //AjaxSiteObj.gotoPage("/sample_pages/issues-list.html");
            AjaxSiteObj.gotoPage("/sample_pages/search-results.html?q=test");
            return false;
        });*/
        
    //AjaxSiteObj.monitorAddressBar(); //start monitoring


    //new GSDSheet().reinitialize(); //initilize GSDSheet
    //new GSDField().reinitialize(); //initilize GSDField
    initGoogleTrack();
    return;
});

$(window).load(function(){
});

