// STORE REQUIRED ACTIONS IN VARIABLE //

var W3CDOM = (document.getElementsByTagName);

function init() {

	// IF ACTIONS ARE NOT SUPPORTED STOP SCRIPT //
	if (!W3CDOM) return;

	// STORE ELEMENT IN VARIABLE //
	var nav = document.getElementById('bodywrapper');

	// STORE IMG TAGS WITHIN ELEMENT INTO AN ARRAY //
	var inputs = nav.getElementsByTagName('input');
	
	// FOR EACH INPUT TAG //
	for (var i=0;i<inputs.length;i++) {

		if(inputs[i].className != "submit") {

			// SET BEGINNING OPACITY FOR DIFFERENT BROWSERS //
			inputs[i].style.MozOpacity = (50 / 100);
			inputs[i].style.opacity = (50 / 100);
			inputs[i].style.KhtmlOpacity = (50 / 100);
			inputs[i].style.filter = "alpha(opacity=" + 50 + ")";

			inputs[i].onmouseover = overfunc;
			inputs[i].onmouseout = outfunc;
			inputs[i].onfocus = overfunc2;
			inputs[i].onblur = outfunc2;

		}

	}

	// STORE IMG TAGS WITHIN ELEMENT INTO AN ARRAY //
	var textareas = nav.getElementsByTagName('textarea');
	
	// FOR EACH INPUT TAG //
	for (var i=0;i<textareas.length;i++) {

		// SET BEGINNING OPACITY FOR DIFFERENT BROWSERS //
		textareas[i].style.MozOpacity = (50 / 100);
		textareas[i].style.opacity = (50 / 100);
		textareas[i].style.KhtmlOpacity = (50 / 100);
		textareas[i].style.filter = "alpha(opacity=" + 50 + ")";

		textareas[i].onmouseover = overfunc;
		textareas[i].onmouseout = outfunc;
		textareas[i].onfocus = overfunc2;
		textareas[i].onblur = outfunc2;

	}

	// STORE IMG TAGS WITHIN ELEMENT INTO AN ARRAY //
	var selects = nav.getElementsByTagName('select');
	
	// FOR EACH INPUT TAG //
	for (var i=0;i<selects.length;i++) {

		// SET BEGINNING OPACITY FOR DIFFERENT BROWSERS //
		selects[i].style.MozOpacity = (50 / 100);
		selects[i].style.opacity = (50 / 100);
		selects[i].style.KhtmlOpacity = (50 / 100);
		selects[i].style.filter = "alpha(opacity=" + 50 + ")";

		selects[i].onmouseover = overfunc;
		selects[i].onmouseout = outfunc;
		selects[i].onfocus = overfunc2;
		selects[i].onblur = outfunc2;

	}


}

function overfunc() {
	this.style.MozOpacity = (100 / 100);
	this.style.opacity = (99 / 100);
	this.style.KhtmlOpacity = (100 / 100);
	this.style.filter = "alpha(opacity=" + 100 + ")";	
}

function overfunc2() {
	this.id = "focused";
	this.style.MozOpacity = (100 / 100);
	this.style.opacity = (99 / 100);
	this.style.KhtmlOpacity = (100 / 100);
	this.style.filter = "alpha(opacity=" + 100 + ")";	
}

function outfunc() {
	if(this.id != "focused") {
		this.style.MozOpacity = (50 / 100);
		this.style.opacity = (50 / 100);
		this.style.KhtmlOpacity = (50 / 100);
		this.style.filter = "alpha(opacity=" + 50 + ")";	
	}
}

function outfunc2() {
	this.style.MozOpacity = (50 / 100);
	this.style.opacity = (50 / 100);
	this.style.KhtmlOpacity = (50 / 100);
	this.style.filter = "alpha(opacity=" + 50 + ")";	
}

function MM_openBrWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}
