/*
#####################################################
#                                                   #
#   JavaScript by Armin Priesner - Webdesignen.at   #
#   Durchlaufstr. 14/1A/33, A-1200 Wien             #
#   Tel: +43-(0)1-333 73 50                         #
#   Fax: +43-(0)1-333 73 50                         #
#   http://webdesignen.at - office@webdesignen.at   #
#                                                   #
#####################################################
*/

function linkInfo(arg)
{
	window.status = arg;
}

function changeLeftNav(id, image, text)
{
	// Hintergrundbild &auml;ndern
	var div = document.getElementById(id);
	div.style.backgroundImage = image;
	
	// Text in der Statusleiste &auml;ndern
	window.status = text;
}

function portalSeite(text_kz, text_fz, link_kontakt, link_impressum, link_agb)
{
	var kopfzeile = document.getElementById('kopfzeile');
	var fusszeile = document.getElementById('fusszeile');
	
	if(text_kz == "")
	{
		text_kz = "Herzlich willkommen, bitte wählen Sie die Seminarwelt die sie besuchen möchten!";
	}
	
	if(text_fz == "")
	{
		text_fz = "&copy; Silvia Schwab | ";
		text_fz += "<a style=\'color: #FFFFFF; text-decoration: none\' href=\'" + link_kontakt + "\' target=\'_self\'>Kontakt</a> | ";
		text_fz += "<a style=\'color: #FFFFFF; text-decoration: none\' href=\'" + link_impressum + "\' target=\'_self\'>Impressum</a> | ";
		text_fz += "<a style=\'color: #FFFFFF; text-decoration: none\' href=\'" + link_agb + "\' target=\'_self\'>AGB</a>";
	}
	
	kopfzeile.innerHTML = text_kz;
	fusszeile.innerHTML = text_fz;
}

function portalSelect()
{
	var txt = document.navigation.zielwelt.selectedIndex;
	var urltxt = document.navigation.zielwelt[txt].value;
	location.href = urltxt;
	document.navigation.zielwelt.selectedIndex = 0;
}

function vorschauText()
{
	var breite=(screen.width/2)-300;
	var hoehe=(screen.height/2)-250;
	var text = document.kontaktdaten.elements[4].value;
	text = text.replace(/</g, "");
	text = text.replace(/>/g, "");
	text = text.replace(/\n/g, "<br />\n");
	text = text.replace(/\\/g, "");
	text = text.replace(/'/g, "");
	text = text.replace(/"/g, "");
	text = text.replace(/\|/g, "");
	
	
	var win = window.open("","","top="+hoehe+",left="+breite+",height=500,width=600,scrollbars=yes");
	var html = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
	html += "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
	html += "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n";
	html += "<head>\n";
	html += "<title>Vorschau der Beschreibung</title>\n";
	html += "<meta name=\"author\" content=\"Silvia Schwab\" />\n";
	html += "<meta name=\"publisher\" content=\"webdesignen.at\" />\n";
	html += "<meta name=\"language\" content=\"de\" />\n";
	html += "<meta http-equiv=\"expires\" content=\"0\" />\n";
	html += "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n";
	html += "<link rel=\"stylesheet\" type=\"text/css\" href=\"stylesheet.css\" />\n";
	html += "</head>\n";
	html += "<body style=\"color: #333333; margin: 10px\">\n";
	html += text;
	html += "</body>\n";
	html += "</html>";
	win.document.write(html);
}

function verwaltung(seite)
{
	var breite=(screen.width/2)-300;
	var hoehe=(screen.height/2)-380;
	
	var win = window.open(seite,"","top="+hoehe+",left="+breite+",height=680,width=600,scrollbars=yes");
}

function detailseite(seite)
{
	var breite=(screen.width/2)-225;
	var hoehe=(screen.height/2)-300;
	
	var win = window.open(seite,"","top="+hoehe+",left="+breite+",height=600,width=550,scrollbars=yes");
}

function sidebarArtikel(artikel)
{
	var breite=(screen.width/2)-300;
	var hoehe=(screen.height/2)-380;
	
	var win = window.open(artikel,"","top="+hoehe+",left="+breite+",height=680,width=600,scrollbars=yes");
}

function prozentLMB(alterpreis, eingabefeld, ausgabefeld)
{
	var neu = eingabefeld.value;
	var alt = alterpreis;
	var nachlass = alt - neu;
	var prozent;
	
	if(nachlass < 0) { prozent = "Fehler"; }
	else
	{
		/* alt : neu = 100 : x */
		x = neu * 100 / alt;
		x = 100 - x;
		prozent = Math.round(x);
		
		if(prozent < 20) { prozent = "Fehler"; }
	}
	
	var output = ausgabefeld;
	output.value = prozent;
}
/*
function vorschauText()
{
	var breite=(screen.width/2)-300;
	var hoehe=(screen.height/2)-250;
	var text = document.upload.elements[13].value;
	text = text.replace(/</g, "");
	text = text.replace(/>/g, "");
	text = text.replace(/\n/g, "<br />\n");
	text = text.replace(/\\/g, "");
	text = text.replace(/'/g, "");
	text = text.replace(/"/g, "");
	text = text.replace(/\|/g, "");
	
	
	var win = window.open("","","top="+hoehe+",left="+breite+",height=500,width=600,scrollbars=yes");
	var html = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n";
	html += "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
	html += "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n";
	html += "<head>\n";
	html += "<title>Vorschau der Beschreibung</title>\n";
	html += "<meta name=\"author\" content=\"Silvia Schwab\" />\n";
	html += "<meta name=\"publisher\" content=\"webdesignen.at\" />\n";
	html += "<meta name=\"language\" content=\"de\" />\n";
	html += "<meta http-equiv=\"expires\" content=\"0\" />\n";
	html += "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\" />\n";
	html += "<link rel=\"stylesheet\" type=\"text/css\" href=\"images/stylesheet.css\" />\n";
	html += "</head>\n";
	html += "<body style=\"color: #333333; background-image: url('images/tabellenbodyorange.gif'); margin: 10px\">\n";
	html += text;
	html += "</body>\n";
	html += "</html>";
	win.document.write(html);
}

function logout()
{
	var meldung = "Beim nächsten Besuch müssen Sie sich wieder mit Username und Passwort anmelden.\n";
	meldung += "Wollen Sie sich wirklich ausloggen?";
	
	var ausloggen = confirm(meldung);
	if(ausloggen == true) location.href = document.URL + "&logout=true";
}

function changeAdminNav(id, color, text)
{
	// Hintergrundfarbe ändern
	var div = document.getElementById(id);
	div.style.backgroundColor = color;
	
	// Text in der Statusleiste ändern
	window.status = text;
}

function addCMS(bbcode)
{
	//BBCODE über Buttons einfügen
	var f = document.forms["cms"].text.value;
	document.forms["cms"].text.value = f + bbcode;
	var f = document.forms["cms"].text;
	f.focus();
	f.value += "";
}

function swapImages(id, img, text)
{
	// Bild ändern
	window.document.images[id].src = img;
}

function tooltip(id, zustand)
{
	// Hilfe ein- und ausblenden
	var tooltip = document.getElementById(id).style;
	
	if(zustand)
	{
		tooltip.visibility = "visible";
	}
	else
	{
		tooltip.visibility = "hidden";
	}
}

function popupFAQ(channel)
{
	var breite=(screen.width/2)-300;
	var hoehe=(screen.height/2)-380;
	
	var win = window.open("faq.php?channel="+channel,"","top="+hoehe+",left="+breite+",height=680,width=600,scrollbars=yes");
}

function popupUEU(channel)
{
	var breite=(screen.width/2)-300;
	var hoehe=(screen.height/2)-380;
	
	var win = window.open("ueberuns.php?channel="+channel,"","top="+hoehe+",left="+breite+",height=680,width=600,scrollbars=yes");
}

function detail(nr,sid)
{
	var breite=(screen.width/2)-355;
	var hoehe=(screen.height/2)-390;
	
	var win = window.open("detail.php?view="+nr+"&sid="+sid,"","top="+hoehe+",left="+breite+",height=700,width=710,scrollbars=yes");
}

function chgDetailCSS(id, schriftfarbe, hintergrund)
{
	var dasTag = document.getElementById(id);
	dasTag.style.color = schriftfarbe;
	dasTag.style.backgroundColor = hintergrund;
}

function changePic(datei)
{
	var curPic = new Image();
	curPic.src = "images/anbieter/" + datei;
	
	window.document.images['main'].src = curPic.src;
}
*/