// OBJECT EMBED
function embedObject(obj){
	document.write(obj);
}

// VISIT & GO
function visit(url){
	document.location.href = url;
}

function go(path){
	location.href = siteRoot + "/section/" + path;
}

// WINDOW STATUS
function setStatus(string){
 	window.status = string;
}

// REFRESH PARENT
function refreshParent(){
	window.opener.location.href = window.opener.location.href;
}

// IMAGE POSITION
var tempEl;
function getRealLeft(imgElem){
	if(ns4){
		xPos=imgElem.x;
	}else if(!exclude){
		xPos=eval(imgElem).offsetLeft;
		tempEl=eval(imgElem).offsetParent;
		while(tempEl!=null){
			xPos+=tempEl.offsetLeft;
			tempEl=tempEl.offsetParent;
		}
	}
	if(is_ie && is_mac){
		xPos+=parseInt(document.body.leftMargin);
	}
	return xPos;
};

function getRealTop(imgElem){
	if(ns4){
		yPos=imgElem.y;
	}else if(!exclude){
		yPos=eval(imgElem).offsetTop;
		tempEl=eval(imgElem).offsetParent;
		while(tempEl!=null){
			yPos+=tempEl.offsetTop;
			tempEl=tempEl.offsetParent;
		}
	}
	if(is_ie && is_mac){
		yPos+=parseInt(document.body.topMargin);
	}
	return yPos;
};

// OPEN WINDOW
var newWindow
function openWindow(width, height, url, childName){
	var childFeatures = ""
	childFeatures += "width=" + width + ","
	childFeatures += "height=" + height + ","
	childFeatures += "directories=0,"
	childFeatures += "menubar=0,"
	childFeatures += "resizable=0,"
	childFeatures += "scrollbars=0,"
	childFeatures += "status=0,"
	childFeatures += "toolbar=0,"
	childFeatures += "alwaysLowered=0,"
	childFeatures += "alwaysRaised=0,"
	childFeatures += "channelmode=0,"
	childFeatures += "dependent=1,"
	childFeatures += "fullscreen=0,"
	childFeatures += "hotkeys=1,"
	childFeatures += "location=0,"
	childFeatures += "titlebar=0,"
	childFeatures += "z-lock=0,"

	if(!newWindow || newWindow.closed){
		newWindow = window.open(url, childName, childFeatures)
		if(!newWindow.opener){
			newWindow.opener = window
		}
	}else{
		newWindow = window.open(url, childName, childFeatures)
		newWindow.focus()
	}
	return true
}

// OPEN SCROLL WINDOW
var newWindow
function openScrollWindow(width, height, url, childName){
	var childFeatures = ""
	childFeatures += "width=" + width + ","
	childFeatures += "height=" + height + ","
	childFeatures += "directories=0,"
	childFeatures += "menubar=0,"
	childFeatures += "resizable=1,"
	childFeatures += "scrollbars=1,"
	childFeatures += "status=0,"
	childFeatures += "toolbar=0,"
	childFeatures += "alwaysLowered=0,"
	childFeatures += "alwaysRaised=0,"
	childFeatures += "channelmode=0,"
	childFeatures += "dependent=1,"
	childFeatures += "fullscreen=0,"
	childFeatures += "hotkeys=1,"
	childFeatures += "location=0,"
	childFeatures += "titlebar=0,"
	childFeatures += "z-lock=0,"

	if(!newWindow || newWindow.closed){
		newWindow = window.open(url, childName, childFeatures)
		if(!newWindow.opener){
			newWindow.opener = window
		}
	}else{
		newWindow = window.open(url, childName, childFeatures)
		newWindow.focus()
	}
	return true
}

// CLONE EMAIL ADDRESS
function email(name, email){
	document.location.href = "mailto:"+name+"<"+email+">?subject=Site Email";
}

// SUBMITS FORM ONENTER
function submitEnter(myfield,e){
	var keycode;
	if (window.event) keycode = window.event.keyCode;
	else if (e) keycode = e.which;
	else return true;

	if (keycode == 13)
	   {
	   myfield.form.submit();
	   return false;
	   }
	else
	   return true;
}
