
function printMe(text) {
	window.showModalDialog('/includes/print.asp?toPrint='+text+'','','center: yes; status: no; unadorned: no; dialogHeight: 120px; dialogWidth: 200px; scroll: no;');
}

function doExitWithPrompt() {
var result = window.showModalDialog('/includes/exitPrompt.asp?categoryColour=' + categoryColour, "Do you want to end this module?","center: yes; status: no; unadorned: no; dialogHeight: 150px; dialogWidth: 200px;");
if (result) {
				prog="In Progress";

				if ( moduleCompleted ){
								prog="Complete";
						} else {
								if (thisPage == modulePages) {
												prog="Complete";
										}
						}

		
	 closeModuleWindow();
	}
}



function doExitRedirect(href) {
if( confirm("Do you want to end this module? Click OK to end, or Cancel to carry on.") ){
	prog="In Progress";
		if (moduleCompleted ){
			prog="Complete";
		} else {
			if (thisPage == modulePages) prog="Complete";
		}
	
	if (window.opener) { window.opener.location = href; }
	window.close();
	}
}

function doExitGoTo(href) {
	prog="In Progress";
		if ( moduleCompleted )
			{  
			prog="Complete";
		} else {
			if (thisPage == modulePages)  prog="Complete"; 
			}
	
	location.href = href;
	
}

function doExitDontLog() {

	if( confirm("Do you want to end this module? Click OK to end, or Cancel to carry on.") ){
				if (window.opener) { window.opener.location.reload(); }
				window.close(); 
				}		

}

function doExit(){

	var prog="In Progress";

 if ( moduleCompleted ){
					prog="Complete";
				} else {
										if (thisPage == modulePages) {
										prog="Complete";
										}
				}

			
		 closeModuleWindow();

} 



function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}


function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_setTextOfLayer(objName,x,newText) { //v3.0
  if ((obj=MM_findObj(objName))!=null) with (obj)
    if (navigator.appName=='Netscape') {document.write(unescape(newText)); document.close();}
    else innerHTML = unescape(newText);
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}


function openWindow( url, width, height, top, left ){
  var str = "width=" + width + ",height=" + height + ",top=" + top + ",left=" + left + ",";
  str = str + "toolbar=yes,directories=no,channelmode=0,resizable=yes,scrollbars=yes,status=no";
  var win = window.open(url,"",str);
}


function openWindow2( url, width, height, top, left, newUrl, specs, newTitle )  
{
//var str = "width=" + width + ",height=" + height + ",top=" + top + ",left=" + left + ",";
//  str = str + "toolbar=no,directories=no,channelmode=0,resizable=no,scrollbars=no,status=no,fullscreen=no";

 var str = "scrollbars=no,resizable=no,";
str = str + "width=" + width + ",height=" + height + ",left=" + left + ",top=" + top; 

  url=url + "?url=" + escape(newUrl) + "&specs=" + specs + "&title=" + newTitle;
  //changed this to just open a window without the add-on box
  //had to retain function as call hard - coded into database via page mastering
  //andyb - 23/07/2002

  if (newUrl == undefined){
	window.open(url, '' , str);
  }
  else{
	window.open(newUrl);
  }


  return false
}


function emailfriend(){
   window.open('/dev/emailfriend.asp','','width=200,height=200,toolbar=no,location=no,directories=no,status=YES,menubar=no,scrollbars=no,resizable=yes,copyhistory=no')
}

function sendFeedback() {
   window.open('../../contactUs.asp#feedback','feedback','height=500, width=785, toolbars=no, resize=yes, location=no, scrollbars=yes');return false
}


function closeModuleWindow(){
 	if (	window.opener && !window.opener.closed){
							window.opener.location.reload();
							}
		setInterval('window.close()',500);
		
}
