﻿function doCookieCheck()
{
    var tmpcookie = new Date();
    chkcookie = (tmpcookie.getTime() + '');
    document.cookie = "chkcookie=" + chkcookie + "; path=/";
    if (document.cookie.indexOf(chkcookie,0) < 0)
    {
         window.location = '/error_cookie.html';
    }
    else
    {
      //window.location = 'cookies.html';
    }
}

function display_error(type)
{
	var error_div = document.getElementById("error_box");
	
	newtop = 0;
	newtop = _get_obj_toppos( document.getElementById("ctl00_logView_logKonto_Password")  ) + 17;
	document.getElementById( "error_box" ).style.top =  newtop + "px";
	newleft = 0;
	newleft = _get_obj_leftpos( document.getElementById("ctl00_logView_logKonto_Password") );
	document.getElementById( "error_box" ).style.left =  newleft + "px";
	
	if ( type == "show" )
	{
		//document.getElementById("inputkd").style.backgroundImage = "url(/images/textfield_inner_red.gif)";
		//document.getElementById("inputpw").style.backgroundImage = "url(/images/textfield_inner_red.gif)";
	
		error_div.style.display = "";
		setTimeout("display_error('')", 5000);
	} else {	
		error_div.style.display = "none";
	}
    		
}

//Show ErrorDiv
function display_input_error(type)
{
       var error_div = document.getElementById("input_error_box");
       
       if ( type == "show" )
	    {
		    error_div.style.display = "";
		    setTimeout("display_input_error('')", 5000);
		} else {	
		    error_div.style.display = "none";
	    }

}

//Form Field Error
function display_error_field(InputID)
{
	//var error_div = document.getElementById("error_box");
	
	//if ( type == "show" )
	//{
	//InputID="ct100_hldContent_"+InputID;
	//InputID="ct100_hldContent_txtAmountMegaMix";
	/*try
	{
	document.getElementById(InputID+"_left").style.backgroundImage = "url(/images/textfield_left_corner_order_red.gif)";
	document.getElementById(InputID+"_right").style.backgroundImage = "url(/images/textfield_right_corner_order_red.gif)";
	document.getElementById(InputID+"_inner").style.backgroundImage = "url(/images/textfield_inner_red.gif)";
	}
	catch (e)
	{
	}
	*/
	try
	{
	 document.getElementById(InputID+"_radio").className = "radio_error";
	}
		catch (e)
	{
	}
	
    try
	{
	 document.getElementById(InputID+"_checkbox").className = "checkbox_error";
	}
		catch (e)
	{
	}
	//alert(document.getElementById("ctl00_middleContent_"+InputID).parentNode.tagName);
	if ( document.getElementById("ctl00_middleContent_"+InputID).type != "radio" && document.getElementById("ctl00_middleContent_"+InputID).type != "checkbox" )
	{
	    document.getElementById("ctl00_middleContent_"+InputID).className = "input_error";
	}
    
    		
}

//Show ErrorDiv
function display_input_error(type)
{
       var error_div = document.getElementById("input_error_box");
       
       if ( type == "show" )
	    {
		    error_div.style.display = "";
		    setTimeout("display_input_error('')", 5000);
		} else {	
		    error_div.style.display = "none";
	    }

}

function show_paymentoptions(option)
{
	
	// Hide all
	document.getElementById("payment_option_kto").style.display = "none";
	document.getElementById("payment_option_cc").style.display = "none";
	//document.getElementById("payment_option_eps").style.display = "none";
	//document.getElementById("payment_option_maestro").style.display = "none";
	//if (option == "payment_option_eps")
    //    document.getElementById("payment_option_eps_hypo").style.display = "none";
	

	
	// Show the correct one
	if ( option != "" )
	{
	    //if(option == "payment_option_eps_hypo")
	     //   document.getElementById("payment_option_eps").style.display="";
		document.getElementById(option).style.display = "";
	}
		
}

//-----------------------------------
// Popup for Spielbedingungen
//-----------------------------------

function showPopup(link)
{
    window.open(link,"new","fullscreen=no,toolbar=yes,status=yes,menubar=no,scrollbars=yes,resizable=yes,directories=no,location=no,width=490,height=650,left=30,top=30")

}

//-----------------------------------
// Show Infofield for winning info
//-----------------------------------

function display_win(type)
{
	var win_div = document.getElementById("divWonResult");
	
	if ( type == "show" )
	{	
		win_div.style.display = "";
		//setTimeout("display_win('')", 5000);
	} else if ( type == "show_kl" ) {
		win_div = document.getElementById("divWonResult_kl");
		newtop = 0;
	    newtop = _get_obj_toppos( document.getElementById("gewinnabfrage_div")  ) + 44;
	    win_div.style.top =  newtop + "px";
	    newleft = 0;
	    newleft = _get_obj_leftpos( document.getElementById("gewinnabfrage_div") );
	    win_div.style.left =  newleft + "px";

	    win_div.style.display = "";
	} else {	
		win_div.style.display = "none";
	}
    		
}