
/* function for opening popup window */
function openpopup(url,popup_name,height,width,other_properties)
{
	var left		= parseInt((screen.width-250)/2);
	var top			= parseInt((screen.height-200)/2)	
	var win_options = 'height=' + height + ',width=' + width + ',resizable=yes,' 
	+ 'scrollbars=yes,left=' + left + ',top=' + top;
//	alert(toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=600,height=500');
	window.open(url,popup_name,win_options);
//	window.open(url);
}


function simplePreload()

{ 

  var args = simplePreload.arguments;

  document.imageArray = new Array(args.length);

  for(var i=0; i<args.length; i++)

  {

    document.imageArray[i] = new Image;

    document.imageArray[i].src = args[i];

  }

}

function validateEmail(email)
{
	// a very simple email validation checking. 
	// you can add more complex email checking if it helps 
	var splitted = email.match("^(.+)@(.+)$");
	if(splitted == null) return false;
	if(splitted[1] != null )
	{
		var regexp_user=/^\"?[\w-_\.]*\"?$/;
		if(splitted[1].match(regexp_user) == null) return false;
	}
	if(splitted[2] != null)
	{
		var regexp_domain=/^[\w-\.]*\.[A-Za-z]{2,4}$/;
		if(splitted[2].match(regexp_domain) == null) 
		{
			var regexp_ip =/^\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\]$/;
			if(splitted[2].match(regexp_ip) == null) return false;
		}// if
		return true;
	}
	return false;
}

function EmptyThis(obj , val)
{
	if(val == 'Search here...')
	{
		obj.value = "";
	}
}
function FillThis(obj, val)
{
	if(val == '')
	{
		obj.value = "Search here...";
	}
}