function fCenterWindow(intWidth,intHeight)
{
   var strOutput = "";

	// Middle Point Of Screen
   intWidth  = (screen.availWidth / 2) - (intWidth / 2) ;
   intHeight = ((screen.availHeight-20) / 2) - (intHeight / 2) ;
   
   // Netscape 4.7
   strOutput += ",screenx=" + intWidth;
   strOutput += ",screeny=" + intHeight;
   
   // Internet Explorer 4.0
   strOutput += ",left=" 	+ intWidth ;
   strOutput += ",top=" 	+ intHeight;
 
   return strOutput;

}

function fLeftWindow(intHeight)
{
   var strOutput = "";

   intHeight = screen.availHeight - (20 + intHeight) ;
   
   // Netscape 4.7
   strOutput += ",screenx=0" ;
   strOutput += ",screeny=" + intHeight;
   
   // Internet Explorer 4.0
   strOutput += ",left=0";
   strOutput += ",left=0,top=" 	+ intHeight;
 
   return strOutput;

}

function fOpenHtmlWindow(strURL, strName, nWidth, nHeight, nScreenX, nScreenY)
{
	//SecondFenster();
   	var win = window.open(strURL, strName,"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width="+nWidth+",height="+nHeight+", screenx=" + nScreenX + ", screeny=" + nScreenY + " ");
	win.focus();
}

function fOpenCenteredWindow(strURL, nWidth, nHeight)
{
	//SecondFenster();
	var str = fCenterWindow(nWidth,nHeight);
   	var win = window.open(strURL, "CenteredWindow","toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=auto,resizable=no, width="+nWidth+", height="+nHeight+" " + str + " ");
	win.focus();
}

function getMicrosite(strMicrosite)
{
	var strURL="";
	var intWidth="";
	var intHeight="";
	switch(strMicrosite)
	{
		case "marblix":
			 strURL="http://marblix.eu/index.php?fnum=8";
			 intWidth="1011";
			 intHeight="600";
		break;
		
		case "secretstone":
			strURL="http://secret-stone.eu/";
			intWidth="780";
			intHeight="595";
		break;
		
		case "microstars":
			strURL="http://microstars.simbatoys.de/";
			intWidth="885";
			intHeight="640";
		break;
		
		case "filly":
			strURL="http://filly.simbatoys.de/";
			intWidth="1252";
			intHeight="925";
			
			//SecondFenster();
			var str = fCenterWindow(intWidth,intHeight);
		   	var win = window.open(strURL, "CenteredWindow","toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=no, width="+intWidth+", height="+intHeight+" " + str + " ");
			win.focus();
		break;
		
		case "chichilove":
			strURL="http://chichilove.eu/";
			intWidth="878";
			intHeight="762";
			
			//SecondFenster();
			var str = fCenterWindow(intWidth,intHeight);
		   	var win = window.open(strURL, "CenteredWindow","toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=no, width="+intWidth+", height="+intHeight+" " + str + " ");
			win.focus();
		break;
		
		case "chichilove_pluesch-neu":
			strURL="http://chichilove.eu/index.php?m=2&lang=";
			intWidth="878";
			intHeight="762";
			
			//SecondFenster();
			var str = fCenterWindow(intWidth,intHeight);
		   	var win = window.open(strURL, "CenteredWindow","toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=no, width="+intWidth+", height="+intHeight+" " + str + " ");
			win.focus();
		break;
		
		case "audir8":
			strURL="http://audir8.dickie-toys.com/";
			intWidth="940";
			intHeight="657";
		break;
		
		case "babybande":
			strURL="http://baby-bande.de/";
			intWidth="960";
			intHeight="696";
		break;
		
		case "powerrangers":
			strURL="http://www.bandaieurope.eu/15_JAHRE_POWER_RANGERS/";
			intWidth="1025";
			intHeight="615";
		break;
		
		case "squap":
			strURL="http://squap.simbatoys.de/";
			intWidth="1320";
			intHeight="925";
			
			//SecondFenster();
			var str = fCenterWindow(intWidth,intHeight);
		   	var win = window.open(strURL, "CenteredWindow","toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=no, width="+intWidth+", height="+intHeight+" " + str + " ");
			win.focus();
		break;
		
		case "squap-tour-2010":
			strURL="http://squap.simbatoys.de/?m=4&lang=";
			intWidth="1320";
			intHeight="925";
			
			//SecondFenster();
			var str = fCenterWindow(intWidth,intHeight);
		   	var win = window.open(strURL, "CenteredWindow","toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=no, width="+intWidth+", height="+intHeight+" " + str + " ");
			win.focus();
		break;
	}
	fOpenCenteredWindow(strURL,intWidth,intHeight);
}

function getGame(strGame)
{
	var strURL="";
	var intWidth="";
	var intHeight="";
	switch(strGame)
	{ 
		case "dickierace":
			 strURL="/games/dickierace/index.html";
			 intWidth="550";
			 intHeight="400";
		break;
		
		case "eichhornexpress":
			 strURL="/games/express/index.html";
			 intWidth="700";
			 intHeight="500";
		break;
		
		case "fashionparty":
			 strURL="/games/fashionparty/index.html";
			 intWidth="700";
			 intHeight="400";
		break;

		case "galacticbooster":
			 strURL="/games/galacticbooster.html";
			 intWidth="816";
			 intHeight="618";
		break;
		
		case "squap":
			 strURL="http://217.160.73.73/adwax/GAMES/SQUAP_GAME/simba.html";
			 intWidth="650";
			 intHeight="640";
		break;
		
		case "chichilove":
			 strURL="http://217.160.73.73/adwax/GAMES/chichilove/simba.html";
			 intWidth="850";
			 intHeight="630";
		break;
	}
	fOpenCenteredWindow(strURL,intWidth,intHeight);
}


function ImageCenterWindow(intWidth,intHeight)
{
	   var strOutput = "";
		// Middle Point Of Screen
	   intWidth  = (screen.availWidth / 2) - (intWidth / 2) ;
	   intHeight = ((screen.availHeight-20) / 2) - (intHeight / 2) ;
	   // Netscape 4.7
	   strOutput += ",screenx=" + intWidth;
	   strOutput += ",screeny=" + intHeight;
	   // Internet Explorer 4.0
	   strOutput += ",left=" 	+ intWidth ;
	   strOutput += ",top=" 	+ intHeight;
	 
	   return strOutput;
}

function ImagePopup (strHtmlCode, strHtmlTitle, intWidth, intHeight, strSelect) 
{
	var strOutput = "";
	var strFileName = "";
	strOutput = '<table border="0" cellspacing="0" cellpadding="0">'+"\n";
	strOutput += '<tr>'+"\n";
	strOutput += '	<td><img';
	strOutput += ' src="' 	+ strHtmlCode + '" ';
	strOutput += ' alt="'	+ strHtmlTitle + '" ';
	strOutput += ' width="'	+ intWidth + '" ';
	strOutput += ' height="' + intHeight + '" ';
	strOutput += ' border="0"></td>'+"\n";
	strOutput += '</tr>'+"\n";
	strOutput += '</table>'+"\n";
	intWidth = intWidth-4; 
	intHeight = intHeight-4; 
	strHtmlCode = strOutput;
		
	var win = window.open(strFileName,  strHtmlTitle,"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width="+intWidth+",height=" + intHeight + ImageCenterWindow(intWidth,intHeight));

	// Format HTML
	strOutput = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">'+"\n";
	strOutput += '<HTML>'+"\n";
	strOutput += '<HEAD>'+"\n";
	// Title
	strOutput += '<TITLE>'+strHtmlTitle+'</TITLE>'+"\n";
	strOutput += '<META http-equiv="content-type" content="text/html;charset=windows-1251">'+"\n";
	strOutput += '</HEAD>'+"\n";
	strOutput += '<BODY bgcolor="#ffffff" topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" style=" border: 0">'+"\n";
	// Html Code
	strOutput += strHtmlCode;
	strOutput += '</BODY></HTML>'+"\n";
	// Edit Window (Put HTML
	win.document.open("text/html");	
	win.document.write(strOutput);
	win.document.close();
	win.focus();
}

function p_Detail_Get3DView(intDomainId, strFolderName, strTitle)
{
	var intWidth = "500";
	var intHeight = "650";
	
	var str3DViewerPath = "";
	switch(parseInt(intDomainId)){
		case 2:
			var intWidth = "500";
			var intHeight = "650";
			str3DViewerPath = "http://3d.simbatoys.de/simba/"+strFolderName+"/index.php?client=dickie";
		break;
		
		case 3:
			var intWidth = "500";
			var intHeight = "650";
			str3DViewerPath = "http://3d.simbatoys.de/dickie/"+strFolderName+"/index.php?client=dickie";
		break;

		default:
			return;
		break;
	}
	
	var FindCharakcter = -1;
	
	var obj3DWindow = null;
	obj3DWindow = window.open(str3DViewerPath,  strTitle, "toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=no,width=" + intWidth + ",height=" + intHeight + fCenterWindow(intWidth, intHeight));
	obj3DWindow.focus();
}

function p_getGalleryPopUp(strId, strType, intStartImage)
{
	var intWidth = 760;
	var intHeight = 620;
	var strGalleryUrlTMP = strGalleryUrl;
	
	if(strType == null){
		strType = "product";
	}
	if(intStartImage < 1){
		intStartImage = 0;
	}
	
	strGalleryUrlTMP += "?sArtNr="+strId;
	strGalleryUrlTMP += "&nFileId="+strId;
	strGalleryUrlTMP += "&nWidth="+intWidth;
	strGalleryUrlTMP += "&nHeight="+intHeight;
	strGalleryUrlTMP += "&sType="+strType;
	strGalleryUrlTMP += "&nImageId="+intStartImage;
	
	var intGalleryWidth = intWidth;
	var intGalleryHeight= intHeight;
	
	intGalleryHeight += 26;
	
	var str = fCenterWindow(intGalleryWidth,intGalleryHeight);
   	var win = window.open(strGalleryUrlTMP, "CenteredWindow","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no, width="+intGalleryWidth+", height="+intGalleryHeight+" " + str + " ");
	win.focus();
}