

$(document).ready(function(){

	// Country list for header	
	$("#header .metanav").append('<div id="countrylist">' +
							'<ul>' +

										'<li><a target="_blank" href="http://www.mucosolvan.bg">Bulharsko</a></li>' +
										
									/*	'<li><a target="_blank" href="http://www.mucosolvan.cz">Česká republika</a></li>' + */
										
										'<li><a target="_blank" href="http://www.mucosolvan.cn">Čína</a></li>' +
										
										'<li><a target="_blank" href="http://www.mucosolvan.de">Německo</a></li>' +
										
										'<li><a target="_blank" href="http://www.mucosolvan.pl">Polsko</a></li>' +
										
										'<li><a target="_blank" href="http://www.mucosolvan.at">Rakousko</a></li>' +

										'<li><a target="_blank" href="http://www.mucosolvan.ro">Rumunsko</a></li>' +
										
									/*	'<li><a target="_blank" href="null">Španělsko</a></li>' + */
										
										'<li><a target="_blank" href="http://www.lasolvan.ua">Ukrajina</a></li>' +



							'</ul>' +
						'</div>');
	$('#countrylist').hide();
	$('.country').click(function(){
		if ($('#countrylist').css('display') == 'none') {
			$('#countrylist').slideDown('normal',function(){
				$('#countrylist').dropShadow({top: 0,left: -1, bottom: 1, right: 1, opacity: 0.3, blur: 2});
			});				
		}
		else 
			$('#countrylist').slideUp().removeShadow();
		return false;
	});

	$("#outer_wrapper").append('<div id="overlay"><!--[if lte IE 6.5]><iframe class="IEFix"></iframe><![endif]--></div>');
	$("#outer_wrapper").append('<div id="disclaimer_overlay"><!--[if lte IE 6.5]><iframe class="IEFix"></iframe><![endif]--></div>');

	var ol = $("#overlay");
	ol.hide();
	var dol = $("#disclaimer_overlay");
	dol.hide();

	var hovered = false;

	var disclaimer = '<div id="disclaimer">' +
						'<div class="clearfix">' +
							'<h3>Personal health</h3>' +
							'<a href="#" class="close">Close window X</a>' +
						'</div>' +
						'<p><strong>You should always contact your healthcare professional for questions on personal health matters.</strong></p>' +
						'<p>We are unable to provide advice or information on the use or intended use of prescription products directly to patients. The queries and feedback form on this site should not be used to ask questions of this nature. Adverse drug reactions should be notified to your healthcare professional as soon as possible.</p>' +
						'<p class="copy">Copyright &copy; null Boehringer Ingelheim GmbH, All rights reserved</p>' +
						'<a href="#" class="print">Print page</a>' +
					 '</div>';

	var country_disclaimer = '<div id="country_disclaimer" class="clearfix">' +
						'<div class="clearfix">' +
							'<h3>Upozornění</h3>' +
							'<a href="#" class="close">zavřít okno X</a>' +
						'</div>' +
						'<br /><p>Kliknutím a následující odkaz opustíte webovou prezentaci společnosti Boehringer Ingleheim. Odkazovaná stránka není pod kontrolou společnosti Boehringer Ingelheim a Boehringer Ingelheim nenese odpovědnost za obsah na odkazovaných stránkách. Zároveň není společnost Boehringer Ingelheim zodpovědná za web casting nebo jiný přenos z odkazovaného webu. Tento odkaz je zde uveden pro úplnost informací a neimplikuje žádnou spojitost mezi společností Boehringer Ingelheim a odkazovaným webem.</p>' +
						'<br /><p><a href="#" id="continue" target="_blank"><strong>Pokračovat</strong></a></p>' +
						'<p class="copy" style="width:330px;" >Copyright &copy; 2008 Boehringer Ingelheim spol. s r.o., Všechna práva vyhrazena<br />&nbsp;</p>' +
					 '</div>';

	$("#outer_wrapper").append(disclaimer);
	$("#outer_wrapper").append(country_disclaimer);
	$('#disclaimer').hide();
	$('#country_disclaimer').hide();

	$('a.phd').click(function(){
		dol.fadeIn("normal", function() { dol.css("opacity",0.75);});
		$('#disclaimer').fadeIn('normal');
		return false;
	});	

	$('#disclaimer a.close').click(function(){
		$("#disclaimer").hide();
		dol.hide();
		return false;
	});
	$('#disclaimer a.print').click(function(){
		$("#disclaimer").hide();
		dol.hide();
		window.print();
		return false;
	});

	$('#countrylist a').each(function(){
		$(this).click(function(){
			dol.fadeIn("normal", function() { dol.css("opacity",0.75);});
			$('#country_disclaimer').fadeIn('normal');
			$('#country_disclaimer a#continue').attr('href',$(this).attr('href'));
			$('#countrylist').hide().removeShadow();
			return false;
		});
	});
	$('#country_disclaimer a.close').click(function(){
		$("#country_disclaimer").hide();
		dol.hide();
		return false;
	});
	$('#country_disclaimer a#continue').click(function(){
		$("#country_disclaimer").hide();
		dol.hide();
	});

	if (jQuery.browser.msie) {		
		$(window).resize( function() { resizeIE(); } );
	}

	$("#recommend td div").hover(function(){
			$(this).addClass("hover");
		},function(){
			$(this).removeClass("hover");
	});
	$("#recommend td div.h").hover(function(){
			$(this).addClass("hover");
		},function(){
			$(this).removeClass("hover");
	});

	$("ul.mainnav").hover(
		function(){		
			//ol.fadeIn("", function() { ol.css("opacity",0.75);});
			ol.show();			
			hovered = true;
		},
		function(){
			ol.hide();
			hovered = false;
		}
	);

	$("#mainnav>ul>li").each(function() {
		var li = $(this);
		var mc = $('>div.mc', li);
		var a = $('a.main', li);
		li.hover(
			function(){
				a.addClass('over');
				if(hovered == false){
					mc.fadeIn();
					$("#header .metanav").css('z-index','500');
					$('#countrylist').hide().removeShadow();
				} else {
					mc.show();
					$("#header .metanav").css('z-index','500');
					$('#countrylist').hide().removeShadow();
				}
			},
			function(){
				a.removeClass('over');
				mc.hide();
				$("#header .metanav").css('z-index','1001');
			}
		)
		a.click( function() { return false; } );
	});

	$("#recommend td div").hover(function(){
			$(this).addClass("hover");
		},function(){
			$(this).removeClass("hover");
	});

	$(".prod_overview td").hover(
		function() { $(this).addClass('hover'); },
		function() { $(this).removeClass('hover'); }
	);

	$(".faqtabs dl a").click( function() { 
		$(".whitebg").removeShadow();		
		$(this).parent().parent().children('dt').removeClass('active');
		$(this).parent().parent().children('dd').removeClass('active');
		$(this).parent().addClass('active');
		$(this).parent().next().addClass('active');
		$(".whitebg").dropShadow({left: 2, top: 2, opacity: 0.3, blur: 2});	
	});	

	$('#tab>ul li a').click( function() { 
		$(this).blur();
		$('#tab>ul li').removeClass("active");
		$(this).parent().addClass('active');
		$(".whitebg").removeShadow();
		setTimeout('loadShadow()',400);
	});	

	/*$('div.metanav a.home').click( function() { 
		$("#outer_wrapper").append('<div id="disclaimer_overlay"><\/div>');
		$("#disclaimer_overlay").html(disclaimer);
		muc_disclaimer = window.open("http://ingwswcms01.eu.boehringer.com/wcms_chc/mucosolvan_com_edit/at/meta/popup_disclaimer.htm", "muc_disclaimer","width=533,height=255,menubar=no,toolbar=no,resizable=yes");
		muc_disclaimer.focus();
	});*/

	$('a.flashTeaser').click( function() { 
		muc_disclaimer = window.open("/jnp/cz/popup/-content-mucosolvan-content-o_kasli-respiratory_System_Animation.html", "Animated_illustration","width=520,height=680,menubar=no,toolbar=no,resizable=yes");
		muc_disclaimer.focus();
		return false;
	});

	$('a.press').click( function() { 
		biNewsCentre = window.open("http://www.boehringer-ingelheim.cz/cz/Home/News_Centre/index.jsp");
		biNewsCentre.focus();
		return false;
	});

	$('#header #searchfield').focus( function() { $(this).attr({ value: "" }); } );
	$('#header #searchfield').blur( function() { $(this).attr({ value: "Search" }); } );

	setTimeout('loadShadow()',500);
	resizeIE();

});

function reloadShadow() {	
	setTimeout('loadShadow()',500);
}
function loadShadow() {	
	$(".btn.zwo").removeShadow();
	$(".btn.eins").removeShadow();
	$(".whitebg").removeShadow();
	$(".bluebg").removeShadow();
	$(".btn.zwo").dropShadow({left: 2, top: 2, opacity: 0.3, blur: 2});
	$(".btn.eins").dropShadow({left: 2, top: 2, opacity: 0.3, blur: 2});
	$(".whitebg").dropShadow({left: 2, top: 2, opacity: 0.3, blur: 2});
	$(".prodbg").dropShadow({left: 2, top: 2, opacity: 0.3, blur: 2});
	$(".bluebg").dropShadow({left: 2, top: 2, opacity: 0.3, blur: 2});
}
function resizeIE(){
	if (jQuery.browser.msie) {	
		var ol = $("#overlay");
		dWidth = ($(document).width()- 21);
		dHeight = ($(document).height());	
		ol.css("width",dWidth);
		ol.css("height",dHeight);
	}	
}

