var hiddenTut,hiddenfold,visiblefold,buttonTut,hiddenSubTut,hiddensubfold,visiblesubfold,buttonSubTut,thisobj,c,d,i; 
var abstopos=new Array(0,150,220,260,300,420,460,330,370);
function showModLevel(i){for (var o = 1; o < 7;o++){var hideall = document.getElementById('mod'+o);hideall.style.visibility = 'hidden';hideModLevel(o);
}//var shiftdown = (i * 45) + 100;
var shiftdown=abstopos[i];
hiddenMod = document.getElementById('mod'+i);hiddenfold = document.getElementById('opencrsfolder'+i);visiblefold = document.getElementById('closedcrsfolder'+i);
hiddenMod.style.top = shiftdown +'px';

if(screenres < 850)	{hiddenMod.style.left =135+'px';var smallres = parseInt(shiftdown)+parseInt(20);hiddenMod.style.top =smallres+'px';	}
else if(screenres > 1024){hiddenMod.style.left =385+'px';	var smallres = parseInt(shiftdown)+parseInt(20);hiddenMod.style.top =smallres+'px';}
else{	hiddenMod.style.top = shiftdown +'px';	}hiddenMod.style.visibility ='visible';hiddenfold.style.visibility ='visible';visiblefold.style.visibility ='hidden';}


/*       Script by hscripts.com     copyright of HIOX INDIA    more scripts @ http://www.hscripts.com  */
var my,mpy=220;
function initd() {
  if (window.Event) {
    document.captureEvents(Event.MOUSEMOVE);
  }
  document.onmousemove = getXY;
}
function getXY(e) {
  x = (window.Event) ? e.pageX : event.clientX;
  my = (window.Event) ? e.pageY : event.clientY;
mpy=parseInt(my)-parseInt(100);
  
}
// above Script by hscripts.com 

function hideModLevel(i){
hiddenTut = document.getElementById('mod'+i);
hiddenfold = document.getElementById('opencrsfolder'+i);
visiblefold = document.getElementById('closedcrsfolder'+i);
hiddenTut.style.visibility ='hidden';
hiddenfold.style.visibility ='hidden';
visiblefold.style.visibility ='visible';
document.getElementById('mod'+i).style.visibility = 'hidden';}
var id= 0;function setsesobj(id){document.submod.objectid.value = id;document.submod.submit();}
var screenres = screen.width; 
function showchem(){
document.getElementById('mod2').style.visibility='visible';
document.getElementById('mod2').style.top =207+'px';
if(screenres < 850)
	{
	document.getElementById('mod2').style.left =135+'px';
	document.getElementById('opencrsfolder2').style.left =20+'px';
	document.getElementById('details00').style.left =575+'px';
	}
	else if(screenres > 1024){document.getElementById('mod2').style.left =385+'px';	
	document.getElementById('opencrsfolder2').style.left =260+'px';
	document.getElementById('closedcrsfolder2').style.left =260+'px';
	document.getElementById('details00').style.left =820+'px';}
	else	
	{
	document.getElementById('details00').style.left=690+'px';
	}
}
function showfmaths(){document.getElementById('mod7').style.visibility='visible';
document.getElementById('mod7').style.top =330+'px';
if(screenres < 850)
	{
	document.getElementById('mod7').style.left =135+'px';
	document.getElementById('opencrsfolder7').style.left =20+'px';
	document.getElementById('details00').style.left =575+'px';
	}
	else if(screenres > 1024){document.getElementById('mod7').style.left =385+'px';	
		document.getElementById('details00').style.left =820+'px';}
	else{document.getElementById('details00').style.left=690+'px';}
}
function showmmaths(){document.getElementById('mod4').style.visibility='visible';
document.getElementById('mod4').style.top =316+'px';
if(screenres < 850)
	{
	document.getElementById('mod4').style.left =135+'px';
	document.getElementById('opencrsfolder4').style.left =20+'px';
	document.getElementById('details00').style.left =575+'px';
	}
	else if(screenres > 1024){document.getElementById('mod4').style.left =385+'px';	
		document.getElementById('details00').style.left =820+'px';}
	else	
	{
	document.getElementById('details00').style.left=690+'px';
	}
}
function showhmaths(){document.getElementById('mod8').style.visibility='visible';
document.getElementById('mod8').style.top =370+'px';
if(screenres < 850)
	{
	document.getElementById('mod8').style.left =135+'px';
	document.getElementById('opencrsfolder8').style.left =20+'px';
	document.getElementById('details00').style.left =575+'px';
	}
	else if(screenres > 1024){
		document.getElementById('mod8').style.left =385+'px';
		document.getElementById('details00').style.left=820+'px';	}
	else	
	{
	document.getElementById('details00').style.left=690+'px';
	}
}
function showsci(){document.getElementById('mod6').style.visibility='visible';
document.getElementById('mod6').style.top =385+'px';
if(screenres < 850)
	{
	document.getElementById('mod6').style.left =135+'px';
	document.getElementById('opencrsfolder6').style.left =20+'px';
	document.getElementById('details00').style.left =575+'px';
	}
	else if(screenres > 1024){document.getElementById('mod1').style.left =485+'px';	
		document.getElementById('details00').style.left =820+'px';}
	else	
	{
	document.getElementById('details00').style.left=690+'px';
	}
}

function showbio(){document.getElementById('mod1').style.visibility='visible';
document.getElementById('mod1').style.top =150+'px';
if(screenres < 850)
	{
	document.getElementById('mod1').style.left =135+'px';
	document.getElementById('opencrsfolder1').style.left =20+'px';
	document.getElementById('details00').style.left =575+'px';
	}
	else if(screenres > 1024){document.getElementById('mod1').style.left =485+'px';	
		document.getElementById('details00').style.left =820+'px';}
	else	
	{
	document.getElementById('details00').style.left=690+'px';
	}
}

function showict(){document.getElementById('mod3').style.visibility='visible';
document.getElementById('mod3').style.top =250+'px';
if(screenres < 850)
	{
	document.getElementById('mod3').style.left =135+'px';
	document.getElementById('opencrsfolder3').style.left =20+'px';
	document.getElementById('details00').style.left =575+'px';
	}
	else if(screenres > 1024){document.getElementById('mod1').style.left =485+'px';	
		document.getElementById('details00').style.left =820+'px';}
	else	
	{
	document.getElementById('details00').style.left=690+'px';
	}
}
var objwindow,popupleft,popuptop,popupParams,objWinOpen = false;var obj = 0;
function showdetails(obj){if(objWinOpen == false){popupleft = window.screen.width -420;popuptop = 250;popupParams = "width=250,height=249";popupParams = popupParams + ",left="+popupleft+ ",top="+popuptop;objwindow = window.open("details.htm", "detailwindow", popupParams);objwindow.focus();objWinOpen = true;}else{objwindow.focus();}}

var a;function showobj(obj,a){
initd()
document.getElementById(oldDetails).style.visibility='hidden';
document.getElementById(oldDets).style.visibility='hidden';
oldDetails='';
var helpdiv=document.getElementById('details'+obj);helpdiv.style.visibility='visible';
helpdiv.style.top =mpy+'px';	
if(screenres < 850)	{helpdiv.style.left =575+'px';}else if(screenres > 1024){helpdiv.style.left =820+'px';}
else{helpdiv.style.left=690+'px';}var posn="";
if(document.all){posn=(parseInt(document.body.scrollTop) + parseInt(200))+'px'}else{posn=parseInt(window.pageYOffset) + parseInt(200)+'px'};
document.getElementById('details'+obj+a).style.visibility='visible';
//document.getElementById('details'+obj).style.top =mpy+'px';	
var helphead=document.getElementById('details00');helphead.style.visibility='hidden';};
var oldDetails='details167',oldDets='details167s';
function hideobj(obj,a){
oldDets='details'+obj;
oldDetails='details'+obj+a;
};

function closechildWindows(){if(objwindow != null){if(objwindow.closed == false){objwindow.close()}}}
var topic; function gosearch(){topic=document.forms[0].searchtext.value;if(topic==""){alert("No text entered!")}else{document.location='mfsearch.htm?'+topic;}};
var span,color;function shadeup(span,color){document.getElementById(span).style.background=color;}function shadedown(span,color){document.getElementById(span).style.background=color;}
function inset(span){document.getElementById(span).style.border='inset';}function outset(span){document.getElementById(span).style.border='outset';}
var s=0,t;var ctestArray = new Array(0,179,177,178,150,144,146,145,147,166,167,186,187,151,148,149,152,153,168,188,181,182,183,184,155,185,154);
var ms=0;var mftestArray = new Array(0,119,120,121,122,123,124,125,127,128,129,131,136,139,142,143,171,172,173,174,175,176,177,201,244,245,246,249,250,281);
var mmtestArray = new Array(0,101,102,103,104,105,106,107,108,110,111,112,113,114,116,118,126);
var hms=0;var hmtestArray = new Array(0,67,123,126,130,131,132,133,134,135,136,137,138,139,140,141,142,143,171,172,173,174,175,176,177);
var stestArray = new Array(0,67,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,171,172)
var itestArray = new Array(0,67,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,171,172)
var testArray= new Array();
function findtext(s,t){
	if(t=='c'){testArray=ctestArray}else if(t=='m'){testArray=mtestArray}else if(t=='mf'){testArray=mftestArray}else if(t=='mm'){testArray=mmtestArray}else if(t=='hm'){testArray=hmtestArray}else if(t=='i'){testArray=itestArray}else if(t=='s'){testArray=stestArray}
	var text = "", myregexp;
	var newhtml = "",wholetext="",foundheader="";
	text=document.forms[0].searchtext.value;//}
	document.getElementById('replace').innerHTML="";
	if (text ==""){alert("No text entered!")}
	else if(text.length < 2){alert("Text not specific enough!")}
	else{
		var i = 1,matches=0;	
		if(text=="ion"){myregexp = new RegExp("\\bion\\b","ig");} 
		else if(text=="ions"){myregexp = new RegExp("\\bions\\b","ig");}
		else{myregexp = new RegExp(text,"ig");}
		var headerArray=new Array();var oldtext = document.getElementById('main').innerHTML;
		document.getElementById('replace').innerHTML=oldtext;
		var comparetext,foundtexts,header,foundtext,replaceheader,functext,resultsbox;
		for(i=1;i<testArray.length;i++)
			{comparetext = document.getElementById('details'+i).innerHTML;
			foundtexts = comparetext.search(myregexp);
			if(foundtexts > -1){
				matches++;header = document.getElementById('h'+testArray[i]).innerHTML;
				foundtext = comparetext.replace(myregexp,"<span style='color:red;font-weight:bold;'>"+text+"</span>");
				document.getElementById('details'+i).innerHTML = foundtext;wholetext = document.getElementById('details'+i).innerHTML; 
			if(parseInt(testArray[i])>115){
				replaceheader="<a href='javascript:void(0)' onclick='goInstantAllTest("+testArray[i]+")'><span style='font-size:14px;font-weight:bold;text-decoration:underline;'>"+header+"</span></a>";}
			else{functext="'gomyTest("+testArray[i]+",\"n\",\"b\")'";
				replaceheader="<a href='javascript:void(0)' onclick="+functext+"><span style='font-size:14px;font-weight:bold;text-decoration:underline;'>"+header+"</span></a>";}
				document.getElementById('h'+testArray[i]).innerHTML = replaceheader;
				foundheader=document.getElementById('h'+testArray[i]).innerHTML;newhtml = newhtml +"<br /><br />"+ foundheader +"<br />"+ wholetext;
				}
			}
		if (matches <1)
			{document.getElementById('main').style.visibility='hidden';document.getElementById('replace').style.visibility='hidden';
			alert("Search not matched, please try again");}
		else{
			document.getElementById('main').style.visibility='hidden';
			document.getElementById('replace').innerHTML="";document.getElementById('replace').innerHTML=newhtml;
			if(screenres > 1024){document.getElementById('replace').style.left =385+'px';}
			document.getElementById('replace').style.visibility='visible';
			resultsbox = document.getElementById('results');
			resultsbox.innerHTML="Word matches found in "+ matches+" Quiztorials, Click on the bold heading link to take this Quiztorial";
			}
		}
	document.getElementById('search').focus();
}

var z;function refreshtext(z){if (z=='c'){document.location='csearch.htm',document.forms[0].searchtext.value='';}else if(z=='m'){document.location='msearch.htm'}else if(z=='mf'){document.location='mfsearch.htm'}else if (z=='i'){document.location='isearch.htm'}else if (z=='s'){document.location='ssearch.htm'}else if (z=='b'){document.location='bsearch.htm'}}
var oo= 1;
function goInstantAllTest(oo){var singlequestWindow = window.open(oo+".htm","questionsWindow","fullscreen,scrollbars");if (singlequestWindow.opener == null){ singlequestWindow.opener = window;}singlequestWindow.focus();}

var tno=0,ttype,tgrade;
function gomyTest(tno,ttype,tgrade){var singlequestWindow = window.open(tno+".htm?t="+ttype+"&d="+tgrade,"questionsWindow","fullscreen,scrollbars");if (singlequestWindow.opener == null){ singlequestWindow.opener = window;}singlequestWindow.focus();}

