/*  	
	Brown Paper Bab - Web Studio (www.brownpaperbag.com.au)
	Version 1.1
	Created: 27th April 2008
	By: info@brownpaperbag.com.au
	Modified: 
		
*/
//<![CDATA[

// sIFR Loader
Event.observe(window, 'load', function(event) { 
	//Set glossary term functions
	$$('a.Glossary').each(function(el) {
		new Control.Modal(el, { containerClassName: 'glossary_container',
				position: 'mouse',
				offsetTop: 16,
				contents: function(){ var s = new Ajax(); return s.getDefinition(el.getID()); }
	});	}); 
	$$('a.view').each(function(el) { new Control.Modal(el, {iframe:true, width:521, height:600}); }); 
	$$('a.Info').each(function(el) { new Control.Modal(el, {iframe: 'true', width: 640, height:480 }); }); 
	$$('a.nw').each(function(el) {
		el.onclick = function() {
				if(window.open(this.href,"childWindow")) return false;
				else return false;};
		el.onkeypress = function() {
				if(window.open(this.href,"childWindow")) return false;
				else return false;};
	});
	
	if(typeof sIFR == "function"){
		sIFR.replaceElement(named({sSelector:"h2#Section", sFlashSrc:"/_share/sifr/din_bold.swf", sColor:"#ffffff", sBgColor:"#000000", sWmode:"transparent"}));
		sIFR.replaceElement(named({sSelector:"h2.Blockhead", sFlashSrc:"/_share/sifr/blockhead.swf", sColor:"#ff7c18", sBgColor:"#ffffff", sWmode:"transparent"}));
		sIFR.replaceElement(named({sSelector:"h2.Din", sFlashSrc:"/_share/sifr/din_bold.swf", sColor:"#ff7c18", sBgColor:"#000000", sWmode:"transparent"}));
		sIFR.replaceElement(named({sSelector:"h3.Din", sFlashSrc:"/_share/sifr/din_bold.swf", sColor:"#333", sBgColor:"#000000", sWmode:"transparent"}));
	};
	if ($('tab.group.one')) new Control.Tabs('tab.group.one');
});

var MyUtils = { 
	isNumber: function(element){ element = $(element); return /^\d+$/.test(element.value); },
	getID: function(element){ element = $(element); return element.readAttribute('title'); }
};
Element.addMethods(MyUtils);


//Google map - District
function showMap(id) { 
	var url = '/map.aspx?d=' + id;
	m = new Control.Modal(false,{iframe:true, overlayCloseOnClick:true, width:700, height:550, href:url});
	m.open();
	//return false;
	//document.location = '/map.aspx?d='+id; 
}
// School Page charts
var CurrentChart = null;
function showChart(el, chart, command) {
	if (CurrentChart) CurrentChart.removeClassName('active')
	el = $(el);
	el.addClassName('active');
	CurrentChart = el;
	ChartCB.callAsync(null,chart,command);
	return false;
}


//]]>