
/**
clears default form field value
*/
function clearDefaultandCSS(el) {
	if (!el.defaultValue) {
		el.defaultValue = el.value;
	}
	if (el.defaultValue == el.value) {
		el.value = "";
	}
	// If Dynamic Style is supported, clear the style
	removeClass(el, "patternFormFieldDefaultColor"); /* removeClass is included in TwistyContrib/twist.js */
}
function setDefaultText(el) {
	if (el.value == "" && el.defaultValue) el.value = el.defaultValue;
	addClass(el, "patternFormFieldDefaultColor");
}

function containsDOM(container,containee){var isParent=false;do{if((isParent=container==containee))
break;containee=containee.parentNode;}
while(containee!=null);return isParent;}
function checkMouseLeave(element,evt){evt=(evt)?evt:((window.event)?window.event:"");window.status=evt;if(evt.relatedTarget){return!containsDOM(element,evt.relatedTarget);}else{if(element.contains(evt.toElement)){return(false);}else{return(true);}}
}

function ShowHideDropdown(i){
	nav=document.getElementById('dropdown_'+i).style;
	con=document.getElementById('dropdown_'+i);
	if(nav.display=='none'){
		nav.display='block';
		con.onmouseout=function(evt){
			if(checkMouseLeave(this,evt)){
				nav=document.getElementById('dropdown_'+i).style;
				nav.display='none';
			}
		}
	}else{
		nav.display='none';
		con.onmouseout=function(evt){
			if(checkMouseLeave(this,evt)){

				nav=document.getElementById('dropdown_'+i).style;
				nav.display='none';
			}
		}
	}	
	
}

function showHide(divID){
if (document.getElementById(divID).style.display!="none"){
	 document.getElementById(divID).style.display="none";
 }
 else{
	  document.getElementById(divID).style.display="block";

  }
}

function ShowHide(divID){
if (document.getElementById(divID).style.display!="none"){
	 document.getElementById(divID).style.display="none";
 }
 else{
	  document.getElementById(divID).style.display="block";

  }
}

function HideLeftBar(){
message=''
		+'<style>'
		+'.leftbarHeader{display:none;}'
		+'.leftbarBody{display:none;}'
		+'.leftbarFooter{display:none;}'
		+'.dragHeader{display:none;}'
		+'.dragBody{display:none;}'
		+'.dragFooter{display:none;}'
		+'</style>'
	 document.getElementById('helpCode').innerHTML=message;		

	}
	
function SetList(ListName,SelectedValue){
var list = document.getElementById(ListName);
for (intI=0; intI<list.options.length;intI++) {
  if (list.options[intI].text == SelectedValue ) {
    list.options[intI].selected = true;
}}}


function SetTextarea(inValue) {
	document.getElementById(inValue).value = RemoveBrakes(document.getElementById(inValue).value)	
}

function RemoveBrakes(inValue){
	var sIn = inValue;
	var sOut = "";
    
	sOut=sIn.replace(/<br \/>/g,"\n");

return sOut;
	
	}

