var isIE6 = ((navigator.userAgent.indexOf("MSIE 6.") != -1) && (navigator.userAgent.indexOf("Opera") == -1));
var isIE7 = ((navigator.userAgent.indexOf("MSIE 7.") != -1) && (navigator.userAgent.indexOf("Opera") == -1));
var isChrome = ((navigator.userAgent.indexOf("Chrome") != -1));
var isSafari = ((navigator.userAgent.indexOf("Safari") != -1));
 
 
 jQuery.fn.center = function () {
    this.css("position","absolute");
    this.css("top", (($(window).height() - this.outerHeight()) / 2) + $(window).scrollTop() + "px");
    this.css("left", (($(window).width() - this.outerWidth()) / 2) + $(window).scrollLeft() + "px");
    return this;
}
 jQuery.fn.centerHoriz = function () {
    this.css("position","absolute");
    this.css("left", (($(window).width() - this.outerWidth()) / 2) + $(window).scrollLeft() + "px");
    return this;
}



function doCenterHoris(tothing) {
    tothing.centerHoriz();
};
     
     
     
     
     
$(document).ready(function(){

$(".clickable").click(
function()
{
    window.location = $(this).attr("url");
}).hover(
function()
{
   $(this).addClass('overblock');
},
function()
{
   $(this).removeClass('overblock');
}
);




	
	//background for input on hover anf focus
	$("input").hover(function(){
		$(this).addClass("write_hover");
	},function(){
		$(this).removeClass("write_hover");
	});
	
	$("input").click(function(){
		$(this).addClass("write");
	});
	
	$("input").blur(function(){
		$(this).removeClass("write");
	});
	
	$("input").focus(function(){
		$(this).addClass("write");
	});
	
	$("textarea").hover(function(){
		$(this).addClass("write_hover");
	},function(){
		$(this).removeClass("write_hover");
	});
	
	$("textarea").click(function(){
		$(this).addClass("write");
	});
	
	$("textarea").blur(function(){
		$(this).removeClass("write");
	});
	
	$("textarea").focus(function(){
		$(this).addClass("write");
	});
	
	$("#contact_form #name").addClass("write");
	$("#contact_form #name").focus();
	
	$(".blockLink").hover(function(){
		$(this).addClass("blockHover");
		$(".blockHover").click(function(){

		});
	
		
	},function(){
		$(this).removeClass("blockHover");
		$(".blockHover").unbind();
		
	});
	

   
   
});






$(function(){
	
 /*******************/

    $("#root").centerHoriz();
    $("#infosHome").centerHoriz();
      
    $(window).resize(function() { doCenterHoris($("#root"));doCenterHoris($("#infosHome")) })

/**************************/




});



