// Web paramaters
var shostname = 'www.ortsplan.ch';
var sVirtualDir = 'miplan';
var mode = '';

//var mode = 'maintenance';


// Searches paramaters

var sAdrsObjID = 'STRCTRL';
var sPOIObjID = 'POICTRL';

function isWindows() {
	return (navigator.appVersion.indexOf("Win") != -1)
}

function isWin95NT() {
	return (isWindows() && (navigator.appVersion.indexOf("Win16") == -1 && navigator.appVersion.indexOf("Windows 3.1") == -1))
}

function isMac() {
	return (navigator.appVersion.indexOf("Mac") != -1)
}

function isMacPPC() {
	return (isMac() && (navigator.appVersion.indexOf("PPC") != -1 || navigator.appVersion.indexOf("PowerPC") != -1))
}

function isUnix() {
	return (navigator.appVersion.indexOf("X11") != -1)
}

function isNav() {
	return (navigator.appName == "Netscape")
}

function isGeneration3() {
	return (navigator.appVersion.charAt(0) == "3")
}

function isGeneration3Min() {
	return (parseInt(navigator.appVersion.charAt(0)) >= 3)
}

function isNav4_02() {
	return (isNav() && (navigator.appVersion.substring(0,4) == "4.02") )
}

function isNav4_05() {
	return (isNav() && (navigator.appVersion.substring(0,4) == "4.05") )
}

function isNav45() {
	
	return (isNav() && (navigator.appVersion.substring(0,3) == "4.5"))
}
function isNav47() {
	return (isNav() && (navigator.appVersion.substring(0,3) == "4.7"))
}
function isNav7() {
	return (isNav() && (navigator.userAgent.indexOf("Netscape/7.0") != -1 ))
}
function isMSIE3Min() {
	return (navigator.appVersion.indexOf("MSIE") != -1)
}

function isIE41() {
	return (isMSIE3Min() && (navigator.appVersion.substring(22,25) == "4.0") )
	
}
function isIE5() {
	return (isMSIE3Min() && (navigator.userAgent.indexOf("MSIE 5.0") != -1 ) )
}
function isIE55() {
	return (isMSIE3Min() && (navigator.userAgent.indexOf("MSIE 5.5") != -1 ) )
}
function isIE516() {

	return (isMSIE3Min() && (navigator.userAgent.indexOf("MSIE 5.16") != -1 ) )
}
function isIE6() {
	return (isMSIE3Min() && (navigator.appVersion.substring(22,25) == "6.0") )
}


function goToNeapoljsLogin(city,map,lang){

	if ( (isMac() || isMacPPC() ))
	{

		if (isIE41() || isIE5())
		{
			alert('Diese Applikation benoetigt Internet Explorer 5.1.6 oder hoeher. Sie koennen die neuste Version direkt und kostenlos auf unserer Website herunterladen.');
			return;
		}
		
		if (isNav45() || isNav47())
		{
			alert('Diese Applikation benoetigt Netscape 7 oder hoeher. Sie koennen die neuste Version direkt und kostenlos auf unserer Website herunterladen.');
			return;	
		}
		
	} else {

		if (isNav45() || isNav47())
		{
			alert('Diese Applikation benoetigt Netscape 7 oder hoeher. Sie koennen die neuste Version direkt und kostenlos auf unserer Website herunterladen.');
			return;
		}	
		
		if (isIE41())
		{
			alert('Diese Applikation benoetigt Internet Explorer 5.0 oder hoeher. Sie koennen die neuste Version direkt und kostenlos auf unserer Website herunterladen.');
			return;
		}
	}
	
	use_login = false;
	if (screen.availHeight > 704 && screen.availWidth > 940){
		var resol = 'big'
	}
	else {var resol = 'small'}
	
	//var msg = "Skin=" + skin + "&lang=" + lang + "&resol=" + resol+"&sessID="+sessID+"&use_login="+use_login;
	var msg = "lang=" + lang + "&resol=" + resol+"&use_login="+use_login;
	
	if (city != '') msg = msg +  "&city=" + city;
	if (map != '') msg = msg + "&MAP_NAME="+map;
	
	parent.parent.parent.parent.window.resizeTo(970,700);
	if (resol == 'small')
	{
		if (use_login == false)
		{
			NeapoljsWin=window.open("http://"+shostname+"/"+sVirtualDir+"/login.phtml?" + msg + "&action=LOGIN&user=guest&upwd=guest","neap", "width=790,height=580,top=0,left=0,resizable=no,menubar=no,location=no,statusbar=no,alwaysraised=yes,scrollbars=no")
		} else {
			NeapoljsWin=window.open("http://"+shostname+"/"+sVirtualDir+"/login.phtml?" + msg,"neap"+sessID, "width=790,height=580,top=0,left=0,resizable=no,menubar=no,location=no,statusbar=no,alwaysraised=yes,scrollbars=no")
		}
	}else{
	
		if (use_login == false)
		{
			NeapoljsWin=window.open("http://"+shostname+"/"+sVirtualDir+"/login.phtml?" + msg + "&action=LOGIN&user=guest&upwd=guest","neap", "width=920,height=680,top=0,left=0,resizable=no,menubar=no,location=no,statusbar=no,alwaysraised=yes,scrollbars=no")
		} else {
			NeapoljsWin=window.open("http://"+shostname+"/"+sVirtualDir+"/login.phtml?" + msg,"neap", "width=920,height=680,top=0,left=0,resizable=no,menubar=no,location=no,statusbar=no,alwaysraised=yes,scrollbars=no")
		}
	}
	
}
function goToNeapoljsWithCity(city,lang){

	if ( (isMac() || isMacPPC() ))
	{

		if (isIE41() || isIE5())
		{
			alert('Diese Applikation benoetigt Internet Explorer 5.1.6 oder hoeher. Sie koennen die neuste Version direkt und kostenlos auf unserer Website herunterladen.');
			return;
		}
		
		if (isNav45() || isNav47())
		{
			alert('Diese Applikation benoetigt Netscape 7 oder hoeher. Sie koennen die neuste Version direkt und kostenlos auf unserer Website herunterladen.');
			return;	
		}
		
	} else {

		if (isNav45() || isNav47())
		{
			alert('Diese Applikation benoetigt Netscape 7 oder hoeher. Sie koennen die neuste Version direkt und kostenlos auf unserer Website herunterladen.');
			return;
		}	
		
		if (isIE41())
		{
			alert('Diese Applikation benoetigt Internet Explorer 5.0 oder hoeher. Sie koennen die neuste Version direkt und kostenlos auf unserer Website herunterladen.');
			return;
		}
	}

	use_login = false;
	
	// ckeck screen resolution	
	if (screen.availHeight > 704 && screen.availWidth > 940){
		var resol = 'big'
		var appWinSize = 'width=920,height=680,top=0,left=0,resizable=no,menubar=no,location=no,statusbar=no,alwaysraised=yes,scrollbars=no';
	}
	else {
		var resol = 'small'
		var appWinSize = 'width=790,height=580,top=0,left=0,resizable=no,menubar=no,location=no,statusbar=no,alwaysraised=yes,scrollbars=no';	
	}
	
	// build url's paramters
	
	//var msg = "lang=" + lang + "&resol=" + resol+"&sessID="+sessID+"&use_login="+use_login+"&city=MIPLAN&mode=2";
	var msg = "lang=" + lang + "&resol=" + resol+"&use_login="+use_login+"&city=MIPLAN&mode=2";

	if (city != '') msg = msg + "&CMD=PLZ&step=ort&ort="+escape(city);
	
	if (use_login == false) msg = msg + "&action=LOGIN&user=guest&upwd=guest";

	if (use_login == false)
	{
		NeapoljsWin=window.open("http://"+shostname+"/"+sVirtualDir+"/login.phtml?" + msg,"neap2", appWinSize)
	} else {
		NeapoljsWin=window.open("http://"+shostname+"/"+sVirtualDir+"/frame.phtml?" + msg,"neap2", appWinSize)
	}			
}
function goToNeapoljsCpny(city,company,lang)
{

	if ( (isMac() || isMacPPC() ))
	{

		if (isIE41() || isIE5())
		{
			alert('Diese Applikation benoetigt Internet Explorer 5.1.6 oder hoeher. Sie koennen die neuste Version direkt und kostenlos auf unserer Website herunterladen.');
			return;
		}
		
		if (isNav45() || isNav47())
		{
			alert('Diese Applikation benoetigt Netscape 7 oder hoeher. Sie koennen die neuste Version direkt und kostenlos auf unserer Website herunterladen.');
			return;	
		}
		
	} else {

		if (isNav45() || isNav47())
		{
			alert('Diese Applikation benoetigt Netscape 7 oder hoeher. Sie koennen die neuste Version direkt und kostenlos auf unserer Website herunterladen.');
			return;
		}	
		
		if (isIE41())
		{
			alert('Diese Applikation benoetigt Internet Explorer 5.0 oder hoeher. Sie koennen die neuste Version direkt und kostenlos auf unserer Website herunterladen.');
			return;
		}
	}

	// no changes must be made here
	var use_login = false;
	var cat = '';
	
	// ckeck screen resolution	
	if (screen.availHeight > 704 && screen.availWidth > 940){
		var resol = 'big'
		var appWinSize = 'width=920,height=680,top=0,left=0,resizable=no,menubar=no,location=no,statusbar=no,alwaysraised=yes,scrollbars=no';
	}
	else {
		var resol = 'small'
		var appWinSize = 'width=790,height=580,top=0,left=0,resizable=no,menubar=no,location=no,statusbar=no,alwaysraised=yes,scrollbars=no';	
	}
	
	// build url's paramters
	
	var msg = "lang=" + lang + "&resol=" + resol+"&use_login="+use_login+"&city=MIPLAN&mode=3";
	msg = msg + "&cat="+escape(cat)+"&cpny="+escape(company)+"&currSrchCity="+escape(city);
	if (use_login == false) msg = msg + "&action=LOGIN&user=guest&upwd=guest";

	if (use_login == false)
	{
		NeapoljsWin=window.open("http://"+shostname+"/"+sVirtualDir+"/login.phtml?" + msg,"neap2", appWinSize)
	} else {
		NeapoljsWin=window.open("http://"+shostname+"/"+sVirtualDir+"/frame.phtml?" + msg,"neap2", appWinSize)
	}				

}
// rba 22.08.2003
function goToNeapoljsPOI(city,poi,lang)
{

	if ( (isMac() || isMacPPC() ))
	{

		if (isIE41() || isIE5())
		{
			alert('Diese Applikation benoetigt Internet Explorer 5.1.6 oder hoeher. Sie koennen die neuste Version direkt und kostenlos auf unserer Website herunterladen.');
			return;
		}
		
		if (isNav45() || isNav47())
		{
			alert('Diese Applikation benoetigt Netscape 7 oder hoeher. Sie koennen die neuste Version direkt und kostenlos auf unserer Website herunterladen.');
			return;	
		}
		
	} else {

		if (isNav45() || isNav47())
		{
			alert('Diese Applikation benoetigt Netscape 7 oder hoeher. Sie koennen die neuste Version direkt und kostenlos auf unserer Website herunterladen.');
			return;
		}	
		
		if (isIE41())
		{
			alert('Diese Applikation benoetigt Internet Explorer 5.0 oder hoeher. Sie koennen die neuste Version direkt und kostenlos auf unserer Website herunterladen.');
			return;
		}
	}

	// no changes must be made here
	var use_login = false;
	var cat = '';
	
	// ckeck screen resolution	
	if (screen.availHeight > 704 && screen.availWidth > 940){
		var resol = 'big'
		var appWinSize = 'width=920,height=680,top=0,left=0,resizable=no,menubar=no,location=no,statusbar=no,alwaysraised=yes,scrollbars=no';
	}
	else {
		var resol = 'small'
		var appWinSize = 'width=790,height=580,top=0,left=0,resizable=no,menubar=no,location=no,statusbar=no,alwaysraised=yes,scrollbars=no';	
	}
	
	// build url's paramters
	
	var msg = "lang=" + lang + "&resol=" + resol+"&use_login="+use_login+"&city=MIPLAN&mode=4";
	msg = msg + "&cat="+escape(cat)+"&poi="+escape(poi)+"&currSrchCity="+escape(city);
	if (use_login == false) msg = msg + "&action=LOGIN&user=guest&upwd=guest";

	if (use_login == false)
	{
		NeapoljsWin=window.open("http://"+shostname+"/"+sVirtualDir+"/login.phtml?" + msg,"neap2", appWinSize)
	} else {
		NeapoljsWin=window.open("http://"+shostname+"/"+sVirtualDir+"/frame.phtml?" + msg,"neap2", appWinSize)
	}				

}