/**
 * @author dailexs
 */
var status = 0;

$(function(){

$("#flash_ad").flashembed("matrixAd3.swf");

    $("a[rel]").overlay({ 
        effect:'apple', 
 		closeOnClick: true,
        onBeforeLoad: function() { 
        $('#flash_ad').css({'display':'none'});
		}
		, 
 		onClose:function(){
			$('#flash_ad').css({'display':'block'});
		}	
    });		
	
   $("button[rel]").overlay({ 
        effect:'apple', 
 		closeOnClick: true,
		onBeforeLoad: function() { 
        $('#flash_ad').css({'display':'none'});
		},
 		onClose:function(){
			$('#flash_ad').css({'display':'block'});
		}	
    });		
	
	$("#claim").click(function(){
		appForm("none");
	});
	
// ********************************************** menu animation *********************************	
	$('#menu_about').mouseover(function(){
		$('#menu_container div').each(function(i){
			if(this.id != "menu_about"){
				$(this).stop().animate({height:'50px'},{queue:false, duration:600});
			}else{
				$(this).stop().animate({height:'170px'},{queue:false,duration:600});
				
			}
			
		});
	}).mouseout(function(){
		$('#menu_container div').each(function(i){
		$(this).stop().animate({height:'70px'},{queue:false, duration:600});
		});
	});

	$('#menu_injury').mouseover(function(){
		$('#menu_container div').each(function(i){
			if(this.id != "menu_injury"){
				$(this).stop().animate({height:'50px'},{queue:false, duration:600});
			}else{
				$(this).stop().animate({height:'170px'},{queue:false,duration:600});
			}
		});
	}).mouseout(function(){
		$('#menu_container div').each(function(i){
		$(this).stop().animate({height:'70px'},{queue:false, duration:600});
		});
	});

	$('#menu_taxi').mouseover(function(){
		$('#menu_container div').each(function(i){
			if(this.id != "menu_taxi"){
				$(this).stop().animate({height:'50px'},{queue:false, duration:600});
			}else{
				$(this).stop().animate({height:'170px'},{queue:false,duration:600});
			}
		});
	}).mouseout(function(){
		$('#menu_container div').each(function(i){
		$(this).stop().animate({height:'70px'},{queue:false, duration:600});
		});
	});

	$('#menu_license').mouseover(function(){
		$('#menu_container div').each(function(i){
			if(this.id != "menu_license"){
				$(this).stop().animate({height:'50px'},{queue:false, duration:600});
			}else{
				$(this).stop().animate({height:'170px'},{queue:false,duration:600});
			}
		});
	}).mouseout(function(){
		$('#menu_container div').each(function(i){
		$(this).stop().animate({height:'70px'},{queue:false, duration:600});
		});
	});


	$('#menu_contact').mouseover(function(){
		$('#menu_container div').each(function(i){
			if(this.id != "menu_contact"){
				$(this).stop().animate({height:'50px'},{queue:false, duration:600});
			}else{
				$(this).stop().animate({height:'170px'},{queue:false,duration:600});
			}
		});
	}).mouseout(function(){
		$('#menu_container div').each(function(i){
		$(this).stop().animate({height:'70px'},{queue:false, duration:600});
		});
	});

	$('#menu_findus').mouseover(function(){
		$('#menu_container div').each(function(i){
			if(this.id != "menu_findus"){
				$(this).stop().animate({height:'50px'},{queue:false, duration:600});
			}else{
				$(this).stop().animate({height:'170px'},{queue:false,duration:600});
			}
		});
	}).mouseout(function(){
		$('#menu_container div').each(function(i){
		$(this).stop().animate({height:'70px'},{queue:false, duration:600});
		});
	});

	$('#menu_reg').mouseover(function(){
		$('#menu_container div').each(function(i){
			if(this.id != "menu_reg"){
				$(this).stop().animate({height:'50px'},{queue:false, duration:600});
			}else{
				$(this).stop().animate({height:'170px'},{queue:false,duration:600});
				
			}
		});
	}).mouseout(function(){
		$('#menu_container div').each(function(i){
		$(this).stop().animate({height:'70px'},{queue:false, duration:600});
		});
	});	

	
// ***************************************** End of menu animation *****************************************	
	
	$('#menu_container a').stop().click(function(e){
		var my_p = $(this).attr('href');
		var x = $(my_p).css('left');

		$('#scroll-window').stop().animate({
						scrollLeft: x
						},
						{	queue: false,
							duration: 500,
							easing: "swing"
						});
					
	 e.preventDefault();

	
	});
});


function appForm(part){
	$('body').click();
	
	$('#scroll-window').stop().animate({
		scrollLeft: 3000
	}, {
		queue: false,
		duration: 600,
		easing: "swing"
	});
}

