function foto_window(src)
{
	window.open('../site/foto.php?src=' +src,'mywin','left=20,top=20,width=810,height=610,toolbar=0,resizable=0,scrollbars=0');
}


function validate_contact_form($lang)
{
  
  document.getElementById("error_mess").innerHTML = "<div class='error_text'></div>";
  var email = document.getElementById("email").value; 
  
  var mess = document.getElementById("message").value;
  
  if ((email=="")||(mess==""))
  {
    if ($lang=="ro")
    {
      
      
    document.getElementById("error_mess").innerHTML += "<div class='error_text'>Completati toate campurile obligatorii, dupa care apasati Trimite!</div>";
    }
    else
    {
      
      document.getElementById("error_mess").innerHTML += "<div class='error_text'>Fill all the mandatory fields, and then press Send!</div>";
    }
    
    return false;
  }
  
  var patt_for_email = new RegExp(".+@.+\\.[a-z]+");
    
  if (!patt_for_email.test(email))
  {
    if ($lang=="ro")
    {
      
      document.getElementById("error_mess").innerHTML += "<div class='error_text'>Adresa de email pe care ati introdus-o nu este valida! Va rugam modificati!</div>";
    }
    else
    {
      
      document.getElementById("error_mess").innerHTML += "<div class='error_text'>The email address you filled is not correct. Please modify it!</div>";
    }
      
    return false;
  }
  
  return true;
}


//----- rotate images functions ------
function adArray()
{
	for (i=0; i<adArray.arguments.length; i++)
	{
		this[i] = new Object();
		this[i].src = adArray.arguments[i];
	}
	this.length = i;
}

function getAdNum(ads)
{
	dat = new Date();
	dat = (dat.getTime()+"").charAt(8);
	if (dat.length == 1)
		ad_num = dat%ads.length;
	else
		ad_num = 0;

	return ad_num;
}

function rotateImg()
{
	if (document.images)
	{
		ad_num = (ad_num+1)%ads.length;
		document.js_ad.src = ads[ad_num].src;
		setTimeout("rotateImg()", 2500);
	}
}