function validate_general(form) {

if (form.title.value == "") {
	switch(form.i18n.value){
		case "en_US": 
			alert ("Please give your report a title!");
			break;
		case "gm_GM": 
		  	alert ("Bitte gebe eine Überschrift ein!");
			break;
	} 
  form.title.focus();
  return false;
} 
if (form.title.value.length < 10) {
	switch(form.i18n.value){
		case "en_US": 
			alert ("The title has to be at least 10 characters!");
			break;
		case "gm_GM": 
	  	 	alert ("Die Überschrift sollte mindestens 10 Zeichen lang sein.");
			break;
	} 
  form.title.focus();
  return false;
} 
if (form.introduction.value == "") {
	switch(form.i18n.value){
		case "en_US": 
			alert ("Please provide an introduction for this place!");
			break;
		case "gm_GM": 
	  	 	alert ("Du hast noch keinen Einleitungstext eingegeben.");
			break;
	}   
  form.introduction.focus();
  return false;
}
if (form.introduction.value.length < 150) {
	switch(form.i18n.value){
		case "en_US": 
			alert ("The introduction has to be at least 150 characters!");
			break;
		case "gm_GM": 
	  	 	alert ("Der Einleitungstext sollte mindestens 150 Zeichen lang sein.");
			break;
	} 
  form.introduction.focus();
  return false;
} 
if (form.introduction.value.length > 256) {
	switch(form.i18n.value){
		case "en_US": 
			alert ("The introduction is limited to 255 characters!");
			break;
		case "gm_GM": 
	  	 	alert ("Der Einleitungstext ist auf 255 Zeichen begrenzt.");
			break;
	} 
  form.introduction.focus();
  return false;
} 

if (form.general.value == "") {
	switch(form.i18n.value){
		case "en_US": 
			alert ("Please enter a general description for this place!");
			break;
		case "gm_GM": 
	  	 	alert ("Du hast noch keinen Einleitungstext eingegeben.");
			break;
	}   
  form.general.focus();
  return false;
}
if (form.general.value.length < 150) {
	switch(form.i18n.value){
		case "en_US": 
			alert ("The general description has to be at least 150 characters!");
			break;
		case "gm_GM": 
	  	 	alert ("Der Einleitungstext sollte mindestens 150 Zeichen lang sein.");
			break;
	} 
  form.general.focus();
  return false;
} 
if (form.general.value.length > 2001) {
	switch(form.i18n.value){
		case "en_US": 
			alert ("The general description is limited to 2000 characters!");
			break;
		case "gm_GM": 
	  	 	alert ("Der Einleitungstext ist auf 2000 Zeichen begrenzt.");
			break;
	} 
  form.general.focus();
  return false;
} 
if (form.v_spots.value == "") {
	switch(form.i18n.value){
		case "en_US": 
			alert ("What have been your favourite spots?");
			break;
		case "gm_GM": 
	  	 	alert ("Wo würdest Du noch einmal hingehen?\nBitte gebe Deine Lieblingsplätze an.");
			break;
	}   
  form.v_spots.focus();  
  return false;
}   
if (form.v_spots.value.length < 50) {
	switch(form.i18n.value){
		case "en_US": 
			alert ("The text on favourite spots has to be at least 50 characters!");
			break;
		case "gm_GM": 
	  	 	alert ("Der Text über Deine Lieblingsplätz sollte mindestens 50 Zeichen lang sein.");
			break;
	} 
  form.v_spots.focus();
  return false;
} 
if (form.v_spots.value.length > 1001) {
	switch(form.i18n.value){
		case "en_US": 
			alert ("The text on favourite spots is limited to 1000 characters!");
			break;
		case "gm_GM": 
	  	 	alert ("Der Text über Deine Lieblingsplätz sollte höchstens 1000 Zeichen lang sein.");
			break;
	} 
  form.v_spots.focus();
  return false;
} 
if (form.like_special.value == "") {
	switch(form.i18n.value){
		case "en_US": 
			alert ("Please tell us what you especialy liked");
			break;
		case "gm_GM": 
			alert ("Was hat Dir am besten gefallen?");
			break;
	}   
  form.like_special.focus();
  return false;
}  
if (form.like_special.value.length < 50) {
	switch(form.i18n.value){
		case "en_US": 
			alert ("The text \"what did you like special\" has to be at least 50 characters!");
			break;
		case "gm_GM": 
	  	 	alert ("Der Text über \"was hat Dir am besten gefallen\" sollte mindestens 50 Zeichen lang sein.");
			break;
	} 
  form.like_special.focus();
  return false;
} 
if (form.like_special.value.length > 1001) {
	switch(form.i18n.value){
		case "en_US": 
			alert ("The text \"what did you like special\" is limited to 1000 characters!");
			break;
		case "gm_GM": 
	  	 	alert ("Der Text über \"was hat Dir am besten gefallen\" sollte höchstens 1000 Zeichen lang sein.");
			break;
	} 
  form.like_special.focus();
  return false;
} 

// if everything is ok proceed the form

 return true;
}

function validate_recommendations(form) {
count = 0;

// count the fields
if (form.accommodations.value != "") count++ 
if (form.clubs.value != "") count++ 
if (form.pubs.value != "") count++ 
if (form.restaurants.value != "") count++ 
if (form.sights.value != "") count++ 
if (form.other.value != "") count++ 

if (count < 2) {
	switch(form.i18n.value){
		case "en_US": 
			alert ("Please fill out at least two fields!");
			break;
		case "gm_GM": 
	  	 	alert ("Bitte fülle mindestens zwei Felder aus!");
			break;
	}   
  return false;
} 
if (form.accommodations.value.length > 1001 || form.clubs.value.length > 1001 || form.pubs.value.length > 1001 || form.restaurants.value.length > 1001 || form.sights.value.length > 1001 || form.other.value.length > 1001) {
	switch(form.i18n.value){
		case "en_US": 
			alert ("Please limited each paragraph to 1000 characters!");
			break;
		case "gm_GM": 
	  	 	alert ("Der Text je Abschnitt ist auf 1000 Zeichen begrenzt.");
			break;
	} 
  return false;
} 
// if everything is ok proceed the form

 return true;
}


function validate_send_email(form) {
	// has to enter subject
	if (form.subject.value == "") {
		alert ("Please enter a subject!");
		form.subject.focus()
		return false;
	} 
	// has to enter message
	if (form.message.value == "") {
		alert ("Please enter your message!");
		form.message.focus()
		return false;
	} 	

	// if everything is ok proceed the form
	 return true;
}


//-------------------------------------------------------------------------------------------------------
// validate the delete form reports

function validate_deleteform(form){
  // validate radio button
  for (i=0; i<form.reason.length; i++) {
    if (form.reason[i].checked) {
      return true;
    }
  }
  
  // nothing checked
  alert ('Please check one of the reasons which tell the user why you did delete his report');
  return false
};
//-------------------------------------------------------------------------------------------------------

//-------------------------------------------------------------------------------------------------------
// validate sign guestbook
function validate_sign_g(form) {
if (form.title.value == "") {
  alert ("Please give your guestbook entry a title!");
  form.title.focus();
  return false;
} 
if (form.msg.value == "") {
  alert ("Please enter your message!");
  form.msg.focus();
  return false;
}
if (form.title.value.length < 5) {
  alert ("The title has to be at least 5 characters!");
  form.title.focus();
  return false;
} 
if (form.msg.value.length < 20) {
  alert ("The message has to be at least 20 characters!");
  form.msg.focus();
  return false;
}
}
//-------------------------------------------------------------------------------------------------------

// align images in reports
//-------------------------------------------------------------------------------------------------------
function go_align(host, report_id, type, align){
	window.location.href = host+'subapp_profiles/act_alter_report_image.php?action=align&report_id='+report_id+'&type='+type+'&align='+align
};
//-------------------------------------------------------------------------------------------------------

// align images in reports
//-------------------------------------------------------------------------------------------------------
function go_scale(host, report_id, type, scale){
	window.location.href = host+'subapp_profiles/act_alter_report_image.php?action=scale&report_id='+report_id+'&type='+type+'&scale='+scale
};
//-------------------------------------------------------------------------------------------------------

// sort pix in member gallery and show specific country
//-------------------------------------------------------------------------------------------------------
function go_sc(host, user_name, country, sort){
	//window.location.href = host+'profiles/3'+user_id+'1?cc='+country+'&so='+sort
	window.location.href = host+user_name+'/pictures_'+country+'_'+sort+'1.html'
};
//-------------------------------------------------------------------------------------------------------

// sort travel tips in member profile and show specific country
//-------------------------------------------------------------------------------------------------------
function go_sg(host, user_name, country, sort, object){
	//window.location.href = host+'profiles/3'+user_id+'1?cc='+country+'&so='+sort
	window.location.href = host+user_name+'/travel-tips_'+country+'_'+sort+'1.html?ob='+object
};
//-------------------------------------------------------------------------------------------------------

// guide info in profiles sort after country
//-------------------------------------------------------------------------------------------------------
function go_sc_guide(host, user_id, country, sort, object){
	window.location.href = host+'profiles/I'+user_id+'1?cc='+country+'&so='+sort+'&ob='+object
};
//-------------------------------------------------------------------------------------------------------

// validate create photo album
//-------------------------------------------------------------------------------------------------------
function  validate_cpa(form){;

if (form.album_title.value == "") {
  alert ("Please give your album a title!");
  form.album_title.focus();
  return false;
} 
if (form.album_title.value.length < 10) {
  alert ("The title has to be at least 10 characters!");
  form.album_title.focus();
  return false;
} 
if (form.album_intro.value == "") {
  alert ("Please enter a text as an introduction!");
  form.album_intro.focus();
  return false;
} 
if (form.album_intro.value.length < 50) {
  alert ("The introduction has to be at least 50 characters!");
  form.album_intro.focus();
  return false;
}  

// if everything is ok proceed the form

 return true;
}
//-------------------------------------------------------------------------------------------------------

// validate add travel log
//-------------------------------------------------------------------------------------------------------
function  validate_atl(form){;

if (form.travellog_title.value == "") {
  alert ("Please enter a title!");
  form.travellog_title.focus();
  return false;
} 
if (form.travellog_title.value.length < 10) {
  alert ("The title has to be at least 10 characters!");
  form.travellog_title.focus();
  return false;
} 
if (form.travellog_entry.value == "") {
  alert ("Please enter a text!");
  form.travellog_entry.focus();
  return false;
} 
if (form.travellog_entry.value.length < 10) {
  alert ("The entry has to be at least 10 characters!");
  form.travellog_entry.focus();
  return false;
}  

// if everything is ok proceed the form

 return true;
}
//-------------------------------------------------------------------------------------------------------