function bebeyond_color_change(obj, pviiColor)
{
	obj.style.backgroundColor=pviiColor
}
function cookie_set_value( name, value )
{
	document.cookie = name + "=" + value + "; path=/";
}
function MM_jumpMenu(targ,selObj,restore){
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
function codeopen (Adresse)
{
  mywindow = window.open(Adresse, "window", "width=500,height=150,left=100,top=200");
  mywindow.focus();
}
function downloadsoftware ()
{
  document.location.href= 'http://ftp.fotobuch-druckerei.com/printahead/download.php';
}
function showRechnung(sJobnummer, SID)
{
  window.open("/auftrag_rechnung.htm?j=" + sJobnummer + "&" + SID,"Rechnung", "width=400,height=150,left=100,top=200");
};
function cookie_get_value( name )
{
 var nameEQ = name + "=";
 var ca = document.cookie.split(';');
 for( var i = 0; i < ca.length; i++ )
 {
  var c = ca[i];
  while ( c.charAt( 0 ) == ' ' ) { c = c.substring( 1, c.length ); }
  if ( c.indexOf( nameEQ ) == 0 ) { return c.substring( nameEQ.length, c.length ); }
 }
 return false;
}
function anzeigen(id)
{
	document.getElementById(id).style.display = "block";
}
function ausblenden(id){
	document.getElementById(id).style.display = "none";
}
function MM_goToURL() 
{
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}	
function MM_openBrWindow(theURL,winName,features, myWidth, myHeight, isCenter) 
{ 
	if(window.screen && isCenter && isCenter=="true")
	{ 
		var myLeft = (screen.width-myWidth)/2;   
		var myTop = (screen.height-myHeight)/2;    
		features+=(features!='')?',':'';    
		features+=',left='+myLeft+',top='+myTop;  
	}  
	window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);
}
function showAngebot(artikel__id, SID)
{		
 window.open("/artikel_angebot.htm?artikel__id=" + artikel__id + "&" + SID,"Angebot", "width=400,height=150,left=100,top=200");
}
function bb_chang_cat_row(obj) 
{ 
	obj.style.backgroundColor="#E8E7E0";
}
function alertrechnung(wert)
{
	if(wert == "")
	{
		alert('Zur Zahlung auf Rechnung sind nur Gewerbetreibende berechtigt, die uns ihren Gewerbeschein vorgelegt haben.');
	}
	document.formular.submit();
}
function changeLoginDisplay(){
	var status;
  if ( document.getElementById('id999') != null )
  {
    status = document.getElementById('id999').style.display;

    if(status == "none"){
      document.getElementById('id999').style.display='';
    } else {
      document.getElementById('id999').style.display='none';
    }
  }
}
function changeAnmeldungDisplay(){
	var status;
  if ( document.getElementById('id888') != null )
  {
    status = document.getElementById('id888').style.display;

    if(status == "none"){
      document.getElementById('id888').style.display='';
    } else {
      document.getElementById('id888').style.display='none';
    }
  }
}

if ( cookie_get_value("btn") == "fotolia" )
{
 document.cookie = "btn=; path=/";
 window.location = '/uploadcheck.htm?datentransfer=fotolia';
}
else if( cookie_get_value("btn") == "upload" )
{
 document.cookie = "btn=; path=/";
 window.location = '/uploadcheck.htm?datentransfer=';
}

function toggleDiv(id,flagit) {
  if (flagit=="1"){
    if (document.layers) document.layers[''+id+''].visibility = "show"
    else if (document.all) document.all[''+id+''].style.visibility = "visible"
    else if (document.getElementById) document.getElementById(''+id+'').style.visibility = "visible"
  }
  else
    if (flagit=="0"){
    if (document.layers) document.layers[''+id+''].visibility = "hide"
    else if (document.all) document.all[''+id+''].style.visibility = "hidden"
    else if (document.getElementById) document.getElementById(''+id+'').style.visibility = "hidden"
  }
}

/* access for elements by id crossbrowser */
function $()
{
	var elements = new Array();
	for (var i = 0; i < arguments.length; i++)
	{
		var element = arguments[i];
		if (typeof element == 'string')
		{
			if (document.getElementById)
			{
				element = document.getElementById(element);
			}
			else if (document.all)
			{
				element = document.all[element];
			}
		}
		elements.push(element);
	}
	if (arguments.length == 1 && elements.length > 0)
	{
		return elements[0];
	}
	else
	{
		return elements;
	}
};

var href = (("https:" == document.location.protocol) ? "https://"+location.host : "http://"+location.host);
var base = document.createElement("base");
base.setAttribute("href", href);
document.getElementsByTagName("head").item(0).appendChild(base);

function switch2nossl(why)
{
  if ( "https:" == document.location.protocol )
  {
    var text = "";
    if( why == "fotolia" )
    {
      text+="Liebe Kundin, lieber Kunde!\r\n\r\n";
      text+="Die folgenden Seiten erfordern zwingend, dass Inhalte von einem fremden Server (fotolia.com) nachgeladen ";
      text+="werden. Zu diesem Zweck wird jetzt kurzzeitig der SSL-Bereich verlassen. Ihre Kundendaten sind davon ";
      text+="jedoch nicht betroffen!";
      alert(text);
      window.location.href = window.location.href.replace("https://","http://");
    }
    else if( why == "logout" && window.location.href.indexOf("#logout") > 10 )
    {
      text+="Liebe Kundin, lieber Kunde!\r\n\r\n";
      text+="Sie haben sich erfolgreich abgemeldet. Der SSL-Bereich wird jetzt wieder verlassen. ";
      text+="Sollten Sie sich an einem oeffentlichen Internetzugang befinden, bitten wir Sie im ";
      text+="eigenen Interesse alle Cookies zu entfernen und den Browser-Cache zu leeren!";
      alert(text);
      window.location.href = window.location.href.replace("https://","http://");
    }
  }
}

function switch2ssl()
{
  if ( "http:" == document.location.protocol )
  {
    window.location.href = window.location.href.replace("http://","https://");
  }
}

/* create element for given type */
function $C(type)
{
	return document.createElement(type);
};