/* code created by Juxtaprose - http://www.juxtaprose.com
(c) 2006. Licensed for use under
Creative Commons Attribution-NonCommercial-ShareAlike 2.0
http://creativecommons.org/licenses/by-nc-sa/2.0/
Please preserve this notice as a means of attribution. Thanks!
*/

var max=10;
var cnt=0;
var smPre = "sm";
var lgPre = "lg";
var infoPre = "info";
var offStyle = '5px solid #fff';
var onStyle = '5px solid #347cab';//#E2F00F';

function show(idx) {	
	for(i=1;i<=cnt;i++)
	{ 
		if(i==idx)
		{
			vis = 'visible';
			dis = 'block';
			sty = onStyle;
			setFrag(i);
		}
		else 
		{
			vis = 'hidden';
			dis = "none";
			sty = offStyle;			
		}			
		$(lgPre+i).style.display=dis;
		$(smPre+i).style.borderLeft=sty;
		$(smPre+i).style.borderBottom=sty;				
		$(infoPre+i).style.display=dis;		
	}
}



function showEvent() {
	idx = this.id.substring(smPre.length);
	show(idx);
	return false;
}

if (typeof(juxtaproseAddWindowOnLoad) != 'function') {

	var juxtaproseAddWindowOnLoad = function(func) {
		var holdonload = window.onload;
		window.onload = function() {
			if (typeof(holdonload)=='function') holdonload();	
			func();
		}
	}
}

function setFrag(idx) {
	newfrag = getFrag($(smPre+idx).href);
	wl = ''+window.location;	
	f = getFrag(wl);
	if (f=='') {
		window.location.replace(window.location + '#' + newfrag);
	} else if(f!=newfrag) {
		wl = ''+window.location;
		idx = wl.lastIndexOf('#');
		window.location.replace(wl.substring(0,idx)+'#' + newfrag);
	}	
}

function getFrag(loc) {
	idx = loc.lastIndexOf('#');
	fr = '';
	if (idx > -1) {
		fr = loc.substring(idx+1);
	}		
	return fr;
}

juxtaproseAddWindowOnLoad(function() {
	var idx=1;
	var wl = ''+window.location;
	var frag = getFrag(wl);
	for(j=1;j<=max;j++) {
		sm = $(smPre+j);
		if (sm!=null) {
			cnt = j;
			sm.onmouseover = showEvent;
			sm.onfocus = showEvent;
			sm.onclick = showEvent;	
			if (frag==getFrag(sm.href)) idx=j;
		} else {
			break;
		}		
	}
	if (cnt>=1) show(idx);
});
