/**
 * Unicode Systems
 * @category   Uni
 * @package    Uni_Fileuploader
 * @copyright  Copyright (c) 2010-2011 Unicode Systems. (http://www.unicodesystems.in)
 * @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
function playerFlvOpen(soundfiledesc,soundfilepath,soundPlayerPath) {
    var UniqueID = 100; // Make each link open in a new window
    var newWinOffset = 50; // Position of first pop-up
    PlayWin = window.open('',UniqueID,'width=800,height=590,top=' + newWinOffset +',left=350,resizable=1,scrollbars=0,titlebar=0,toolbar=0,menubar=0,status=0,directories=0,personalbar=0');
    PlayWin.focus();

    var winContent = "<HTML><HEAD><TITLE>" + soundfiledesc + "</TITLE><style>.form-button-alt{background-color:#618499; border:1px solid #406A83;color:#FFFFFF; cursor:pointer; font-family:arial,sans-serif !important; font-size:12px !important; font-size-adjust:none !important; font-stretch:normal !important; font-style:normal !important; font-variant:normal !important; font-weight:bold !important; line-height:normal !important; overflow:visible; padding:1px 8px; text-align:center; vertical-align:middle; width:auto;}</style></HEAD><BODY bgcolor='#FAF7EE'>";
    //winContent +='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" width="1903" height="734"><param name="movie" value="http://www.hdflvplayer.net/magento-hd-flash-video-player/demo/skin/frontend/default/default/hdflvplayer/hdplayer.swf" /><param name="flashvars" value="baserefM=http://www.hdflvplayer.net/magento-hd-flash-video-player/demo/index.php/&id=&pid=2&autoplay=false&showPlaylist=true&showPlaylist=true&timer=false&zoom=false&share=false" /><param name="allowFullScreen" value="true" /><param name="wmode" value="transparent" /><param name="allowscriptaccess" value="always" /><embed src="http://www.hdflvplayer.net/magento-hd-flash-video-player/demo/skin/frontend/default/default/hdflvplayer/hdplayer.swf" flashvars="baserefM=http://www.hdflvplayer.net/magento-hd-flash-video-player/demo/index.php/&id=&pid=2&autoplay=false&showPlaylist=true&timer=false&zoom=false&share=false" style="width:793px;height:634px" allowFullScreen="true" allowScriptAccess="always" type="application/x-shockwave-flash" wmode="transparent"></embed></object>';
	//winContent += "<p style='font-weight: bold; font-size:15px; color:#E26703; font-family:Verdana,sans-serif; line-height:1.5; clear: both;'>" + soundfiledesc + "</p>";

   // winContent += '<embed width="100%"  height="100%"  flashvars="height=570&width=800&displayheight=570&file='+soundfilepath+'&image='+soundPlayerPath+'bg.jpg&backcolor=0x000000&frontcolor=0xFF3333&lightcolor=0xeeeeee&link='+soundfilepath+'&amp;showstop=true&volume=100&callback=analytics" allowfullscreen="true" AUTOSTART="TRUE" allowscriptaccess="always" wmode="transparent" quality="high" name="player1" id="player1" src="'+soundPlayerPath+'player.swf" type="application/x-shockwave-flash"></embed>';
	
	/*winContent +=  '<object classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715,8,9,10" type="application/x-oleobject" width="320" height="300" standby="Loading Microsoft Windows Media Player components..." id="MediaPlayer">';
winContent += '<param name="AnimationatStart" value="true">';
winContent += '<param name="TransparentatStart" value="true">';
winContent += '<param name="AUTOPLAY" value="true">';
winContent += '<param name="ShowControls" value="true">';
winContent += '<param name="showstatusbar" value="true">';*/
winContent += '<embed width="100%" autoplay="true"  height="100%" autostart="true" flashvars="height=570&width=800&displayheight=570&file='+soundfilepath+'&image=http://www.softwarevideo.com/skin/frontend/default/default/images/play1.png&backcolor=0x000000&frontcolor=0xFF3333&lightcolor=0xeeeeee&link='+soundfilepath+'&amp;showstop=true&volume=100&callback=analytics&play=yes&autostart=true" allowfullscreen="true"  allowscriptaccess="always"  wmode="transparent" quality="high" name="player1" id="player1" src="'+soundPlayerPath+'player.swf" type="application/x-shockwave-flash"></embed>';
//winContent += '</object>';

 
	
	
   // winContent += "<DIV align='center' style='margin-top: 3px; clear: both;'><button onclick='javascript:window.close();' class='form-button-alt' type='button'><span>Close</span></button></DIV>";
    winContent += "</BODY></HTML>";

    PlayWin.document.write(winContent);
    PlayWin.document.close(); // "Finalizes" new window
    UniqueID = UniqueID + 0 // set to "1" to make each link open in new window
    newWinOffset = newWinOffset + 0 // subsequent pop-ups will be this many pixels lower
}

function fileUploaderPopup1(options){
    this.options = {
        title: '_blank',
        url: '#',
        width: 600,
        height: 500
    }
    Object.extend(this.options, options || {});
    window.open(this.options.url, this.options.title, 'width='+this.options.width+',height='+this.options.height);
}


var fileUploaderPopup = {
    open: function(options)
    {
        this.options = {
            url: '#',
            width: 600,
            height: 500,
            name:"_blank",
            location:"no",
            menubar:"yes",
            toolbar:"no",
            status:"yes",
            scrollbars:"yes",
            resizable:"yes",
            left:"",
            top:"",
            normal:false
        }
        Object.extend(this.options, options || {});

        if (this.options.normal){
            this.options.menubar = "yes";
            this.options.status = "yes";
            this.options.toolbar = "yes";
            this.options.location = "yes";
        }

        this.options.width = this.options.width < screen.availWidth?this.options.width:screen.availWidth;
        this.options.height=this.options.height < screen.availHeight?this.options.height:screen.availHeight;
        var openoptions = 'width='+this.options.width+',height='+this.options.height+',location='+this.options.location+',menubar='+this.options.menubar+',toolbar='+this.options.toolbar+',scrollbars='+this.options.scrollbars+',resizable='+this.options.resizable+',status='+this.options.status
        if (this.options.top!="")openoptions+=",top="+this.options.top;
        if (this.options.left!="")openoptions+=",left="+this.options.left;
        window.open(this.options.url, this.options.name,openoptions );
        return false;
    }
}
