// AJAX CODE
// Enhanced by myself

function parseScript(_source, containerid) {
	var source = _source;
	var scripts = new Array();
	
	// Strip out tags
	while(source.indexOf("<script") > -1 || source.indexOf("</script") > -1) {
		var s = source.indexOf("<script");
		var s_e = source.indexOf(">", s);
		var e = source.indexOf("</script", s);
		var e_e = source.indexOf(">", e);
		
		// Add to scripts array
		scripts.push(source.substring(s_e+1, e));
		// Strip from source
		source = source.substring(0, s) + source.substring(e_e+1);
	}
	
	document.getElementById(containerid).innerHTML=source;

	// Loop through every script collected and eval it
	for(var i=0; i<scripts.length; i++) {
		try {
			eval(scripts[i]);
		}
		catch(ex) {
			// do what you want here when a script fails
			alert(scripts[i]);
		}
	}
}



/***********************************************
* Dynamic Ajax Content- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

var loadedobjects=""
var rootdomain="//"+window.location.hostname

function ajaxpage(url, containerid){
var page_request = false
if (window.XMLHttpRequest) // if Mozilla, Safari etc
page_request = new XMLHttpRequest()
else if (window.ActiveXObject){ // if IE
try {
page_request = new ActiveXObject("Msxml2.XMLHTTP")
} 
catch (e){
try{
page_request = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){}
}
}
else
return false
page_request.onreadystatechange=function(){
loadpage(page_request, containerid)
}
page_request.open('GET', url, true)
page_request.send(null)
}

function loadpage(page_request, containerid){
if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
parseScript(page_request.responseText,containerid)
//document.getElementById(containerid).innerHTML=page_request.responseText
}

// SWFOBJECT LOAD
function loadSWF(pTitle,pPic){
var url = "swf/person.swf";
var so = new SWFObject(url, "person", "300", "356", "8", "#CACCB7");
so.addParam("wmode", "transparent");
so.addVariable("picURL", pPic);
so.addVariable("pName", pTitle);
so.write("localPnt");
}

// SWFOBJECT LOAD
function loadSWF2(pTitle,pPic){
var url = "../swf/person.swf";
var so = new SWFObject(url, "person", "300", "356", "8", "#CACCB7");
so.addParam("wmode", "transparent");
so.addVariable("picURL", pPic);
so.addVariable("pName", pTitle);
so.write("localPnt");
}

//TOGGLE FUNCTIONS
function toggle(id){ 
    tarID = document.getElementById(id);
    tarID.style.display = (tarID.style.display == 'block') ? 'none' : 'block';
}
function show(id){
	showID = document.getElementById(id);
	showID.style.display = "block";
}
function hide(id){
	hideID = document.getElementById(id);
	hideID.style.display = "none";	
}

