function OpenPrintHelp(){
	sWindow = "";
	sWindow = window.open("PrintHelp.Asp","PrintHelp","resizable=yes,scrollbars=yes,menubar=no,location=no,toolbar=no,status=no,height=150,width=500,left=0,top=0;");
	sWindow.focus();
}

function OpenWin(){
	sWindow = "";
	sWindow = window.open("Learning.Asp","Learning","resizable=yes,scrollbars=yes,menubar=no,location=no,toolbar=no,status=no,height=150,width=300,left=0,top=0;");
	sWindow.focus();
}

function CloseWin(){
	window.close();
}

function OpenWebLinks(stepid){
	sWindow = "";
	sWindow = window.open("WebLinks.Asp?StepID=" + stepid,"WebLinks","resizable=yes,scrollbars=yes,menubar=no,location=no,toolbar=yes,status=no,height=510,width=790,left=0,top=0;");
	sWindow.focus();
}

function OpenExternalWebLink(url){
	sWindow = "";
	sWindow = window.open(url,"ExternalWebLink","resizable=yes,scrollbars=yes,menubar=yes,location=yes,toolbar=yes,status=yes,height=510,width=790,left=0,top=0;");
	sWindow.focus();
}

function OpenCertificate(type, stepid){
	sWindow = "";
	sWindow = window.open("Certificate.Asp?StepID=" + stepid + "&CertificateType=" + type,"Certificate","resizable=no,scrollbars=no,menubar=no,location=no,toolbar=no,status=no,height=600,width=800,left=0,top=0;");
	sWindow.focus();
}

function OpenRegistration(){
	sWindow = "";
	sWindow = window.open("Registration_TermsAndConditions.Asp","Registration","resizable=no,scrollbars=yes,menubar=no,location=no,toolbar=no,status=no,height=510,width=790,left=0,top=0;");
	sWindow.focus();
}

function OpenGuidedTour(){
	sWindow = "";
	sWindow = window.open("TeachersManual_GuidedTour.Asp","GuidedTour","resizable=yes,scrollbars=yes,menubar=no,location=no,toolbar=no,status=no,height=350,width=500,left=0,top=0;");
	sWindow.focus();
}

function OpenLogon(){
	sWindow = "";
	sWindow = window.open("Logon.Asp","Logon","resizable=no,scrollbars=no,menubar=no,location=no,toolbar=yes,status=no,height=530,width=790,left=0,top=0;");
	sWindow.focus();
}

function OpenLogonFamily(){
	sWindow = "";
	sWindow = window.open("Logon.Asp?FamilyLogon=True","Logon","resizable=no,scrollbars=no,menubar=no,location=no,toolbar=yes,status=no,height=530,width=790,left=0,top=0;");
	sWindow.focus();
}

function OpenLogonUpgrade(){
	sWindow = "";
	sWindow = window.open("Logon.Asp?UpgradeLogon=True","Logon","resizable=no,scrollbars=no,menubar=no,location=no,toolbar=yes,status=no,height=530,width=790,left=0,top=0;");
	sWindow.focus();
}

function OpenUserGuide(){
	sWindow = "";
	sWindow = window.open("Tour.Asp","GuidedTour","resizable=yes,scrollbars=yes,menubar=no,location=no,toolbar=no,status=no,height=600,width=480,left=0,top=0;");
	sWindow.focus();
}

function OpenSurvivalGuideSinglePage(){
	sWindow = "";
	sWindow = window.open("ControlPanel_Survival_Guide.Asp","SurvivalGuide","resizable=yes,scrollbars=yes,menubar=no,location=no,toolbar=no,status=no,height=600,width=500,left=0,top=0;");
	sWindow.focus();
}

function OpenGlossary(word){
	sWindow = "";
	sWindow = window.open("Glossary.Asp?Word=" + word,"Glossary","resizable=no,scrollbars=yes,menubar=no,location=no,status=no,toolbar=no,height=400,width=720,left=0,top=0;");
	sWindow.focus();
}

function OpenTeachersManual(){
	sWindow = "";
	sWindow = window.open("TeachersManual.Asp","TeachersManual","resizable=yes,scrollbars=yes,menubar=no,location=no,toolbar=yes,status=no,left=0,top=0;");
	sWindow.resizeTo(screen.availWidth - 100, screen.availHeight - 100);
	sWindow.focus();
}

function OpenControlPanel(){
	sWindow = "";
	sWindow = window.open("ControlPanel.Asp","ControlPanel","resizable=yes,scrollbars=yes,menubar=no,location=no,toolbar=yes,status=no,left=0,top=0");
	sWindow.resizeTo(screen.availWidth - 100, screen.availHeight - 100);
	sWindow.focus();
}

function OpenSurvivalGuide(){
	sWindow = "";
	sWindow = window.open("SurvivalGuide.Asp","ControlPanel","resizable=yes,scrollbars=yes,menubar=no,location=no,toolbar=yes,status=no,left=0,top=0");
	sWindow.resizeTo(screen.availWidth - 100, screen.availHeight - 100);
	sWindow.focus();
}

function OpenTeachersManualModulePlan(stepid, moduleid){
	sWindow = "";
	sWindow = window.open("TeachersManual_ModulePlan.Asp?StepID=" + stepid + "&ModuleID=" + moduleid,"TeachersManual","resizable=yes,scrollbars=yes,menubar=no,location=no,toolbar=yes,status=no,height=600,width=800,left=0,top=0;");
	sWindow.focus();
}

function OpenLessonNotes(stepid, moduleid){
	sWindow = "";
	sWindow = window.open("TeachersManual_LessonNotes.Asp?StepID=" + stepid + "&ModuleID=" + moduleid,"TeachersManual","resizable=yes,scrollbars=yes,menubar=no,location=no,toolbar=yes,status=no,height=600,width=800,left=0,top=0;");
	sWindow.focus();
}

function openhelp(generichelpid, helpheight, helpwidth, icanid){
	sWindow = "";
	sWindow = window.open("Help.Asp?GenericHelpID=" + generichelpid + "&ICanID=" + icanid + "&SelectedTab=1", "Help", "toolbar=no, status=no, resizeable=yes, width=" + helpwidth + ", height=" + helpheight);
	sWindow.resizeTo(helpwidth, helpheight);
	sWindow.focus();
}

function changehappygreen(q, icanid, moduleid, capabilityyesican){
	if (document.all) document.all["happy" + q].src = "Images/Happy/Green.Gif";
	sWindow = "";
	sWindow = window.open("ICanDoThis.Asp?ModuleID=" + moduleid + "&ICanID=" + icanid + "&CapabilityYesICan=" + capabilityyesican, "ICan", "toolbar=no, status=no, resizeable=yes, width=200, height=120");
	sWindow.focus();
}

function changeconfident(moduleid, action, color100, color200, color300){
	document.all["happy100"].src = "Images/Happy/" + color100 + ".Gif";
	document.all["happy200"].src = "Images/Happy/" + color200 + ".Gif";
	document.all["happy300"].src = "Images/Happy/" + color300 + ".Gif";
	sWindow = "";
	sWindow = window.open("ICanDoThis.Asp?Action=" + action + "&ModuleID=" + moduleid, "ICan", "toolbar=no, status=no, resizeable=no, width=200, height=120");
	sWindow.focus();
}

function changebg(loc, step, module, imgnum, topicrow, topiccolumn){
	document.all["picloc" + loc].background = "Images/DolphinSystem/Step_" + step + "/" + module + "/" + topicrow + "_" + topiccolumn + "/Backgrounds/" + imgnum + ".Jpg";
}

function changehappyred(generichelpid, q, helpheight, helpwidth, icanid, happyexist){
	if (happyexist == 'True'){
		document.all["happy" + q].src = "Images/Happy/Red.Gif";
	}
	sWindow = "";
	sWindow = window.open("Help.Asp?GenericHelpID=" + generichelpid + "&ICanID=" + icanid + "&SelectedTab=1", "Help", "toolbar=no, status=no, resizeable=yes, width=" + helpwidth + ", height=" + helpheight);
	sWindow.resizeTo(helpwidth, helpheight);
	sWindow.focus();
}

function changehappyredglossary(glossarytermid, q, icanid){
	if (document.all) document.all["happy" + q].src = "Images/Happy/Red.Gif";
	sWindow = "";
	sWindow = window.open("Glossary.Asp?GlossaryTermID=" + glossarytermid + "&ICanID=" + icanid,"Glossary","resizable=no,scrollbars=yes,menubar=no,location=no,toolbar=no,status=no,height=400,width=720,left=0,top=0;");
	sWindow.focus();
}

function resethappyredmodule(moduleid, userid){
	document.all["happy" + moduleid].src = "Images/Happy/Red.Gif";
	sWindow = "";
	sWindow = window.open("ResetPupil.Asp?ModuleID=" + moduleid + "&UserID=" + userid, "ResetPupil", "toolbar=no, status=no, resizeable=no, width=200, height=120");
	sWindow.focus();
}

function resethappyredican(icanid, userid){
	document.all["happy" + icanid].src = "Images/Happy/Red.Gif";
	sWindow = "";
	sWindow = window.open("ResetPupil.Asp?ICanID=" + icanid + "&UserID=" + userid, "ResetPupil", "toolbar=no, status=no, resizeable=no, width=200, height=120");
	sWindow.focus();
}

function printit(){  
	if (window.print) {
		window.print() ;  
	}else{
		document.body.insertAdjacentHTML('beforeEnd', '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>');
		WebBrowser1.ExecWB(6, 2);
		WebBrowser1.outerHTML = "";
	}
}

function changeuser(){
	classidanduserid = document.form.select[document.form.select.selectedIndex].value;

	if (classidanduserid == "LogoutSchool"){
		parent.location="School.Asp";
	}else if (classidanduserid == "LogoutFamily"){
		parent.location="School_Family.Asp";
	}else{
		parent.location="DolphinSystem.Asp?ChangeUser=" + classidanduserid;
	}
}

function changestepandclass(stepid, classid){
	parent.Main.location="TeachersManual_ClassPlanningGrid.Asp?StepID=" + stepid + "&ClassID=" + classid
}

function changestep(stepid, classid){
	parent.Main.location="TeachersManual_SkillsList.Asp?StepID=" + stepid + "&ClassID=" + classid
}

function changeyear(yearid, classid){
	parent.Main.location="TeachersManual_SkillsList_ByYear.Asp?YearID=" + yearid + "&ClassID=" + classid
}

function changeyearuserslist(yearid, classid){
	parent.Main.location="ControlPanel_Users_Main.Asp?YearID=" + yearid
}

function changeyearprogressgrids(yearid, classid){
	parent.Main.location="ControlPanel_Users_Main.Asp?ProgressGrid=True&YearID=" + yearid
}

function changeyearqca(yearid, classid){
	parent.Main.location="TeachersManual_QCAList_ByYear.Asp?YearID=" + yearid + "&ClassID=" + classid
}

function changestepandclassspecial(stepid, classid){
	parent.Main.location="TeachersManual_SpecialClassPlanningGrid.Asp?StepID=" + stepid + "&ClassID=" + classid
}

function changestepandclassid(stepid, classid, page){
	parent.Main.location="ControlPanel_Actions.Asp?ControlPanel=True&Type=Classes&Action=" + page + "&StepID=" + stepid + "&ClassID=" + classid
}

function changeclassid(classid, page){
	parent.Main.location="ControlPanel_Actions.Asp?ControlPanel=True&Type=Classes&Action=" + page + "&ClassID=" + classid
}

function playMp3Infant(filename, stepid, module, topicrow, topiccolumn){
	mp3.innerHTML = "<embed height='0' width='0' hidden='true' autostart='true' loop='false' src='DolphinSystem/Step_" + stepid + "/" + module + "/" + topicrow + "_" + topiccolumn + "/Sounds/" + filename + "'>";
}

function playMp3Junior(filename, stepid, module){
	mp3.innerHTML = "<embed height='0' width='0' hidden='true' autostart='true' loop='false' src='DolphinSystem/Step_" + stepid + "/" + module + "/Junior/Sounds/" + filename + "'>";
}

var init_msg = "                          Empowering Children for Learning";
var scroll = init_msg;

function doScroll() {
	if (scroll.length == 1){
		scroll = init_msg;
	}else{
		scroll = scroll.substring(1, scroll.length);
	}
	TextBox.value = scroll;
	ScrollTimeOut = window.setTimeout('doScroll()', 100);
	return true;
}

function openwin(surl) {
	window.open(surl,'Window1','menubar=no,scrollbars=no,width=400,height=20,toolbar=no');
}

function Del_Page(str_txt, str_url){
	if (str_txt =='0'){
		str_txt='This special group will be permanently deleted but its users will remain. Are you sure you want to do this?';
	}
	if (str_txt =='1'){
		str_txt='This class and its pupils will be permanently deleted. Are you sure you want to do this?';
	}
	if (str_txt =='2'){
		str_txt='This user and its records will be permanently deleted. Are you sure you want to do this?';
	}
	if (str_txt =='3'){
		str_txt='This project will be permanently deleted. Are you sure you want to do this?';
	}
	if (confirm(str_txt)){ 				
		document.theForm.action = str_url;
		document.theForm.submit();
	}	
}
