function empfehlen(){
	document.getElementById('recomend-layer').style.display = "block";	
}
function empfehlenSchliessen(){
	document.getElementById('recomend-layer').style.display = "none";	
}
function over(element)
{
   document.getElementById(element).style.display = 'block';
}

function out(element)
{
		if(document.getElementById(element)) document.getElementById(element).style.display = 'none';
}

function execute_url(page_url)
{
		var http_in_url = page_url.search(/http:\/\//);
		if(http_in_url != -1)
		{
				window.open(page_url);
		}
		else
		{		
				window.location.href=page_url;
		}
}

function ap_execute_url(page_url)
{
	window.location.href=page_url;
}

function print_page() {
	var Seitenhref = window.location;
	var search = location.search;
	
	if(search != ""){
		Seitenhref += "&print=1";
		PrintWindow = window.open(Seitenhref, "Zweitfenster", "width=664,height=700,left=300,top=150,scrollbars=1");
	}
	else{
		Seitenhref += "?&print=1";
		PrintWindow = window.open(Seitenhref, "Zweitfenster", "width=664,height=700,left=300,top=150,scrollbars=1");

	}
	PrintWindow.focus();
}

function und_weg() {
	document.getElementById('not_visible_print').style.display = 'none';
	window.print();
}

function execute_global_search(search_function) {
		var search_var = "?query="+search_function;
		document.location.href=search_var;
}

function arrowHide(element){
	element.style.display = 'none';
}

function getYpos(element){
	return (element.offsetParent) ? element.offsetTop + getYpos(element.offsetParent) : element.offsetTop;
}

Event.observe(window, 'load', function() {
	var arrow = document.getElementById('promoArrow');
	var action_pos = 0;
	
	if(arrow){
		action_pos = getYpos(arrow)-110;
		arrow.style.top = action_pos+"px";
		window.setTimeout(function(){
			arrowHide(arrow);
		}, 5000);
	}
	
	/* Skip Intro */
	$$("#play-button").each(function(elem){
		elem.observe("click", function(evt){
			play();
		});
	});

	/*
	 * Wired Minds Download Counter
	 */
	$$(".file-link").each(function(elem) {
		elem.observe("click", function(evt) {
			var website_replace = this.href;
			var website_replace_string = /^http:\/\/[a-zA-Z0-9\.\-_\/]*[\/]/;
			var replaced = website_replace.gsub(website_replace_string, '');
			wiredminds.count(replaced)
		});
	});		
	
	$$("#_recipients").each(function(elem) {
		elem.observe("change", function() {
			$$('.rcp-aspx-id').each(function(elem2) {
				elem2.value = elem.options[elem.selectedIndex].text;
			});
		});
	});
	
	if($("hk-wmmap-world-hl")){
		/*Worldmap*/
		if(navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.substring(22, 23) == '6'){
			$("hk-wmmap-world-hl").insert("<div id='hk-wmeurope-high' style='display: none; margin:0px; background: url(/media/internalnotforuse/layout_media/worldmap_hkg/continents/europa~2.gif) no-repeat;' />");
			$("hk-wmmap-world-hl").insert("<div id='hk-wmamerica-high' style='display: none; background: url(/media/internalnotforuse/layout_media/worldmap_hkg/continents/amerika~2.gif) no-repeat;' />");
			$("hk-wmmap-world-hl").insert("<div id='hk-wmasia-high' style='display: none; background: url(/media/internalnotforuse/layout_media/worldmap_hkg/continents/asien~2.gif) no-repeat;' />");
			$("hk-wmmap-world-hl").insert("<div id='hk-wmaustralia-high' style='display: none; background: url(/media/internalnotforuse/layout_media/worldmap_hkg/continents/australien~1.gif) no-repeat;' />");
		}	
		else{
			$("hk-wmmap-world-hl").insert("<div id='hk-wmeurope-high' style='display: none; margin:0px; background: url(/media/internalnotforuse/layout_media/worldmap_hkg/continents/europa~1.png) no-repeat;' />");
			$("hk-wmmap-world-hl").insert("<div id='hk-wmamerica-high' style='display: none; background: url(/media/internalnotforuse/layout_media/worldmap_hkg/continents/amerika~1.png) no-repeat;' />");
			$("hk-wmmap-world-hl").insert("<div id='hk-wmasia-high' style='display: none; background: url(/media/internalnotforuse/layout_media/worldmap_hkg/continents/asien~1.png) no-repeat;' />");
			$("hk-wmmap-world-hl").insert("<div id='hk-wmaustralia-high' style='display: none; background: url(/media/internalnotforuse/layout_media/worldmap_hkg/continents/australien.png) no-repeat;' />");
		}
		$$(".hk-wmmap-continent").each(function($elem) {
			var active_element = "";
			$elem.observe("click", function() {
				$($w($elem.className)[1]).style.left = "0px";
				if ($w($elem.className)[1] == "hk-wmworld")
				{
					$("hk-wmworld").style.left = "0px";
					$($w($elem.className)[2]).style.left = "-1000px";
				}
				else if ($w($elem.className)[1] == "hk-wmamerica")
				{
					if(navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.substring(22, 23) == '6'){
						$("hk-wmmap-america-hl").insert("<div id='hk-wmcanada-high' style='display: none; background: url(/media/internalnotforuse/layout_media/worldmap_hkg/countries/canada~1.gif) no-repeat;' />");
						$("hk-wmmap-america-hl").insert("<div id='hk-wmusa-high' style='display: none; background: url(/media/internalnotforuse/layout_media/worldmap_hkg/countries/usa~1.gif) no-repeat;' />");
						$("hk-wmmap-america-hl").insert("<div id='hk-wmbrazil-high' style='display: none; background: url(/media/internalnotforuse/layout_media/worldmap_hkg/countries/brasilien~1.gif) no-repeat;' />");
						$("hk-wmmap-america-hl").insert("<div id='hk-wmmexico-high' style='display: none; background: url(/media/internalnotforuse/layout_media/worldmap_hkg/countries/mexico~1.gif) no-repeat;' />");
						$("hk-wmmap-america-hl").insert("<div class='hk-back-map-high' style='display: none; background: url(/media/internalnotforuse/layout_media/worldmap_hkg/countries/back_button~1.gif) no-repeat;' />");
					}
					else{
						$("hk-wmmap-america-hl").insert("<div id='hk-wmcanada-high' style='display: none; background: url(/media/internalnotforuse/layout_media/worldmap_hkg/countries/canada.png) no-repeat;' />");
						$("hk-wmmap-america-hl").insert("<div id='hk-wmusa-high' style='display: none; background: url(/media/internalnotforuse/layout_media/worldmap_hkg/countries/usa.png) no-repeat;' />");
						$("hk-wmmap-america-hl").insert("<div id='hk-wmbrazil-high' style='display: none; background: url(/media/internalnotforuse/layout_media/worldmap_hkg/countries/brasilien.png) no-repeat;' />");
						$("hk-wmmap-america-hl").insert("<div id='hk-wmmexico-high' style='display: none; background: url(/media/internalnotforuse/layout_media/worldmap_hkg/countries/mexico.png) no-repeat;' />");
						$("hk-wmmap-america-hl").insert("<div class='hk-back-map-high' style='display: none; background: url(/media/internalnotforuse/layout_media/worldmap_hkg/countries/back_button.png) no-repeat;' />");
					}
				}
				else if ($w($elem.className)[1] == "hk-wmeurope")
				{
					if(navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.substring(22, 23) == '6'){
						$("hk-wmmap-europe-hl").insert("<div id='hk-wmbenelux-high' style='display: none; background: url(/media/internalnotforuse/layout_media/worldmap_hkg/countries/benelux~1.gif) no-repeat;' />");
						$("hk-wmmap-europe-hl").insert("<div id='hk-wmgermany-high' style='display: none; background: url(/media/internalnotforuse/layout_media/worldmap_hkg/countries/deutschland~1.gif) no-repeat;' />");
						$("hk-wmmap-europe-hl").insert("<div id='hk-wmfrance-high' style='display: none; background: url(/media/internalnotforuse/layout_media/worldmap_hkg/countries/frankreich~1.gif) no-repeat;' />");
						$("hk-wmmap-europe-hl").insert("<div id='hk-wmgreatbritain-high' style='display: none; background: url(/media/internalnotforuse/layout_media/worldmap_hkg/countries/grossbritannien~1.gif) no-repeat;' />");
						$("hk-wmmap-europe-hl").insert("<div id='hk-wmitalia-high' style='display: none; background: url(/media/internalnotforuse/layout_media/worldmap_hkg/countries/italien~1.gif) no-repeat;' />");
						$("hk-wmmap-europe-hl").insert("<div id='hk-wmaustria-high' style='display: none; background: url(/media/internalnotforuse/layout_media/worldmap_hkg/countries/oesterreich~1.gif) no-repeat;' />");
						$("hk-wmmap-europe-hl").insert("<div id='hk-wmswiss-high' style='display: none; background: url(/media/internalnotforuse/layout_media/worldmap_hkg/countries/schweiz~1.gif) no-repeat;' />");
						$("hk-wmmap-europe-hl").insert("<div id='hk-wmscandinavia-high' style='display: none; background: url(/media/internalnotforuse/layout_media/worldmap_hkg/countries/skandinavien~1.gif) no-repeat;' />");
						$("hk-wmmap-europe-hl").insert("<div id='hk-wmspain-high' style='display: none; background: url(/media/internalnotforuse/layout_media/worldmap_hkg/countries/spanien~1.gif) no-repeat;' />");
						$("hk-wmmap-europe-hl").insert("<div id='hk-wmcentraleasteurope-high' style='display: none; background: url(/media/internalnotforuse/layout_media/worldmap_hkg/countries/centralost-europa~1.gif) no-repeat;' />");
						$("hk-wmmap-europe-hl").insert("<div id='hk-wmsoutheasteurope-high' style='display: none; background: url(/media/internalnotforuse/layout_media/worldmap_hkg/countries/suedost-europa~1.gif) no-repeat;' />");
						$("hk-wmmap-europe-hl").insert("<div class='hk-back-map-high' style='display: none; background: url(/media/internalnotforuse/layout_media/worldmap_hkg/countries/back_button~1.gif) no-repeat;' />");
					}
					else{
						$("hk-wmmap-europe-hl").insert("<div id='hk-wmbenelux-high' style='display: none; background: url(/media/internalnotforuse/layout_media/worldmap_hkg/countries/benelux.png) no-repeat;' />");
						$("hk-wmmap-europe-hl").insert("<div id='hk-wmgermany-high' style='display: none; background: url(/media/internalnotforuse/layout_media/worldmap_hkg/countries/deutschland.png) no-repeat;' />");
						$("hk-wmmap-europe-hl").insert("<div id='hk-wmfrance-high' style='display: none; background: url(/media/internalnotforuse/layout_media/worldmap_hkg/countries/frankreich.png) no-repeat;' />");
						$("hk-wmmap-europe-hl").insert("<div id='hk-wmgreatbritain-high' style='display: none; background: url(/media/internalnotforuse/layout_media/worldmap_hkg/countries/grossbritannien.png) no-repeat;' />");
						$("hk-wmmap-europe-hl").insert("<div id='hk-wmitalia-high' style='display: none; background: url(/media/internalnotforuse/layout_media/worldmap_hkg/countries/italien.png) no-repeat;' />");
						$("hk-wmmap-europe-hl").insert("<div id='hk-wmaustria-high' style='display: none; background: url(/media/internalnotforuse/layout_media/worldmap_hkg/countries/oesterreich.png) no-repeat;' />");
						$("hk-wmmap-europe-hl").insert("<div id='hk-wmswiss-high' style='display: none; background: url(/media/internalnotforuse/layout_media/worldmap_hkg/countries/schweiz.png) no-repeat;' />");
						$("hk-wmmap-europe-hl").insert("<div id='hk-wmscandinavia-high' style='display: none; background: url(/media/internalnotforuse/layout_media/worldmap_hkg/countries/skandinavien.png) no-repeat;' />");
						$("hk-wmmap-europe-hl").insert("<div id='hk-wmspain-high' style='display: none; background: url(/media/internalnotforuse/layout_media/worldmap_hkg/countries/spanien.png) no-repeat;' />");
						$("hk-wmmap-europe-hl").insert("<div id='hk-wmcentraleasteurope-high' style='display: none; background: url(/media/internalnotforuse/layout_media/worldmap_hkg/countries/centralost-europa.png) no-repeat;' />");
						$("hk-wmmap-europe-hl").insert("<div id='hk-wmsoutheasteurope-high' style='display: none; background: url(/media/internalnotforuse/layout_media/worldmap_hkg/countries/suedost-europa.png) no-repeat;' />");
						$("hk-wmmap-europe-hl").insert("<div class='hk-back-map-high' style='display: none; background: url(/media/internalnotforuse/layout_media/worldmap_hkg/countries/back_button.png) no-repeat;' />");
					}
				}
				else if ($w($elem.className)[1] == "hk-wmasia")
				{
					if(navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.substring(22, 23) == '6'){
						$("hk-wmmap-asia-hl").insert("<div id='hk-wmcombination-high' style='display: none; background: url(/media/internalnotforuse/layout_media/worldmap_hkg/countries/asien-verbund~1.gif) no-repeat;' />");
						$("hk-wmmap-asia-hl").insert("<div id='hk-wmchina-high' style='display: none; background: url(/media/internalnotforuse/layout_media/worldmap_hkg/countries/china~1.gif) no-repeat;' />");
						$("hk-wmmap-asia-hl").insert("<div id='hk-wmjapan-high' style='display: none; background: url(/media/internalnotforuse/layout_media/worldmap_hkg/countries/japan~1.gif) no-repeat;' />");
						$("hk-wmmap-asia-hl").insert("<div class='hk-back-map-high' style='display: none; background: url(/media/internalnotforuse/layout_media/worldmap_hkg/countries/back_button~1.gif) no-repeat;' />");
					}
					else{
						$("hk-wmmap-asia-hl").insert("<div id='hk-wmcombination-high' style='display: none; background: url(/media/internalnotforuse/layout_media/worldmap_hkg/countries/asien-verbund.png) no-repeat;' />");
						$("hk-wmmap-asia-hl").insert("<div id='hk-wmchina-high' style='display: none; background: url(/media/internalnotforuse/layout_media/worldmap_hkg/countries/china.png) no-repeat;' />");
						$("hk-wmmap-asia-hl").insert("<div id='hk-wmjapan-high' style='display: none; background: url(/media/internalnotforuse/layout_media/worldmap_hkg/countries/japan.png) no-repeat;' />");
						$("hk-wmmap-asia-hl").insert("<div class='hk-back-map-high' style='display: none; background: url(/media/internalnotforuse/layout_media/worldmap_hkg/countries/back_button.png) no-repeat;' />");
					}
				}
			});
			
			$elem.observe("mouseover", function() {
				if (!$elem.hasClassName('hk-back-map'))
				{
					$($w($elem.className)[1]+"-high").show();
					$$("."+$w($elem.className)[1]).each(function($elem2) {
						$elem2.setStyle({color: '#000000'});
					});
				}
				else
				{
					$$(".hk-back-map-high").each(function($elem) {
						$elem.show();
					});
				}	
			});
			
			$elem.observe("mouseout", function() {
				if (!$elem.hasClassName('hk-back-map'))
				{		
					$($w($elem.className)[1]+"-high").hide();
					$$("."+$w($elem.className)[1]).each(function($elem2) {
						$elem2.setStyle({color: '#7E8891'});
					});		
				}
				else
				{
					$$(".hk-back-map-high").each(function($elem) {
						$elem.hide();
					});
				}					
			});
		});
		
		$$(".hk-wmmap-country").each(function($elem) {
			$elem.observe("mouseover", function() {
				$($w($elem.className)[1]+"-high").show();
				$$("."+$w($elem.className)[1]).each(function($elem2) {
					$elem2.setStyle({color: '#000000'});
				});
			});
			
			$elem.observe("mouseout", function() {
				$($w($elem.className)[1]+"-high").hide();
				$$("."+$w($elem.className)[1]).each(function($elem2) {
					$elem2.setStyle({color: '#7E8891'});
				});
			});  
		});
	}	
});