var Sep_Window=new Object();
//---------------------------------------------------------
// Open Eigenes Window für Links
// Hib_Open_Window('Link','1','','','tools','root');
//  Edit from Dreamweaver
//---------------------------------------------------------  
function Hib_Open_Window(theURL) {
	if (theURL=='#' || theURL=='-' || theURL=='') return;
	if (theURL.indexOf('') != -1) theURL = theURL.replace('newsletter-anmelden','?internal&action=Dynpage_Link.action&Parameter=NEWSLETTER;hdlr;;');
	window.status = '';
	var eigenes_fenster = 1;
	if (theURL.indexOf('/unternehmen/') != -1) eigenes_fenster = 0;
	var s_width  = 0;
	var s_height = 0;
	var tools = '';
	var RootPage='';
	var std_tools = 'status=no,toolbar=no,scrollbars=yes,resizable=yes,width=660,height=451';
	if (Hib_Open_Window.arguments.length > 1) {
		if (Hib_Open_Window.arguments[1] == '0') eigenes_fenster = 0;
		if (!Hib_Open_Window.arguments[2]) ; else s_width = Hib_Open_Window.arguments[2];
		if (!Hib_Open_Window.arguments[3]) ; else s_height = Hib_Open_Window.arguments[3];
		if (!Hib_Open_Window.arguments[4]) ; else tools = Hib_Open_Window.arguments[4];
		if (!Hib_Open_Window.arguments[5]) ; else RootPage = Hib_Open_Window.arguments[5];
	}
	if (tools=='' || tools=='-') tools = std_tools;
	if (RootPage=='root') {
	    if (theURL.indexOf('_A_') != -1) {
	    	if (theURL.indexOf('/vw/') != -1) theURL = '/Haendler/'+HdlrNummer + '/?vw&id=F9201&mc=1&detail=' + theURL;
	    	if (theURL.indexOf('/vwlnf/') != -1) theURL = '/Haendler/'+HdlrNummer + '/?vwlnf&id=F9201&mc=1&detail=' + theURL;
	    	//if (theURL.indexOf('/audi/') != -1) theURL = '/Haendler/'+HdlrNummer + '/?audi&id=F9201&mc=1&detail=' + theURL;
	    	if (theURL.indexOf('/porsche/') != -1) theURL = '/Haendler/'+HdlrNummer + '/?porsche&id=92010&detail=' + theURL;
	    	
	      	this.location = theURL;
	      	return false;
	    }
		var time = new Date();
		time = time.getTime();
		if(Sep_Window.closed == false) Sep_Window.close();
		var winName  = 'InfoSeite' + time;
		Sep_Window = window.open(theURL,winName,tools);
		Sep_Window.focus();
   }else{
	   	if (parent.frames.length <= 0 && theURL.indexOf('SVC=MABLISTE') == -1)	{ // Seite ist bereits als eigenes Window geöffnet
	   		this.location = theURL;
	   		return false;
	   	}else{ // Seite ist im PopUp
	      	if (eigenes_fenster == 1) {
	      		var time = new Date();
	      		time = time.getTime();
	      		if(Sep_Window.closed == false) Sep_Window.close();
	      		var winName  = 'InfoSeite' + time;
	      		Sep_Window = window.open(theURL,winName,tools);
	      		Sep_Window.focus();
	      		//return false;
	         }else{
	      		if (s_width != 0) self.resizeTo(s_width,s_height)	
	      		this.location = theURL;
	      		return false;
	         }
	      }
   }   
}
//---------------------------------------------------------
// Resize Bug-Fix for Netscape
//---------------------------------------------------------  
	var doAll = (document.all != null)
	var YY_oldX = window.innerWidth; var YY_oldY = window.innerHeight;
function YY_ns4refresh() { }

//----------------------------------------------------------------
// showWindow
//----------------------------------------------------------------
function showWindow(url,winSizeX,winSizeY,noToolbar,noResize){

	if (url.indexOf('fb/h_spiel.htm') != -1) {
	    this.location = url;
	    return false;
	}
	
	var windowOptions = 'status=yes,toolbar=yes,resizable=yes,width=710,height=500';
	if(winSizeX) 
		windowOptions = windowOptions.replace('width=710','width=' + winSizeX);
	if(winSizeY) 
		windowOptions = windowOptions.replace('height=500','height=' + winSizeY);
	if(noResize) 
		windowOptions = windowOptions.replace('resizable=yes','resizable=no');
	if(noToolbar) 
		windowOptions = windowOptions.replace('toolbar=yes','toolbar=no');
   var theWindow = window.open(url,'theWindow',windowOptions); 
   theWindow.focus();
}   

//----------------------------------------------------------------
// showWindow
//----------------------------------------------------------------
function showKontakt(url){
	var windowOptions = 'status=yes,toolbar=no,resizable=yes,width=630,height=500,scrollbars=yes';
   var theWindow = window.open(url,'Kontakt',windowOptions); 
   theWindow.focus();
}   