$(document).ready(function(){
	
    $('.boxes .box:nth-child(3n)').css('margin-right','0');
    $('.gallery a:nth-child(2n)').css('margin-right','0');
	$('.text-cont table tr:even').addClass('even');

    //-- Disable skype
	window.setTimeout(function() {
	    $('.skype_pnh_container').html('');
		$('.skype_pnh_print_container').removeClass('skype_pnh_print_container');
	}, 800);

	
	//---hide border for last item in main menu
    $('.menu ul li:first').css('border', '0 none');
	$('ul.prices-pages li:first').css({'border':'0 none', 'padding-left':'0'});

    //---hide arrow for first breadcrumb
    //$('ul.breadcrumbs li:first').css({paddingLeft:'0', background:'none'});
	
	//---vertical menu
    //$(document).ready(function() {$('ul.vertical-menu').initMenu();});
	//$('div.middle ul a').collapsor();
	
	// expand active menu item
	/*var currentURL = $(location).attr("href");
	$('div.middle ul a').each(function(){
		if($(this).attr("href") == currentURL){
			$(this).addClass("open");
			$(this).parents('li').children(':first-child').addClass("open");
			$(this).parents('li').children('ul').css('display', 'block');
		} 
	});*/

   /* $('.menu a:first').addClass('first');
    var z = 30;
    $('.menu a').each(function(){
        if(!$(this).hasClass("active")){
            $(this).css('z-index', z);
            z--;
        }
    });*/

    //$.preloadCssImages();



    //--superfish menu
	
	/*$('ul.sf-menu').sooperfish();
	$('ul.sf-menu li:last').css({'background':'none', 'padding-right':'0'});
	$('ul.sf-menu li:last a').css('padding-right', '0');   */
	
    /*var superargs = {animation: {height:'show'}, delay:200};
    if($.browser.msie && $.browser.version=="6.0") superargs = {animation: {opacity:'show'}, delay:50};
    $("ul.sf-menu").supersubs({
            minWidth:    12,   // minimum width of sub-menus in em units
            maxWidth:    27,   // maximum width of sub-menus in em units
            extraWidth:  1     // extra width can ensure lines don't sometimes turn over
                               // due to slight rounding differences and font-family
    }).superfish(superargs).find('ul').bgIframe({opacity:true});
    $(".sf-menu ul li:last-child").css('border-bottom', '0 none');*/
	
	
	//--tipsy tooltips
    //$('.langs a, .sitemap a').tipsy({ html: true,gravity: 'n' });
	
	//---add url to images
	$('.text-cont img').each(function(){
		var src = $(this).attr('src');
		var w = $(this).attr('width');
		var h = $(this).attr('height');
		var al = $(this).attr('align');
		$(this).replaceWith('<a href="' + src +'" class="show-fancy"><img src="' + src + '" width="' + w + '" height="' + h + '" align="' + al + '"  /></a>');
	});
	
	//-- Gallery
    /*$('.img-box').mouseenter(function(){$(this).find("img").fadeTo("medium",0.5)}).mouseleave(function(){$(this).find("img").fadeTo("medium",1)});*/
    $('.img-box, .show-fancy').fancybox({
		'titleShow' 	: true, 
        'titlePosition'	: 'outside',
        'transitionIn'	: 'elastic',
        'transitionOut'	: 'elastic'
    });
	
	equalPanels(63);
	//$(window).bind('resize', function () { equalPanels(63); });

});

function equalPanels(diff){
	var h = 0;
	h = $('.all').height() - $('.up').height() - $('.menu').height();
	h = h - diff;
	$('.left').height(0);
	$('.left-cont').height(0);
	$('.left').height(h);
	$('.left-cont').height(h - 30);
	$('.right').height(0);
	$('.right-cont').height(0);
	$('.right').height(h);
	$('.right-cont').height(h - 30);
}
