addEvent(window, 'onload', forceFrames);

function forceFrames()
{
	var webAddress = window.location.protocol+'//'+window.location.hostname;
	var isIndex = (window.location.pathname == '/' || window.location.pathname == '/index.htm') ? true : false;

	if (isIndex)
	{
		if (window.location.search)
		{
			var page = window.location.search.substr(window.location.search.indexOf("?") + 1);
			if (page == window.location.pathname) { return ;}
			frames['content'].location.href = webAddress+page;
		}
	}
	else
	{
		if (window != top) { return ;}
		top.location.href = 'index.htm?'+window.location.pathname;
	}
}

function addEvent(oTarget, sType, fpDest) 
{
	var oOldEvent = oTarget[sType];
	if (typeof oOldEvent != "function") 
	{
		oTarget[sType] = fpDest;
	} 
	else if (sType == 'onsubmit')
	{
		oTarget[sType] = function(e) 
		{
			if (oOldEvent(e) === false) { return false;}
			return fpDest(e);
		}			
	}
	else 
	{
		oTarget[sType] = function(e) 
		{
			oOldEvent(e);
			fpDest(e);
		}
	}
}


if (window != top) top.location.href = location.href;


var message="Function Disabled!";
function clickIE() {if (document.all) {alert(message);return false;}}
function clickNS(e) {if 
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {alert(message);return false;}}}
if (document.layers) 
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}

document.oncontextmenu=new Function("return false")


function checkEmailAddress(field) {
	if (field.value != '' && !field.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,4}))$)\b/gi)) {
		alert('Please enter a valid e-mail address.');
		field.focus();
		field.select();
	}
}


var imgObj; 
function over(imgNum) { 
    if(menuReadyState) { 
        //find image object 
        imgObj = document.images["b"+imgNum]; 

        //find position of image 
        xPos = getRealLeft(imgObj); 
        yPos = getRealTop(imgObj); 

		yPos++;

        //activate menu with returned co-ordinates 
        activateMenu(imgNum,180,yPos); 
	} 
} 


