// To circumvent the whole 'path' issue, from subdirectories, we have a global 
// called ScriptPathOffset that will control the relative path to our script files.

var ScriptPathOffset;

var scripts = [
	"/Scripts/macromedia.js",
	"/Scripts/AC_RunActiveContent.js",
	"http://w.sharethis.com/button/buttons.js",
	"/Scripts/sharethis.js",
	"/Scripts/EducationOpenWindow.js",
	"/Scripts/TopMenuPreload.js",
	"/Pixiray/pixiray.js"
	
];

function include(file){
	var script_file = "";
	if(ScriptPathOffset && file[0]!='/'){
		script_file = ScriptPathOffset;
		if(script_file[script_file.length-1] != '/'){
			script_file += '/';
		}
	}
	script_file += file;
	document.writeln("<script type=\"text/javascript\" src=\"" + script_file + "\"></script>");
}

for(var idx in scripts){
	include(scripts[idx]);
}

var PixiRayLauncher = {
	"(/(default\.aspx)?)$":[0,'prIndex'],
	"(/news\.aspx)$":[1,'prNews'],
	".*":false
};

window.onload = function(){
	var path = location.pathname.toLowerCase();
	var re;
	for(re in PixiRayLauncher){
		if(path.search(re) != -1){
			if(PixiRayLauncher[re]){
				PixiRay.Init(PixiRayLauncher[re][0],PixiRayLauncher[re][1]);
				break;
			}else{
				PixiRay.Init();
				break;
			}
		}
	}
	if(window.Rotator!=undefined){
		InitializeRotators();
	}
}
window.onresize = function(){
	PixiRay.Resize();	//repositions her accordingly
}
