	//
	function doSearch(theForm, defValue){
		if (theForm.query.value == '') {
			theForm.query.focus();
		} else if (theForm.query.value == defValue) {
			theForm.query.value = '';
			theForm.query.focus();
		} else {
			theForm.submit()
		}
	}
	
	function doBlink() {
		var blink = document.all.tags('BLINK');
		for (var i=0; i < blink.length; i++)
			blink[i].style.visibility = blink[i].style.visibility == '' ? 'hidden' : '' ;
	}
	
	function startBlink() {
		if (document.all)
			setInterval('doBlink()', 500);
	}

	
	
	function check_date(field)
	{
     	var checkstr = "0123456789";
     	var DateField = field;
     	var Datevalue = "";
     	var DateTemp = "";
     	var separator = "../index.html";
     	var day;
     	var month;
     	var year;
     	var leap = 0;
     	var i;
     
     	DateValue = DateField.value;
     	// del all the chars exception 0..9
     	for (i = 0; i < DateValue.length; i++) {
        	if (checkstr.indexOf(DateValue.substr(i,1)) >= 0) {
            	DateTemp = DateTemp + DateValue.substr(i,1);
        	}
     	}
     	DateValue = DateTemp;
     	// if the string is 8 digits length
     	if (DateValue.length != 8){
     		return false;
     	}
     	// testing the year
     	year = DateValue.substr(4,4);
     	if ((year == 0) || (year < 1000)) {
      		return false;
     	}
     	// month between 1..12
     	month = DateValue.substr(2,2);
     	if ((month < 1) || (month > 12)) {
      		return false;
     	}
     	// day >1
     	day = DateValue.substr(0,2);
     	if (day < 1) {
      		return false;
     	}
     	// february month for the bisextils years
     	if ((year % 4 == 0) || (year % 100 == 0) || (year % 400 == 0)) {
      		leap = 1;
     	}
     	if ((month == 2) && (leap == 1) && (day > 29)) {
      		return false;
     	}
     	if ((month == 2) && (leap != 1) && (day > 28)) {
      		return false;
     	}
     	// validation of the other months
     	if ((day > 31) && ((month == "01") || (month == "03") || (month == "05") || (month == "07") || (month == "08") || (month == "10") || (month == "12"))) {
      		return false;
     	}
     	if ((day > 30) && ((month == "04") || (month == "06") || (month == "09") || (month == "11"))) {
      		return false;
     	}
     	//
     	if ((day == 0) && (month == 0) && (year == 0000)) {
      		return false;
     	}
     	// re-write the field
     	DateField.value = day + separator + month + separator + year;

     	return true;
	}        
	
function check_email(field){
	var string = field.value;

   	if (string.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
        return true;
    else
        return false;
}

//only numbers or letters
function check_field(field) {	
	var string = field.value;

	if (string.search(/^\w+( \w+)?$/) != -1)
        return true;
    else
        return false;
}

//only numbers
function check_field_n(field) {
	var string = field.value;

	if (string.search(/^\d+$/) != -1)
        return true;
    else
        return false;
}

function showWnd(aLang, aFile, aTitle){
	window.open('popup415a.html?lang='+aLang+'&image='+aFile+'&title='+aTitle, '', 'height=600,width=800,toolbar=no,scrollbars=yes,menubar=no,resizable=yes,titlebar=no,screenX=50,screenY=50');
    return;
}

var g_i = 100;
var g_iID;
var g_arrImg = new Array();
g_arrImg[0] = "images/home3.jpg";
g_arrImg[1] = "images/home4.jpg";
//functions used for fading images and switching to other images - that is creating the effect of 
//switching betwen 2 images by fading away the first into the second one
function loadDiv(iActivate)
{
	if (document.all["filterDIV"] && document.all["imgAlpha"] && iActivate==1)
	{
		document.all["filterDIV"].width = document.all["imgAlpha"].width;
		g_iID = setInterval("setAlpha("+iActivate+");",(navigator.appName.indexOf("Netscape")>-1) ? 1000 : 10);
	}
}
function setAlpha(iActivate)
{
	if (navigator.appName.indexOf("Netscape")>-1)
	{
		document.all["imgAlpha"].src =  (document.all["imgAlpha"].src.indexOf(g_arrImg[1])>-1) ? g_arrImg[0] : g_arrImg[1];
	}
	else
	{
		document.all['filterDIV'].filters.item('alpha').opacity=g_i;
		g_i--;
		if (g_i==0)
		{
			clearInterval(g_iID);
			g_i=100;
			document.all["imgAlpha"].src =  (document.all["imgAlpha"].src.indexOf(g_arrImg[1])>-1) ? g_arrImg[0] : g_arrImg[1];
			loadDiv(iActivate);
		}
	}
}

