//austria.at JavaScript-Library

//Preload Image Tabs
var interfaceimg=new Array()
function preloadimg(){
	for (i=0;i<arguments.length;i++){
		interfaceimg[i]=new Image()
		interfaceimg[i].src=arguments[i]
	}
}

/////////////// Alle Reiter-Bilder hier eintragen! ///////////////
preloadimg(	
			"http://www.austria.at/images/tt2/1_off.gif", 
			"http://www.austria.at/images/tt2/2_off.gif", 
			"http://www.austria.at/images/tt2/3_off.gif", 
			"http://www.austria.at/images/tt2/4_off.gif", 
			"http://www.austria.at/images/tt2/5_off.gif", 
			"http://www.austria.at/images/tt2/6_off.gif", 
			"http://www.austria.at/images/tt2/7_off.gif", 
			"http://www.austria.at/images/tt2/8_off.gif", 
			"http://www.austria.at/images/tt2/1_on.gif", 
			"http://www.austria.at/images/tt2/2_on.gif", 
			"http://www.austria.at/images/tt2/3_on.gif", 
			"http://www.austria.at/images/tt2/4_on.gif", 
			"http://www.austria.at/images/tt2/5_on.gif", 
			"http://www.austria.at/images/tt2/6_on.gif", 
			"http://www.austria.at/images/tt2/7_on.gif", 
			"http://www.austria.at/images/tt2/8_on.gif"
		);
/////////////// Alle Reiter-Bilder hier eintragen! ///////////////

//----------------------[ NICHTS NACH DIESER LINIE ÄNDERN ]--------------------------

// automatische Datumsauswahl für Minibooking
function Select_Value_Set(SelectName, Value)
{
	eval('SelectObject = document.' + SelectName + ';');
	for(index = 0; 
	    index < SelectObject.length; 
	    index++)
	   {
	   if(SelectObject[index].value == Value)
	      SelectObject.selectedIndex = index;
	   }
}

// GoLive-Scriptelemente
CSAg = window.navigator.userAgent; CSBVers = parseInt(CSAg.charAt(CSAg.indexOf("/")+1),10);
CSIsW3CDOM = ((document.getElementById) && !(IsIE()&&CSBVers<6)) ? true : false;
function IsIE() { return CSAg.indexOf("MSIE") > 0;}
function CSIEStyl(s) { return document.all.tags("div")[s].style; }
function CSNSStyl(s) { if (CSIsW3CDOM) return document.getElementById(s).style; else return CSFindElement(s,0);  }
CSIImg=false;
function CSInitImgID() {if (!CSIImg && document.images) { for (var i=0; i<document.images.length; i++) { if (!document.images[i].id) document.images[i].id=document.images[i].name; } CSIImg = true;}}
function CSFindElement(n,ly) { if (CSBVers<4) return document[n];
	if (CSIsW3CDOM) {CSInitImgID();return(document.getElementById(n));}
	var curDoc = ly?ly.document:document; var elem = curDoc[n];
	if (!elem) {for (var i=0;i<curDoc.layers.length;i++) {elem=CSFindElement(n,curDoc.layers[i]); if (elem) return elem; }}
	return elem;
}

function CSGetImage(n) {if(document.images) {return ((!IsIE()&&CSBVers<5)?CSFindElement(n,0):document.images[n]);} else {return null;}}
CSDInit=false;
function CSIDOM() { if (CSDInit)return; CSDInit=true; if(document.getElementsByTagName) {var n = document.getElementsByTagName('DIV'); for (var i=0;i<n.length;i++) {CSICSS2Prop(n[i].id);}}}
function CSICSS2Prop(id) { var n = document.getElementsByTagName('STYLE');for (var i=0;i<n.length;i++) { var cn = n[i].childNodes; for (var j=0;j<cn.length;j++) { CSSetCSS2Props(CSFetchStyle(cn[j].data, id),id); }}}
function CSFetchStyle(sc, id) {
	var s=sc; while(s.indexOf("#")!=-1) { s=s.substring(s.indexOf("#")+1,sc.length); if (s.substring(0,s.indexOf("{")).toUpperCase().indexOf(id.toUpperCase())!=-1) return(s.substring(s.indexOf("{")+1,s.indexOf("}")));}
	return "";
}

function CSGetStyleAttrValue (si, id) {
	var s=si.toUpperCase();
	var myID=id.toUpperCase()+":";
	var id1=s.indexOf(myID);
	if (id1==-1) return "";
	s=s.substring(id1+myID.length+1,si.length);
	var id2=s.indexOf(";");
	return ((id2==-1)?s:s.substring(0,id2));
}

function CSSetCSS2Props(si, id) {
	var el=document.getElementById(id);
	if (el==null) return;
	var style=document.getElementById(id).style;
	if (style) {
		if (style.left=="") style.left=CSGetStyleAttrValue(si,"left");
		if (style.top=="") style.top=CSGetStyleAttrValue(si,"top");
		if (style.width=="") style.width=CSGetStyleAttrValue(si,"width");
		if (style.height=="") style.height=CSGetStyleAttrValue(si,"height");
		if (style.visibility=="") style.visibility=CSGetStyleAttrValue(si,"visibility");
		if (style.zIndex=="") style.zIndex=CSGetStyleAttrValue(si,"z-index");
	}
}

function CSURLPopupShow(formName, popupName, target) {
	var form  = (!IsIE()&&CSBVers>=5)?document.forms[formName]:CSFindElement(formName);
	var popup = form.elements[popupName];
	window.open(popup.options[popup.selectedIndex].value, target);
	popup.selectedIndex = 0;
}

// alte Elemente

function MM_reloadPage(init)
{ 
	if (init == true)
        with (navigator)
		{
        	if ((appName == "Netscape") && (parseInt(appVersion) == 4))
            {
                document.MM_pgW = innerWidth;
                document.MM_pgH = innerHeight;
                onresize = MM_reloadPage;
            }
       	}
	else if (innerWidth != document.MM_pgW || innerHeight != document.MM_pgH)
        location.reload();
}

MM_reloadPage(true);

function MM_findObj(n, d)
{
	var p, i, x;
    if (!d)
        d = document;
    if ((p = n.indexOf("?")) > 0 && parent.frames.length)
	{
        d = parent.frames[n.substring(p + 1)].document;
        n = n.substring(0, p);
    }
    if (!(x = d[n]) && d.all)
        x = d.all[n];
    for (i = 0; !x && i < d.forms.length; i++)
        x = d.forms[i][n];
    for (i = 0; !x && d.layers && i < d.layers.length; i++)
        x = MM_findObj(n, d.layers[i].document);
    if (!x && d.getElementById)
        x = d.getElementById(n);
    return x;
}

function MM_showHideLayers()
{
    var i, p, v, obj, args = MM_showHideLayers.arguments;
    for (i = 0; i < (args.length - 2); i += 3)
        if ((obj = MM_findObj(args[i])) != null)
        {
            v = args[i + 2];

            if (obj.style)
            {
                obj = obj.style;

                v = (v == 'show') ? 'block' : (v == 'hide') ? 'none' : v;
            }
            obj.display = v;
        }
}

function MM_openBrWindow(theURL, winName, features)
{
	window.open(theURL, winName, features);
}

function run_image_email(email, object, field)
{
	var image = document.getElementById(field);
    var link = 'index.php?page=counter&id=' + object + '&type=email&call=0&image=1';
	image.src = link;
    document.location.href = 'mailto:' + email;
    return false;
}

