var gobj_regExpEmail;
var gobj_regExpPhone;
var gobj_regExpInteger;
var gobj_regExpImgFilename;
var gintarr_monthDays;
var GREGORYYEAR;


gobj_regExpEmail       = new RegExp ("^[a-zA-Z0-9._%-]+@[a-zA-Z0-9._%-]+\\.([a-zA-Z]{2,4}|museum|travel)$", "g");
gobj_regExpPhone       = new RegExp ("^\\+?[0-9]+$", "g");
gobj_regExpInteger     = new RegExp( "(^0$)|(^[+-]?[1-9][0-9]*$)", "g");
gobj_regExpImgFilename = new RegExp("(\\.jpg$)|(\\.jpeg$)|(\\.gif$)", "i");
gobj_regExpDate        = new RegExp ("^[0-9]{1,2}\\/[0-9]{1,2}\\/[0-9]{4}$", "g");

gintarr_monthDays = new Array(31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
GREGORYYEAR = 1582;




/***************** isLeap *****************
 It checks if a certain year is a leap one or not.
 It's depended on a correct integer input year.
 It returns true or false.
*/
function isLeap (int_year) {
//	int_year += 2000;


	if( int_year > -46 ) {
		// the leap year was introduced into the Julian calendar in 46 B.C.
		if( int_year < 8 ) {
			// after 46 B.C. and before 8 A.D. leap years were one of 3 years
			if( int_year<-8 && (0 == int_year%3) )
				return true;
			else
				// there weren't any leap years from 8 B.C. to 8 A.D.
				return false;
		}
		else {
			// after 7 A.D.
			if( 0 != int_year%4 )
				// the year could not be divided into 4 without a remainder
				return false;
			else {
				// the year could be divided into 4 without a remainder and it is after 7 A.D.
				if( int_year<GREGORYYEAR ) {
					return true;
				}
				else {
					if( (0 == int_year%100) && (0 != int_year%400) )
						// the year could be divided into 100 without a remainder but
						// it could not be divided into 400 without a remainder
						return false;
					else
						return true;
				}
			}
		}
	}
	else
		// there were not any leap years before 46 B.C.
		// and only God knows how many days their years had.
		return false;
}
