
//*---* Include the iBox script

document.write("<script type=\"text/javascript\" src=\"/conferences/UOCC_CONFERENCE_TEMPLATE/registration/scripts/ibox/ibox.js\"></scr" + "ipt>");
//document.write("<script type=\"text/javascript\">iBox.setPath('/conferences/UOCC_CONFERENCE_TEMPLATE/registration/scripts/ibox/');</scr" + "ipt>");




function addLoadEvent(func)
{
/*
	var oldonload = window.onload;

	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			if (oldonload) {
				oldonload();
			}
			func();
		}
	}
*/
	if (window.attachEvent)
		window.attachEvent("onload", func);
	else if (window.addEventListener)
		window.addEventListener("load", func, false);
	else
		document.addEventListener("load", func, false);
}



//*-----------------------------------------------------------------------------
//		PAGE HEIGHT + WIDTH
//*-----------------------------------------------------------------------------

var pageHeight;
var pageWidth;

function getPageSize()
{
	if (window.innerHeight && window.scrollMaxY)
	{
		pageWidth = window.innerWidth + window.scrollMaxX;
		pageHeight = window.innerHeight + window.scrollMaxY;
	}
	else if (document.body.scrollHeight > document.body.offsetHeight)
	{
		pageWidth = document.body.scrollWidth;
		pageHeight = document.body.scrollHeight;
	}
	else
	{
		pageWidth = document.body.offsetWidth + document.body.offsetLeft;
		pageHeight = document.body.offsetHeight + document.body.offsetTop;
	}
}


function getElementsByClass(searchClass,node,tag) {
	var classElements = new Array();

	if ( node == null )
		node = document;

	if ( tag == null )
		tag = '*';

	var els = node.getElementsByTagName(tag);
	var elsLen = els.length;
	var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");

	for (i = 0, j = 0; i < elsLen; i++) {
		if ( pattern.test(els[i].className) ) {
			classElements[j] = els[i];
			j++;
		}
	}

	return classElements;
}








function openWin(value)
{
	window.open(value,'popup','resizable=no,width=700,height=500,status=no,location=no,toolbar=no,menubar=no,scrollbars=yes');
}




//*-----------------------------------------------------------------------------
//		MAILTO LINKS
//*-----------------------------------------------------------------------------

function m(n,d,s,txt)
{
	if (txt == null)
		document.write('\74'+'a safe href="mail'+'to\72'+n+'\100'+d+'\56'+s+'">'+n+'\100'+d+'\56'+s+'\74'+'/a'+'\76');
	else
		document.write('\74'+'a safe href="mail'+'to\72'+n+'\100'+d+'\56'+s+'">'+txt+'\74'+'/a'+'\76');
}


//*-----------------------------------------------------------------------------
//		STRIP SPACES (FROM BEGINNING AND END)
//*-----------------------------------------------------------------------------

function trim(e)
{
	// get the object the event was called on
	var targ = (e.target) ? e.target : e.srcElement;

	// get the value of that field
	test = targ.value;

	// reset the value of the object
	targ.value = test.replace(/^\s+|\s+$/g, "");
}


//*-----------------------------------------------------------------------------
//		CLEAR SELECTIONS ON RADIO BUTTONS OR DROP DOWNS
//*-----------------------------------------------------------------------------

function clearSelections(name)
{
	var obj = document.thisForm[name];
	if (obj.options)
	{
		for (i = 0; i < obj.options.length; i++)
			obj.options[i].selected = false;
	}
	else
	{
		for (i = 0; i < obj.length; i++)
			obj[i].checked = false;
	}
}


//*-----------------------------------------------------------------------------
//		EXPAND OR COLLAPSE AN ELEMENT
//*-----------------------------------------------------------------------------

function show(id)
{
	// show the element
	document.getElementById(id).style.display = "block";
}


function hide(id)
{
	// hide the element
	document.getElementById(id).style.display = "none";
}


function expand() {
	for (var i=0; i<expand.arguments.length; i++) {
		var element = document.getElementById(expand.arguments[i]);

		//show the element
		//element.style.display = "block";
		element.style.display = "";

		//enable everything inside
		enableChildren(expand.arguments[i]);
	}

	if(typeof validatorResize == 'function')
		validatorResize();
}


function collapse()
{
	for (var i=0; i<collapse.arguments.length; i++) {
		var element = document.getElementById(collapse.arguments[i]);

		//hide the element
		element.style.display = "none";

		//disable everything inside
		disableChildren(collapse.arguments[i]);
	}

	if(typeof validatorResize == 'function')
		validatorResize();
}


//*-----------------------------------------------------------------------------
//		UNCHECK ELEMENTS WITHIN AN 'ID' ON A PAGE
//*-----------------------------------------------------------------------------


function getChildren(id)
{
	// mark the parent node
	var object = document.getElementById(id);
	var parent = (object != null) ? object : id;

	// get everything inside it. everything.
	return parent.getElementsByTagName('*');
}


function disableChildren(id)
{
	var children = getChildren(id);

	//loop through and uncheck things
	for (var i=0; i<children.length; i++) {

		//now disable it (if it has a type it must be an input field)
		if(children[i].type)
			children[i].disabled = true;

		if(children[i].name && document.getElementById(children[i].name))
			document.getElementById(children[i].name).style.display = "none";
	}
}


function enableChildren(id)
{
	var children = getChildren(id);

	// loop through and uncheck things
	for (var i=0; i<children.length; i++) {
		children[i].disabled = false;

		if(children[i].name && document.getElementById(children[i].name))
			document.getElementById(children[i].name).style.display = "";
	}
}


/*
function unCheck(obj)
{
	if (obj.type == "checkbox" || obj.type == "radio")
		obj.checked = false;

	if (obj.type == "text")
		obj.value = "";

	if (obj.type == "select-one" || obj.type == "select-multiple")
		for (j=0; j<obj.length; j++)
			obj.options[j].selected = false;
}
*/


