﻿//var is_ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));

function popUp(URL)
{
    day = new Date();
    id = day.getTime();
    var leftedge = window.screen.width;
    leftedge = leftedge/2 - 512;
    if (leftedge <= 0) leftedge=0;
    eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=575,height=402,left="+leftedge+",top=100');");
}

function UpdateRemaining(desc)
{
    var remain = document.getElementById("ctl00_ContentPlaceHolder1_txtCharsLeft");
    if (desc.innerText.length > 500) desc.innerText = desc.innerText.substr(0, 500);
    var charsleft = 500 - desc.innerText.length;
    remain.innerText = charsleft.toString();
}

function OpenPage(URL) {
    day = new Date();
    id = day.getTime();
    eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=" + screen.width + ",height=" + screen.height + ",left=0,top=0');");
}

function embPlayer() { 
   // Get Operating System 
   var isWin = navigator.userAgent.toLowerCase().indexOf("windows") != -1;
   if (isWin) { // Use MIME type application/x-mplayer2
      visitorOS="Windows";
   } else { // Use MIME type audio/mpeg, audio/x-wav, etc.
      visitorOS="Other";
   }

   var objTypeTag = "application/x-mplayer2"; // MIME type for non-IE browsers on Windows
   if (visitorOS != "Windows") { objTypeTag = "audio/mpeg"}; // MIME type for Linux & Mac 
  
   document.writeln("<object width='550'>");
   document.writeln("<param name='type' value='" + objTypeTag + "'>");
   document.writeln("<param name='src' value=''>");
   document.writeln("<param name='autoplay' value='true'>");
   document.writeln("<param name='autostart' value='0'>");
   document.writeln("<param name='volume' value='-9'>");
   document.writeln("<param name='controller' value='1'>");
   document.writeln("<param name='PlayCount' value='2'>");
   document.writeln("<EMBED src='' type='" + objTypeTag + "' autoplay='false' autostart='-1' width='550' volume='-9' controller='1' PlayCount='7'></EMBED>");
   document.writeln("</object>");
   document.close(); // Finalize document
}