var edit_mode = "3";
var treecolor = "FFFFFFFF";
var dirty = false;
var site_nav_index = {'a':[1],'aw':[1,2],'ab':[1,3],'ay':[1,4],'ac':[1,5],'ad':[1,6],'ae':[1,7],'af':[1,8],'ag':[1,9],'ax':[1,10],'ah':[1,11],'ai':[1,12],'ak':[1,13],'al':[1,14],'am':[1,15],'aq':[1,16],'as':[1,17],'at':[1,18],'au':[1,19],'aj':[1,20],'aa':[21],'an':[21,22],'ba':[23],'b':[23,24],'cg':[23,25],'ch':[23,26],'d':[27],'da':[27,28],'db':[27,29],'dc':[27,30],'dd':[27,31],'de':[27,32],'df':[27,33],'dg':[27,34],'dh':[27,35],'di':[27,36],'dj':[27,37],'dk':[27,38],'dl':[27,39],'dm':[27,40],'dn':[27,41],'do':[27,42],'dp':[27,43],'dq':[27,44],'dr':[27,45],'ds':[27,46],'dy':[27,47],'f':[48],'fa':[48,49],'fb':[48,50],'fc':[48,51],'fd':[48,52],'fe':[48,53],'ff':[48,54],'fg':[48,55],'fh':[48,56],'g':[57],'gy':[57,58],'h':[59],'ha':[59,60],'hb':[59,61],'hc':[59,62],'hd':[59,63],'he':[59,64],'hf':[59,65],'hg':[59,66],'hh':[59,67],'hi':[59,68],'hj':[59,69],'hk':[59,70],'hl':[59,71],'hm':[59,72],'hn':[59,73],'ho':[59,74],'hp':[59,75],'hq':[59,76],'hr':[59,77],'hy':[59,78],'i':[79],'ia':[79,80],'ib':[79,81],'ie':[79,82],'if':[79,83],'ig':[79,84],'ih':[79,85],'ii':[79,86],'ij':[79,87],'ik':[79,88],'il':[79,89],'im':[79,90],'in':[79,91],'ip':[79,92],'j':[93],'ja':[93,94],'jb':[93,95],'jc':[93,96],'jd':[93,97],'je':[93,98],'jf':[93,99],'jg':[93,100],'jh':[93,101],'ji':[93,102],'jj':[93,103],'jk':[93,104],'jl':[93,105],'jm':[93,106],'jv':[93,107],'jw':[93,108],'k':[109],'ka':[109,110],'kb':[109,111],'kc':[109,112],'kd':[109,113],'ke':[109,114],'kf':[109,115],'kg':[109,116],'kh':[109,117],'ki':[109,118],'kk':[109,119],'kl':[109,120],'km':[109,121],'kn':[109,122],'ko':[109,123],'kp':[109,124],'kq':[109,125],'kr':[109,126],'ks':[109,127],'l':[128],'la':[128,129],'lb':[128,130],'lc':[128,131],'m':[132],'mb':[132,133],'mc':[132,134],'md':[132,135],'me':[132,136],'mf':[132,137],'mg':[132,138],'mh':[132,139],'mj':[132,140],'mk':[132,141],'mn':[132,142],'o':[143],'oa':[143,144],'p':[145],'pd':[145,146],'q':[147],'qa':[147,148],'t':[149],'tb':[149,150],'tc':[149,151],'td':[149,152],'te':[149,153],'tf':[149,154],'tg':[149,155],'th':[149,156],'ti':[149,157],'tj':[149,158],'vj':[149,159],'w':[160],'wa':[160,161],'wb':[160,162],'wc':[160,163],'wd':[160,164],'we':[160,165],'wf':[160,166],'wg':[160,167],'wh':[160,168],'y':[169],'ya':[169,170],'yb':[169,171],'yg':[169,172]};
var nav_path = site_nav_index[page];

function process_nav()
{
	var nav = [['a','Home','a',1,1,'',''],[['aw','Core Values','Our Core Values',2,1,'',''],['ab','Aims','School Mission Statement',3,1,'',''],['ay','Statistics Portal','Website Statistics',4,0,'',''],['ac','School Day','Structure of the School Day',5,0,'',''],['ad','School Year','Session 2010 - 2011',6,1,'',''],['ae','Primary Schools','Associated Primary Schools & Pupil Enrolment',7,1,'',''],['af','Guidance System','The Guidance System',8,1,'',''],['ag','RE & Observance','Religious Education and Observance',9,1,'',''],['ax','National Qual','Scottish Government Consultation',10,1,'',''],['ah','Management Team','Senior Management Team',11,1,'',''],['ai','Staff List','Staff List August 2010',12,1,'',''],['ak','Staffroom','Welcome to the Staffroom',13,1,'',''],['al','Det to Succeed','Determined to Succeed',14,0,'',''],['am','Child Protection','Child Protection',15,1,'',''],['aq','School Closure','aq',16,0,'',''],['as','Ed Dep\'t Contacts','as',17,0,'',''],['at','Other Contacts','at',18,0,'',''],['au','School Contacts','au',19,0,'',''],['aj','School Senate','aj',20,1,'',''],],['aa','Newsdesk','aa',21,1,'',''],[['an','Media Club','Media Club',22,1,'',''],],['ba','Contact Info','Contact Information',23,1,'',''],[['b','Getting in touch','Location Maps',24,1,'',''],['cg','Pupil Visit','Pupil Visit to Castlehead Paisley',25,0,'',''],['ch','Refurbishment','Refurbishment of CHS Paisley',26,0,'',''],],['d','Curriculum','Curriculum',27,1,'',''],[['da','Art','Art Department',28,1,'',''],['db','Biology','Biology Department',29,1,'',''],['dc','Chemistry','Chemistry Department',30,1,'',''],['dd','English','English Department',31,1,'',''],['de','Geography','Geography Department',32,1,'',''],['df','History','History Department',33,1,'',''],['dg','Home Economics','Home Economics Department',34,1,'',''],['dh','ICT - Bus. Stds.','ICT Department: Business Studies',35,1,'',''],['di','ICT - Computing','ICT Department: Computing',36,1,'',''],['dj','Lifeskills','Lifeskills',37,1,'',''],['dk','Mathematics','Mathematics Department',38,1,'',''],['dl','Modern Languages','Modern Languages Department',39,1,'',''],['dm','Modern Studies','Modern Studies Department',40,1,'',''],['dn','Music','Music Department',41,1,'',''],['do','Physical Educ.','Physical Education Department',42,1,'',''],['dp','Physics','Physics Department',43,1,'',''],['dq','Religious Educ.','Religious Education Department',44,1,'',''],['dr','Science','Science Department',45,1,'',''],['ds','Technical Educ.','Technical Education Department',46,1,'',''],['dy','Biology Test','Test Page - Under Development',47,0,'',''],],['f','Pupil Support','Support for Pupils',48,1,'',''],[['fa','Paired Reading','Paired Reading',49,1,'',''],['fb','Brain Training','Raising Attainment',50,1,'',''],['fc','Parents\' Evening','fc',51,1,'',''],['fd','Learning Support','Support for Learning',52,1,'',''],['fe','Supported Study','fe',53,1,'',''],['ff','At Your Side','Anti Bullying Support Group',54,1,'',''],['fg','A.M. Group','Attendance Matters',55,1,'',''],['fh','Homework Club','Homework Club - Timetable',56,1,'',''],],['g','Newsletters','Newsletter Archive',57,1,'',''],[['gy','Mobile Phones','Guidance re the use of mobile telephones in School',58,1,'',''],],['h','CHS Successes','Celebrating Success',59,1,'',''],[['ha','Scottish Education','ha',60,1,'',''],['hb','Education & Leisure','Education and Leisure Awards',61,1,'',''],['hc','Renfrewshire Council','Renfrew District Council Quality Award',62,1,'',''],['hd','Education for Work','National Award for Excellence in Education for Work & Enterprise',63,1,'',''],['he','UK Maths Challenge','he',64,1,'',''],['hf','Princess of Wales','Diana, Princess of Wales Memorial Award for Young People.',65,1,'',''],['hg','Physical Education','Physical Education Awards',66,1,'',''],['hh','Scottish Space','Scottish Space Foundation',67,1,'',''],['hi','Fundraising','Charity Fundraising',68,1,'',''],['hj','Provost Community','Provost Community Award',69,1,'',''],['hk','Awards Ceremony','hk',70,1,'',''],['hl','Philip Lawrence','The Philip Lawrence Awards',71,1,'',''],['hm','Paired Reading Portal','Paired Reading Scheme - Scottish Government Portal',72,1,'',''],['hn','Have A Heart','Have A Heart Paisley',73,1,'',''],['ho','Children\'s Award','National Children\'s Award',74,1,'',''],['hp','Nationwide Award','Nationwide Award Nomination',75,1,'',''],['hq','Young Scot Awards','Young Scot Awards',76,1,'',''],['hr','Young Enterprise Awards','Young Enterprise Awards',77,1,'',''],['hy','Health Promoting School','Health Promoting School',78,1,'',''],],['i','Parents\' Centre','Welcome to Castlehead Parents\' Centre',79,1,'',''],[['ia','PTA Intro','ia',80,1,'',''],['ib','PTA Letter','Letter from the Secretary',81,0,'',''],['ie','Minutes Nov 06','PTA Minutes',82,0,'',''],['if','Minutes Mar 05','PTA Minutes',83,0,'',''],['ig','Minutes Sept 05','PTA Minutes',84,0,'',''],['ih','Minutes Nov 05','PTA Minutes',85,0,'',''],['ii','Family Support','ii',86,1,'',''],['ij','Legal Support','ij',87,1,'',''],['ik','Associations','ik',88,1,'',''],['il','Organisations','il',89,1,'',''],['im','Safety Net','im',90,1,'',''],['in','Support Info','Making the Difference - Support Packages',91,0,'',''],['ip','Parent Focus Group','Parent Focus Group',92,0,'',''],],['j','Web Links','Web Links - Menu',93,1,'',''],[['ja','Organisations','Web Links - Organisations',94,1,'',''],['jb','Learning Zones','Web Links - Learning Zones',95,1,'',''],['jc','Universities','Web Links - Universities',96,1,'',''],['jd','Colleges / Train','Web Links - Colleges / Training',97,1,'',''],['je',' Health & Wellbeing','Web Links - Health & Wellbeing',98,1,'',''],['jf','Forces / Services','Web Links - Forces / Services',99,1,'',''],['jg','Miscellaneous','Web Links - Miscellaneous',100,1,'',''],['jh','Museums','Web Links - Museums',101,1,'',''],['ji','Newspapers','Web Links - Newspapers',102,1,'',''],['jj','Encyclopedias','Web Links - Encyclopedias',103,1,'',''],['jk','Environment','Web Links - Environment',104,1,'',''],['jl','Career Planning','Web Links - Career Planning',105,1,'',''],['jm','UCAS','University Applications Procedure',106,1,'',''],['jv','Clearing','Clearing 2008',107,1,'',''],['jw','Careers','Planning Your Career',108,1,'',''],],['k','Resources','Department Resources and Coursework',109,1,'',''],[['ka','Art','Art Resources',110,0,'',''],['kb','Biology','Biology Resources',111,0,'',''],['kc','Chemistry','Chemistry Resources',112,0,'',''],['kd','English','English Resources',113,0,'',''],['ke','Geography','Geography Resources',114,0,'',''],['kf','History','History Resources',115,0,'',''],['kg','Home Economics','Home Economics Resources',116,0,'',''],['kh',' ICT - Bus Stud',' Business Studies Resources',117,0,'',''],['ki','ICT - Computing','Computing Resources',118,0,'',''],['kk','Mathematics','Mathematics Resources',119,0,'',''],['kl','Modern Languages','Modern Languages Resources',120,0,'',''],['km','Modern Studies','Modern Studies Resources',121,0,'',''],['kn','Music','Music Resources',122,0,'',''],['ko','Religious Educ','Religious Education Resources',123,0,'',''],['kp','Physical Educ','Physical Education Details',124,0,'',''],['kq','Physics','Physics Resources',125,0,'',''],['kr','Science','Science Resources',126,0,'',''],['ks','Technical Educ','Technical Education Resources',127,0,'',''],],['l','Library','Library / Learning Zone',128,1,'',''],[['la','Resources','General Resources',129,0,'',''],['lb','Using','Using the Library / Learning Zone',130,0,'',''],['lc','Study','Study / Revision Material',131,0,'',''],],['m','Special Events 2010/11','m',132,1,'',''],[['mb','event exhibitors','Alphabetical List of Exhibitors\<br\>',133,1,'',''],['mc','event map','Pavillion Route Map',134,1,'',''],['md','event info','Careers Convention - Additional Information Supplied by Exhibito',135,1,'',''],['me','event poster','Annual Careers Convention',136,1,'',''],['mf','Burns Supper','Burns Supper',137,1,'',''],['mg','Carol Concert','Christmas Carol Concert',138,1,'',''],['mh','Burns Poetry','Burns Poetry\<br\>\<br\>',139,0,'',''],['mj','Fireworks','Using Fireworks - Know the Law?',140,0,'',''],['mk','Fireworks Safety','Fireworks Safety',141,0,'',''],['mn','Work Experience','mn',142,1,'',''],],['o','Index','o',143,1,'',''],[['oa','-','oa',144,0,'',''],],['p','Calendar 10/11','p',145,1,'',''],[['pd','Calendar 05/06','pd',146,0,'',''],],['q','Out & About','Out & About',147,1,'',''],[['qa','-','blank',148,0,'',''],],['t','Staff Resources','t',149,0,'',''],[['tb','Trade  Unions','Trade Unions',150,0,'',''],['tc','Others','Others',151,0,'',''],['td','School Docs','td',152,0,'',''],['te','Associations','Professional Associations',153,0,'',''],['tf','Organisations','\<font size =3\>Organisations - Click on the images below to visit',154,0,'',''],['tg','NP Movies','National Priority Movies',155,0,'',''],['th','HMI Documents','HMIE',156,0,'',''],['ti','Resources','General Documents',157,0,'',''],['tj','Renfrewshire','Renfrewshire Staff Resources',158,0,'',''],['vj','Staff Log-in','',159,0,'',''],],['w','Feedback','Website Feedback Form',160,0,'',''],[['wa','SELS','SELS On-Line Questionnaires',161,0,'',''],['wb','Acknowledge 1','wb',162,0,'',''],['wc','Enquiries','e-mail to School Office',163,0,'',''],['wd','Acknowledge 2','',164,0,'',''],['we','Broken Links','Broken Web Link Report Form',165,0,'',''],['wf','Leaver Destinations','School Leaver Questionnaire',166,0,'',''],['wg','Helpdesklog','ICT Helpdesk Form',167,0,'',''],['wh','Acknowledge 3','wh',168,0,'',''],],['y','Image library','Do not delete images in this section - required for other pages',169,0,'',''],[['ya','home page (a) images','Do Not Delete',170,0,'',''],['yb','Burns Supper (mf) images','Do Not Delete',171,0,'',''],['yg','Required Images','Do not Delete',172,0,'',''],]];
	_process_nav(nav, 0, '');
}

function _process_nav(nav, level, state)
{
	nav_div = document.getElementById('navblock');
	navigation = write_nav(nav, level, state);
	if (nav_div.hasChildNodes())
	{
		nav_div.removeChild(nav_div.childNodes[0]);
	}
	nav_div.appendChild(navigation);
}


function write_nav(nav, level, state)
{
	var navigation = document.createElement("ul");
	if (nav == 'undefined')
	{
		alert('Deary me, this isn\'t right!');
	}
	if (state == '' && nav_path.length >= (level + 1)) {navigation.style.display = "block";}
	navigation.className ='uln';
	for (var x = 0; x < nav.length; x++)
	{
		var item = nav[x];
		if (item && typeof(item[0]) == 'string')
		{
			if (typeof(nav[x+1]) != 'undefined' && typeof(nav[x+1][0]) != 'string' && typeof(nav[x+1][0]) != 'undefined')
			{
				var citem = write_nav_item(item, level, 'nf', state);
				if (citem != null)
				{
					x++;
					item = nav[x];
					if (nav[x - 1] != 'undefined' && nav[x-1][3] == nav_path[level] && item[4] != 0)
					{
						var child_nav = write_nav(item, level + 1, '');
						citem.appendChild(child_nav);
					}
					else
					{
						if (item[4] != 0)						{
							citem.appendChild(write_nav(item, level + 1, '_x'));
						}
					}
					navigation.appendChild(citem);
				}
			}
			else
			{
				citem = write_nav_item(item, level, 'np', state);
				if (citem != null)
				{
					navigation.appendChild(citem);
				}
			}
		}
	}
	return navigation;
}

function write_nav_item(item, level, navtype, state)
{
	var on_style = "";
	var list_on_style = "";
	var mode = 3;
	
	if (item[1] == '')
	{
		item[1] = 'Untitled';
	}
	if (item[3] == nav_path[level])	{
		on_style = " " + navtype;
		on_style += item[3] == nav_path[level] ? '_on' : '';

		list_on_style = " l" + navtype;
		list_on_style += item[3] == nav_path[level] ? '_on' : '';
	}
	else	{
		list_on_style = " l" + navtype;
		list_on_style += '_off';
	}
	if (item[4] == 0 && mode == 3)
	{
		on_style = '_hidden';
		list_on_style = '_hidden';
	}

	if (item[4] == 0 && mode == 3)
	{
		return null;
	}

	var nav_item = document.createElement("li");
	nav_item.setAttribute('id', "_" + item);
	//nav_item.setAttribute('class', "l" + navtype + list_on_style);
	nav_item.className = "l" + navtype + list_on_style;
	//if (level > 0 || navtype == 'np') {nav_item.style.display = "none";}

	div1 = document.createElement("div");
	div1.className = "nbg";

	div2 = document.createElement("div");
	//div2.setAttribute('class', navtype + on_style);
	div2.className = navtype + on_style;

// create disclosure
	if (navtype == 'nf')
	{
		d_b = document.createElement("a");
		d_b.setAttribute('name', '');
		d_b.setAttribute('onclick', 'disclose(this);');
		d_b.className="d_i";	// disclosure icon

		d_a = document.createElement("img");
		d_a.setAttribute('src', 'http://www.take2theweb.com/images/FIG.GIF');
		d_a.setAttribute('onclick', 'disclose(event);');
		d_a.onclick = disclose;
		d_a.setAttribute('height', '16');
		d_a.setAttribute('width', '16');
		d_a.className = 'nfi';
		//d_b.appendChild(d_a);
		div2.appendChild(d_a);
	}
	
//
	
	d_a = document.createElement("a");
	d_a.className = 'n_l';		// navigation link
	if (item[6] != undefined && item[6] != '')	{
		d_a.setAttribute('href', item[6]);
		d_a.setAttribute('target', '_top');
	}
	else
	{
		d_a.setAttribute('href', item[0] + '.html');
	}
	d_a.setAttribute('title', item[2]);
	d_a.setAttribute('alt', "This is a disclosure item");
	if (item[5] != '') {d_a.setAttribute('accesskey', item[5]);}
	
	d_a_txt = document.createTextNode(item[1]);
	
	d_a.appendChild(d_a_txt);
	div2.appendChild(d_a);
	div1.appendChild(div2);
	nav_item.appendChild(div1);
	return nav_item;
}

function disclose(e)
{
	if (!e) var e = window.event;
	e = e.target || e.srcElement;
	p = e.parentNode.parentNode.parentNode.lastChild;
	var state = p.style.display;
	switch(state)
	{
		case '':
		case null:
		case 'none':
			p.style.display='block';
			{
				e.className ='nfi_on';
			}
			break;
		default:
			p.style.display='none';
			{
				e.className ='nfi';
			}
	}
}

