//Login
function login()
{
location = "default.aspx?pageIndex=0"
//location = "Maintenance.htm"
//window.open("default.aspx?pageIndex=0","","width=1024,height=768,top=0,left=0,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,target=_blank")
}

//Register
function register()
{
location = "default.aspx?pageIndex=1"
//location = "Maintenance.htm"
//window.open("default.aspx?pageIndex=1","","width=1024,height=768,top=0,left=0,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,target=_blank")
}

function login2()
{
location = "../default.aspx?pageIndex=0"
//location = "../Maintenance.htm"
//window.open("../default.aspx?pageIndex=0","","width=1024,height=768,top=0,left=0,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,target=_blank")
}

//Register
function register2()
{
location = "../default.aspx?pageIndex=1"
//location = "../Maintenance.htm"
//window.open("../default.aspx?pageIndex=1","","width=1024,height=768,top=0,left=0,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,target=_blank")
}

// mobile
function openMobile()
{
window.open("/mobile","","width=260,height=500,top=30,left=30,scrollbars=yes,resizable=no,target=_blank")
}
function openMobile2()
{
window.open("../mobile","","width=260,height=500,top=30,left=30,scrollbars=yes,resizable=no,target=_blank")
}

function getCopyrightYear()
{
  return new Date().getFullYear().toString();
}

// M1 link to home page

function home()
{
  location = "Index.aspx"
  //location = "Index.htm"

}

function popup(url, h, w) 
{
  w = window.open(url,'nm','height=' + h + ',' + 'width=' + w);
  w.focus();
  return false;
}

// pop-ups ow - open window
function openwindowGuide()
{
window.open("guide/Index.htm","","width=720,height=590,top=30,left=30,scrollbars=no,resizable=no,toolbar=0,location=no,target=_blank")
}
function openwindowGuide2()
{
window.open("../guide/Index.htm","","width=700,height=590,top=70,left=70,scrollbars=no,resizable=no,toolbar=0,location=no,target=_blank")
}
function openwindowFAQ()
{
window.open("support/faq.html","","width=720,height=820,top=30,left=30,scrollbars=yes,resizable=no,toolbar=0,location=no,target=_blank")
}
function openwindowFAQ2()
{
window.open("../support/faq.html","","width=720,height=820,top=30,left=30,scrollbars=yes,resizable=no,toolbar=0,location=no,target=_blank")
}
function openwindowViewTips()
{
window.open("../support/Viewing.htm","","width=500,height=500,top=30,left=30,scrollbars=yes,resizable=no,toolbar=0,location=no,target=_blank")
}
function openwindowPCTour2()
{
window.open("../support/Tour/Tour1.htm","","width=720,height=820,top=30,left=30,scrollbars=yes,resizable=no,toolbar=1,target=_blank")
}
function openwindowDevices()
{
window.open("http://www.livecast.com/support/supported-devices.html","","width=1030,height=900,top=30,left=30,scrollbars=yes,resizable=no,toolbar=1,target=_blank")
}
function openwindowPCTour()
{
window.open("support/Tour/Tour1.htm","","width=720,height=820,top=30,left=30,scrollbars=yes,resizable=no,toolbar=1,target=_blank")
}
function openwindowFDB()
{
window.open("Contact2.aspx","","width=460,height=420,top=30,left=30,scrollbars=no,resizable=no,location=no,toolbar=0,target=_blank")
}

function openwindowFDB2()
{
window.open("../Contact2.aspx","","width=460,height=420,top=30,left=30,scrollbars=no,resizable=no,location=no,toolbar=0,target=_blank")
}

function owEwentPrint()
{
window.open("html_controls/WebcastPrint.aspx","","width=520,height=440,top=20,left=20,scrollbars=no,resizable=no,target=_blank")
}
function owInvoicePrint()
{
window.open("html_controls/InvoicePrint.aspx","","width=520,height=440,top=20,left=20,scrollbars=no,resizable=no,target=_blank")
}
function openwindowPrivacy()
{
window.open("company/Privacy.htm","","width=720,height=820,top=30,left=30,scrollbars=yes,resizable=no,toolbar=1,target=_blank")
}
function openwindowLegal()
{
window.open("company/terms.htm","","width=720,height=820,top=30,left=30,scrollbars=yes,resizable=no,toolbar=1,target=_blank")
}

function openwindowRulesRegs()
{
window.open("company/Rules&Regs.htm","","width=816,height=782,top=30,left=30,scrollbars=yes,resizable=no,toolbar=1,target=_blank")
}
function openwindowRulesRegs2()
{
window.open("../company/Rules&Regs.htm","","width=816,height=782,top=30,left=30,scrollbars=yes,resizable=no,toolbar=1,target=_blank")
}
function openwindowPCPlan()
{
window.open("support/Plan.htm","","width=720,height=560,top=30,left=30,scrollbars=yes,resizable=no,location=no,toolbar=0,target=_blank")
}
function openwindowCardCode()
{
window.open("support/Cardcode.htm","","width=430,height=430,top=30,left=30,scrollbars=yes,resizable=no,location=no,toolbar=0,target=_blank")
}
function openwindowSMS()
{
window.open("support/SmsSignUp.htm","","width=600,height=500,top=30,left=30,scrollbars=no,resizable=no,location=no,toolbar=0,target=_blank")
}
function openUserGuideWindow(filename, windowWidth, windowHeight) {
  window.open(filename, "", "width=" + windowWidth + ", height=" + windowHeight + ", top=50,left=" + (screen.width / 2 - windowWidth/2) + ", status=0, scrollbars=0,resizable=0,location=0,toolbar=0")
}

//Show/Hide Layers
function toggleLayer(whichLayer)
{
  if (document.getElementById)
  {
    // standards 
    var style2 = document.getElementById(whichLayer).style;
    style2.display = style2.display? "":"block";
  }
  else if (document.all)
  {
    //  old msie versions 
    var style2 = document.all[whichLayer].style;
    style2.display = style2.display? "":"block";
  }
  else if (document.layers)
  {
    //  nn4 
    var style2 = document.layers[whichLayer].style;
    style2.display = style2.display? "":"block";
  }
}

function toggleLayer1(whichLayer)
{
  if (document.getElementById)
  {
    // standards 
    var style2 = document.getElementById(whichLayer).style;
    style2.display = style2.display? "":"none";
  }
  else if (document.all)
  {
    //  old msie versions 
    var style2 = document.all[whichLayer].style;
    style2.display = style2.display? "":"none";
  }
  else if (document.layers)
  {
    //  nn4 
    var style2 = document.layers[whichLayer].style;
    style2.display = style2.display? "":"none";
  }
}

//Show/Hide Layers 2
var toggle = false;

function show(object) {
    if (document.layers && document.layers[object])
        document.layers[object].visibility = 'visible';
    else if (document.all) {
        document.all[object].style.visibility = 'visible';
        document.all[object].style.zIndex = 100;
    }
}
function hide(object) {
    if (document.layers && document.layers[object])
        document.layers[object].visibility = 'hidden';
    else if (document.all)
        document.all[object].style.visibility = 'hidden';
}

function press () {
        if (toggle = !toggle) show('myId');
        else hide('myId')
        }

// Dialog Box for Delete Contact
function confirmSubmit() {

if (confirm("Are you sure you want to delete selected items?")==true)
    return true;
  else
    return false;}
    
// Dialog Box for File Publish, Send etc. when private
function confirmPublic() {

if (confirm("This video is 'private'. Do you want to make it available to 'share', and proceed with request?")==true)
    return true;
  else
    return false;}
    
// Focus on Login
function setFocus()
{
  var tbUsername  = document.getElementById("Login_tbUnm");
  if(tbUsername != null) tbUsername.focus();
}
   
function DefaultUnload()
{
  if(self.location.search) self.location = "default.aspx"
}
   
function Popup(url, name, width, height) 
{
  winSet = "toolbar=no,location=no,directories=no,menubar=no,scrollbars=no,resizable=no,status=yes,dependent=yes";
  winSet += ",width="+width +",height="+height+",left="+(screen.availWidth-width)/2+",top="+(screen.availHeight-height)/2;
  window.open(url, name, winSet).focus();
}

//Enable checkbox for publishing

function EnableCb(host)
{
  var cbPublish  = document.getElementById(host + "_cbPublish");
  cbPublish.disabled = false;
}

function DisableCb(host)
{
  var cbPublish  = document.getElementById(host + "_cbPublish");
  var cbShowcase  = document.getElementById(host + "_cbShowcase");
  cbPublish.checked = false;
  cbPublish.disabled = true;
 } 
 
function DisableCbOnLoad()
{
  var cbPublish  = document.getElementById("_ctl0_cbPublish");
  var rbStrPrivate  = document.getElementById("_ctl0_rbStrPrivate");
  if(rbStrPrivate.checked = true) cbPublish.disabled = true; 
}

function Embed(id) { window.open("../EmbedCode.aspx?id=" + id, "", "width=600,height=250")}

function IsMacAndNoWindowsMediaPlugin() {
  if(navigator.userAgent.search(/os x/i) != -1)  {
    if(navigator.plugins) {
      for (i=0; i < navigator.plugins.length; i++) {
        if(navigator.plugins[i].name.search(/windows media/i) != -1) return false;
        if(navigator.plugins[i].name.search(/flip4mac/i) != -1) return false;
      }
      return true;
    }    
  }
  return false;
}
