if(top!=self){top.location=self.location;}
var msgXmlhttp=createHTTPXMLObj();
function getEventItmLUC(o){var i=new Array();if(o.offsetParent){i[0]=o.offsetLeft;i[1]=o.offsetTop;while(o=o.offsetParent){i[0]+=o.offsetLeft;i[1]+=o.offsetTop;}}return i;}
function createHTTPXMLObj(){if(window.XMLHttpRequest)return new XMLHttpRequest();else if(window.ActiveXObject)return new ActiveXObject("Microsoft.XMLHTTP");else return false;}

	// ELEMENTE EIN/AUSBLENDEN
	function showHideElement(selectedElement)
	{
		// prüfen ob die Daten bereits ein- oder ausgeblendet sind
		if(document.getElementById(selectedElement).style.display=="none")
		{
			// Einblenden
			document.getElementById(selectedElement).style.display="block";
		}else{
			// Ausblenden
			document.getElementById(selectedElement).style.display="none";
		}
	}	
	
	// ELEMENTE SWITCHEN
	function switchOptions(selectedElement){
		if(document.submiturl.showoptions.value == "0"){
			/*document.getElementById('optionsicon').src =	"_images/icons/icon_nav_red_down.gif";*/
			document.submiturl.showoptions.value = "1";
			showHideElement(selectedElement);
		}else{
			/*document.getElementById('optionsicon').src =	"_images/icons/icon_nav_red_up.gif";*/
			document.submiturl.showoptions.value = "0";
			showHideElement(selectedElement);
		}
	}
	
	// OPTION AKTIVIEREN
	function activateValue(key){
		document.submiturl.elements[key][1].checked=true;
	}
	
	// OPTION AKTIVIEREN
	function deactivateValue(key){
		document.submiturl.elements[key][0].checked=true;
	}
	
	// BALLOON-TOPTIPP Konfigurieren
	function showToolTip(key){
		Tip(getOptionHelp(key), BALLOON, true, WIDTH, 250, OFFSETX, -17);
	}
	
	// BALLOON-TOPTIPP Konfigurieren
	function showToolTipText(key){
		Tip(key, BALLOON, true, WIDTH, 300, OFFSETX, -270);
	}
	
	// FEEDBACK FUNCTINOS
    function fb_open(){
        document.getElementById("fb_form").style.display="block";
    }
    function fb_close(){
        document.getElementById("fb_form").style.display="none";
    }
    function fb_send(){
        msgXmlhttp.open("POST","/feedback/send.php",true);
        msgXmlhttp.onreadystatechange=fb_resp;
        msgXmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        msgXmlhttp.send("fb_f0="+document.getElementById("fb_f0").value+"&fb_f1="+encodeURIComponent(document.getElementById("fb_f1").value)+"&fb_f2="+document.getElementById("fb_f2").value+"&fb_email="+document.getElementById("fb_email").value);
    }
    function fb_resp(){
        if(msgXmlhttp.readyState==4&&msgXmlhttp.status==200){
            var x = msgXmlhttp.responseXML.getElementsByTagName("x")[0].firstChild.nodeValue;
            switch(parseInt(x))
            {
                case 0:
                    // nicht alles ausgefüllt
                    alert("Bitte alle Felder ausfüllen!");
                    break;
                case 1:
                    // captcha falsch
                    var nH = msgXmlhttp.responseXML.getElementsByTagName("h")[0].firstChild.nodeValue;
                    document.getElementById("fb_f0").value = nH;
                    document.getElementById("fb_f3").src = "/_includes/captcha.php?t="+nH;
                    document.getElementById("fb_f2").style.border = "solid 1px red";
                    document.getElementById("fb_f2").style.backgroundColor = "#F5A9A9";
                    break;
                case 2:
                    // ok
                    document.getElementById("fb_form").innerHTML = "<p style='padding:40px;font-size:60px;'>Danke!</p>";
                    setTimeout("fb_close()",1000);
                    break;
            }
        }
    }
function btnhover(o,i){if(i)o.style.backgroundPosition='bottom';else o.style.backgroundPosition='top';}
function chkkey(e) { if(e.keyCode==27){document.getElementById('progdetails_box').style.display='none';document.getElementById('result_box').style.display='none';} }
var hm_dd_show = 0;
var hm_dd_sub = [];
hm_dd_sub[0] = [];
hm_dd_sub[0].push(new Array("Auszahlungen","http://www.trailer.to/articles/read-auszahlungen_50.html"));
hm_dd_sub[0].push(new Array("Neuigkeiten","http://www.trailer.to/articles/browse-news-1.html"));
hm_dd_sub[1] = [];
hm_dd_sub[1].push(new Array("Was ist ein Forum ?","http://de.wikipedia.org/wiki/Internetforum"));
hm_dd_sub[2] = [];
hm_dd_sub[2].push(new Array("Video reinstellen","http://www.trailer.to/admin/addvideo.php"));
hm_dd_sub[2].push(new Array("Einnahmen","#"));
hm_dd_sub[3] = [];
hm_dd_sub[3].push(new Array("So funktionierts","/sofunktionierts.html"));
hm_dd_sub[3].push(new Array("Wie viel kann ich verdienen?","/preise.html"));
hm_dd_sub[4] = [];
hm_dd_sub[4].push(new Array("Meine Favouriten","http://www.trailer.to/favorites.html?a=show"));
hm_dd_sub[4].push(new Array("Meine Daten","http://www.trailer.to/edit_profile.html"));
hm_dd_sub[4].push(new Array("Avatar &auml;ndern","http://www.trailer.to/upload_avatar.html"));
hm_dd_sub[4].push(new Array("Postfach","#"));
hm_dd_sub[5] = [];
hm_dd_sub[5].push(new Array("Werbeformate & Preise","/sofunktionierts.html"));
hm_dd_sub[5].push(new Array("Targeting","#"));
hm_dd_sub[5].push(new Array("Interesse?","http://www.trailer.to/contact_us.html"));
hm_dd_sub[6] = [];
hm_dd_sub[6].push(new Array("FAQ","/faq.html"));
hm_dd_sub[6].push(new Array("Kontakt","http://www.trailer.to/contact_us.html"));
function hm_dd(o,p){var r=document.getElementById("navigation_sub");hm_dd_show=1;var q=getEventItmLUC(o);r.style.left=q[0]-1;r.style.top=q[1]+27;r.innerHTML="";for(var i=0;i<hm_dd_sub[p].length;i++)r.innerHTML += "<a class='navigation_sub_itm' href='"+hm_dd_sub[p][i][1]+"'>"+hm_dd_sub[p][i][0]+"</a>";r.style.display="";}
function hm_dd_close(){hm_dd_show=0;setTimeout("hm_dd_doClose()",300);}
function hm_dd_doClose(){if(hm_dd_show==0)document.getElementById("navigation_sub").style.display="none";}
