$(function() {
    $('input[title]').bind({
        focus: function() {
            if ($(this).attr('title') == $(this).attr('value')) {
                $(this).attr('value', '');
            }
        },
        blur: function() {
            if ($(this).attr('value') == '') {
                $(this).attr('value', $(this).attr('title'));
            }
        }
    });
});




	
$(document).ready(function() {

 			$("a[rel=img]").fancybox({
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'titlePosition' 	: 'over',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
				}
			});




//Центральный block1
    $('.center .block1').bind('click', function() {
        var href = $(this).find("a").attr("href");
   		if (href) {window.location=href;}
    });


$('.center .block1').hover(function(){
	var href = $(this).find("a").attr("href");
		if (href) {
			$(this).addClass('hovered');
		}
}, function(){
			$(this).removeClass('hovered');
		});

//Правый block1
    $('.right .block1').bind('click', function() {
        var href = $(this).find("a").attr("href");
   		if (href) {window.location=href;}
    });


$('.right .block1').hover(function(){
	var href = $(this).find("a").attr("href");
		if (href) {
			$(this).addClass('hovered');
		}
}, function(){
			$(this).removeClass('hovered');
		});





var fix_width = 500;
var height = $(".center embed").height();
var width = $(".center embed").width();
var pern = width/height;
var fix_height = 1/pern*fix_width;
$(".center embed").css('height', fix_height + 'px');
$(".center embed").css('width', fix_width + 'px');


var height = $(".center iframe").height();
var width = $(".center iframe").width();
var pern = width/height;
var fix_height = 1/pern*fix_width;
$(".center iframe").css('height', fix_height + 'px');
$(".center iframe").css('width', fix_width + 'px');






});
