//----------------------|----------|
//|   GuardServer.net   |          |
//|---------------------|          |
//|                                |
//|  reliability is in charge...   |
//|                                |
//|   domain name administrator,   |
//|         hosting provider and   |
//|               web developer.   |
//|                                |
//| ------------------------------ |
//|   http://www.guardserver.net   |
//|      info@guardserver.net      |
//|--------------------------------|


function SlideIN(i)
{
	i.style.cssText = 'background-color:#ECE100; cursor:hand; color:#000000;';
}


function SlideOUT(i)
{
	i.style.cssText = '';
}


function PhotoPop(PicPoint)
{
	window.open('PhotoPop.asp?PicPoint='+PicPoint,'GaleriPop','toolbar=no,status=no,menubar=no,location=no,directories=no,resizable=yes,scrollbars=no,width=200,height=700,top=5,left=5');
}


function PhotoResize()
{
	var i=0;

	if (navigator.appName == 'Netscape')
	{
		i=40;
	}
	
	if (document.images[0])
	{
		window.resizeTo(document.images[0].width + 50, document.images[0].height + 140 - i);
		self.focus();
	}
}


function isValidEmail(emailAddress)	//GuardServer.net
{
	var emailRegExp = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	return (emailRegExp.test(emailAddress));
}


function mustBeNumaric(e)
{
	var whichCode = (window.Event) ? e.which : e.keyCode;

	if (whichCode == 13 || whichCode == 44 || whichCode == 45 || whichCode == 46)
		return true;  // enter, comma, hyphen, period

	if (whichCode > 57 )
		return false;

	if (whichCode < 48 && whichCode > 13)
		return false;
}


function PopTakvim(formName, formNo)
{
	var PopWidth = 210;
	var PopHeight = 240;
	var PopLeft = (window.screen.width - PopWidth) / 2;
	var PopTop = (window.screen.height - PopHeight) / 2;

	PopTakvimWin=window.open('PopTakvim.asp?formName='+formName+'&myURLday='+document.forms[formNo].myURLday.value+'&myURLmonth='+document.forms[formNo].myURLmonth.value+'&myURLyear='+document.forms[formNo].myURLyear.value,'PopTakvim','toolbar=no,status=no,menubar=no,location=no,directories=no,resizable=no,scrollbars=no,width=' + PopWidth + ',height=' + PopHeight + ',top=' + PopTop + ',left=' + PopLeft);
}


function CheckContact()
{
	if (document.Contact.ContactName.value.length<4)
	{
		alert("Please provide your Name.");
		document.Contact.ContactName.focus();
		return false;
	}
	else if (!isValidEmail(document.Contact.ContactMail.value))
	{
		alert("Please provide a valid E-mail address.");
		document.Contact.ContactMail.focus();
		return false;
	}
	else if (document.Contact.ContactText.value.length<10)
	{
		alert("Form can not be empty.");
		document.Contact.ContactText.select();
		return false;
	}
	else if (document.Contact.ContactText.value.length>1500)
	{
		alert("Text can not be longer than 1500 characters.");
		document.Contact.ContactText.focus();
		return false;
	}
	else
	{
		return true;
	}
}


function CheckBooking()
{
	if (document.Booking.BookingName.value.length<4)
	{
		alert("Please provide your Name.");
		document.Booking.BookingName.focus();
		return false;
	}
	else if (!isValidEmail(document.Booking.BookingMail.value))
	{
		alert("Please provide a valid E-mail address.");
		document.Booking.BookingMail.focus();
		return false;
	}
	if (document.Booking.myURLday.value<1 || document.Booking.myURLmonth.value<1 || document.Booking.myURLyear.value<2006)
	{
		alert("Please provide Flight Date.");
		document.Booking.myURLday.select();
		return false;
	}
	else if (document.Booking.BookingFlightNumber.value.length<2)
	{
		alert("Please provide Flight Number.");
		document.Booking.BookingFlightNumber.select();
		return false;
	}
	else if (document.Booking.BookingAirline.value.length<3)
	{
		alert("Please provide Airline Company.");
		document.Booking.BookingAirline.focus();
		return false;
	}
	else if (document.Booking.BookingPlace.value.length<3)
	{
		alert("Please provide End / Start Place for your journey.");
		document.Booking.BookingPlace.focus();
		return false;
	}
	else
	{
		return true;
	}
}
