// JavaScript Document
$(document).ready(function(){
	$('a[rel*=external]').click( function() {
        window.open(this.href);
        return false;
    });
	
	$('div.slider div.sigplus-gallery').slides({
				play: 6000,
				fadeSpeed: 300,
				effect: 'fade',
				preload: true,
				generateNextPrev: true				
	});
	
	
	Cufon('ul.nav li a', {
		textShadow: '#05256b 1px 1px 0px',
		hover: true
	});
	Cufon('h1', {
		textShadow: '#8facb7 1px 1px',
		//textShadow: '#666 2px 2px',
		hover: true,
		color: '-linear-gradient(#0056d9, #052982)'
	});
	Cufon('h2', {
		//textShadow: '#8facb7 1px 1px',
		//textShadow: '#666 2px 2px',
		hover: true,
		color: '-linear-gradient(#0056d9, #052982)'
	});
	Cufon('div.customkontakt strong.nadpis', {
		textShadow: '#666 1px 1px',
		//textShadow: '#666 2px 2px',
		hover: true,
		color: '-linear-gradient(#0056d9, #052982)'
	});
	Cufon('div.rounded strong.nadpis', {
		textShadow: '#05256b 1px 1px 0px',
		hover: true
	});
	Cufon('div.mapa strong.nadpis', {
		textShadow: '#05256b 1px 1px 0px',
		hover: true
	});
	Cufon('div.mapa a.rezervace', {
		textShadow: '#564033 1px 1px',
		//textShadow: '#666 2px 2px',
		hover: true,
		color: '-linear-gradient(#fafafa, #e0e0e0)'
	});
	Cufon('div.telefon, div.slogan', {
		textShadow: '#FFF 1px 1px 0px',
		hover: true
	});
	Cufon('a.button, .rsform-submit-button, .rsform-button', {
		textShadow: '#ba5820 1px 1px 0px',
		hover: {
		textShadow: '#0a2d6f 1px 1px 0px'
	}
	});
	Cufon('strong.newsflash-titlerounded a');
	Cufon('legend');
	Cufon('ul.secondnav li.parent a:not(ul.secondnav li.parent li a)', {
		textShadow: '#764d15 1px 1px 0px',
		hover: true
	});
	setTimeout(
		function() 
			{
				var badwidth = ($("#nav ul").width() + 26);
				var goodwidth = (1045 - badwidth) / 14;
				//alert (badwidth)
				$("#nav li a").css( "padding-left","+="+goodwidth);
				$("#nav li a").css( "padding-right","+="+goodwidth);
			}, 1);
	/*var transwidth = (1045 - ($("#nav ul").width() + 17));
	var goodwidth = (((1045 - ($("#nav ul").width() + 17)) / 7) / 2);
	//alert (goodwidth);
	var tmp = 6;*/
	
	

	
	/*$('#center').corner('15px');
	$('div.fill').corner('15px');
	$('div.article').corner('15px');*/
	
	/*$('#coda-slider-1').codaSlider({
					autoSlide: true,
					autoHeight: false,
					crossLinking: false,
					autoSlideInterval: 6000,
					autoSlideStopWhenClicked: true
	});*/
	
	$('div.mapa-akce a').tipsy({fade: true, delayIn: 500});

	//$("div.mapa-akce a img").animate({width: "-=10"},0);
	$("div.mapa-akce a.wide").hover(function() {
		//var novaSirka = $(this).width()*1.2;
	  $(this).find("img").animate({
		width: "141px", height: "95px"
	  }, 500 );
	  $(this).css("z-index",99);
	},
	function() {	
		var sirka = $(this).width() / 1.2;	  
		$(this).find("img").animate({
		width: "85px", height: "57px" //(novaSirka/1.2)
	  }, 500 );
	  $(this).css("z-index",95);
					  
	});
	$("div.mapa-akce a.long").hover(function() {
		//var novaSirka = $(this).width()*1.2;
	  $(this).find("img").animate({
		width: "95px", height: "141px"
	  }, 500 );
	  $(this).css("z-index",99);
	},
	function() {	
		var sirka = $(this).width() / 1.2;	  
		$(this).find("img").animate({
		width: "65px", height: "96px" //(novaSirka/1.2)
	  }, 500 );
	  $(this).css("z-index",95);
					  
	});
	
	$("a.blank").click(function () {		
		return false;		
	});
	
	
	function getUrlVars()
{
    var vars = [], hash;
    var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
    for(var i = 0; i < hashes.length; i++)
    {
        hash = hashes[i].split('=');
        vars.push(hash[0]);
        vars[hash[0]] = hash[1];
    }
    return vars;
}
	var jedna = getUrlVars()["hotel"];
	
	if(jedna == '1') {
		//$("#hotel").value = jedna;
		$("#hotel").val('Hotel Anna');
	}
	if(jedna == '2') {
		//$("#hotel").value = jedna;
		$("#hotel").val('Hotel Bavor');
	}	
	if(jedna == '3') {
		//$("#hotel").value = jedna;
		$("#hotel").val('Hotel Konopiště');
	}
	if(jedna == '4') {
		//$("#hotel").value = jedna;
		$("#hotel").val('Hotel Vavřinec');
	}
	
	$("#prohlidka").flashembed("http://www.amberhotels.cz/flash/vavrinec-prohlidka.swf");
	$("#prohlidka-konopiste").flashembed("http://www.amberhotels.cz/flash/konopiste-prohlidka.swf");
	
	
	/*----------------MAPY--------------*/
	var mapaAnna = '<iframe width="533" height="480" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.cz/maps?f=q&amp;source=s_q&amp;hl=cs&amp;geocode=&amp;q=anna+loc:+Kapl%C3%AD%C5%99ova+168,+385+01+Vimperk+II&amp;sll=49.930008,15.369873&amp;sspn=6.471956,13.348389&amp;brcurrent=5,0,0&amp;ie=UTF8&amp;hq=anna&amp;hnear=Kapl%C3%AD%C5%99ova+168,+385+01+Vimperk+II&amp;cid=16741386878747585441&amp;ll=49.058064,13.782692&amp;spn=0.026997,0.054932&amp;z=14&amp;iwloc=A&amp;output=embed"></iframe><br /><a href="http://maps.google.cz/maps?f=q&amp;source=embed&amp;hl=cs&amp;geocode=&amp;q=anna+loc:+Kapl%C3%AD%C5%99ova+168,+385+01+Vimperk+II&amp;sll=49.930008,15.369873&amp;sspn=6.471956,13.348389&amp;brcurrent=5,0,0&amp;ie=UTF8&amp;hq=anna&amp;hnear=Kapl%C3%AD%C5%99ova+168,+385+01+Vimperk+II&amp;cid=16741386878747585441&amp;ll=49.058064,13.782692&amp;spn=0.026997,0.054932&amp;z=14&amp;iwloc=A" class="button" onclick="window.open(this.href); return false;">Zvětšit mapu</a>';
	
	var mapaBavor = '<iframe width="533" height="480" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.cz/maps?f=q&amp;source=s_q&amp;hl=cs&amp;geocode=&amp;q=Amber+Hotel+BAVOR&amp;sll=49.930008,15.369873&amp;sspn=6.471956,13.348389&amp;brcurrent=5,0,0&amp;ie=UTF8&amp;hq=Amber+Hotel+BAVOR&amp;hnear=&amp;cid=10460342963076108382&amp;ll=49.268477,13.905258&amp;spn=0.053766,0.109863&amp;z=13&amp;iwloc=A&amp;output=embed"></iframe><br /><small><a href="http://maps.google.cz/maps?f=q&amp;source=embed&amp;hl=cs&amp;geocode=&amp;q=Amber+Hotel+BAVOR&amp;sll=49.930008,15.369873&amp;sspn=6.471956,13.348389&amp;brcurrent=5,0,0&amp;ie=UTF8&amp;hq=Amber+Hotel+BAVOR&amp;hnear=&amp;cid=10460342963076108382&amp;ll=49.268477,13.905258&amp;spn=0.053766,0.109863&amp;z=13&amp;iwloc=A" class="button"  onclick="window.open(this.href); return false;">Zvětšit mapu</a>';
	
	var mapaKonopiste = '<iframe width="533" height="480" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?hl=cs&amp;q=amber+hotel+konopi%C5%A1t%C4%9B&amp;ie=UTF8&amp;hq=amber+hotel+konopi%C5%A1t%C4%9B&amp;hnear=&amp;cid=8048948727375575372&amp;ll=49.780488,14.676962&amp;spn=0.026603,0.054932&amp;z=14&amp;iwloc=A&amp;output=embed"></iframe><br /><a href="http://maps.google.com/maps?hl=cs&amp;q=amber+hotel+konopi%C5%A1t%C4%9B&amp;ie=UTF8&amp;hq=amber+hotel+konopi%C5%A1t%C4%9B&amp;hnear=&amp;cid=8048948727375575372&amp;ll=49.780488,14.676962&amp;spn=0.026603,0.054932&amp;z=14&amp;iwloc=A&amp;source=embed" class="button" onclick="window.open(this.href); return false;">Zvětšit mapu</a>';
	
	var mapaVavrinec = '<iframe width="533" height="480" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.cz/maps?f=q&amp;source=s_q&amp;hl=cs&amp;geocode=&amp;q=Amber+Hotel+VAV%C5%98INEC&amp;sll=49.930008,15.369873&amp;sspn=6.471956,13.348389&amp;brcurrent=5,0,0&amp;ie=UTF8&amp;hq=Amber+Hotel+VAV%C5%98INEC&amp;hnear=&amp;cid=5821100392733685659&amp;ll=50.428151,14.261112&amp;spn=0.026245,0.054932&amp;z=14&amp;iwloc=A&amp;output=embed"></iframe><br /><a href="http://maps.google.cz/maps?f=q&amp;source=embed&amp;hl=cs&amp;geocode=&amp;q=Amber+Hotel+VAV%C5%98INEC&amp;sll=49.930008,15.369873&amp;sspn=6.471956,13.348389&amp;brcurrent=5,0,0&amp;ie=UTF8&amp;hq=Amber+Hotel+VAV%C5%98INEC&amp;hnear=&amp;cid=5821100392733685659&amp;ll=50.428151,14.261112&amp;spn=0.026245,0.054932&amp;z=14&amp;iwloc=A" class="button" onclick="window.open(this.href); return false;">Zvětšit mapu</a>';
	
	$("#mapaAnna").append(mapaAnna);
	$("#mapaBavor").append(mapaBavor);
	$("#mapaKonopiste").append(mapaKonopiste);
	$("#mapaVavrinec").append(mapaVavrinec);
	
	



});
