$(document).ready(function(){

$('a.thumb').lightBox();


/* --- Z-INDEX FIX --*/
var zIndexNumber = 1000;
	$('div').each(function() {
		$(this).css('zIndex', zIndexNumber);
		zIndexNumber -= 10;
	});



/* --- CONTACT FORM --*/


 $(".send").click(function() {  
  

 var name = $("input#name").val();
var email = $("input#email").val();
var comment= $("input#comment").val();
var dataString = 'name='+ name + '&email=' + email + '&comment=' + comment;




  //alert (dataString);

   $.ajax({
      type: "POST",
      url: "../data/contact.php",
      data: dataString,
      success: function() {
        $('.footer-coloumn-last').html("<div id='message'></div>");
    
        $('#message').html("<h3>Your questions has been sent.</h3>")
        .append("<p>We will reply via email that you provide<br/>or you can call us for more info</p>")
        .hide()
        .fadeIn(2200, function() {
          $('#message').append("<p>Thank you</p>");
        });
      }
    });
    return false;

  
  
  });  



/* --- CONTACT FORM --*/

/* --- LANGUAGES --*/

 
function translateTo( lang ){ //this can be declared in the global scope too if you need it somewhere else 
        $('body').translate( 'english', lang, {   //translate from english to the selected language 
          not: '.jq-translate-ui',  //by default the generated element has this className 
          fromOriginal:true   //always translate from english (even after the page has been translated) 
        }); 
 } 

 var lang = $.cookie('lang'); //get previously translated language 
     
    if( lang )  //if it was set then 
        translateTo( lang ); 

$("li#lang1").click(function () { 

    $.cookie("lang", "en", { expires: 1 });
     $('body').translate( { from: 'en', to: $.cookie("lang"), fromOriginal: true, not: 'select', async:  true, toggle: true, walk: false} );
     
});


$("li#lang2").click(function () { 

    $.cookie("lang", "fr", { expires: 1 });
     $('body').translate( { from: 'en', to: $.cookie("lang"), fromOriginal: true, not: 'select', async:  true, toggle: true, walk: false} );
     
});

$("li#lang3").click(function () { 

    $.cookie("lang", "ar", { expires: 1 });
     $('body').translate( { from: 'en', to: $.cookie("lang"), fromOriginal: true, not: 'select', async:  true, toggle: true, walk: false } );
     
});

$("li#lang4").click(function () { 

    $.cookie("lang", "zh", { expires: 1 });
     $('body').translate( { from: 'en', to: $.cookie("lang"), fromOriginal: true, not: 'select', async:  true, toggle: true, walk: false} );
     
});

$("li#lang5").click(function () { 

    $.cookie("lang", "de", { expires: 1 });
     $('body').translate( { from: 'en', to: $.cookie("lang"), fromOriginal: true, not: 'select', async:  true, toggle: true, walk: false} );
     
});

$("li#lang6").click(function () { 

    $.cookie("lang", "it", { expires: 1 });
     $('body').translate( { from: 'en', to: $.cookie("lang"), fromOriginal: true, not: 'select', async:  true, toggle: true, walk: false} );
     
});

$("li#lang7").click(function () { 

    $.cookie("lang", "ja", { expires: 1 });
     $('body').translate( { from: 'en', to: $.cookie("lang"), fromOriginal: true, not: 'select', async:  true, toggle: true, walk: false} );
     
});

$("li#lang8").click(function () { 

    $.cookie("lang", "ko", { expires: 1 });
     $('body').translate( { from: 'en', to: $.cookie("lang"), fromOriginal: true, not: 'select', async:  true, toggle: true, walk: false} );
     
});



     


/* --- BANNER ROTATE & PARTNERS --*/


$('#banner-rotate') 
.before('<div id="nav">') 
.cycle({ 
    fx:     'fade', 
    speed:  2500, 
    timeout: 2500, 
    pager:  '#nav' 
});

/* --- BANNER ROTATE & PARTNERS --*/


/* --- MAIN MENU--*/

    // everything goes here
	$("div#menu-services-hover").hide();
	
	$("li#panel2b a").mouseover(function() {
        // do things here
		$("div#menu-services-hover").show('blind');
											   
    }).mouseout(function() {
        // do things here
	
    }).mousedown(function() {
        // do things here
    }).mouseup(function() {
        // do things here
    });
	

	$("li#panel1b a").mouseover(function() {
        // do things here
		$("div#menu-services-hover").hide();
    }).mouseout(function() {
        // do things here
	
    }).mousedown(function() {
        // do things here
    }).mouseup(function() {
        // do things here
    });
		
		
	$("li#panel3b a").mouseover(function() {
        // do things here
		$("div#menu-services-hover").hide();
    }).mouseout(function() {
        // do things here
	
    }).mousedown(function() {
        // do things here
    }).mouseup(function() {
        // do things here
    });
	
	
   	$("div#menu-services-hover").mouseover(function() {
        // do things here
		$("div#menu-services-hover").show();
    }).mouseout(function() {
        // do things here

    }).mousedown(function() {
        // do things here
	
    }).mouseup(function() {
        // do things here
		
    });
	
	
   $("ul#service-hover").mouseover(function() {
        // do things here
		$("ul#service-hover").show();
    }).mouseout(function() {
        // do things here
		$("div#menu-services-hover").hide();
    }).mousedown(function() {
        // do things here
		
    }).mouseup(function() {
        // do things here
		
    });
	
/* --- MAIN MENU--*/

});




