function WinOpennewv1(filepg) {

open(filepg,"Windownewv1","width=780,height=570,resize,toolbar=no,scrollbars=no,status=no,menubar=no");

}
function newAlert(filepg)
{
	ConfirmStatus = confirm("You are about to view a site \n that is external to the skoool.co.uk web site.\n skoool.co.uk takes no responsibility for the\n content displayed on external sites.")

	if (ConfirmStatus == true) 
	{
	window.open(filepg, 'externalsite');	
	}
}
function newAlert2(filepg)
{
	ConfirmStatus = confirm("You are about to view a site \n that is external to the skoool.co.uk web site.\n skoool.co.uk takes no responsibility for the\n content displayed on external sites.")

	if (ConfirmStatus == true) 
	{
	window.open(filepg, 'externalsite');	
	}
}
function WinOpenForReview(filepg) 
{
	if (screen.height <= 480 && screen.width <= 800 )
	{
		open(filepg,"WindowReview","width=700,height='+(screen.availHeight-20) +',left=0,top=0,resize,toolbar=no,scrollbars=no,status=no,menubar=no");
	}
	else
	{
		open(filepg,"WindowReview","width=760,height=500,left=50,top=50,resize,toolbar=no,scrollbars=no,status=no,menubar=no");
	}
}

function openLOWindow(URLtoOpen) 
{

	if (screen.height <= 480 && screen.width <= 800 )
	{
	  newWindow = window.open(URLtoOpen,'LOWin','height='+(screen.availHeight-20) +',width=700,left=0,top=0,toolbar=no,scrollbars=no');
	}
	else
	{
	  newWindow = window.open(URLtoOpen,'LOWin','height=500,width=760,left=50,top=50,toolbar=no,scrollbars=no');
	}
}

function openPDAWindow(URLtoOpen) 
{
	if (screen.height <= 480 && screen.width <= 800 )
	{
		newWindow=window.open(URLtoOpen,'PDAWin','height='+(screen.availHeight-20) +',width=700,left=0,top=0,toolbar=no,scrollbars=no'); 
	}
	else
	{
		newWindow=window.open(URLtoOpen,'PDAWin','height=500,width=700,left=50,top=50,toolbar=no,scrollbars=no'); 
	}
}
function openSIMWindow(URLtoOpen) 
{
	if (screen.height <= 480 && screen.width <= 800 )
	{
		newWindow=window.open(URLtoOpen,'SIMWin','height='+(screen.availHeight-20) +',width=700,left=0,top=0,toolbar=no,scrollbars=no'); 
	}
	else
	{ 
		newWindow=window.open(URLtoOpen,'SIMWin','height=500,width=760,left=50,top=50,toolbar=no,scrollbars=no'); 
	}
}
function openLPWindow(URLtoOpen) 
{ 
	if (screen.height < 768 && screen.width < 1024 )
	{
//		alert("LearnPaths are not available.");
		alert("Screen Resolution must be at least 1024*768 to view the learnpaths. Please change your settings or access the site with another suitable device.");
	}
	else
	{
		newWindow=window.open(URLtoOpen,'LPWin','height=630,width=1002,left=50,top=50,toolbar=no,scrollbars=no'); 
	}
}
function openLWindow(URLtoOpen) 
{ 

	alert('These lessons are not available at the moment.');

	//newWindow=window.open(URLtoOpen,'LWin','height=570,width=778,left=50,top=50,toolbar=no,scrollbars=no'); 
//	var pos=URLtoOpen.lastIndexOf("keystage4/maths");
//	if (pos>=0)	
//	{
//		if (screen.height <= 480 && screen.width <= 800 )
//		{
//			newWindow=window.open(URLtoOpen,'LWin','height='+(screen.availHeight-20) +',width=655,left=0,top=0,toolbar=no,scrollbars=no'); 
//		}
//		else
//		{
//			newWindow=window.open(URLtoOpen,'LWin','height=570,width=778,left=50,top=50,toolbar=no,scrollbars=no'); 
//		}
//	}
//	else
//	{
//		if (screen.height <= 480 && screen.width <= 800 )
//		{
//			var pos=URLtoOpen.lastIndexOf("/");
//			var newstr = URLtoOpen.substring(0,pos)
//			URLtoOpena = newstr + "/h-frame-ie-umpc.htm";
//			URLtoOpen = URLtoOpena;
//			newWindow=window.open(URLtoOpen,'LWin','height='+(screen.availHeight-20) +',width=765,left=0,top=0,toolbar=no,scrollbars=no'); 
//		}
//		else
//		{
//			newWindow=window.open(URLtoOpen,'LWin','height=570,width=778,left=50,top=50,toolbar=no,scrollbars=no'); 
//		}
//	}
}
function openDemoWindow(URLtoOpen) 
{ 
	if (screen.height <= 480 && screen.width <= 800 )
	{
		newWindow=window.open(URLtoOpen,'dWin','height='+(screen.availHeight-20) +',width=615,left=0,top=0,toolbar=no,scrollbars=no'); 
	}	
	else
	{
		newWindow=window.open(URLtoOpen,'dWin','height=590,width=790,left=50,top=50,toolbar=no,scrollbars=no'); 
	}
}
function openEurekaWindow(URLtoOpen, windowName, windowFeatures) 
{ 
newWindow=window.open(URLtoOpen, windowName, windowFeatures); 
}
function openNewWindow(URLtoOpen, windowName, windowFeatures) 
{ newWindow=window.open(URLtoOpen, windowName, windowFeatures); }
function WinOpennewpda(filepg) {

open(filepg,"Windownewpda","width=390,height=536,resize,toolbar=no,scrollbars=no,status=no,menubar=no");

}
function WinOpennewphone(filepg) {

open(filepg,"Windownewphone","width=285,height=560,resize,toolbar=no,scrollbars=no,status=no,menubar=no");

}

function WM_imageSwap(daImage, daSrc)
{
	var objStr,obj;
	if(document.images)
	{
		if (typeof(daImage) == 'string') 
		{
			objStr = 'document.' + daImage;
			obj = eval(objStr);
			obj.src = daSrc;
		}
		else if ((typeof(daImage) == 'object') && daImage && daImage.src) 
		{
			daImage.src = daSrc;
		}
	}
}



function openLO(URLtoOpen) 
{

if (screen.height <= 480 && screen.width <= 800 )
	{
	  newWindow = window.open(URLtoOpen,'LOWin','height='+(screen.availHeight-30) +',width=680,left=0,top=0,toolbar=no,scrollbars=no');
	}
	else
	{
	  //newWindow = window.open(URLtoOpen,'LOWin','height='+(screen.height) +',width='+(screen.width) +',left=0,top=0,toolbar=no,scrollbars=no');
	  newWindow = window.open(URLtoOpen,'LOWin','height=510,width=765,left=50,top=50,toolbar=no,scrollbars=no');
	}
}





function launchNumberline(){			
PopupWin = window.open("numberline/Numberline_web_test.html", "Numberline",  "resizable=0,menubars=0,toolbars=0,scrollbars=0,status=0,width=800,height=430");
		}	
function launchToolkit(){	
PopupWin = window.open("toolkit/MA_GUI_classmate_web_test.html", "MathsToolkit", "resizable=0,menubars=0,toolbars=0,scrollbars=0,status=0,width=800,height=429");
		}
function openFootball() 
{
if (screen.height <= 480 && screen.width <= 800 )
 {
   newWindow = window.open('football/index_cm.html','footie','channelmode=yes,toolbar=no,status=no,titlebar=no,scrollbars=no');
 }
 else
 {
 //newWindow = window.open('football/index_cm.html','footie','channelmode=yes,toolbar=no,status=no,titlebar=no,scrollbars=no');
   location.href='/football.aspx';
 }
}

function openFootballGame(URLtoOpen) 
{
	if (screen.height <= 480 && screen.width <= 800 )
	{
	  newWindow = window.open(URLtoOpen,'footyWin','height='+(screen.availHeight-20) +',width=700,left=0,top=0,toolbar=no,scrollbars=no');
	}
	else
	{
	  newWindow = window.open(URLtoOpen,'footyWin','height=475,width=760,left=50,top=50,toolbar=no,scrollbars=no');
	}

}

function printIt(printThis)
{
var win=null;
var conttext = printThis.replace(/Back to top/g,'');
conttext.replace(/Print this page/g,'');
win = window.open();
self.focus();
win.document.open();
win.document.write('<'+'html'+'><'+'head'+'>');
win.document.write('<link href=\"/css/reset.css\" rel=\"stylesheet\" type=\"text/css\" media=\"screen\">');
win.document.write('<link href=\"/css/print.css\" rel=\"stylesheet\" type=\"text/css\" media=\"screen\">');
win.document.write('<'+'/'+'head'+'><'+'body'+'>');
win.document.write('<h1>skoool.co.zm</h1>');
win.document.write(conttext);
win.document.write('<'+'/'+'body'+'><'+'/'+'html'+'>');
win.document.close();
win.print();
win.close();
}
