// JavaScript Document
 var GB_ANIMATION = true;
$(document).ready(function(){
	/*$(document).snowfall({flakeColor : '#dddddd',flakeCount : 100, maxSpeed : 10});*/
	/*$('#elementid').snowfall({flakeCount : 100, maxSpeed : 10});
	$('.class').snowfall({flakeCount : 100, maxSpeed : 10});*/
	/*************************************/
	/* MAIN NAVIGATION SYSTEM            */
	/*************************************/
	$('#coda-slider-1').codaSlider({dynamicArrows: false});
	
	$(".coda-nav ul li a[title]").tooltip({
			tipClass: 'tooltip2',
			effect: 'fade',
			fadeOutSpee: 100,
			predelay:400,
			position: "bottom right",
			offset: [-90, -80]
	});
	
	$("li.tab1 a").mouseover(function(){
		$(this).attr('title','Who we are');					
	});
	$("li.tab2 a").mouseover(function(){
		$(this).attr('title','_HINK');					
	});
	$("li.tab3 a").mouseover(function(){
		$(this).attr('title','Portfolio');					
	});
	$("li.tab4 a").mouseover(function(){
		$(this).attr('title','Clients');					
	});
	$("li.tab5 a").mouseover(function(){
		$(this).attr('title','News');					
	});
	$("li.tab6 a").mouseover(function(){
		$(this).attr('title','Contact');					
	});
	/*$("li.tab7 a").mouseover(function(){
		$(this).attr('title','Contact');					
	});*/
	
	$("li.tab1 a").click(function (){
    	$("#social-media").removeClass("current");
    	
        /*$(".nav:gt(1)").css('display','none');*/
  	}); 	
	
	/*************************************/
	/* FIRST PAGE SLIDESHOW              */
	/*************************************/
	$('#wall_decoration').cycle({
		fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
		timeout: 3000
	});
	
	
	/************************************/
	/* GREY BOX                         */
	/************************************/
        $("a.greybox").click(function(){
          var t = this.title || $(this).text() || this.href;
          GB_show(t,this.href,700,1250);
          return false;
        });
	
	/*************************************/
	/* _HINK PAGE SLIDESHOW              */
	/*************************************/
	$('#_hink_slideshow').cycle({
		fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
		timeout: 3000
	});
	
	/*************************************/
	/* PORTFOLIO                         */
	/*************************************/
	$('#portfolio_pages').css('height','500px');
	$('div.portfolio_brands_gallery img').slidingGallery({
		useCaptions: false,
		container: $('div.portfolio_brands_gallery')
	});
	
	/*************************************/
	/* CLIENTS                           */
	/*************************************/
	$('#client_logos img').mouseover(function(){
		var filename = $(this).attr('src').substr(24);
		$(this).attr('src',"images/clients/logos/"+filename);
	});
	
	$('#client_logos img[title]').tooltip({
		offset: [22, 0]
		//position: 'top center'  
	});
	
	$('#client_logos img').mouseout(function(){
		var filename = $(this).attr('src').substr(21);
		$(this).attr('src',"images/clients/logos/bw/"+filename);
	});

	/*************************************/
	/* CONTACT PAGE                      */
	/*************************************/
	$("#limecontact_form").validationEngine();

	var ajax_load = "<img src='img/loader_white.gif' alt='loading...' />"; 				  
	$("#contact_send").click(function(){
			var post_data = "name="+ $("input#name").val()+ 
					  "&surname="+ $("input#surname").val()+ 
					  "&email="+ $("input#email").val()+
					  "&telephone="+ $("input#telephone").val()+ 
					  "&comments="+ $("textarea#comments").val()+ 
					  "&captcha="+ $("input#captcha").val()+
					  "&lang="+ $("input#lang").val();
			$('#contact_form_container')
				.html(ajax_load)
				.load('pages/send_contact', post_data);																																																				
	});
	
	$("#malev").mouseover(function(){
		$("#malev_bubble").css('display','block');
	});
	$("#malev").mouseout(function(){
		$("#malev_bubble").css('display','none');
	});
	$("#mapicon").toggle(function(){
		$("#googlemap").css('display','block');
	},function(){
		$("#googlemap").css('display','none');
	});
	$("#close_googlemap").click(function(){
		$("#googlemap").css('display','none');
	});
		/*},function(){
			$("#malev_bubble").css('display','none');*/
	
	$('ul.sf-menu').superfish();

});

