
// added window opener script in here.

var newWindow = null;

function closeWin(){
	if (newWindow != null){
		if(!newWindow.closed)
			newWindow.close();
	}
}

function popUpWin(url, type, strWidth, strHeight){
	
//	closeWin();
		
	var tools="";
	if (type == "standard" || type == "fullScreen") tools = "status=yes,resizable,toolbar=no,location=no,scrollbars=yes,menubar=no,width="+strWidth+",height="+strHeight;
	if (type == "console") tools = "status=yes,resizable,toolbar=no,location=no,scrollbars=yes,width="+strWidth+",height="+strHeight+",left=0,top=0";
	newWindow = window.open(url, 'newWin', tools);
	newWindow.focus();
}




// JavaScript Document

startList = function() {

if (document.all&&document.getElementById) {
	navRoot = document.getElementById("nav");

	for (i=0; i<navRoot.childNodes.length; i++) {
		
		node = navRoot.childNodes[i];

		if (node.nodeName=="LI") {

			node.onmouseover=function() {
				this.className+=" over";
  			}
  			
  			node.onmouseout=function() {
  				this.className=this.className.replace(" over", "");
   			}
		}
  	}
}

if (document.all&&document.getElementById) {
	navRoot = document.getElementById("tabsIE");

	for (i=0; i<navRoot.childNodes.length; i++) {

		node = navRoot.childNodes[i];

		if (node.nodeName=="LI") {

			node.onmouseover=function() {
				this.className+=" over";
  			}
  			
  			node.onmouseout=function() {
  				this.className=this.className.replace(" over", "");
   			}
   		}
  	}
}

}
window.onload=startList;



function OpenMovie(MovieName)  { 
	window.open("../stream/MoviePlayer.aspx?Movie=" + MovieName,"", "toolbar=no,location=no,status=no,menubar=no,scrollbars=no");
}


function hidediv(Element) {
if (document.getElementById)
	{ // DOM3 = IE5, NS6
		document.getElementById(Element).style.display=1?'none':'';
	}else {
		if (document.layers) { // Netscape 4
	document.Element.visibility = 'hidden';
	}
	else { // IE 4
	document.all.Element.style.visibility = 'hidden';
	}
	}
	}
function showdiv(Element) {
	if (document.getElementById) { // DOM3 = IE5, NS6
	document.getElementById(Element).style.display=0?'none':'';
	}
	else {
	if (document.layers) { // Netscape 4
	document.Element.visibility = 'visible';
	}
	else { // IE 4
	document.all.Element.style.visibility = 'visible';
	}
	}
}


var donthide=0;
var addAskSpace = '';
var ImagePath = 'http://www.pastest.co.uk/images/borders/';
function showPacesPopup(width,height,scrolling){
var url="<iframe src='http://www.pastest.co.uk/pacescasesdemo/default.html' style='border:none;' width=775 height=435 scrolling=no frameborder=0></iframe>";
	fillPacesElement(url,width,height,scrolling);
	setPacesPopupStyles();
}
function hidePacesPopup(){
	//if(donthide==0){
	unsetPacesPopupStyles();

	var el = document.getElementById('popupdiv');
el.innerHTML="";
	//}else{
	//donthide=0;	
	//}
}
function showQuestionCollectionPopup(){
var url="<iframe src='public/QuestionCollection.aspx' style='border:none;' width=540 height=435 scrolling=no frameborder=0></iframe>";
	fillQuestionElement(url,540,435,false);
	setPacesPopupStyles();
}
function hidePacesPopup(){
	//if(donthide==0){
	unsetPacesPopupStyles();

	var el = document.getElementById('popupdiv');
el.innerHTML="";
	//}else{
	//donthide=0;	
	//}
}

function fillPacesElement(url,width,height,scrolling) {


	image2 = new Image();
	image2.src = ImagePath + 'popuptl.png';
	image3 = new Image();
	image3.src = ImagePath + 'popuptr.png';
	image4 = new Image();
	image4.src = ImagePath + 'popupbl.png';
	image5 = new Image();
	image5.src = ImagePath + 'popupbr.png';
	image6 = new Image();
	image6.src = ImagePath + 'popupborder.png';

	scrolling = typeof(scrolling) != 'undefined' ? scrolling : 'yes'
	var fullwidth = width + 28;
	var el = document.getElementById('popupdiv');
	el.innerHTML = '<center><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><table width=' + fullwidth + 'px cellpadding=0 cellspacing=0 style=\'padding:0px;margin:0px;\' onClick="donthide=1;"><tr><td style=\'padding:0px;margin:0px;\' ><img src="' + ImagePath + 'popuptl.png"></td><td  style=\'padding:0px;margin:0px;\'  background="' + ImagePath + 'popupborder.png" width=100%></td><td style=\'padding:0px;margin:0px;\'  ><img src="' + ImagePath + 'popuptr.png"></td></tr><tr><td  style=\'padding:0px;margin:0px;\'  background="' + ImagePath + 'popupborder.png"></td><td  style=\'padding:0px;margin:0px;\'  bgcolor="#ffffff" width=100%><div style="padding:0px;margin:0px;">' + url + '</div></td><td  style=\'padding:0px;margin:0px;\'  background="' + ImagePath + 'popupborder.png"></td></tr><tr><td  style=\'padding:0px;margin:0px;\'  background="' + ImagePath + 'popupborder.png"></td><td  style=\'padding:0px;margin:0px;\'   bgcolor="#ffffff" width=100% align=center style="padding:8px;background:url(' + ImagePath + 'popupbottombar.png)  #ffffff bottom repeat-x;" valign=bottom><input type=button onClick="hidePacesPopup();" value="Close"></td><td  style=\'padding:0px;margin:0px;\'  background="' + ImagePath + 'popupborder.png"></td></tr><tr><td style=\'padding:0px;margin:0px;\'  ><img src="' + ImagePath + 'popupbl.png"></td><td background="' + ImagePath + 'popupborder.png" width=100%></td><td style=\'padding:0px;margin:0px;\'  ><img src="' + ImagePath + 'popupbr.png"></td></tr></table></center>';
}



function fillVLecturesElement(url,width,height,scrolling) {


	image2 = new Image();
	image2.src = ImagePath + 'popuptl.png';
	image3 = new Image();
	image3.src = ImagePath + 'popuptr.png';
	image4 = new Image();
	image4.src = ImagePath + 'popupbl.png';
	image5 = new Image();
	image5.src = ImagePath + 'popupbr.png';
	image6 = new Image();
	image6.src = ImagePath + 'popupborder.png';

	scrolling = typeof(scrolling) != 'undefined' ? scrolling : 'yes'
	var fullwidth = width + 28;
	var el = document.getElementById('popupdiv');
	el.innerHTML = '<center><br><br><br><br><br><br><br><br><br><br><br><table width=' + fullwidth + 'px cellpadding=0 cellspacing=0 style=\'padding:0px;margin:0px;\' onClick="donthide=1;"><tr><td style=\'padding:0px;margin:0px;\' ><img src="' + ImagePath + 'popuptl.png"></td><td  style=\'padding:0px;margin:0px;\'  background="' + ImagePath + 'popupborder.png" width=100%></td><td style=\'padding:0px;margin:0px;\'  ><img src="' + ImagePath + 'popuptr.png"></td></tr><tr><td  style=\'padding:0px;margin:0px;\'  background="' + ImagePath + 'popupborder.png"></td><td  style=\'padding:0px;margin:0px;\'  bgcolor="#ffffff" width=100%><div style="padding:0px;margin:0px;">' + url + '</div></td><td  style=\'padding:0px;margin:0px;\'  background="' + ImagePath + 'popupborder.png"></td></tr><tr><td  style=\'padding:0px;margin:0px;\'  background="' + ImagePath + 'popupborder.png"></td><td  style=\'padding:0px;margin:0px;\'   bgcolor="#ffffff" width=100% align=center style="padding:8px;background:url(' + ImagePath + 'popupbottombar.png)  #ffffff bottom repeat-x;" valign=bottom><input type=button onClick="hidePacesPopup();" value="Close"></td><td  style=\'padding:0px;margin:0px;\'  background="' + ImagePath + 'popupborder.png"></td></tr><tr><td style=\'padding:0px;margin:0px;\'  ><img src="' + ImagePath + 'popupbl.png"></td><td background="' + ImagePath + 'popupborder.png" width=100%></td><td style=\'padding:0px;margin:0px;\'  ><img src="' + ImagePath + 'popupbr.png"></td></tr></table></center>';
}





function fillQuestionElement(url,width,height,scrolling) {


	image2 = new Image();
	image2.src = ImagePath + 'popuptl.png';
	image3 = new Image();
	image3.src = ImagePath + 'popuptr.png';
	image4 = new Image();
	image4.src = ImagePath + 'popupbl.png';
	image5 = new Image();
	image5.src = ImagePath + 'popupbr.png';
	image6 = new Image();
	image6.src = ImagePath + 'popupborder.png';

	scrolling = typeof(scrolling) != 'undefined' ? scrolling : 'yes'
	var fullwidth = width + 28;
	var el = document.getElementById('popupdiv');
	el.innerHTML = '<center><br><br><br><br><br><table width=' + fullwidth + 'px cellpadding=0 cellspacing=0 style=\'padding:0px;margin:0px;\' onClick="donthide=1;"><tr><td style=\'padding:0px;margin:0px;\' ><img src="' + ImagePath + 'popuptl.png"></td><td  style=\'padding:0px;margin:0px;\'  background="' + ImagePath + 'popupborder.png" width=100%></td><td style=\'padding:0px;margin:0px;\'  ><img src="' + ImagePath + 'popuptr.png"></td></tr><tr><td  style=\'padding:0px;margin:0px;\'  background="' + ImagePath + 'popupborder.png"></td><td  style=\'padding:0px;margin:0px;\'  bgcolor="#ffffff" width=100%><div style="padding:0px;margin:0px;">' + url + '</div></td><td  style=\'padding:0px;margin:0px;\'  background="' + ImagePath + 'popupborder.png"></td></tr><tr><td  style=\'padding:0px;margin:0px;\'  background="' + ImagePath + 'popupborder.png"></td><td  style=\'padding:0px;margin:0px;\'   bgcolor="#ffffff" width=100% align=center style="padding:8px;background:url(' + ImagePath + 'popupbottombar.png)  #ffffff bottom repeat-x;" valign=bottom><input type=button onClick="hidePacesPopup();" value="Close"></td><td  style=\'padding:0px;margin:0px;\'  background="' + ImagePath + 'popupborder.png"></td></tr><tr><td style=\'padding:0px;margin:0px;\'  ><img src="' + ImagePath + 'popupbl.png"></td><td background="' + ImagePath + 'popupborder.png" width=100%></td><td style=\'padding:0px;margin:0px;\'  ><img src="' + ImagePath + 'popupbr.png"></td></tr></table></center>';
}

function setPacesPopupStyles() {
	document.getElementById('popupdiv').setAttribute("class", "popupdivparent");
	document.getElementById('popupdiv').setAttribute("className", "popupdivparent"); 
	document.getElementById('popupdiv').style.height = maxPacesHeight() + 'px';
}
function maxPacesHeight() {
    var h=0; 
    if (window.document.innerHeight>h)
        h=window.document.innerHeight;
    if (window.document.documentElement.clientHeight>h)
        h=window.document.documentElement.clientHeight;
    if (window.document.body.clientHeight>h)
        h=window.document.body.clientHeight;
    return h;
}
function unsetPacesPopupStyles() {
	document.getElementById('popupdiv').setAttribute("class", "popupdivparentNone");
	document.getElementById('popupdiv').setAttribute("className", "popupdivparentNone"); 
}

function ShowPacesDemo(){
	showPacesPopup(775,435,false);
}

function showVLecturesPopup(width,height,scrolling){

var url="<iframe src='http://www.pastest.co.uk/videoLectures/index.html' style='border:none;' width=958 height=575 scrolling=no frameborder=0></iframe>";
	fillVLecturesElement(url,width,height,scrolling);
	setPacesPopupStyles();
}	
function ShowVLecturesDemo(){
	
	showVLecturesPopup(958,575,false);

}


function fillOsceElement(url,width,height,scrolling) {


	image2 = new Image();
	image2.src = ImagePath + 'popuptl.png';
	image3 = new Image();
	image3.src = ImagePath + 'popuptr.png';
	image4 = new Image();
	image4.src = ImagePath + 'popupbl.png';
	image5 = new Image();
	image5.src = ImagePath + 'popupbr.png';
	image6 = new Image();
	image6.src = ImagePath + 'popupborder.png';

	scrolling = typeof(scrolling) != 'undefined' ? scrolling : 'yes'
	var fullwidth = width + 28;
	var el = document.getElementById('popupdiv');
	el.innerHTML = '<center><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><table width=' + fullwidth + 'px cellpadding=0 cellspacing=0 style=\'padding:0px;margin:0px;\' onClick="donthide=1;"><tr><td style=\'padding:0px;margin:0px;\' ><img src="' + ImagePath + 'popuptl.png"></td><td  style=\'padding:0px;margin:0px;\'  background="' + ImagePath + 'popupborder.png" width=100%></td><td style=\'padding:0px;margin:0px;\'  ><img src="' + ImagePath + 'popuptr.png"></td></tr><tr><td  style=\'padding:0px;margin:0px;\'  background="' + ImagePath + 'popupborder.png"></td><td  style=\'padding:0px;margin:0px;\'  bgcolor="#ffffff" width=100%><div style="padding:0px;margin:0px;">' + url + '</div></td><td  style=\'padding:0px;margin:0px;\'  background="' + ImagePath + 'popupborder.png"></td></tr><tr><td  style=\'padding:0px;margin:0px;\'  background="' + ImagePath + 'popupborder.png"></td><td  style=\'padding:0px;margin:0px;\'   bgcolor="#ffffff" width=100% align=center style="padding:8px;background:url(' + ImagePath + 'popupbottombar.png)  #ffffff bottom repeat-x;" valign=bottom><input type=button onClick="hidePacesPopup();" value="Close"></td><td  style=\'padding:0px;margin:0px;\'  background="' + ImagePath + 'popupborder.png"></td></tr><tr><td style=\'padding:0px;margin:0px;\'  ><img src="' + ImagePath + 'popupbl.png"></td><td background="' + ImagePath + 'popupborder.png" width=100%></td><td style=\'padding:0px;margin:0px;\'  ><img src="' + ImagePath + 'popupbr.png"></td></tr></table></center>';
}


function showOscePopup(width,height,scrolling){

var url="<iframe src='http://www.pastest.co.uk/OSCEDemo/index.html' style='border:none;' width=775 height=435 scrolling=no frameborder=0></iframe>";
	fillOsceElement(url,width,height,scrolling);
	setPacesPopupStyles();
}



function ShowOsceDemo(){
	
	showOscePopup(740,460,false);

}


function fillAskElement(url,width,height,scrolling) {


	image2 = new Image();
	image2.src = ImagePath + 'popuptl.png';
	image3 = new Image();
	image3.src = ImagePath + 'popuptr.png';
	image4 = new Image();
	image4.src = ImagePath + 'popupbl.png';
	image5 = new Image();
	image5.src = ImagePath + 'popupbr.png';
	image6 = new Image();
	image6.src = ImagePath + 'popupborder.png';

	scrolling = typeof(scrolling) != 'undefined' ? scrolling : 'yes'
	var fullwidth = width + 28;
	var el = document.getElementById('popupdiv');
	el.innerHTML = '<center><table width=' + fullwidth + 'px cellpadding=0 cellspacing=0 style=\'padding:0px;margin:0px;\' onClick="donthide=1;"><tr><td style=\'padding:0px;margin:0px;\' ><img src="' + ImagePath + 'popuptl.png"></td><td  style=\'padding:0px;margin:0px;\'  background="' + ImagePath + 'popupborder.png" width=100%></td><td style=\'padding:0px;margin:0px;\'  ><img src="' + ImagePath + 'popuptr.png"></td></tr><tr><td  style=\'padding:0px;margin:0px;\'  background="' + ImagePath + 'popupborder.png"></td><td  style=\'padding:0px;margin:0px;\'  bgcolor="#ffffff" width=100%><div style="padding:0px;margin:0px;">' + url + '</div></td><td  style=\'padding:0px;margin:0px;\'  background="' + ImagePath + 'popupborder.png"></td></tr><tr><td  style=\'padding:0px;margin:0px;\'  background="' + ImagePath + 'popupborder.png"></td><td  style=\'padding:0px;margin:0px;\'   bgcolor="#ffffff" width=100% align=center style="padding:8px;background:url(' + ImagePath + 'popupbottombar.png)  #ffffff bottom repeat-x;" valign=bottom><input type=button onClick="hidePacesPopup();" value="Close"></td><td  style=\'padding:0px;margin:0px;\'  background="' + ImagePath + 'popupborder.png"></td></tr><tr><td style=\'padding:0px;margin:0px;\'  ><img src="' + ImagePath + 'popupbl.png"></td><td background="' + ImagePath + 'popupborder.png" width=100%></td><td style=\'padding:0px;margin:0px;\'  ><img src="' + ImagePath + 'popupbr.png"></td></tr></table></center>';
}


function showAskPopup(width,height,scrolling){

var url="<iframe src='http://www.pastest.co.uk/askTheExperts/askPage.asp' style='border:none;' width=740 height=460 scrolling=no frameborder=0></iframe>";
	fillAskElement(url,width,height,scrolling);
	setPacesPopupStyles();
}



function ShowAskDemo(){

	showAskPopup(740,460,false);

}

function ShowAskDemo2(){

	showAskPopup(740,460,false);

}


