function AddFav() {
if (document.all)
window.external.AddFavorite('http://www.seagullsbay.gr', 'Seagulls Bay');
else if (window.sidebar)
window.sidebar.addPanel('Seagulls Bay', 'http://www.seagullsbay.gr', "");
}

function AddFav_en() {
if (document.all)
window.external.AddFavorite('http://www.seagullsbay.gr/index_en.php', 'Mandra Paleopolion');
else if (window.sidebar)
window.sidebar.addPanel('Mandra Paleopolion', 'http://www.seagullsbay.gr/index_en.php', "");
}

// ------------------------------------------------------------------

function TellFriend() {
	window.open("tellfriend.php","Win","height=250,width=300,location=no,menubar=no,statusbar=no");		
}

function TellFriend_en() {
	window.open("tellfriend_en.php","Win","height=250,width=300,location=no,menubar=no,statusbar=no");		
}
// ------------------------------------------------------------------

function ShowPic() {
NewWin=window.open("map.php","PicWindow","height=450,width=460,location=no,menubar=no,statusbar=no");
NewWin.opener = window;
}

function ShowPic_en() {
NewWin=window.open("map_en.php","PicWindow","height=450,width=460,location=no,menubar=no,statusbar=no");
NewWin.opener = window;
}
// ------------------------------------------------------------------


function ShowPic2(PRODID) {
NewWin=window.open("showall.php?prodid="+PRODID,"PicWindow","height=700,width=700,location=no,menubar=no,statusbar=yes");
NewWin.opener = window;
}

function ShowPic2_en(PRODID) {
NewWin=window.open("showall_en.php?prodid="+PRODID,"PicWindow","height=700,width=700,location=no,menubar=no,statusbar=yes");
NewWin.opener = window;
}
// ------------------------------------------------------------------

function Search() {
if (document.form1.keyword.value == '') {
	alert('Εισάγετε λέξη κλειδί για αναζήτηση!');
}
else {
	document.form1.submit();
}
}

// ------------------------------------------------------------------

function Search_en() {
if (document.form1.keyword.value == '') {
	alert('Fill in a keyword!');
}
else {
	document.form1.submit();
}
}

function Validate() {
if (document.form1.email1.value == '' || document.form1.email2.value == '' || document.form1.comments.value == '' ) {
	alert('Συμπληρώστε όλα τα πεδία!');	
}
else {
	document.form1.submit();
}	
}

function Validate_en() {
if (document.form1.email1.value == '' || document.form1.email2.value == '' || document.form1.comments.value == '' ) {
	alert('Fill in all the fields!');	
}
else {
	document.form1.submit();
}	
}

// ------------------------------------------------------------------

function Contact() {
if (document.frm.fname.value == '' || document.frm.lname.value == '' || document.frm.tel.value == '' || document.frm.email.value == ''
	|| document.frm.country.value == '' ) {
	alert('Παρακαλούμε συμπληρώστε όλα τα πεδία!');	
}
else {
	document.frm.submit();
}	
}

function Contact_en() {
if (document.frm.fname.value == '' || document.frm.lname.value == '' || document.frm.tel.value == '' || document.frm.email.value == ''
	|| document.frm.country.value == '' ) {
	alert('please fill in all required fields!');	
}
else {
	document.frm.submit();
}	
}

// ------------------------------------------------------------------

function IsValidMail( str )
	{
		var	found = 0,
			nm = 0,
			ps = 0;

		for ( var i = 0; i < str.length - 1; i++ )	{
			if ( str.charAt( i ) == "@" )	{
				found++;
				ps = i;
				break;
 			}
 			if ( str.charAt( i ) == " " && nm )
	 			return ( false );
 			if ( !found && str.charAt( i ) != " " )
 				nm++;
		}
		if ( ( !nm ) || ( !found ) )
			return ( false );
		nm = 0;
		found = 0;

		for ( var i = ++ps; i < str.length - 1; i++ )	{
			if ( str.charAt( i ) == " " )
				return ( false );
			if ( str.charAt( i ) == "@" )
				return ( false );
			if ( str.charAt( i ) == "." )	{
				found++;
				break;
 			}
			nm++;
		}
		if ( nm && found )
			return ( true );
		return ( false );
	}	

	function checkEmail( aField )
	{
		if ( aField.value != "" )
			if ( !IsValidMail( aField.value ) ) {
				alert( "Το Email σας δεν είναι έγκυρο..." );
				aField.focus();
			}
	}

	function checkEmail_en( aField )
	{
		if ( aField.value != "" )
			if ( !IsValidMail( aField.value ) ) {
				alert( "Your Email is not valid..." );
				aField.focus();
			}
	}

// ------------------------------------------------------------------

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
