
//This function openWin  is  used to bring pop-ups  of specified size and type.
//@ param page is the url of the page to be opened,
//@ param hgth is the height of the pop up  window
//@ param wdth is the width of the pop up window
//@param type specifies  various attributes which sets window property like  scrolbars,resizable,tittlebar etc.


function openWin(page,hgth,wdth,type)
{
var winname=Math.floor(Math.random()*100)+"ten";
var winhgth=window.screen.availHeight;var winwdth=window.screen.availWidth;
if(hgth<=0 || hgth>winhgth)hgth=winhgth;
if(wdth<=0 || wdth>winwdth)wdth=winwdth;
var tp=parseInt(window.screen.availHeight/2)-parseInt(hgth/2);
var lt=parseInt(window.screen.availWidth/2)-parseInt(wdth/2);


var winproperty1="height=" + hgth + ",width=" +wdth + ",titlebar=no,scrollbars=yes, resizable =  yes ,top=" + tp + ",left=" + lt + "";
var winproperty2="height=" + hgth + ",width=" +wdth + ",titlebar=no,scrollbars=yes,resizable = no,top =" + tp + ",left=" + lt + "";
var winproperty3="height=" + hgth + ",width=" +wdth + ",titlebar=no,scrollbars=auto,resizable=yes,top=" + tp + ",left=" + lt + "";

var winproperty4="height=" + hgth + ",width=" +wdth + ",titlebar=no,scrollbars=auto,resizable=yes,top=" + tp + ",left=" + lt + "";
var winproperty5="height=" + hgth + ",width=" +wdth + ",titlebar = yes,scrollbars = yes,resizable =  yes ,top=" + tp + ",left=" + lt + "";

var winproperty6="height=" + hgth + ",width=" +wdth + ",titlebar = no,scrollbars = no,resizable =  yes ,top=" + tp + ",left=" + lt + "";

var winproperty7="height=" + hgth + ",width=" +wdth + ",titlebar = no,scrollbars = no,resizable =  no ,top=" + tp + ",left=" + lt + "";

var winproperty8="height=" + hgth + ",width=" +wdth + ",titlebar=no,status=no,resizable = no,top =" + tp + ",left=" + lt + "";

if(type == 1)
{
	var winprop=winproperty1;		
}
else if(type== 2)
{
	var winprop=winproperty2;

}
else if(type==3)
{
	var winprop=winproperty3;

}
else if(type==4)
{
	var winprop=winproperty4;

}
else if(type==5)
{
	var winprop=winproperty5;

}
else if(type==6)
{
	var winprop=winproperty6;

}
else if(type==7)
{
	var winprop=winproperty7;

}
else if(type==8)
{
	var winprop=winproperty8;

}
else
{
	var winprop=winproperty1;
}

 window.open(page,winname,winprop);

}



function openFullScreen(page)
{
var winname=Math.floor(Math.random()*100)+"ten";
var winhgth=window.screen.availHeight*.9;var winwdth=window.screen.availWidth*.9;

var tp=parseInt(window.screen.availHeight/2)-parseInt(winhgth/2);
var lt=parseInt(window.screen.availWidth/2)-parseInt(winwdth/2);
var winproperty="height=" + winhgth + ",width=" +winwdth + ",titlebar=no,scrollbars=yes,maximize=yes,top=" + tp + ",left=" + lt + "";
//page="newwin.jsp?newaction=start&bean="+page;
window.open(page,winname,winproperty);
}


function openScormCourse(page)
{
var winname=Math.floor(Math.random()*100)+"ten";
var winhgth=window.screen.availHeight;var winwdth=window.screen.availWidth;

var tp=parseInt(window.screen.availHeight/2)-parseInt(winhgth/2);
var lt=parseInt(window.screen.availWidth/2)-parseInt(winwdth/2);
var winproperty="directories =yes ,height ="+ winhgth +" ,left ="+lt+",location = yes,menubar =yes,";
winproperty=winproperty+" resizable =  yes ,scrollbars =  yes ,status = yes ,titlebar =  yes,toolbar = yes,top ="+ tp +" ,width = "+winwdth ;  
window.open(page,winname,winproperty);
}
