var ie = (document.styleSheets && document.all)?true:false;
document.targetField = "";

function send2friend(locale){
	var newS2F = window.open("/aspx/pop_tellafriend.aspx?locale="+locale,"Tellafriend","width=380,height=504,top=20,left=20,scrollbars");
	newS2F.focus();
}

function openPrivacy(locale){
	newPrivacy = window.open("/aspx/pop_privacy.aspx?locale="+locale,"Privacy","width=508,height=550,top=20,left=20,scrollbars");
	newPrivacy.focus();
}

function openImprint(locale){
	newImprint = window.open("/aspx/pop_imprint.aspx?locale="+locale,"Imprint","width=508,height=420,top=20,left=20,scrollbars");
	newImprint.focus();
}

function openAGB(locale){
	newAGB = window.open("/aspx/pop_AGB.aspx?locale="+locale,"AGB","width=508,height=550,top=20,left=20,scrollbars");
	newAGB.focus();
}

function openAGB1(locale){
	newAGB = window.open("/aspx/pop_AGB1.aspx?locale="+locale,"AGB","width=508,height=550,top=20,left=20,scrollbars");
	newAGB.focus();
}

function openAGB2(locale){
	newAGB = window.open("/aspx/pop_AGB2.aspx?locale="+locale,"AGB","width=508,height=550,top=20,left=20,scrollbars");
	newAGB.focus();
}

function openFAQ(locale){
	newFAQ = window.open("/aspx/pop_FAQ.aspx?locale="+locale,"FAQ","width=508,height=550,top=20,left=20,scrollbars");
	newFAQ.focus();
}

function openBill(locale,idorder){
	newBill = window.open("/aspx/pop_bill.aspx?locale="+locale+"&idorder="+idorder,"Bill","width=508,height=550,top=20,left=20,scrollbars");
	newBill.focus();
}

function openVoucher(locale,typ,idorder,iditem){
	newVoucher = window.open("/aspx/pop_voucher_"+typ+".aspx?locale="+locale+"&idorder="+idorder+"&iditem="+iditem,"Voucher","width=580,height=550,top=20,left=20,scrollbars");
	newVoucher.focus();
}

function openRequest(locale){
	newRequest = window.open("/aspx/pop_request.aspx?locale="+locale,"Request","width=508,height=550,top=20,left=20,scrollbars,resizable");
	newRequest.focus();
}

function openGallery(locale,idobj,curpos){
	newGallery = window.open("/aspx/pop_gallery.aspx?locale="+locale+"&idobj="+idobj+"&curpos="+curpos,"Gallery","width=622,height=521,top=20,left=20");
	newGallery.focus();
}

function openMap(locale, mapUrl) {
	newMap = window.open(mapUrl, 'salzburgmap','width=750,height=455');
	newMap.focus();
}

function img_act(imgName, obj) {
	if (obj.src) {
		obj.src=eval(imgName+".src");
	} else if (document[obj]) {
		document[obj].src=eval(imgName+".src");
	}
}

function img_act2(imgName, obj, curPic) {
	if (document.curPic != curPic) {
		if (obj.src) {
			obj.src=eval(imgName+".src");
		} else if (document[obj]) {
			document[obj].src=eval(imgName+".src");
		}
	}
}

function img_act_link(imgName, obj) {
	if (obj.firstChild.src){
		obj.firstChild.src=eval(imgName+".src");
	}
}

function img_act2_link(imgName, obj, curPic) {
	if (document.curPic != curPic) {
		if (obj.firstChild.src){
			obj.firstChild.src=eval(imgName+".src");
		}
	}
}

function findPosX(obj){
	var curleft = 0;
	if (obj.offsetParent){
		while (obj.offsetParent){
			curleft += obj.offsetLeft;
			obj = obj.offsetParent;
		}
	}
	return curleft;
}

function findPosY(obj){
	var curtop = 0;
	if (obj.offsetParent){
		while (obj.offsetParent){
			curtop += obj.offsetTop;
			obj = obj.offsetParent;
		}
	}
	return curtop;
}

function onlyNumbers(evt){
	evt = (evt) ? evt : ((event) ? event : null);
	if (evt){
		var charCode = (evt.charCode || evt.charCode == 0) ? evt.charCode : ((evt.keyCode) ? evt.keyCode : evt.which);
		if (charCode > 13 && (charCode < 48 || charCode > 57)){
			if (evt.returnValue){
				evt.returnValue = false;
			} else if (evt.preventDefault){
				evt.preventDefault();
			} else {
				return false;
			}
		}
	}
}

//###############################
//# flash scripts               #
//###############################

var MM_contentVersion = 7;

var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {
		var words = navigator.plugins["Shockwave Flash"].description.split(" ");
	    for (var i = 0; i < words.length; ++i)
	    {
		if (isNaN(parseInt(words[i])))
		continue;
		var MM_PluginVersion = words[i]; 
	    }
	var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.appVersion.indexOf("Win") != -1)) {
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
	document.write('on error resume next \n');
	document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
	document.write('</SCR' + 'IPT\> \n');
}


function writeFlashStart(txt, fontcolor, fontsize, linkUrl, linkcolor, section, lang, img){
	if ( MM_FlashCanPlay ) {
		document.writeln("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" width=\"765\" height=\"200\" id=\"header_big\" align=\"middle\" VIEWASTEXT>");
		document.writeln("<param name=\"allowScriptAccess\" value=\"sameDomain\">");
		document.writeln("<param name=\"movie\" value=\"/images/header/header_big.swf?txt="+txt + "&fontcolor="+fontcolor + "&fontsize="+fontsize + "&link="+linkUrl + "&linkcolor="+linkcolor + "&section="+section + "&lang="+lang + "&img="+img + "\">");
		document.writeln("<param name=\"quality\" value=\"high\">");
		document.writeln("<param name=\"wmode\" value=\"opaque\">");
		document.writeln("<param name=\"bgcolor\" value=\"#ffffff\">");
		document.writeln("<embed src=\"/images/header/header_big.swf?txt="+txt + "&fontcolor="+fontcolor + "&fontsize="+fontsize + "&link="+linkUrl + "&linkcolor="+linkcolor + "&section="+section + "&lang="+lang + "&img="+img + "\" quality=\"high\" wmode=\"opaque\" bgcolor=\"#ffffff\" width=\"765\" height=\"200\" name=\"header_big\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\"><\/embed>");
		document.writeln("<\/object>");
	} else {
		document.writeln("<div style=\"position:relative;width:765px;height:200px;\">");
		document.writeln("<h1 style=\"position:absolute;right:25px;bottom:6px;z-index:1;\"><a href=\"" + linkUrl + "\" style=\"font-size:" + fontsize + "px;color:" + linkcolor + ";text-decoration:none;\">" + txt + "<\/a><\/h1>");
		document.writeln("<img src=\"/public/images/header/default_start.jpg\" width=\"765\" height=\"200\" alt=\"\"><br>");
		document.writeln("<\/div>");
	}
}

function writeFlashSub(txt, fontcolor, fontsize, linkUrl, linkcolor, section, lang, img){
	if ( MM_FlashCanPlay ) {
		document.writeln("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" width=\"765\" height=\"86\" id=\"header_big\" align=\"middle\" VIEWASTEXT>");
		document.writeln("<param name=\"allowScriptAccess\" value=\"sameDomain\">");
		document.writeln("<param name=\"movie\" value=\"/images/header/header_shoppingcart.swf?txt=" + txt + "&fontcolor=" + fontcolor + "&fontsize=" + fontsize + "&link=" + linkUrl + "&linkcolor=" + linkcolor + "&section=" + section + "&lang=" + lang + "&img="+img + "\">");
		document.writeln("<param name=\"quality\" value=\"high\">");
		document.writeln("<param name=\"wmode\" value=\"opaque\">");
		document.writeln("<param name=\"bgcolor\" value=\"#ffffff\">");
		document.writeln("<embed src=\"/images/header/header_shoppingcart.swf?txt=" + txt + "&fontcolor=" + fontcolor + "&fontsize=" + fontsize + "&link=" + linkUrl + "&linkcolor=" + linkcolor + "&section=" + section + "&lang=" + lang + "&img="+img + "\" quality=\"high\" wmode=\"opaque\" bgcolor=\"#ffffff\" width=\"765\" height=\"86\" name=\"header_big\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\"><\/embed>");
		document.writeln("<\/object>");
	} else {
		document.writeln("<div style=\"position:relative;width:765px;height:86px;\">");
		document.writeln("<h1 style=\"position:absolute;right:25px;bottom:6px;z-index:1;\"><a href=\"" + linkUrl + "\" style=\"font-size:" + fontsize + "px;color:" + linkcolor + ";text-decoration:none;\">" + txt + "<\/a><\/h1>");
		document.writeln("<img src=\"/public/images/header/default_shoppingcart.jpg\" width=\"765\" height=\"86\" alt=\"\"><br>");
		document.writeln("<\/div>");
	}
}

function writeFlashShoppingcart(section, lang){
	if ( MM_FlashCanPlay ) {
		document.writeln("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" width=\"765\" height=\"86\" id=\"header_big\" align=\"middle\" VIEWASTEXT>");
		document.writeln("<param name=\"allowScriptAccess\" value=\"sameDomain\">");
		document.writeln("<param name=\"movie\" value=\"/images/header/header_shoppingcart.swf?section=" + section + "&lang=" + lang + "\">");
		document.writeln("<param name=\"quality\" value=\"high\">");
		document.writeln("<param name=\"wmode\" value=\"opaque\">");
		document.writeln("<param name=\"bgcolor\" value=\"#ffffff\">");
		document.writeln("<embed src=\"/images/header/header_shoppingcart.swf?section=" + section + "&lang=" + lang + "\" quality=\"high\" wmode=\"opaque\" bgcolor=\"#ffffff\" width=\"765\" height=\"86\" name=\"header_big\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\"><\/embed>");
		document.writeln("<\/object>");
	} else {
		document.writeln("<div style=\"position:relative;width:765px;height:86px;\">");
		document.writeln("<img src=\"/public/images/header/default_shoppingcart.jpg\" width=\"765\" height=\"86\" alt=\"\"><br>");
		document.writeln("<\/div>");
	}
}

function writeFlash( src, width, height, txt){
	if ( MM_FlashCanPlay == true) {
		document.write("<object data=\"" + src + "\" type=\"application/x-shockwave-flash\" width=\"" + width + "\" height=\"" + height + "\">");
		document.write("<param name=\"movie\" value=\"" + src + "\" \/>");
		document.write("<param name=\"loop\" value=\"false\" \/>");
		document.write("<param name=\"menu\" value=\"false\" \/>");
		document.write("<param name=\"quality\" value=\"high\" \/>");
		document.write("<param name=\"wmode\" value=\"transparent\" \/>");
		document.write("<a href=\"http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\" target=\"_blank\">" + txt + "<\/a><br \/>");
		document.write("<\/object>");
	} else {
		document.write("<a href=\"http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\" target=\"_blank\">" + txt + "<\/a><br \/>");
	}
}

