    function MM_goToURL() { //v3.0
       var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
       for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
    }

    function MM_openBrWindow(theURL,winName,features) { //v2.0
    window.open(theURL,winName,features);
    }
        
    function strReplaceAll(str,strFind,strReplace){
        var returnStr = str;
        var start = returnStr.indexOf(strFind);
        while (start>=0)
        {
            returnStr = returnStr.substring(0,start) + strReplace + returnStr.substring(start+strFind.length,returnStr.length);
            start = returnStr.indexOf(strFind,start+strReplace.length);
        }
        return returnStr;
    }
    
    function open_window_centered(url,name,newwidth,newheight){
          var pos_x = (screen.availWidth/2) - (newwidth/2);
          var pos_y = (screen.availHeight/2) - (newheight/2);
          url = escape(url);
          url = strReplaceAll(url,"+"," ");
          url = strReplaceAll(url,"%3F","?");
          url = strReplaceAll(url,"%3D","=");
          url = strReplaceAll(url,"%26","&");
          cntwindow=window.open(url,name,'status=0, resize=no, height='+newheight+', width='+newwidth+',left='+pos_x+',top='+pos_y);
          cntwindow.focus();
    }

    function download_dispatch(iddownload,filetype){
      var pos_x = 2600;
      var pos_y = 2600;
      var url = "<?php print $cst_server; ?>download.php?iddownload=" + iddownload;
      dispatchwindow=window.open(url,'dispatchwindow','scrollbars=no,resize=no,height=50,width=50,left='+pos_x+',top='+pos_y);      
      window.focus();
    }

    function show_content(idcontent){
      var newwidth  = 580;
      var newheight = 580;    
      var pos_x = (screen.availWidth/2) - (newwidth/2);
      var pos_y = (screen.availHeight/2) - (newheight/2);
      var url = "<?php print $cst_server; ?>content_popup.php?idcontent=" + idcontent;      
      cntwindow=window.open(url,'content','scrollbars=1,resize=1,height='+newheight+',width='+newwidth+',left='+pos_x+',top='+pos_y);      
      cntwindow.focus();
    }    

    // display the sound-player
    function soundplayer(iddownload){
      if (iddownload != 0)
      {
	        document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
	        document.write('codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,79"');
	        document.write('WIDTH="354" HEIGHT="24" id="soundplayer" ALIGN="">');
	        document.write('<param name="wmode" value="transparent">');
	        document.write('<PARAM NAME=movie VALUE="viewers/soundplayer.swf?iddownload='+iddownload+'"> <PARAM NAME=menu VALUE=false> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#E8E8CF>');
	        document.write('<EMBED src="viewers/soundplayer.swf?iddownload='+iddownload+'" menu=false quality=high bgcolor=#FFFFFF  WIDTH="354" HEIGHT="24" NAME="soundplayer" ALIGN="" wmode="transparent"');
	        document.write('TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>');
	        document.write('</OBJECT>');
      }
    }
    
    // display the videoplayer
    function videoplayer(iddownload){
		if (iddownload != 0){
	        document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
	        document.write(' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,79"');
	        document.write(' WIDTH="269" HEIGHT="227" id="videoplayer" ALIGN="">');
	        document.write('<param name="wmode" value="transparent">');
	        document.write(' <PARAM NAME=movie VALUE="viewers/videoplayer.swf?iddownload='+iddownload+'"> <PARAM NAME=menu VALUE=false> <PARAM NAME=quality VALUE=high> <EMBED src="viewers/videoplayer.swf?iddownload='+iddownload+'" menu=false quality=high WIDTH="269" HEIGHT="227" NAME="videoplayer" ALIGN=""');
	        document.write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>');
	        document.write('</OBJECT>');
		}
    }

    // display the slideshowplayer
    function slideshowplayer(idgallery){
      if (idgallery != 0)
      {
	        document.write('<DIV align="CENTER"><OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
	        document.write(' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,79"');
	        document.write(' WIDTH="424" HEIGHT="435" id="slideshowplayer" ALIGN="">');
	        document.write('<param name="wmode" value="transparent">');
	        document.write(' <PARAM NAME=movie VALUE="viewers/slideshowplayer.swf?idgallery='+idgallery+'"> <PARAM NAME=menu VALUE=false> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#F3F3E7> <EMBED src="viewers/slideshowplayer.swf?idgallery='+idgallery+'" menu=false quality=high bgcolor=#F3F3E7  WIDTH="424" HEIGHT="435" NAME="slideshowplayer" ALIGN="" wmode="transparent"');
	        document.write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>');
	        document.write('</OBJECT></DIV>');        
      }
    }

    // display the panoramaviewer
    function panoramaplayer(iddownload,loop){
      if (iddownload != 0)
      {
        document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
        document.write(' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0"');
        document.write(' WIDTH="400" HEIGHT="120" id="panoramaplayer" ALIGN="">');
        document.write('<param name="wmode" value="transparent">');
        document.write(' <PARAM NAME=movie VALUE="viewers/panoramaplayer.swf?iddownload='+iddownload+'&loop='+loop+'"> <PARAM NAME=menu VALUE=false> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED src="viewers/panoramaplayer.swf?iddownload='+iddownload+'&loop='+loop+'" menu=false quality=high bgcolor=#FFFFFF  WIDTH="400" HEIGHT="120" NAME="panoramaplayer" ALIGN="" wmode="transparent"');
        document.write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>');
        document.write('</OBJECT>');
      }
    }

    function ipwebstats(paramstr){ 
      var width = screen.width; 
      var height = screen.height; 
      var url='stats.php?' + paramstr + '&width=' + width + "&height=" + height;
      document.ipwebstats.src=url;
    } 

    function ipw_loadMovie(moviefile){
    	var FO = { 	movie:"flvplayer.swf",width:"326",height:"260",majorversion:"7",build:"0",bgcolor:"#FFECEF",flashvars:"file=files/uploads/"+moviefile+".flv&autostart=true" };
    	UFO.create(FO, "flvplayer");
    }

