// DDi Solutions JavaScript Document
<!--
var isIE, isNav
if (parseInt(navigator.appVersion) >= 4) {
	if (navigator.appName == "Netscape") {
		isNav = true
	} else {
		isIE = true
	}
}
/** 
*	Re-defines the getElementById tag
*/
var $
if (!window.$)
{
	//var $ = new function (){
		$ = function(name){
			if (document.getElementById) return document.getElementById(name);
			else if (document.all) return document.all[name];
			else if (document.layers) return getEleNN4(document,name); /*document.layers[name];*/
			else return false;
		}
	//}
}
/**
*	Scroll the page to the specified coords...
*/
function bodyScroll() {var f=document.forms[0]; /*if (f.ScrollTop!=null) f.ScrollTop.value=Body.scrollTop;*/}
/**
*	Get the specified element with the style attribute.
*	Code originally from http://www.quirksmode.org and modified.
*	See http://www.xs4all.nl/~ppk/js/index.html?dhtmloptions.html
*/
function getEle(name)
{
	if (document.getElementById) this.obj = document.getElementById(name);
	else if (document.all) this.obj = document.all[name];
	else if (document.layers) 
	{
		this.obj = getEleNN4(document,name);
		this.style = this.obj;
	}
	
	if (this.obj && !document.layers) this.style = this.obj.style;
}

function getEleNN4(obj,name)
{
	var x = obj.layers;
	var thereturn;
	for (var i=0;i<x.length;i++)
	{
		if (x[i].id == name)
		 	thereturn = x[i];
		else if (x[i].layers.length)
			var tmp = getObjNN4(x[i],name);
		if (tmp) thereturn = tmp;
	}
	return thereturn;
}
/**
*	Get the window size
*/
function getSize( oFrame ) 
{
	if( !oFrame ) { oFrame = window; } var myWidth = 0, myHeight = 0;
	if( typeof( oFrame.innerWidth ) == 'number' ) { myWidth = oFrame.innerWidth; myHeight = oFrame.innerHeight; }
	else if( oFrame.document.documentElement && ( oFrame.document.documentElement.clientWidth || oFrame.document.documentElement.clientHeight ) ) {
		myWidth = oFrame.document.documentElement.clientWidth; myHeight = oFrame.document.documentElement.clientHeight; }
	else if( oFrame.document.body && ( oFrame.document.body.clientWidth || oFrame.document.body.clientHeight ) ) {
		myWidth = oFrame.document.body.clientWidth; myHeight = oFrame.document.body.clientHeight; }
	return [myWidth,myHeight];
}
/**
*	Open a popup window
*/
function openWin(url, w, h, centre)
{
	var c = getSize();
	var opt = "";
	opt += "'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width="+w+",height="+h;
	opt += ",left="+(centre && c ? ((c[0,0]-w)/2) : 50)+",top="+(centre && c ? ((c[0,1]-h)/2) : 50);
	opt += "'";
	var win = window.open(url, "",opt);
	if ( win ) win.focus();
}
/**
*	Attach an event
*/
function addEvent(obj, evType, fn)
{
	if (obj.addEventListener)
	{
   		obj.addEventListener(evType, fn, false);
   		return true;
	}
	else if (obj.attachEvent)
	{
   		var r = obj.attachEvent("on"+evType, fn);
   		return r;
 	}
 	else
 	{
   		return false;
 	}
}
/**
*	Detach an event
*/
function removeEvent(obj, evType, fn)
{
	if (obj.addEventListener)
	{
		obj.removeEventListener(evType, fn, false);
   		return true;
	}
	else if (obj.attachEvent)
	{
		var r = obj.detachEvent('on'+evType, fn);
   		return r;
 	}
 	else
 	{
   		return false;
 	}
}
function submitHandler(e)
{
	//alert("Correct Submit Handler");
	if (e && e.preventDefault)
		e.preventDefault();
	return false;
}
/**
*	Attach the enter key event when the control gets focus.
*/
//function attachEnterEvent(){document.onkeydown = doEnterKey;}
/**
*	Detach the enter key event when the control loses focus.
*/
//function detachEnterEvent(){document.onkeydown = null;}
/**
*	Execute the click event when the enter key is pressed.
* 	The method is used like so:
*		onkeydown="javascript: return doEnterKey(event, 'buttonClientID');"
*
*
*
*/
function doEnterKey(e, ele)
{
	var code;
	// e gives access to the event in all browsers
	if (!e) var e = window.event;
	// This stops all propagation of the event in the bubbling phase.
	e.cancelBubble = true;
	if (e.stopPropagation) e.stopPropagation();
	
	// Determine which key was pressed.
	if (e.keyCode) code = e.keyCode;
	else if (e.which) code = e.which;
	//alert(code);
	var subButton = $(ele);
	if (code == 13 && subButton)
	{
		//alert(subButton.id);
		// 
		if (e && e.returnValue) e.returnValue = false;
		else if (e && e.preventDefault) e.preventDefault();	
		// HACK: Remove the form submissions (Submit) event handler. In FireFox
		// the form will always submit if there is more than one button
		// on the form. We need to add an event handler for the form OnSubmit
		// event to be thrown away until we determine the key pressed here.
		if (isNav) removeEvent(document.forms[0], "submit", submitHandler);
		subButton.click();		
		e.returnValue = false;
		if (e.preventDefault) e.preventDefault();
		return false;
	}
	return true;
}
/**
*	Describe the tabs and panels for the tab interface/control.
*/
//var ti_tabs = new Array();
//var ti_panels = new Array();
var _defaultTabPanel = "regForm_Registration_DefaultItem";
/**
*	Show/Hide tabs.
*/
function ShowHideTabs(tabs, panels, panel, hidden) 
{ 
	var e = $(hidden);
	e.value = panel; 
	/*document.getElementById*/
	if (tabs != null && panels != null) { 		
		for (var i = 0; i < panels.length; i++) {
			if (panels[i] != panel) {
				$(panels[i]).style.display = 'none';
				$(tabs[i]).parentNode.className = '';
			} 
			else { 				
				$(panels[i]).style.display = 'block';
				$(tabs[i]).parentNode.className = 'selected';
			}
		}
	} 
}
//-->