windowOnLoad.add("bild()");

function PlayVideo(usernr,ObjektNr,filename_video,titel_video,bild){
	
	// <![CDATA[
				var so = new SWFObject("/include/flv_player/gddflvplay-v35.swf", "einzelansichtbildgross1", "260", "210", "9", "#000000"); 
					so.addParam("scale", "noscale");
					so.addParam("quality", "best");
					so.addParam("allowScriptAccess", "always");
					so.addParam("allowFullScreen", 'true');
					//VIDEO PARAMS
					so.addVariable("vdo", escape('/userdaten/'+usernr+'/'+ObjektNr+'/video/'+filename_video+'')); //video file
					so.addVariable("desc", escape(''+titel_video+'')); //  movie title
					so.addVariable("autoplay", 'false'); // autoplay: true or false  | default: false
					so.addVariable("sound", '70'); // sound volume 0-100	
					// YOUR CUSTOM LOGO, remove the next line if none
					//so.addVariable("mylogo", escape('customlogo.png')); // PNG, JPG, GIF,SWF, we recommend PNG for transparency
					
					//BUFFER SIZE (preloads x seconds of the movie before play)
					so.addVariable("buffer", 2); // buffer time in seconds; default 2sec if missing
					// START 
				  so.write("einzelansichtbildgross1");
					// ]]>
				document.getElementById("bildlink").style.display  = "block";
		return(true);
	
	}
	
	//////////////////////////////////////////////////////////////////////////////////////////////////////
	function switch2picture(bild){
		var innerHTML = '<img class="img_gross"  src="'+bild+'"/>';
		document.getElementById("einzelansichtbildgross").innerHTML  = innerHTML;
		document.getElementById("bildlink").style.display  = "none";
		
	}	 
	
	//////////////////////////////////////////////////////////////////////////////////////////////////////
	
	function maximizePicture(Ereignis, Img){
		if (Ereignis){
			with(scrollPos()){
				var innerHTML = '<img style="border: solid 1px black; padding: 1px;" height="400" src="' + Img.src.replace(/thumbs\//, '') + '" />';
				document.getElementById("maxpicture").style.left = Ereignis.clientX + left + 10   + "px";
    			document.getElementById("maxpicture").style.top  = Ereignis.clientY + top  - 200 + "px";
				document.getElementById("maxpicture").innerHTML  = innerHTML;
			}
		} // end if	 
	} // end function maximizePicture
	
	//////////////////////////////////////////////////////////////////////////////////////////////////////
	
	function minimizePicture(){
	
		document.getElementById("maxpicture").innerHTML  = "";
	
	}
	
	function movePicture(Ereignis) {
		with(scrollPos()) {
			document.getElementById("maxpicture").style.left = Ereignis.clientX + left + 10   + "px";
    		document.getElementById("maxpicture").style.top  = Ereignis.clientY + top  - 200  + "px";
		}
	}
	
	/////////////////////////////////////////////////////////////////////////////////////////////////
	function showLageplan(src) {
		if(src=='-1') {
			return false;
		}
		PlanWindow = window.open(src, "Planwindow", "resizeable=yes,width=805,height=605");
  		PlanWindow.focus();
	}
	
	function tellAFriend(objektnr) {
		tafWindow = window.open('/php/index/index.ferienwohnung.tellafriend.php?nr='+objektnr, "Planwindow", "resizeable=yes,width=350,height=400");
  		tafWindow.focus();
	}

	function switchBigImage(width,height,newsrc) {
		hoehe = height+18;//+48;
		breite = width+18;
		//FotoWindow = window.open(newsrc, 'Fotowindow', 'resizeable=yes,width='+breite+',height='+hoehe);
		FotoWindow = window.open('', 'Fotowindow', 'resizeable=yes,width='+breite+',height='+hoehe);
		
		FotoWindow.document.open();
		FotoWindow.document.write('<html><head><title>'+newsrc+'</title></head><body>');
		FotoWindow.document.write('<img src="'+newsrc+'">');
		//FotoWindow.document.write('<center><table>');
		//FotoWindow.document.write('<tr>');
		//FotoWindow.document.write('<td><a href=""><img src="/img/zurueck_pfeil.gif"></a></td>');
		//FotoWindow.document.write('<td><a href=""><img src="/img/vorwaerts_pfeil.gif"></a></td>');
		//FotoWindow.document.write('</tr>');
		//FotoWindow.document.write('</table></center>');
		FotoWindow.document.write('</body></html>');
		FotoWindow.document.close();
		
		FotoWindow.focus();
		//$('einzelansichtbildgross').src = newsrc;
		//alert(newsrc);
	}
	/////////////////////////////////// Bilderanzeige per mouseover ///////////////////////////////
	function show_(objEvt)
	{
	   blnIE                          = window.event;
	   objEvt                         = (blnIE) ? window.event : objEvt;
	   objTarget                      = (blnIE) ? objEvt.srcElement : objEvt.target;
	   document.detail.src            = objTarget.src;
	   intScrollX                     = (blnIE) ? document.body.scrollLeft : window.pageXOffset;
	   intScrollY                     = (blnIE) ? document.body.scrollTop : window.pageYOffset;
	   intPosX                        = (blnIE) ? objEvt.clientX : objEvt.pageX;
	   intPosY                        = (blnIE) ? objEvt.clientY : objEvt.pageY;
	   document.detail.style.left     = intPosX + 2;
	   document.detail.style.top      = intPosY + 2;
	   document.detail.style.display  = '';
	}
	function hide_()
	{
	  document.detail.style.display   ='none';
	}
	
	function bild() {
		arrImgs=document.getElementsByName('hovern');
		for(i=0;i < arrImgs.length;++i) {
			arrImgs[i].onmouseover=show_;
			arrImgs[i].onmousemove=show_;
			arrImgs[i].onmouseout=hide_;
		  }
	 }
	 
	//////////////////////////////// Freymann neu ab 09.09.09 //////////////////////////////////////
	function imagePopup(url, i, mouse) {
		

		
		var mousepos 	= new mslib().getMousePos(mouse);
		var scrollpos	= new mslib().getScrollPos();
		
		var bigPicture 	= document.getElementById("bigpicture");
		var last 		= document.getElementById("last");
		var next 		= document.getElementById("next");
		var container 	= document.getElementById("images_hauptcontainer");
		
		new Draggable("images_hauptcontainer", {handle: "handle"});
		
		document.getElementById("bild_text").innerHTML = document.getElementsByName("thumb")[i].title;
		

		if(document.getElementById("einzelansichtbildgross1")){
			document.getElementById("einzelansichtbildgross1").style.visibility	=	'hidden';
		}
		
		with(container){
			
			style.display 	= 	"block";
				
			if(imagePopup.prototype.move){
				//style.top		= 	(mousepos.y-100)	+	"px";          // alt
				//style.left		=	(mousepos.x+10)		+ 	"px";      // alt
				style.position = 'absolute';
				style.top = 0+"px";
				style.left = 400+"px";
				style.backgroundColor = 'white';
			}//end if
			
		}//end with
			
		with(bigPicture){
			src = url;
			
		}//end with
			
		with(last) { // Zurckblttern
			
			onclick 	= document.getElementsByName("thumb")[Math.max(i-1, 0)].onclick;
			
			if(i==0){
				style.visibility = "hidden";
			}//end if
			else{
				style.visibility = "visible";
			}
			
		}//end with
			
		with(next) { // Vorwrtsblttern
			
			onclick = document.getElementsByName("thumb")[Math.min(i+1, document.getElementsByName("thumb").length-1)].onclick;
			
			if(i==document.getElementsByName("thumb").length-1){
				style.visibility = "hidden";
			}//end if
			else{
				document.getElementById("bild_text").innerHTML = document.getElementsByName("thumb")[i].title;
				style.visibility = "visible";
			}//end else
			
		}//end with

	}//end function
	
	function imageClose() {
		with(document.getElementById("images_hauptcontainer")) {
				style.display = "none";
		}//end with
		document.getElementById("einzelansichtbildgross1").style.visibility	=	'visible';
	}//end function
	
	
