﻿// JScript File
function FU(obj)
{
if(obj.value=='username'){obj.value='';}
}
function UFU(obj)
{
if(obj.value==''){obj.value='username';}
}
function PU(obj)
{
if(obj.value=='qpqpqpqp'){obj.value='';}
}
function UPU(obj)
{
if(obj.value==''){obj.value='qpqpqpqp';}
}
function fnTrapKD(btn,e){
 	e= (window.event)? event : e;
 	intKey = (e.keyCode)? e.keyCode: e.charCode;
   if (intKey == 13)
   { 
     e.returnValue=false;
     e.cancel = true;
     btn.click();
   } 
}



// 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();
}




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 ImagePath = 'http://www.pastestinterviewskills.com/images/borders/';
function showPacesPopup(width,height,scrolling){
var url="<iframe src='http://www.pastestinterviewskills.com/eLectureDemo/index.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 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><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();" style="background:#fff;" 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);
}
