﻿function setStart(imgNum)
{
    $.cookie('flash_header', imgNum);
	//alert(imgNum);
}
changeHeight();
function changeHeight(){
	$("#scrollInner .viewport .overview").width($("#scrollInner .viewport").width());
	if($("body").height()<650)return false;
	if($("#gallery").hasClass("bigpage")){
		$(".scrollInner_style").removeAttr("id");
		$(".center_content").css("padding-bottom","20px");
		$(".scrollInner_style .scrollbar").remove();
		$(".scrollInner_style .viewport").css({"height":"auto","overflow":"visible"});
		$(".scrollInner_style .viewport .overview").css({"position":"relative","overflow":"visible"});
		return false;
	}
	$("#scrollInner .viewport").height($("body").height()-450);
}
$(window).load(function(){
	$('#scrollInner').tinyscrollbar();
});
function changePic(url_){
	$("#gallery .big_img img").attr("src",url_);
	}
function mycarousel_initCallback(carousel)
{
    // Disable autoscrolling if the user clicks the prev or next button.
    carousel.buttonNext.bind('click', function() {
        carousel.startAuto(0);
    });

    carousel.buttonPrev.bind('click', function() {
        carousel.startAuto(0);
    });

};

jQuery(function(){
	jQuery('input[placeholder], textarea[placeholder]').placeholder();
}); 
$(window).resize(function(){
	changeHeight();
});
$(document).ready(function(){	
	$("#top_menu td .cov .zig").css("visibility","visible")
	$("div.spoilerTxt").hide();
	$("span.spoilerTitle").click(function(){
		$(this).parent().next("div.spoilerTxt").slideToggle(300, function(){$('#scrollInner').tinyscrollbar_update('relative')});
		$(this).parent().parent().next("div.spoilerTxt").slideToggle(300, function(){$('#scrollInner').tinyscrollbar_update('relative')});
		});

	jQuery('#mycarousel').jcarousel({
		auto: 0,
		scroll: 3,
		wrap: null,
		initCallback: mycarousel_initCallback
	});
	changeHeight();
	$("#top_menu td .sub").css("visibility","visible");
	/*$("#top_menu tr td:first").addClass("first");
	$("#top_menu tr td:last").addClass("last");
	$("#footer .cont .bot_menu li:first").addClass("first");
	$("#footer .cont .bot_menu li:last").addClass("last");*/
	$("area[rel^='prettyPhoto']").prettyPhoto();
	$(".gallery:first a[rel^='prettyPhoto']").prettyPhoto({animation_speed:'normal',theme:'facebook',slideshow:3000, autoplay_slideshow: false, overlay_gallery:false});
	$(".gallery:gt(0) a[rel^='prettyPhoto']").prettyPhoto({animation_speed:'fast',slideshow:10000, hideflash: true});
	$("#custom_content a[rel^='prettyPhoto']:first").prettyPhoto({
	custom_markup: '<div id="map_canvas" style="width:260px; height:265px"></div>',
	changepicturecallback: function(){ initialize(); }
	});
	$("#custom_content a[rel^='prettyPhoto']:last").prettyPhoto({
	custom_markup: '<div id="bsap_1259344" class="bsarocks bsap_d49a0984d0f377271ccbf01a33f2b6d6"></div><div id="bsap_1237859" class="bsarocks bsap_d49a0984d0f377271ccbf01a33f2b6d6" style="height:260px"></div><div id="bsap_1251710" class="bsarocks bsap_d49a0984d0f377271ccbf01a33f2b6d6"></div>',
	changepicturecallback: function(){ _bsap.exec(); }
	}); 
}); 


