﻿// JScript File
var oldColor;

function setMouseOverColor(element) {
oldColor = element.style.backgroundColor;
element.style.backgroundColor="#cbdcb6";
}

function setMouseOutColor(element) {
element.style.backgroundColor=oldColor;
element.style.textDecoration='none';
}

function ShowPopup(){

 var thePopup = document.getElementById("stopFlash");

thePopup.style.visibility="visible";

}

function ChangeValue(hvalue) {
//alert(hvalue);
        // [0] set a direct reference to the Form in question
        var theForm = document.getElementsByTagName('form')[0];

        // Assumming the Hidden Field is the first element in the form
        theForm.ctl00_ContentPlaceHolder1_txtHidden.value = hvalue;
        //alert('hid value = ' + theForm.ctl00_ContentPlaceHolder1_txtHidden.value);
       }
       
       function WorkshopcheckOptionSelected(workshoptestid) {
       //alert(workshoptestid);
        var theForm = document.getElementsByTagName('form')[0];
//alert('hid value = ' + theForm.ctl00_ContentPlaceHolder1_txtHidden.value);
if (theForm.ctl00_ContentPlaceHolder1_txtHidden.value != 0)
{

//var strReturn;
window.showModalDialog('debrief2.aspx?testid=' + workshoptestid + '&answer=' + theForm.ctl00_ContentPlaceHolder1_txtHidden.value,null,'status:no;dialogWidth:700px;dialogHeight:300px;dialogHide:true;help:no;scroll:yes;resizable:yes');
//if (strReturn != null) document.getElementById('txtValue').value=strReturn;
theForm.submit();
return true;
}
else
{
alert('Please choose an answer to continue!');
return false;
}
}

 function checkOptionSelected() {
        var theForm = document.getElementsByTagName('form')[0];
//alert('hid value = ' + theForm.ctl00_ContentPlaceHolder1_txtHidden.value);
if (theForm.ctl00_ContentPlaceHolder1_txtHidden.value == 1)
{
theForm.submit();
return true;
}
else
{
alert('Please choose an answer to continue!');
return false;
}
}

function openCertificate()
{
window.open('candidatescorereport.aspx?','popupbt','width=700,height=300,resizable=no,titlebar=no,location=0,status=0,toolbar=no');
}

//new bit to try and remove IE toolbars

function WinOpenLogin()
{
window.opener=self;
self.close();
window.open('login.aspx','Login','maximize=true,top=0,left=0,height=100%,width=100%,status=yes,resizable=yes,toolbar=no,menubar=no,location=no,fullscreen=true, scrollbars=yes, location=no');

}
function winclose()
{
window.opener=self;
self.close(); 
} 
function newWindow(mypage,myname,w,h,features) {
  if(screen.width){
  var winl = (screen.width-w)/2;
  var wint = (screen.height-h)/2;
  }else{winl = 0;wint =0;}
  if (winl < 0) winl = 0;
  if (wint < 0) wint = 0;
  var settings = 'height=' + h + ',';
  settings += 'width=' + w + ',';
  settings += 'top=' + wint + ',';
  settings += 'left=' + winl + ',';
  settings += features;
  win = window.open(mypage,myname,settings);
  win.window.focus();
}
