// StatusText
function MM_displayStatusMsg(msgStr) {
  status = msgStr;
  document.MM_returnValue = true;
}


var submitcount=0;
/* function validate(email) {
  if (email.length < 6) {
		return false;
	}
	if (email.indexOf(" ") != -1) {
		return false;
	}
	if (email.indexOf("&auml;") != -1) {
		return false;
	}
	if (email.indexOf("&ouml;") != -1) {
		return false;
	}
	if (email.indexOf("&uuml;") != -1) {
		return false;
	}
	if (email.indexOf("&szlig;") != -1) {
		return false;
	}
	if (email.indexOf("@") < 1) {
		return false;
	}
	if (email.indexOf(".") < 1) {
		return false;
	}
	if ((email.length - 2) <= (email.lastIndexOf("."))) {
		return false;
	}
	if ((email.length - 2) <= (email.lastIndexOf("@"))) {
		return false;
	}
	if (!(email.substr((email.lastIndexOf("@")+1)).lastIndexOf("."))) {
		return false;
	}
	return true;
}

function check_newsletter_form() {
  if ((document.forms.newsletterform.company) && (document.forms.newsletterform.company.value == "")) {
    alert("Bitte füllen sie das Feld \"Firma\" korrekt aus!");
  }
  else if ((document.forms.newsletterform.surname) && (document.forms.newsletterform.surname.value == "")) {
    alert("Bitte füllen sie das Feld \"Nachname\" korrekt aus!");
  }
  else if ((document.forms.newsletterform.firstname) && (document.forms.newsletterform.firstname.value == "")) {
    alert("Bitte füllen sie das Feld \"Vorname\" korrekt aus!");
  }
  else if ((validate(document.forms.newsletterform.email.value)) == false) {
    alert("Bitte füllen sie das Feld \"E-Mail\" korrekt aus!");
  }
  else if ((document.forms.newsletterform.city) && (document.forms.newsletterform.city.value == "")) {
    alert("Bitte füllen sie das Feld \"Ort\" korrekt aus!");
  }
  else if ((document.forms.newsletterform.zip) && (document.forms.newsletterform.zip.value == "")) {
    alert("Bitte füllen sie das Feld \"PLZ\" korrekt aus!");
  }
  else if ( ((document.forms.newsletterform.nwsl1) && (document.forms.newsletterform.nwsl2)) && ((!document.forms.newsletterform.nwsl1.checked) && (!document.forms.newsletterform.nwsl2.checked)) ) {
    alert("Bitte wählen Sie mindestens eine Newsletter-Rubrik aus!");
  }
  else {
    document.forms.newsletterform.submit();
    return true;
  }
}
*/
function change_lang(id) {
	if (top.menu){
		var frameset = new Array(top.frames[1],top.menu,top.bottom, top.main); //top.frames[1] = top frame, sonst Probleme in IE, main wird über onload in menu.php angesprochen

		for(var i = 0; i < frameset.length; i++) {
			var locstring = String(frameset[i].location);
			var changelangid = locstring.replace(/\/(de|en|ru)\//, "/"+id+"/");
			frameset[i].location.href = changelangid;
		}
	}
}


function do_search(f) {
	if(top.menu){
		var one = top.menu.location.search;
		var two = one.split("&");
		for (i = 0; i < two.length; ++i) {
			if (two[i].match(/^lang_id=/)) {
				f.action='main.php?'+two[i]+"&do=search&search="+f.searchbox.value;
				f.submit();
			}
			else if (two[i].match(/^\?lang_id=/)) {
				f.action='main.php'+two[i]+"&do=search&search="+f.searchbox.value;
				f.submit();
			}
		}
	}
}

function goto_main() {
	if(top.menu || top.main){
		var one = top.menu.location.search;
		var two = one.split("&");

		 for(i=0;i<two.length;++i) {
			 if(two[i].match(/^lang_id=/)) {
				 top.main.location.href='main.php?'+two[i];
			 }
			 else if(two[i].match(/^\?lang_id=/)) {
				 top.main.location.href='main.php'+two[i];
			 }
		 }
	}
}

function goto_content_from_right(menu_id) {
	if(top.menu || top.main){
		var one = top.menu.location.search;
		var two = one.split("&");

		 for (i = 0; i < two.length; ++i) {
			 if (two[i].match(/^lang_id=/)) {
				 top.menu.location.href='menu.php?menu='+menu_id+'&'+two[i];
			 }
			 else if(two[i].match(/^\?lang_id=/)) {
				 var three = two[i].substring(1,999);
				 top.menu.location.href='menu.php?menu='+menu_id+'&'+three;
			 }
		}
	}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// 'CUSTOM' functions für Div Höhen Resize
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function InitDivHeight() {
	browser = navigator.userAgent;
	opera = browser.search(/Opera/);
	msie = browser.search(/MSIE/);
	ns = browser.search(/Netscape/)
	ff = browser.search(/Firefox/);

	if (msie != -1 || opera != -1) {
		initHeight = document.body.clientHeight;
		initWidth = document.body.clientWidth;
	}

	if (ns != -1 || ff != -1) {
		initHeight = window.innerHeight;
		initWidth = window.innerWidth;
	}
}

function DivResize() {
	browser = navigator.userAgent;
	opera = browser.search(/Opera/);
	msie = browser.search(/MSIE/);
	ns = browser.search(/Netscape/)
	ff = browser.search(/Firefox/);

	if ((msie != -1 || opera != -1) && document.getElementById("Div")) {
		docHeight = document.body.clientHeight;
		docWidth = document.body.clientHeight;
		text = document.getElementById("Div").style.top;
		textH = text.split("px");
		textHeight = Number(textH[0]); //TextHöhe oberhalb des "Div", entspricht top Wert des resizable divs

			if (docHeight <= initHeight || docHeight >= initHeight || docWidth <= initWidth || docWidth >= initWidth ) {
				divHeight = docHeight - textHeight;
				divHeightpx = divHeight + "px";
				document.getElementById("Div").style.height = divHeightpx;
			}
	}
	if ((ns != -1 || ff != -1) && document.getElementById("Div")) {
		docHeight = window.innerHeight;
		docWidth = window.innerWidth;
		text = document.getElementById("Div").style.top;
		textH = text.split("px");
		textHeight = Number(textH[0]); //TextHöhe oberhalb des "Div", entspricht top Wert des resizable divs

			if (docHeight <= initHeight || docHeight >= initHeight || docWidth <= initWidth || docWidth >= initWidth) {
				divHeight = docHeight - textHeight;
				divHeightpx = divHeight + "px";
				document.getElementById("Div").style.height = divHeightpx;
			}
	}
}
//END............................................................................................................................................................................................................................................................................


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// 'CUSTOM' function für Hintergrund Image Ja/Nein bei bestimmten Contents, abhängig von der id bestimmter divs
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function BgImage() {
	if (document.getElementById("StartSeite") || document.getElementById("SearchMessages") || document.getElementById("News")){
		document.getElementsByTagName("body")[0].style.backgroundImage = "url(images/transparent.gif)";
	}
	else {
		document.getElementsByTagName("body")[0].style.backgroundImage = "url(images/main_bggraphix.gif)";
	}
}
//END............................................................................................................................................................................................................................................................................



////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// 'GLOBAL' function OperaResizeFix() für Opera; Fix für style height:100% problem bei Opera
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function OperaResizeFix() {
	browser = navigator.userAgent;
	opera = browser.search(/Opera/);

	if (opera != -1){
  	self.location.reload();
	}
}
//END............................................................................................................................................................................................................................................................................


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// 'GLOBAL' function FrameReload(root)
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function FrameReload(framename) {
//	if (top.location.href == this.location.href) {
//		var vars = window.location.href;
//		var file_name = String(vars.match(/[^\/]+$/));
//		var otherframe = String(file_name.match(/top|bottom|blank/));
//		if(otherframe == "null") {
//			var g = file_name.replace(/^[A-Za-z]+/, 'index');
//		}
//		else {
//			var g = "index01.html";
//		}
//		top.location.href = root+"/"+g;
//	}
	var _tocheck = "to" + "p.lo" + "cation.h" + "ref == thi" + "s.loc" + "ation.hr" + "ef";
	var _togo = "to" + "p.loca" + "tion.hre" + "f=";

	if(eval(_tocheck)) {
		var _vars = eval("thi" + "s.locatio" + "n.h"+ "ref");
		_vars = _vars.replace(framename, 'index');
		eval(_togo + "'" + _vars +"'");
	}

}
//END............................................................................................................................................................................................................................................................................


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// 'GLOBAL' function FrameReloadExternal(file)
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function FrameReloadExternal(root) {
	var _tocheck = "to" + "p.lo" + "cation.h" + "ref == thi" + "s.loc" + "ation.hr" + "ef";
	var _togo = "to" + "p.loca" + "tion.hre" + "f=";

	if(eval(_tocheck)) {
		var _loc = escape(eval("to" + "p.loca" + "tion.hre" + "f"));
		eval(_togo + "'"+ root + '/index/de/external.htm?url=' + _loc + "'");
	}



}
//END............................................................................................................................................................................................................................................................................


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// 'GLOBAL' function TopPath(id)  für onclick top links etc
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function TopPath(id){//function für onclick top links etc
	var href = document.getElementById(id).href;
	var menuhrefstd = href.search(/menu_/);
	var menuhrefext = href.search(/_ext/);
  var contenthref = href.search(/content_/); //Inhalt ohne Menuzuweisung zb newsletter wenn nicht über menu angesteuert

	if(contenthref != -1){
		top.location.href = href;
	}
	else {
		if (menuhrefext != -1){
			var clearhref = href.replace(/_ext/, "");
			top.location.href = clearhref;
		}
		else {
			if (menuhrefstd != -1){
				var clearhref = href.replace(/menu_/, "index_");
				top.location.href = clearhref;
			}
		}
	}
}
//END............................................................................................................................................................................................................................................................................


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// 'CUSTOM' functions für IE <a><font class=""></font></a>; workaround für IE hover-effekt; font links classes, müssen auch entsprechend als hover classes im .css file definiert sein: a:hover font.class {}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function IEHoverFix(){ //

//	var browser = navigator.userAgent;
//	var msie = browser.search(/MSIE/);
//	var classes = new Array('Text01','Text02','Text03','Text05'); //Classen Namen
//
//	if (msie != -1){
//
//		for (var x=0; x < document.getElementsByTagName("A").length; x++){
//			var fontA = document.getElementsByTagName("A")[x];
//
//			if (fontA.childNodes.length > 0){
//				if((fontA.firstChild.tagName == 'FONT' || fontA.firstChild.firstChild.tagName == 'FONT')  && (fontA.firstChild.className == classes[0] || fontA.firstChild.firstChild.className == classes[0] || fontA.firstChild.className == classes[2] || fontA.firstChild.firstChild.className == classes[2]  || fontA.firstChild.className == classes[3]  || fontA.firstChild.firstChild.className == classes[3] ) ){
//					fontA.onmouseover = IETextCSS01_00;
//					fontA.onmouseout = IETextCSS01_01;
//				}
//				else {
//					if((fontA.firstChild.tagName == 'FONT'  || fontA.firstChild.firstChild.tagName == 'FONT') && (fontA.firstChild.className == classes[1] || fontA.firstChild.firstChild.className == classes[1])){
//						fontA.onmouseover = IETextCSS02_00;
//						fontA.onmouseout = IETextCSS02_01;
//					}
//				}
//
//			}
//		}
//	}
}

function IETextCSS01_00() {
	this.setAttribute("style", "text-decoration:underline;");
}
function IETextCSS01_01() {
	this.setAttribute("style", "text-decoration:none;");
}
function IETextCSS02_00() {
	this.setAttribute("style", "text-decoration:none;color:#4D5364;");
}
function IETextCSS02_01() {
	this.setAttribute("style", "text-decoration:underline;color:#8F96A8;");
}
//END............................................................................................................................................................................................................................................................................


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// 'GLOBAL' function GetHost()
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function GetHost(){
	var host = top.location.host;

	if (host == "konzeptra.com"){
		top.location.replace('http://www.konzeptra.com');
	}

	return host;
}
//END............................................................................................................................................................................................................................................................................


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// 'CUSTOM' functions ChkFrset() und vars für EXTERNE FILES; Nachladen des Frset bzw. Frames bei bestimmten, statische EXTERNEN Files, die in der main geöffnet werden
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/*var host = top.location.host;
var hostchk = host.match(/konzeptra/);

var extfile = new Array("http://www.konzeptra.at/vorlage/form_partner_l1.php","http://www.konzeptra.at/vorlage/content_cms.php");
var tophref = new Array("http://www.konzeptra.at/vorlage/index_m268.php", "http://www.konzeptra.at/vorlage/index_m280.php"); //erfordert, dass diese files physisch am server liegen und im frset die entsprechenden files laden

function ChkFrset(){ // onload function für externes file

	if(!top.menu && hostchk != null ){
		for (var x=0; x < extfile.length; x++){
			if(top.location.href == extfile[x]){
				top.location.href = tophref[x];
			}
		}
	}
}
*/

//END............................................................................................................................................................................................................................................................................

function addEvent(elm, evType, fn, useCapture) {
	if (elm.addEventListener) {
		elm.addEventListener(evType, fn, useCapture);
		return true;
	}
	else if (elm.attachEvent) {
		var r = elm.attachEvent('on' + evType, fn);
		return r;
	}
	else {
		elm['on' + evType] = fn;
	}
}

function in_array(item,arr) {
for(p=arr.length;p--;) if(item==arr[p]) return true;
return false;
}
