function printPage() {
	var printlink = document.getElementById("print");
	if(printlink) {
		printlink.onclick = function () {
			print();
			return false;
		}	
	}
}

function doChangeCountry(){
	this.document.countryform.submit();
}

function doChangeCountryPressZone(language, link, id) {
	window.location='/' + language + '/' + link + '?id=' + id + ',c_id=' + document.getElementById('countrySelect').value;
}

function doChangeCountryPressZoneSimple(language, link) {
	window.location='/' + language + '/' + link + '?c_id=' + document.getElementById('countrySelect').value;
}

function doChangeCategory(){
	this.document.categoryform.submit();
}


function doValidateRegistration(){
	var msg;
	msg = "";
	
	if (this.document.theform.csFirstName.value == ""){
		msg += "- First name\n";
	}
	if (this.document.theform.csLastName.value == ""){
		msg += "- Last name\n";
	}
	
	if (msg != ""){
		msg = "The following fields must be filled :\n" + msg;
		alert(msg);
		return false;
	}else{
		return true;
	}
}

function doValidateSponsor(){
	var msg;
	msg = "";
	
	if (this.document.theform.csFirstName.value == ""){
		msg += "- First name\n";
	}
	if (this.document.theform.csLastName.value == ""){
		msg += "- Last name\n";
	}
	
	if (msg != ""){
		msg = "The following fields must be filled :\n" + msg;
		alert(msg);
		return false;
	}else{
		return true;
	}
}


function doValidateContact(){
	var msg;
	msg = "";
	
	if (this.document.theform.csFirstName.value == ""){
		msg += "- First name\n";
	}
	if (this.document.theform.csLastName.value == ""){
		msg += "- Last name\n";
	}
	if (this.document.theform.csEmail.value == ""){
		msg += "- E-mail\n";
	}
	if (this.document.theform.chMessage.value == ""){
		msg += "- Message\n";
	}
	
	if (msg != ""){
		msg = "The following fields must be filled :\n" + msg;
		alert(msg);
		return false;
	}else{
		return true;
	}
}

function do_showSpecify(str) {
	var spec = document.getElementById("specifyactivity");
	if (spec) {
		if (str == "others") {
			spec.style.display = "block";
		}
		else {
			spec.style.display = "none";
		}
	}	
}

function doValidateNewsletter(form) {
	var msg = "";
	var error = 0;
	if (form.lastname.value.length == 0){
		error++;
		msg += "\n- Name";
	}
	if (form.gender.value.length == 0){
		error++;
		msg += "\n- Gender";
	}
	if (form.firm.value.length == 0){
		error++;
		msg += "\n- Company";
	}
	if (form.activity.value.length == 0){
		error++;
		msg += "\n- Activity";
	}
	if (form.activity.value.length > 0 && form.activity.value == "others"){
		if (form.activity2.value.length == 0) {
			error++;
			msg += "\n- Activity";
		}	
	}
	if (form.country.value.length == 0){
		error++;
		msg += "\n- Country";
	}
	if (form.thislang.value.length == 0){
		error++;
		msg += "\n- Language";
	}
	if (form.email.value.length == 0){
		error++;
		msg += "\n- Email";
	}
	if(error) {
		alert("Please fill out following fields: " + msg);
		return false;
	}
	return true ;
}

function doPrintPics(par){
	window.open("../printpics.dhtml?item=" + par,"printpics_popup","toolbar=1,location=1,directories=0,status=1,menubar=1,scrollbars=yes,width=600,height=300");
}

function find_item(item) {
	if( window.mmIsOpera){ 
		return(document.getElementById(item));
	}
	if (document.all){ 
		return(document.all[item]);
	}
	if (document.getElementById){ 
		return(document.getElementById(item));
	}
	return(false);
}

function doShowCountryList(){
	var a;
	a = find_item("countrynav");
	if (a != null) a.style.display="block";
}

function doHideCountryList(){
	var a;
	a = find_item("countrynav");
	if (a != null) a.style.display="none";
}

function doShowCats(id){
	var a;
	a = find_item("cat" + id);
	if (a != null) a.style.display="block";
}

function doHideCats(id){
	var a;
	a = find_item("cat" + id);
	if (a != null) a.style.display="none";
}