function openNews(sID) {

	window.open('news_popup.asp?id='+sID,'News','left=50, top=50, toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=800,height=400');        

}

function goToUrl()
{
	if (!(document.link_form.link_list[document.link_form.link_list.selectedIndex].value=="0"))
	{
		location.href = document.link_form.link_list[document.link_form.link_list.selectedIndex].value;
	}
}
		
function WinOpen(surl,target,itop,ileft,iwidth,iheight) {
		msgWindow=window.open(surl,target,"top="+itop+",left="+ileft+",width="+iwidth+",height="+iheight+",menubar=no,location=no,toolbar=no,directories=no,status=no,resizable=no,scrollbars=no")
}

function RealHelp() {
	window.open('realhelp.asp','real','left=150, top=150, toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=340,height=340');        
}

function ShowContent(sID) {
	window.open('content_popup.aspx?id='+sID,'News','left=50, top=50, toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=auto,resizable=yes,width=200,height=340');        
}

function ShowEmpf(p_id,t_na) {
	window.open('empfehlen.aspx?p_id='+p_id+'&t_na='+t_na,'Empfehlung','left=50, top=50, toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=auto,resizable=yes,width=340,height=340');        
}

function ShowBigImg(url,width,height) { 	imgwin=window.open('', '_blank', 'directories=no, location=no, menubar=no, resizable=no, scrollbars=no, status=no, toolbar=no, width='+width+', height='+height); 	imgwin.document.open(); 	imgwin.document.writeln("<HTML> <HEAD> <TITLE> "+url+" </TITLE> </HEAD> <BODY LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0> <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%  HEIGHT=100%><TR><TD align=center valign=middle><a href='Javascript:window.close();'><IMG border=0 SRC='"+url+"'></a> </TD> </TR> </TABLE> </BODY> </HTML>"); 	imgwin.document.close(); } 
function ShowBigImgAuto(url,width,height) { 		imgwin=window.open('', '_blank', 'directories=no, location=no, menubar=no, resizable=no, scrollbars=no, status=no, toolbar=no, width='+width+', height='+height); 	imgwin.document.open(); 	imgwin.document.writeln("<HTML> <HEAD> <TITLE> "+url+" </TITLE> </HEAD> <BODY LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 onload=\"Test();\"> <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%  HEIGHT=100%><TR><TD align=center valign=middle><a href='Javascript:window.close();'><IMG border=0 SRC='"+url+"' id=imgCover></a> </TD> </TR> </TABLE><script>function Test(){window.resizeTo((document.getElementById('imgCover').width+40),(document.getElementById('imgCover').height+60));}</script> </BODY> </HTML>"); 	imgwin.document.close(); } 

function checkForm() {
	max = document.address.elements.length;
	for(i=0; i < max; i++) {
		if(document.address.elements[i].value == "") {
			feld = document.address.elements[i].name;
			alert("Sie haben das Eingabefeld \"" + feld + "\" nicht ausgefuellt.");			
			document.address.elements[i].focus();
			return false;
		}
	} 
	mail = document.address.elements['email'];
	if(mail.value.indexOf('@')==-1 || mail.value.indexOf('.')==-1) {
		alert("E-Mail Adresse ist ungültig!");
		return false;
	}
	else {
		return true;
	}
}

function switchLayer(layerID) {
	if (document.getElementById) {
		var style2 = document.getElementById(layerID).style;
		style2.display = style2.display? "":"block"; }
	 else if (document.all) {
		var style2 = document.all[layerID].style;
		style2.display = style2.display? "":"block"; } 
}
	

function ChangeImage(image, source)
{
	document.images[image].src=source;
}

	//global variables
	var objRef;
	var strUrl;
	var strMode;
	
	// ///////////////////////////////////////////////////////////////
	// OpenSaferpayTerminal
	//
	// if java script is enabled this function sets a javascript code 
	// in the executive space of the open call or calls the 
	// OpenSaferpayTerminalWindow function directly (in case of BUTTON 
	// - works only with enabled java script)
	// ///////////////////////////////////////////////////////////////
	function OpenSaferpayTerminal(url, obj, mode) 
	{
		window.onerror = DoNothing;
		
		//open a window for these browsers		
		if(
			(
				(window.navigator.appName.indexOf("Microsoft Internet Explorer") != -1 &&
					window.navigator.appVersion.substring(0,1) >= 4
				) 
				||
				(window.navigator.appName.indexOf("Netscape") != -1 &&
					window.navigator.appVersion.substring(0,1) >= 4
				)
			)
			&&
			(window.navigator.userAgent.indexOf("Opera") == -1)	
		)
		{
			objRef = obj;
			strUrl = url;
			strMode = mode;
		
			if(mode == "LINK")
			{
				obj.href = "javascript:OpenSaferpayTerminalWindow()";
			}
			else if(mode == "FORM")
			{
				obj.action = "javascript:OpenSaferpayTerminalWindow()";
			}
			else if(mode == "BUTTON")
			{
				OpenSaferpayTerminalWindow();
			}
		}
	}

	// ///////////////////////////////////////////////////////////////
	// OpenSaferpayTerminalWindow
	//
	// the java script code that was set thru OpenSaferpayTerminal
	// function will call this function. OpenSaferpayTerminalWindow 
	// then creates the saferpay window.
	// ///////////////////////////////////////////////////////////////
	function OpenSaferpayTerminalWindow() 
	{
		window.onerror = DoNothing;

		//reset the url for the next click
		if(strMode == "LINK") objRef.href = strUrl;
		else if(strMode == "FORM") objRef.action  = strUrl;
		
		//add the standalone attribute to deliver the window state to the server
		if(strUrl.indexOf("WINDOWMODE=Standalone") == -1) strUrl += "&WINDOWMODE=Standalone";
	
		w = window.open(
			strUrl,
			'SaferpayTerminal',
			'scrollbars=1,resizable=0,toolbar=0,location=0,directories=0,status=1,menubar=0,width=580,height=400'
		);
		
		w.focus();
	}
	
	
	// ///////////////////////////////////////////////////////////////
	// OpenSaferpayWindowJScript(strUrl)
	//
	// this function provides the open window functionality for
	// using form javascript
	// ///////////////////////////////////////////////////////////////
	function OpenSaferpayWindowJScript(strUrl) 
	{
		window.onerror = DoNothing;
		
		//add the standalone attribute to deliver the window state to the server
		if(strUrl.indexOf("WINDOWMODE=Standalone") == -1) strUrl += "&WINDOWMODE=Standalone";
	
		w = window.open(
			strUrl,
			'SaferpayTerminal',
			'scrollbars=1,resizable=0,toolbar=0,location=0,directories=0,status=1,menubar=0,width=580,height=400'
		);
		
		w.focus();
	}

	// ///////////////////////////////////////////////////////////////
	// DoNothing
	//
	// error handler does nothing.
	// ///////////////////////////////////////////////////////////////
	function DoNothing(sMsg,sUrl,sLine)
	{
		//if the error handler returns true the error will not be 
		//displayed except InterDev error handling is enabled.
		return true;
}


//player

var act_index = null;

function element_exists(id) {
    return document.getElementById(id);
}

function set_ctrl(index) {
    if (act_index == index) {
        if (currentState == 'PLAYING') {
            if (element_exists('track' + index)) {
                document.getElementById('track' + index).src = img_ctrl_play;
            }

            player.sendEvent('PLAY', false);
        }
        else if (currentState == 'PAUSED') {
            if (element_exists('track' + index)) {
                document.getElementById('track' + index).src = img_ctrl_pause;
            }

            player.sendEvent('PLAY', true);
        }
    }
    else {
        if (element_exists('track' + act_index)) {
            document.getElementById('track' + act_index).src = img_ctrl_play;
        }
        if (element_exists('track' + index)) {
            document.getElementById('track' + index).src = img_ctrl_pause;
        }

        player.sendEvent('ITEM', index);
    }

    act_index = index;


}


	
