/*
#####################################################
#                                                   #
#   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 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;
}