var xmlHttp

function showHint1(str)
{
if (str.length==0)
  { 
  document.getElementById("txtHint").innerHTML="";
  return;
  }
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url=str;

url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
} 

function stateChanged() 
{ 
if (xmlHttp.readyState==4)
{ 
document.getElementById("txtHint").innerHTML=xmlHttp.responseText;
$("a[rel='album']").colorbox();

}
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}


function send_mail(){
	var name    = document.project_mail.name.value;
	var email   = document.project_mail.address.value;
	var phone   = document.project_mail.number.value;
	var message = document.project_mail.message.value;
	
	if(name=="" || phone=="" || email=="" || message=="")
	{
		window.alert("please fill in all the required fields");
		return false;
	}
	else if(name=="enter your name" || phone=="enter your phone number" || email=="enter your email address" || message=="enter your message")
		{
		window.alert("please fill in all the required fields");
		return false;
		}
		
		else{
		document.project_mail.submit();
		return true;
		}
		
}

function send_email(){
	var name    = document.investment.name.value;
	var email   = document.investment.email.value;
	var phone   = document.investment.phone.value;
	var message = document.investment.message.value;
	
	if(name=="" || phone=="" || email=="" || message=="")
	{
		window.alert("please fill in all the required fields");
		return false;
	}
	else if(name=="enter your name" || phone=="enter your phone number" || email=="enter your email address" || message=="enter your message")
		{
		window.alert("please fill in all the required fields");
		return false;
		}
		
		else{
		document.investment.submit();
		return true;
		}
		
}


function join_mail(){
	
	validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;
	var email = document.join_news.email.value;
	
	if (email.search(validRegExp) == -1) 
   {
      alert('A valid e-mail address is required.\nPlease try again.');
      return false;
    }
 else {
    document.join_news.submit();
		return true;
}
}


function isValidEmail(){
  validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;
	var email = document.join_news.email.value
   // search email text for regular exp matches
    if (email.search(validRegExp) == -1) 
   {
      alert('A valid e-mail address is required.\nPlease amend and retry');
      return false;
    }
 else {
    document.join_news.submit();
}
}


function isValidEmail3(){
  validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;
	var email = document.contact_us.email.value
   // search email text for regular exp matches
    if (email.search(validRegExp) == -1) 
   {
      alert('A valid e-mail address is required.\nPlease amend and retry');
      return false;
    }
 else {
    document.contact_us.submit();
}
}


function isValidEmail2(){
  validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;
	var email = document.MailingList.email.value
   // search email text for regular exp matches
    if (email.search(validRegExp) == -1) 
   {
      alert('A valid e-mail address is required.\nPlease amend and retry');
      return false;
    }
 else {
    document.MailingList.submit();
}
}

function search1(){
var search = document.search_form.search.value;
if(search=="" || search=="search")
{
window.alert("Search box cannot be empty!")
return false;
}
else{
document.search_form.submit();
return true;
}
}
