var myURL="",domStyle="",isDHTML = 0,isID = 0,isAll = 0,isLayers = 0,browserVersion = "";

if (document.getElementById) {
		isID = 1; isDHTML = 1;//Mozilla
	}else{
	if (document.all) {
			isAll = 1; isDHTML = 1;//Every other DHTML compliant browser
		}else{
			browserVersion = parseInt(navigator.appVersion);
			if ((navigator.appName.indexOf('Netscape') != -1) && (browserVersion == 4)) {isLayers = 1; isDHTML = 1;}//OLD browsers
	}
}

function findDOM(objectID,withStyle) {
	if (withStyle == 1) {
		if (isID) { return (document.getElementById(objectID).style) ; }//Mozilla
		else { 
			if (isAll) { return (document.all[objectID].style); } // IE
		else {
			if (isLayers) { return (document.layers[objectID]); }//Netscape pre 6
		};}
	}
	else {
		if (isID) { return (document.getElementById(objectID)) ; }
		else { 
			if (isAll) { return (document.all[objectID]); }
		else {
			if (isLayers) { return (document.layers[objectID]); }
		};}
	}
	return "";
}


//extra global functions

function displayWindow(url, width, height) {
        var Win = window.open(url,"_blank",'width=' + width +
',height=' + height + ',resizable=0,scrollbars=1');
}

function displayWindow2(url, width, height) {
        var Win = window.open(url,"_blank",'width=' + width +
',height=' + height + ',resizable=0,scrollbars=1');
}

 
function displayWindowResizable(url, width, height) {
        var Win = window.open(url,"openWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=1');
}



function setClass(objectID,newClass) {
	var dom = findDOM(objectID,0);
	dom.className = newClass;
}

function getMyClass(objectID) {
	var dom = findDOM(objectID,0);
	return	dom.className ;
}

function getDisplay(objectID) {
if (isAll || isID) {
	var domStyle = findDOM(objectID,1);
	return	domStyle.display;
	}
}

function revealDiv(objectID) {
	if (isAll || isID) {
		domStyle = findDOM(objectID,1);
		domStyle.display='block';
	}
	return;
}

function concealDiv(objectID) {
	if (isAll || isID) {
		domStyle = findDOM(objectID,1);
		domStyle.display='none';
	}
	return;
}

/*This function is used by the event Resveration form.
function checkTAComments(thisObject,initialText){
		if (thisObject.value==initialText){
		thisObject.value="";
		setClass(thisObject.id,'normalTA');
	}
}
*/

/*Simple URL Mining*/
var sURL = (location.pathname.indexOf('?') != -1) ? location.pathname.substring(0, location.pathname.indexOf('?')) : location.pathname;
sURL = (location.pathname.charAt(0) == '/') ? location.pathname.substring(1) : location.pathname;
var aURL = sURL.split('/');


var appendedValue = location.search;
var appendedValue = appendedValue.substring(appendedValue.indexOf("?")+1);
//appendedValue will be whatever is after the ?
var appendedValue = unescape(appendedValue);

//alert(appendedValue);
//theValue = theValue.substring(theValue.indexOf("=")+1)

/*URL Mining*/
function parseGetVars() {
	var getVars = new Array();
	var qString = unescape(top.location.search.substring(1));
if(qString!=''){
	var pairs = qString.split(/\&/);
		for (var i in pairs) {
			var nameVal = pairs[i].split(/\=/);
			getVars[nameVal[0]] = nameVal[1];
		} 
	}
	return getVars;
}
var g = parseGetVars();
//set a form field like this: 
//document.myForm.entryDate.value=g['entryDate'];


function visi(nr)//toggles visibility of an id: http://www.quirksmode.org/js/blockinvi.html
{
	if (document.layers)
	{
		vista = (document.layers[nr].visibility == 'hide') ? 'show' : 'hide'
		document.layers[nr].visibility = vista;
	}
	else if (document.all)
	{
		vista = (document.all[nr].style.visibility == 'hidden') ? 'visible'	: 'hidden';
		document.all[nr].style.visibility = vista;
	}
	else if (document.getElementById)
	{
		vista = (document.getElementById(nr).style.visibility == 'hidden') ? 'visible' : 'hidden';
		document.getElementById(nr).style.visibility = vista;

	}
}


function blocking(nr)//toggles display of an id: http://www.quirksmode.org/js/blockinvi.html
{
	if (document.layers)
	{
		current = (document.layers[nr].display == 'none') ? 'block' : 'none';
		document.layers[nr].display = current;
	}
	else if (document.all)
	{
		current = (document.all[nr].style.display == 'none') ? 'block' : 'none';
		document.all[nr].style.display = current;
	}
	else if (document.getElementById)
	{
		vista = (document.getElementById(nr).style.display == 'none') ? 'block' : 'none';
		document.getElementById(nr).style.display = vista;
	}
}



function openURL(baseURL,appendedURL){ 
	goURL= baseURL + "?"+ appendedURL;
	top.location.href = goURL; 
}



