// JavaScript Document
function showMenu(elmnt,par){
document.getElementById(elmnt).style.visibility="visible";
YAHOO.util.Dom.replaceClass(par, 'menuItem', 'menuItemOn');
}
function hideMenu(elmnt,par){
document.getElementById(elmnt).style.visibility="hidden";
YAHOO.util.Dom.replaceClass(par, 'menuItemOn', 'menuItem');
}
function showSubMenu(elmnt,par){
document.getElementById(elmnt).style.visibility="visible";
YAHOO.util.Dom.replaceClass(par, 'menu', 'subMenuIn');
}
function hideSubMenu(elmnt,par){
document.getElementById(elmnt).style.visibility="hidden";
YAHOO.util.Dom.replaceClass(par, 'subMenuIn', 'menu');
}
function pageRender(){
YAHOO.util.Dom.setStyle('as', 'opacity', '.90');
YAHOO.util.Dom.setStyle('sub', 'opacity', '.90');
YAHOO.util.Dom.setStyle('pi', 'opacity', '.90');
YAHOO.util.Dom.setStyle('ls', 'opacity', '.90');
YAHOO.util.Dom.setStyle('ce', 'opacity', '.90');
YAHOO.util.Dom.setStyle('nm', 'opacity', '.90');
YAHOO.util.Dom.setStyle('cu', 'opacity', '.90');
YAHOO.util.Dom.setStyle('sub1', 'opacity', '.90');
YAHOO.util.Dom.setStyle('sub2', 'opacity', '.90');
YAHOO.util.Dom.setStyle('sub3', 'opacity', '.90');
return true;
}
window.onload =  function(){
	defaultTextboxes();	
}
function defaultTextboxes(){
	var inputs = document.getElementsByTagName('INPUT');
	for (var n=0; n< inputs.length; n++){
		if ((inputs[n].type.toLowerCase() == 'text')&&(inputs[n].title != '')){			
			inputs[n].value = inputs[n].title;
			inputs[n].onfocus = clearText;
			inputs[n].onblur = setText;
		}
	}
}
function clearText(){
	var defaultText = this.title;	
	if (this.value == defaultText){
		this.value = '';
		
		if (YAHOO.util.Dom.hasClass(this, 'password')){
			//fucking IE 
			var passinput = document.createElement('input');			
			var id = this.id;
			passinput.id = this.id;
			passinput.name = this.name;
			passinput.title = this.title;
			passinput.type = 'password';
			passinput.className = 'field password';
			var parent = this.parentNode;
			parent.replaceChild(passinput, this);
			passinput.onblur = setText;
			setTimeout('document.getElementById("'+id+'").focus();',10);
		}
	}
}
function setText(){
	var defaultText = this.title;
	if (this.value == ''){
		this.value = defaultText;
		if (YAHOO.util.Dom.hasClass(this, 'password')){
			var labelinput = document.createElement('input');
			labelinput.id = this.id;
			labelinput.name = this.name;
			labelinput.title = this.title;
			labelinput.value = defaultText;
			labelinput.className = 'field password';
			labelinput.type = 'text';
			var parent = this.parentNode;
			parent.replaceChild(labelinput, this);
			labelinput.onfocus = clearText;
		}
	}
}
function stripslashes(str) {
	if (str==null) return '';
	str=str.replace(/\\'/g,'\'');
	str=str.replace(/\\"/g,'"');
	str=str.replace(/\\\\/g,'\\');
	str=str.replace(/\\0/g,'\0');
	return str;
}
