var quicktimeVersion = getQuicktimeVersion();

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function openPic(imageName,imageWidth,imageHeight) 
	{
   newWindow = window.open("","newWindow","width="+imageWidth+",height="+imageHeight+",scrollbars=no,left=250,top=250");
   newWindow.document.open();
   newWindow.document.write('<html><title>Setbild</title><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0">');
   newWindow.document.write('<img src=\"'+imageName+'\" width='+imageWidth+' height='+imageHeight+' alt=\"schliessen\" onClick=\"javascript:self.close()\">');
   newWindow.document.write('</body></html>');
   newWindow.document.close();
   newWindow.focus();
}

function openPressePic(imageName,imageWidth,imageHeight) 
	{
   newWindow = window.open("","newWindow","width="+imageWidth+",height="+imageHeight+",scrollbars=yes,left=250,top=250");
   newWindow.document.open();
   newWindow.document.write('<html><title>Setbild</title><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0">');
   newWindow.document.write('<img src=\"'+imageName+'\" width='+imageWidth+' height='+imageHeight+' alt=\"schliessen\" onClick=\"javascript:self.close()\">');
   newWindow.document.write('</body></html>');
   newWindow.document.close();
   newWindow.focus();
}

function openTrailer(movName, movWidth, movHeight,type)
	{	 	

		newWindow = window.open("","newWindow","width="+movWidth+",height="+movHeight+",scrollbars=no,left=140,top=240");
   	newWindow.document.open();
   	newWindow.document.write('<html><title>Trailer</title><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0">');		
   	if (type=='mov') 
   		{
  			newWindow.document.write('<object id="Quicktime" type="video/quicktime" width=\"'+movWidth+'\" height=\"'+movHeight+'\" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"> <param name="src" value=\"'+movName+'\" /> <param name="AutoStart" value="false" /><embed name="Quicktime" src=\"'+movName+'\" type="video/quicktime" width=\"'+movWidth+'\" height=\"'+movHeight+'\"></embed></object>');
  			}
  		else 
  			{
  			newWindow.document.write('<object id="MediaPlayer" type="application/x-oleobject" width=\"'+movWidth+'\" height=\"'+movHeight+'\" classid="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95"> <param name="src" value=\"'+movName+'\" /> <param name="AutoStart" value="false" /><embed name="MediaPlayer" src=\"'+movName+'\" type="application/x-oleobject" width=\"'+movWidth+'\" height=\"'+movHeight+'\"></embed></object>');
  			}
  		
  		newWindow.document.write('</body></html>');
   	newWindow.document.close();
   	newWindow.focus();
	}


function openMov(movName, movWidth, movHeight)
	{	 	
   if (quicktimeVersion > 4 && navigator.platform != 'Linux i686')
		{
		/*alert ("Zoomen mit strg und shift, Rotation mit der Maus"); */
		newWindow = window.open("","newWindow","width="+movWidth+",height="+movHeight+",scrollbars=no,left=140,top=240");
   	newWindow.document.open();
   	newWindow.document.write('<html><title>3d Panorama</title><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0">');		
		
  		movName=movName+"mov";
  		newWindow.document.write('<object id="Quicktime" type="video/quicktime" width="800" height="400" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"> <param name="src" value=\"'+movName+'\" /> <param name="AutoStart" value="false" /><embed name="Quicktime" src=\"'+movName+'\" type="video/quicktime" width="800" height="400"></embed></object>');
  			
  		newWindow.document.write('</body></html>');
   	newWindow.document.close();
   	newWindow.focus();
  		}
	else
  		{
    	alert ("QuicktimeVR Plugin fehlt");
    	movName=movName+"jpg";
  		openPic(movName, '700', '350');
  		}

	}


// Quicktime Detection  v1.0
// documentation: http://www.dithered.com/javascript/quicktime_detect/index.html
// license: http://creativecommons.org/licenses/by/1.0/
// code by Chris Nott (chris[at]dithered[dot]com)


function getQuicktimeVersion() 
	{
   	var agent = navigator.userAgent.toLowerCase(); 
   
   	// NS3+, Opera3+, IE5+ Mac (support plugin array):  check for Quicktime plugin in plugin array
   	if (navigator.plugins != null && navigator.plugins.length > 0) 
		{
      	for (i=0; i < navigator.plugins.length; i++ ) 
			{
	         	var plugin =navigator.plugins[i];
	         	if (plugin.name.indexOf("QuickTime") > -1) 
				{
	            	quicktimeVersion = parseFloat(plugin.name.substring(18));
	         		}
	      	}
	   	}
	   
	   	// IE4+ Win32:  attempt to create an ActiveX object using VBScript
	   	else if (agent.indexOf("msie") != -1 && parseInt(navigator.appVersion) >= 4 && agent.indexOf("win")!=-1 && agent.indexOf("16bit")==-1) 
			{
	     		document.write('<scr' + 'ipt language="VBScript"\> \n');
	      	document.write('on error resume next \n');
		      document.write('dim obQuicktime \n');
		      document.write('set obQuicktime = CreateObject("QuickTimeCheckObject.QuickTimeCheck.1") \n');
		      document.write('if IsObject(obQuicktime) then \n');
		      document.write('   if obQuicktime.IsQuickTimeAvailable(0) then \n');
		      document.write('      quicktimeVersion = CInt(Hex(obQuicktime.QuickTimeVersion) / 1000000) \n');
		      document.write('   end if \n');
		      document.write('end if \n');
		      document.write('</scr' + 'ipt\> \n');
	  		}
	
	   	// Can't detect in all other cases
	   		else 
				{
	      		quicktimeVersion = quicktimeVersion_DONTKNOW;
	   			}
	
	   	return quicktimeVersion;
		}
	quicktimeVersion_DONTKNOW = -1;



