﻿// JScript File
var timerID = null
var timerRunning = false

function stopclock(){
    if(timerRunning)
        clearTimeout(timerID)
    timerRunning = false
}

function startclock(){
    stopclock()
    showtime()
}

function showtime(){
    var now = new Date()
    var hours = now.getHours()
    var minutes = now.getMinutes()
    var seconds = now.getSeconds()
    var timeValue = "" + ((hours > 12) ? hours - 12 : hours)
    timeValue  += ((minutes < 10) ? ":0" : ":") + minutes
    timeValue  += ((seconds < 10) ? ":0" : ":") + seconds
    timeValue  += (hours >= 12) ? " PM" : " AM"
    document.getElementById("ctl00_lblClock").innerHTML = timeValue 
    timerID = setTimeout("showtime()",1000)
    timerRunning = true
}
 
function ConfirmDelete()
{
    return confirm("Please click OK to confirm that you would like to delete this item")
}



function TEST()
{
    alert('Munkeh');
}


function ShowHideDiv(id)
{
    var oDiv = document.getElementById(id);
    if (oDiv.style.display == 'none')
    {
        oDiv.style.display = "block";    
    }
    else
    {
        oDiv.style.display = "none";
    }
}
function ShowDiv(id)
{
    var oDiv = document.getElementById(id);
        oDiv.style.display = "block";
   
}
function HideDiv(id)
{
    var oDiv = document.getElementById(id);   
        oDiv.style.display = "none";    
  
}

function ShowHideDivAll(id)
{
    var oDiv = document.getElementById(id);
    var sCurrentDisplay = oDiv.style.display;    
    var aDivs = document.getElementsByTagName('div');
        
    for (i=0; i < aDivs.length; i++) 
    {      
        if(aDivs[i].id.indexOf('divVacancy') != -1)
        {   
            aDivs[i].style.display = "none"; 
        }
    }      
      
    if (sCurrentDisplay == 'none')
    {
        oDiv.style.display = "block";    
    }
    else
    {
        oDiv.style.display = "none";
    }
}



function SwitchPressDivs(id, id2)
{
    var oDiv = document.getElementById(id);
    var sCurrentDisplay = oDiv.style.display;  
      
    var aDivs = document.getElementsByTagName('div');        
    for (i=0; i < aDivs.length; i++) 
    {      
        if(aDivs[i].id.indexOf('divPressFull') != -1)
        {   
            aDivs[i].style.display = "none"; 
        }
        
         if(aDivs[i].id.indexOf('divPressBrief') != -1)
        {   
            aDivs[i].style.display = "block"; 
        }
    }      
      
    if (sCurrentDisplay == 'none')
    {
        //show full
        oDiv.style.display = "block"; 
        //hide brief   
        oDiv = document.getElementById(id2);
        oDiv.style.display = "none"; 
    }
}