﻿$(document).ready(function(){


// set google adwords cookie

        gaw_strings = window.location.search.substring(1);
        gaw_clickString = gaw_strings.split("gclid");
        
        if(gaw_clickString[1] != null) {
            document.cookie = "GAWordsIsSet";
        }


// contact drop down

                $('li#contact-header-button').hoverIntent(
                    function () {
                        $('div#cdd-body2').fadeIn('fast');
                    },
                    function () {
                        $('div#cdd-body2').fadeOut('fast');
                    });


// Region Selector

                    $('li#region-header-button').hoverIntent(
                    function () {
                        $('ul#region-menu').fadeIn(100);
                    },
                    function () {
                        $('ul#region-menu').fadeOut(100);
                    });


//search box


                $('img#searchButtonUS').click(function () {
                    theURL = "http://www.zenithinfotech.com/search.aspx?searchStr=" + document.getElementById('searchInputUS').value;
                    window.location.href = theURL;
                });


                $('img#searchButtonEU').click(function () {
                    theURL = "http://www.zenithinfotech.eu/search.aspx?searchStr=" + document.getElementById('searchInputEU').value;
                    window.location.href = theURL;
                });






// main menu dropdown

	$('ul.sf-menu').superfish({
	delay: 500,
	animation: {opacity:'show', height:'show'},
	speed: 'fast'
	});




// fancy box 



	$("a.fancy").fancybox({
		'frameWidth': 600,
		'frameHeight': 345
	});

	$("a.fancy-form").fancybox({
		'frameWidth': 900,
		'frameHeight': 500
	});

	$("a.fancy-ss").fancybox({
		'frameWidth': 900,
		'frameHeight': 550
	});

	$("a.inline-fancy").fancybox({
		'frameWidth': 600,
		'frameHeight': 345,
		'hideOnContentClick': false

	});

	$("a.fancy2").fancybox({
		'scrolling': 'no',
		'margin': 0,
		'titleShow': false
	});


	$("a.fancy-faq").fancybox({
		'titleShow': false
	});




// region selector dropdown



	$('div#region-selector-box').hoverIntent(
                    function(){
                    $('div#region-selector-box ul').slideDown('fast');
                    },
                    function(){
                    $('div#region-selector-box ul').slideUp('fast');
                    });





// side menu 2.0


	$('li.side-menu-sub-li').hoverIntent(
                    function(){
                    $('ul', this).slideDown('fast');
                    },
                    function(){
                    $('ul', this).slideUp('fast');
                    });


});


