function send_email() {
	if(document.frm_send.email_to.value==""){document.frm_send.email_to.focus();alert("Please enter a destination address");return false;}
	if(document.frm_send.email.value==""){document.frm_send.email.focus();alert("Please enter a destination address");return false;}
	if(document.frm_send.message.value==""){document.frm_send.message.focus();alert("Please enter a message");return false;}
	return true;
}

function validpostevent() {
	if(document.frm.titre.value==""){document.frm.titre.focus();alert("Please enter a event title");return false;}
	if(document.frm.organizer.value==""){document.frm.organizer.focus();alert("Please enter an organizer");return false;}
	if(document.frm.datedebut.value==""){document.frm.datedebut.focus();alert("Please select a begin date");return false;}
	if(document.frm.datefin.value==""){document.frm.datefin.focus();alert("Please enter an end date");return false;}
	if(document.frm.description.value==""){document.frm.description.focus();alert("Please enter an event description");return false;}
	if(document.frm.contact_1.value==""){document.frm.contact_1.focus();alert("Please enter a contact name");return false;}
	if(document.frm.contact_address.value==""){document.frm.contact_address.focus();alert("Please enter an address");return false;}
	if(document.frm.contact_city.value==""){document.frm.contact_city.focus();alert("Please enter a city");return false;}
	if(document.frm.contact_stateprov.value==""){document.frm.contact_stateprov.focus();alert("Please enter a state/province");return false;}
	if(document.frm.contact_zip.value==""){document.frm.contact_zip.focus();alert("Please enter a zip code");return false;}
	if(document.frm.contact_country.value==""){document.frm.contact_country.focus();alert("Please enter a country");return false;}
	if(document.frm.contact_email.value==""){document.frm.contact_email.focus();alert("Please enter an email");return false;}
	if(document.frm.contact_phone.value==""){document.frm.contact_phone.focus();alert("Please enter a phone number");return false;}
	return true;
}

function searchee() {
	if(document.top_search.keyword.value==""){document.top_search.keyword.focus();alert("Please enter a keyword");return false;}
	tmpkey = document.top_search.keyword.value
	longueur = tmpkey.length
	if(longueur <=2){document.top_search.keyword.focus();alert("Please, enter more than 2 characteres");return false}		
}

function adv_search() {
	if(document.frm_search.keyword.value==""){document.frm_search.keyword.focus();alert("Please enter a keyword");return false;}
	tmpkey = document.frm_search.keyword.value
	longueur = tmpkey.length
	if(longueur <=2){document.frm_search.keyword.focus();alert("Please, enter more than 2 characteres");return false}		
}

function goadsearchee() {
	document.location.href='/?page=search&a=1&keyword='+document.top_search.keyword.value;
}

var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',status=no'
win = window.open(mypage,myname,settings)
}

function hideshow(obj) { 
	if (parseInt(navigator.appVersion) >= 5 || navigator.appVersion.indexOf["MSIE 5"] != -1) {
		if (obj.style.display=="none") 
			obj.style.display="";
		else
			obj.style.display="none";
	}
}

function opacite(obj, opacity, notDisplay) {
	obj.style.filter = "alpha(opacity:"+opacity+")";
	obj.style.KHTMLOpacity = opacity/100;
	obj.style.MozOpacity = opacity/100;
	obj.style.opacity = opacity/100;
	if(notDisplay)
		obj.style.display = "none";
};

function countText(countField, maxLen) {
	var charCount;
	charCount = countField.value.length;
	while(charCount > maxLen) {
		countField.value = countField.value.substring(0, maxLen);
		charCount = countField.value.length;
	}
	document.getElementById('leftcar').innerHTML = (maxLen - charCount);
}

function mostread(days) {
	showcontent('li=1&d='+days, '/home/most_read.asp', 'most_read'); return false;
}

