function toggleFormFieldContent( FormFieldObj, Action, DefaultText ){

	if( Action == "on" ){
		if( FormFieldObj.value.trim() == DefaultText.trim() )
			FormFieldObj.value = "";
	}
	else{
		if( FormFieldObj.value.trim() == "" )
			FormFieldObj.value = DefaultText;
	}
}

function popupWindow( Page, Width, Height ){
	popWindow = window.open( Page,"","width="+(Width*1+18)+",height="+(Height*1+18)+",scrollbars=no,left="+((screen.width-Width)/2)+",top="+((screen.height-Height)/2)).focus();
}

function embedFlash(File, Width, Height ) {
	document.write('<embed src="'+File+'" quality="high" width="'+Width+'" height="'+Height+'" name="myflash" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
}

function setImgSrc( ImgObj, Filename ){
	if( !ImgObj ) return false;
	ImgObj.src = Filename;
}

function limitTextarea( Textarea, MaxLimit ) {
	if (Textarea.value.length > MaxLimit) {
		Textarea.value = Textarea.value.substring(0, MaxLimit);
	}
}

function showHideChangePassword(){
	
	if(document.getElementById("change_password_hidden").style.display == "none"){
		document.getElementById("change_password_hidden").style.display = "block";
		document.updateprofileform.change_password.value = 1;
	}
	else{
		document.getElementById("change_password_hidden").style.display = "none";
		document.updateprofileform.change_password.value = 0;
	}
	
}
