//<!--- Javascript --->
function link_state(oriclass, selclass, tag, id){
	var allPageTags=document.getElementsByTagName(tag);
	for (i=0; i<allPageTags.length; i++) {  
		if (allPageTags[i].className==selclass) {
			allPageTags[i].className =oriclass;
		}  
	} 
	document.getElementById(id).className =selclass;
}
function link_state_lite(selclass, id){
	document.getElementById(id).className =selclass;
}

function showDiv_Custom(obj,obj2){ 
	var changediv=document.getElementById(obj); 

	if (changediv.style.display == "block"){ 
	changediv.style.display = "none";
	changetit.style.textDecoration = "none";
	
	} 
	else{ 
	changediv.style.display = "block";
	changetit.style.textDecoration = "underline";
	} 
} 

function cfm_myaction(u,m){
	if (confirm(m))
		self.location.href=u;
	}
	
function popwin_center(f,u,w,h,s,m,t){
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	p = "width=" + w + ",height=" + h +  ",scrollbars=" + s + ",menubar=" + m + ",toolbar=" + t + ",top=" + TopPosition + ",left=" + LeftPosition;
	cometwin = window.open(u,f,p);
	}
	
function chk_pw(fm,p1,p2){
	var result = true;
	var objForm = document.forms[fm];
	if (objForm.elements[p1].value.length <= 0){
		alert("Please enter a password and try again.");
		result = false;
		}
	else if (objForm.elements[p1].value.length < 6){
		alert("Please make sure the password is at least 6 characters long and try again.");
		result = false;
		}
	else if (objForm.elements[p2].value.length <= 0){
		alert("Please retype password and try again.");
		result = false;
		}
	else if (objForm.elements[p2].value.length < 6){
		alert("Please make sure the retype password is at least 6 characters long and try again.");
		result = false;
		}
	else if (objForm.elements[p2].value!=objForm.elements[p1].value){
		alert("Please make sure both passwords are the same and try again.");
		result = false;
		}
	return result;
	}

function logout(msg,purl,smsg){
	if (confirm(msg)){
		u = "index.cfm?do=logout&success_message=" + smsg + "&post_url=" + purl;;
		self.location.href = u;
		}
	}