function openPopUp(site)
{
	winurl 		= "./"+site;
	winname 	= "suzuki";
	width 		= 710;
	height 		= 705;

	test = window.open(winurl,winname,"top=50,left=50,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,copyhistory=0,width="+width+",height="+height+",channelmode=0,dependent=0,fullscreen=0");
}

function openPapa(site)
{
	window.opener.location.href = './' + site;
}

function openPrint(site)
{
	winurl 		= "./"+site;
	winname 	= "suzukiprint";
	width 		= 726;
	height 		= 705;

	test = window.open(winurl,winname,"top=150,left=150,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,copyhistory=0,width="+width+",height="+height+",channelmode=0,dependent=0,fullscreen=0");
}

function expandit(curobj)
{
	extInfo   = curobj;
	// smallInfo = curobj+"_sum";
	
	if(document.getElementById(extInfo))
	{
		extInfo_folder=document.getElementById(extInfo).style;
		// smallInfo_folder=document.getElementById(smallInfo).style;
	}

	if (extInfo_folder.display=="none")
	{
		extInfo_folder.display="";
		// smallInfo_folder.display="none";
	}
	else
	{
		extInfo_folder.display="none";
		// smallInfo_folder.display="";
	}
}

function openAndClose(curobj,open_txt,close_txt,open_img,close_img)
{
	if(document.getElementById(curobj))
	{
		folder=document.getElementById(curobj).style;
	}

   	// we want to change the text of the link so we generate a unique identifier
	callingLink = curobj+"_link";
	// we want to change the img of the link so we generate a unique identifier
	callingImg  = curobj+"_img";
	
	if (folder.display=="none")
	{
		folder.display="";
		if ( close_txt ) document.getElementById(callingLink).innerHTML = unescape(close_txt);		
		// if ( close_txt ) document.getElementById(callingLink).innerHTML = close_txt;		
		if ( close_img ) document.getElementById(callingImg).src = close_img;		
	}
	else
	{
		folder.display="none";
		document.getElementById(callingLink).innerHTML = unescape(open_txt);		
		if ( open_txt ) document.getElementById(callingLink).innerHTML = unescape(open_txt);		
		// if ( open_txt ) document.getElementById(callingLink).innerHTML = open_txt;		
		if ( open_img ) document.getElementById(callingImg).src = open_img;					
	}
}

function checkProximityForm()
{
	newWin		= 0;
	error_bool 	= 0;
	myForm 		= document.searchaddress;

	/*
	// BECAUS WE HAVE SOME DEFAULT VALUES WE NEED TO FILTER THEM FIRST
	if ( myForm['name0'] && myForm['name0'].value == name0 ) myForm['name0'].value = "";
	if ( myForm['zip0'].value  == zip0  ) myForm['zip0'].value  = "";
	if ( myForm['city0'].value == city0 ) myForm['city0'].value = "";
	// because it looks better we will set street also to an emoty string
	if ( myForm['street0'].value == street0 ) myForm['street0'].value = "";
	*/
	if ( myForm['free_text0'].value == free_text0 ) myForm['free_text0'].value = "";

	// alert(myForm['name0'].value+"\n"+myForm['zip0'].value+"\n"+myForm['city0'].value+"\n");
	// BECAUSE WE DO NO FREESEARCH WE NEED TO CHECK FOLLOWING COMBINATIONS
	// 1. NO ZIP NO CITY NO DEALER => error
	// 2. IF ZIP MIN LEN
	// 3. IF CITY MIN LEN
	// 4. IF DEALER WE NEED ZIP OR CITY
	/*
	// CONDITION 1
	if ( myForm['name0'] && myForm['name0'].value.length == 0 && myForm['city0'].value.length == 0 && myForm['zip0'].value.length == 0 )
	{
		error_bool = 1;
		error_msg = "Bitte geben Sie den Namen eines HotSpot, eine PLZ oder einen Ort ein.";
	}
	else
	{
		// CONDITION 2
		if ( myForm['zip0'].value.length > 0 && myForm['zip0'].value.length < 2 ) 
		{
			error_bool = 1;
			error_msg = "Bitte geben Sie eine PLZ ein mit mind. 2 Ziffern.";
		}
		
		// CONDITION 3
		if ( myForm['city0'].value.length > 0 && myForm['city0'].value.length < 3 ) 
		{
			error_bool = 1;
			error_msg = "Bitte geben Sie einen Ort ein mit mind. 3 Buchstaben.";
		}		

		// CONDITION 4
		if ( myForm['name0'] && myForm['name0'].value.length > 0 && (myForm['city0'].value.length == 0 && myForm['zip0'].value.length > 0) && (myForm['city0'].value.length > 0 && myForm['zip0]'].value.length == 0) )
		{
			error_bool = 1;
			error_msg = "Bitte geben Sie zusaetzlich zum HotSpot eine PLZ oder einen Ort ein.";
		}		
	}
	*/	
	if ( error_bool )
	{
		alert (error_msg);		
		return false;
	}
	else
	{
		if ( newWin == 1 )
		{
			openWin('index.php');
		}
		else
		{
			// location.href='map24.searchresult.php';
			return true;
		}
		return true;
	}
}

function checkUncheck( box )
{
	if ( box.checked )
	{
		box.checked = false;
	}
	else
	{
		box.checked = true;
	}
}
