function OpenGenericDocument(file, w, h) {
    if ("/" + file.isFile) {
        if (h == NaN) { h = 400; }
        if (w == NaN) { w = 760; }
        var hs = screen.height;
        var ls = screen.width;
        var top = (hs - h) / 2;
        if (top <= 0) { top = 0; }
        var left = (ls - w) / 2;
        if (left <= 0) { left = 0; }
        var OGD = window.open(file, "ogd", "top=" + top + ", left=" + left + ", width=" + w + ", height=" + h + ", resizable=1, scrollbars=1");
    }
}
function OpenVideo_WMV_MPG(file, w, h) {
    if ("/" + file.isFile) {
        if (h == NaN) { h = 345; }
        if (w == NaN) { w = 425; }
        var hs = screen.height;
        var ls = screen.width;
        var top = (hs - h) / 2;
        if (top <= 0) { top = 0; }
        var left = (ls - w) / 2;
        if (left <= 0) { left = 0; }

        //per Internet Explorer
        var s = "<object id='player' height='" + h + "' width='" + w + "' classid='CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6'>";
        s += "<param name='url' value='" + file + "' />";
        s += "<param name='src' value='" + file + "' />";
        s += "<param name='autoStart' value='true' />";
        s += "<param name='showcontrols' value='true' />";
        s += "<param name='playCount' value='1' />";
        //Per altri browser
        s += "<object type='video/x-ms-wmv' data='" + file + "' width='" & w + "' height='" + h + "'>";
        s += "<param name='src' value='" + file + "' />";
        s += "<param name='autostart' value='true' />";
        s += "<param name='controller' value='true' />";
        s += "<param name='Loop' value='0' />";
        s += "</object></object>";

        var corpo = "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'><html xmlns='http://www.w3.org/1999/xhtml'><head><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1' /><title>Video</title></head>";
        corpo += "<body bgcolor='#000000'><div align='center'><font color='#FFFFFF' size='4' face='Verdana, Arial, Helvetica, sans-serif'>";
        corpo += "Video</font><br /><br />";
        corpo += s;
        corpo += "<br /><br /><a href='#' onclick='javascript:window.close();'><font color='#FFFFFF' size='1' face='Verdana, Arial, Helvetica, sans-serif'>Chiudi</a></font></div></body></head>";
        var WMV_MPG = window.open("", "wmvmpg", "top=" + top + ", left=" + left + ", width=" + w + ", height=" + h + ", resizable=1, scrollbars=0");
        WMV_MPG.document.write(corpo);
    }
}
function OpenVideo_MOV(file, w, h) {
    if ("/" + file.isFile) {
        if (h == NaN) { h = 345; }
        if (w == NaN) { w = 425; }
        var hs = screen.height;
        var ls = screen.width;
        var top = (hs - h) / 2;
        if (top <= 0) { top = 0; }
        var left = (ls - w) / 2;
        if (left <= 0) { left = 0; }

        //per Internet Explorer
        var s = "<object classid='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B' codebase='http://www.apple.com/qtactivex/qtplugin.cab' height='" + h + "' width='" + w + ">";
        s += "<param name='src' value='" + file + "' />";
        s += "<param name='pluginspage' value='http://www.apple.com/quicktime/download/' />";
        s += "<param name='autoplay' value='true' />";
        s += "<param name='controller' value='true' />";
        //Per altri browser
        s += "<object type='video/quicktime' data='" + file + "' width='" & w + "' height='" + h + "'>";
        s += "<param name='src' value='" + file + "' />";
        s += "<param name='pluginurl' value='http://www.apple.com/quicktime/download/' />";
        s += "<param name='autoplay' value='true' />";
        s += "<param name='controller' value='true' />";
        s += "</object></object>";

        var corpo = "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'><html xmlns='http://www.w3.org/1999/xhtml'><head><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1' /><title>Video</title></head>";
        corpo += "<body bgcolor='#000000'><div align='center'><font color='#FFFFFF' size='4' face='Verdana, Arial, Helvetica, sans-serif'>";
        corpo += "Video</font><br /><br />";
        corpo += s;
        corpo += "<br /><br /><a href='#' onclick='javascript:window.close();'><font color='#FFFFFF' size='1' face='Verdana, Arial, Helvetica, sans-serif'>Chiudi</a></font></div></body></head>";
        var MOV = window.open("", "mov", "top=" + top + ", left=" + left + ", width=" + w + ", height=" + h + ", resizable=1, scrollbars=0");
        MOV.document.write(corpo);
    }
}
function OpenVideo_SWF(file, w, h) {
    if ("/" + file.isFile) {
        if (h == NaN) { h = 345; }
        if (w == NaN) { w = 425; }
        var hs = screen.height;
        var ls = screen.width;
        var top = (hs - h) / 2;
        if (top <= 0) { top = 0; }
        var left = (ls - w) / 2;
        if (left <= 0) { left = 0; }

        //per Internet Explorer
        var s = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,22,0' height='" + h + "' width='" + w + ">";
        s += "<param name='Movie' value='" + file + "' />";
        s += "<param name='Src' value='" + file + "' />";
        s += "<param name='bgcolor' value='#000000' />";
        s += "<param name='quality' value='high' />";
        s += "<param name='Loop' value='false' />";
        s += "<param name='Scale' value='ShowAll' />";
        s += "<param name='WMode' value='Window' />";
        //Per altri browser
        s += "<object data='" + file & "' height='" + h + "' width='" + w + "' type='application/x-shockwave-flash'>";
        s += "<param name='pluginurl' value='http://www.macromedia.com/go/getflashplayer' />";
        s += "<param name='bgcolor' value='#000000' />";
        s += "<param name='quality' value='high' />";
        s += "<param name='Loop' value='false' />";
        s += "<param name='Scale' value='ShowAll' />";
        s += "<param name='WMode' value='Window' />";
        s += "</object></object>";

        var corpo = "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'><html xmlns='http://www.w3.org/1999/xhtml'><head><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1' /><title>Video</title></head>";
        corpo += "<body bgcolor='#000000'><div align='center'><font color='#FFFFFF' size='4' face='Verdana, Arial, Helvetica, sans-serif'>";
        corpo += "Video</font><br /><br />";
        corpo += s;
        corpo += "<br /><br /><a href='#' onclick='javascript:window.close();'><font color='#FFFFFF' size='1' face='Verdana, Arial, Helvetica, sans-serif'>Chiudi</a></font></div></body></head>";
        var SWF = window.open("", "swf", "top=" + top + ", left=" + left + ", width=" + w + ", height=" + h + ", resizable=1, scrollbars=0");
        SWF.document.write(corpo);
    }
}
function OpenAudio_MP3(file, w, h) {
    if ("/" + file.isFile) {
        if (h == NaN) { h = 60; }
        if (w == NaN) { w = 150; }
        var hs = screen.height;
        var ls = screen.width;
        var top = (hs - h) / 2;
        if (top <= 0) { top = 0; }
        var left = (ls - w) / 2;
        if (left <= 0) { left = 0; }

        var s = "<object type='application/x-mplayer2' data='" + file + "' width='" + w + "' height='" + h + "'>";
        s += "<param name='src' value='" + file + "' />";
        s += "<param name='filename' value='" + file + "' />";
        s += "<param name='type' value='application/x-mplayer2' />";
        s += "<object classid='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B' codebase='http://www.apple.com/qtactivex/qtplugin.cab' width='" + w + "' height='" + h + "'>";
        s += "<param name='src' value='" + file + "' />";
        s += "<param name='controller' value='true' />";
        s += "<param name='autoplay' value='true' />";
        s += "<object type='audio/mpeg' data='" + file + "' width='" + w + "' height='" + h + "'>";
        s += "<param name='src' value='" + file + "' />";
        s += "<param name='filename' value='" + file + "' />";
        s += "<param name='type' value='audio/mpeg' />";
        s += "</object></object></object>";

        var corpo = "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'><html xmlns='http://www.w3.org/1999/xhtml'><head><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1' /><title>Video</title></head>";
        corpo += "<body bgcolor='#000000'><div align='center'><font color='#FFFFFF' size='4' face='Verdana, Arial, Helvetica, sans-serif'>";
        corpo += "Video</font><br /><br />";
        corpo += s;
        corpo += "<br /><br /><a href='#' onclick='javascript:window.close();'><font color='#FFFFFF' size='1' face='Verdana, Arial, Helvetica, sans-serif'>Chiudi</a></font></div></body></head>";
        var MP3 = window.open("", "mp3", "top=" + top + ", left=" + left + ", width=" + w + ", height=" + h + ", resizable=1, scrollbars=0");
        MP3.document.write(corpo);
    }
}
function OpenAudio_WMA(file, w, h) {
    if ("/" + file.isFile) {
        if (h == NaN) { h = 60; }
        if (w == NaN) { w = 150; }
        var hs = screen.height;
        var ls = screen.width;
        var top = (hs - h) / 2;
        if (top <= 0) { top = 0; }
        var left = (ls - w) / 2;
        if (left <= 0) { left = 0; }

        var s = "<object id='player' height='" + h + "' width='" + w + "' classid='CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6'>";
        s += "<param name='url' value='" + file + "' />";
        s += "<param name='src' value='" + file + "' />";
        s += "<param name='autoStart' value='true' />";
        s += "<param name='showcontrols' value='false' />";
        s += "<param name='playCount' value='1' />";
        //Per altri browser
        s += "<object type='video/x-ms-wma' data='" + file + "' width='" + w + "' height='" + h + "'>";
        s += "<param name='src' value='" + file + "' />";
        s += "<param name='controller' value='false' />";
        s += "<param name='autoStart' value='true' />";
        s += "<param name='Loop' value='false' />";
        s += "</object></object>";

        var corpo = "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'><html xmlns='http://www.w3.org/1999/xhtml'><head><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1' /><title>Video</title></head>";
        corpo += "<body bgcolor='#000000'><div align='center'><font color='#FFFFFF' size='4' face='Verdana, Arial, Helvetica, sans-serif'>";
        corpo += "Video</font><br /><br />";
        corpo += s;
        corpo += "<br /><br /><a href='#' onclick='javascript:window.close();'><font color='#FFFFFF' size='1' face='Verdana, Arial, Helvetica, sans-serif'>Chiudi</a></font></div></body></head>";
        var WMA = window.open("", "wma", "top=" + top + ", left=" + left + ", width=" + w + ", height=" + h + ", resizable=1, scrollbars=0");
        WMA.document.write(corpo);
    }
}
function OpenWebSite(MyUrl, w, h) {
    if (h == NaN) { h = 400; }
    if (w == NaN) { w = 760; }
    var hs = screen.height;
    var ls = screen.width;
    var top = (hs - h) / 2;
    if (top <= 0) { top = 0; }
    var left = (ls - w) / 2;
    if (left <= 0) { left = 0; }
    var OWS = window.open(MyUrl, "ows", "top=" + top + ", left=" + left + ", width=" + w + ", height=" + h + ", resizable=1, scrollbars=1, status=1, menubar=1, location=1, titlebar=1, toolbar=1");
    return false;
  }
/*Open FLV file with FlowPlayer, free version, in outer window*/
  function OpenPHGY(file, titolo, w, h) {
//    if (h == NaN) { h = 500; }
//    if (w == NaN) { w = 660; }
    var hs = screen.height;
    var ls = screen.width;
    var top = (hs - h) / 2;
    if (top <= 0) { top = 0; }
    var left = (ls - w) / 2;
    if (left <= 0) { left = 0; }

    var corpo = "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'><html xmlns='http://www.w3.org/1999/xhtml'><head><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1' /><title>" + titolo + "</title>";
    corpo += "<script type='text/javascript' src='wjet-widgets/FlowPlayer/flowplayer-3.1.4.min.js'></script></head>"
    corpo += "<body bgcolor='#000000'>";
    corpo += "<div style='width:" + w + "px; height:" + h + "px; float:left; margin:0px 4px 0px 0px;' id='player'></div>";
    corpo += "<script type='text/javascript'>flowplayer('player', 'wjet-widgets/FlowPlayer/flowplayer-3.1.5.swf','" + file + "');</script>";
    corpo += "</body></head>";
    var phgy = window.open("", "phgy", "top=" + top + ",left=" + left + ",width=" + (w+15) + ",height=" + (h+14) + ",resizable=0,scrollbars=0,location=0,menubar=0,status=0,titlebar=0,directories=0,toolbar=0", "replace=true");
    phgy.document.write(corpo);
    phgy.opener.document.title = phgy.opener.document.title + " - " + titolo;
    return true;
  }

