//function for highlighting bullets
function hilite ( imgID, ObjName )
{
   document.images[imgID].src = eval( ObjName + ".src" )
}
//function for popup
function popup(strGlPage, strGlPageTitle, iWidth, iHeight) 
{	
	OpenWin = this.open(strGlPage, strGlPageTitle, "toolbar=no,menubar=no,location=no,scrollbars=yes,width=" + iWidth + ",height=" + iHeight)
}
//functions to change bgcolor on mouseover etc.
function button_over(eButton){
	eButton.style.backgroundColor = "#B5BDD6";
	eButton.style.borderColor = "darkblue darkblue darkblue darkblue";
}
function button_out(eButton){
	eButton.style.backgroundColor = "transparent";
	eButton.style.borderColor = "transparent";
}
function button_down(eButton){
	eButton.style.backgroundColor = "#8494B5";
	eButton.style.borderColor = "darkblue darkblue darkblue darkblue";
}
function button_up(eButton){
	eButton.style.backgroundColor = "#B5BDD6";
	eButton.style.borderColor = "darkblue darkblue darkblue darkblue";
	eButton = null; 
}
//fucntion to check to content of the submit form (contact > interactive)
function form_check(strLanguage){
	if (document.contact.name.value==""){
		switch(strLanguage){
			case 'en':	alert('Please fill in your name.');break;
			case 'fr':	alert('Veuillez compléter votre nom.');break;
			case 'nl':	alert('Gelieve uw naam in te vullen.');break;
		}
		document.contact.name.focus();
		return false
	}
	if (document.contact.fname.value==""){
		switch(strLanguage){
			case 'en':	alert('Please fill in your first name.');break;
			case 'fr':	alert('Veuillez compléter votre prénom.');break;
			case 'nl':	alert('Gelieve uw voornaam adres in te vullen.');break;
		}
		document.contact.fname.focus();
		return false
	}
	if (document.contact.email.value==""){
		switch(strLanguage){
			case 'en':	alert('Please fill in your email address.');break;
			case 'fr':	alert('Veuillez compléter votre addresse email.');break;
			case 'nl':	alert('Gelieve uw email adres in te vullen.');break;
		}
		document.contact.email.focus();
		return false
	}
	if (document.contact.tel.value==""){
		switch(strLanguage){
			case 'en':	alert('Please fill in your phone number.');break;
			case 'fr':	alert('Veuillez compléter votre numéro téléphonique.');break;
			case 'nl':	alert('Gelieve uw telefoon nummer in te vullen.');break;
		}
		document.contact.tel.focus();
		return false
	}
}
function form_search(strSearchString){
	location.href='/search/index.asp?searchstring=' + strSearchString;
}
function headersubmit(){
	var iChars = "0123456789";
	if ( (document.header.pubdd.value == "dd" && document.header.pubmm.value == "mm" && document.header.pubyyyy.value == "yyyy") || (document.header.pubdd.value == "" && document.header.pubmm.value == "" && document.header.pubyyyy.value == "") ) {
		//alert('do nothing')
	}
	else {
		var strInput = document.header.pubdd.value;
		if (strInput=="")
		{
			alert('Please fill in publication day.');
			document.header.pubdd.focus();
			return false
		}
		else
		{
			for (var i = 0; i < strInput.length; i++) {
				if (iChars.indexOf(strInput.charAt(i)) == -1) {
					alert('Illegal publication day.');
					document.header.pubdd.focus();
					return false
				}
			}
		}
	   	var strInput = document.header.pubmm.value;
		if (strInput=="")
		{
			alert('Please fill in publication month.');
			document.header.pubmm.focus();
			return false
		}
		else
		{
			for (var i = 0; i < strInput.length; i++) {
				if (iChars.indexOf(strInput.charAt(i)) == -1) {
					alert('Illegal publication month.');
					document.header.pubmm.focus();
					return false
				}
			}
		}
	   	var strInput = document.header.pubyyyy.value;
		if (strInput=="")
		{
			alert('Please fill in publication year.');
			document.header.pubyyyy.focus();
			return false
		}
		else
		{
			for (var i = 0; i < strInput.length; i++) {
				if (iChars.indexOf(strInput.charAt(i)) == -1) {
					alert('Illegal publication year.');
					document.header.pubyyyy.focus();
					return false
				}
			}
		}
	}
	if ( (document.header.expdd.value == "dd" && document.header.expmm.value == "mm" && document.header.expyyyy.value == "yyyy") || (document.header.expdd.value == "" && document.header.expmm.value == "" && document.header.expyyyy.value == "") ) {
		//alert('do nothing')
	}
	else {
		var strInput = document.header.expdd.value;
		if (strInput=="")
		{
			alert('Please fill in expiration day.');
			document.header.expdd.focus();
			return false
		}
		else
		{
			for (var i = 0; i < strInput.length; i++) {
				if (iChars.indexOf(strInput.charAt(i)) == -1) {
					alert('Illegal expiration day.');
					document.header.expdd.focus();
					return false
				}
			}
		}
	   	var strInput = document.header.expmm.value;
		if (strInput=="")
		{
			alert('Please fill in expiration month.');
			document.header.expmm.focus();
			return false
		}
		else
		{
			for (var i = 0; i < strInput.length; i++) {
				if (iChars.indexOf(strInput.charAt(i)) == -1) {
					alert('Illegal expiration month.');
					document.header.expmm.focus();
					return false
				}
			}
		}
	   	var strInput = document.header.expyyyy.value;
		if (strInput=="")
		{
			alert('Please fill in expiration year.');
			document.header.expyyyy.focus();
			return false
		}
		else
		{
			for (var i = 0; i < strInput.length; i++) {
				if (iChars.indexOf(strInput.charAt(i)) == -1) {
					alert('Illegal expiration year.');
					document.header.expyyyy.focus();
					return false
				}
			}
		}
	}
	document.header.submit();
}
function Reorder(eSelect, iCurrentField, numSelects, strLevel)
{
       var eForm = eSelect.form;
       var iNewOrder = eSelect.selectedIndex + 1;
       var iPrevOrder;
       var positions = new Array(numSelects);
       var ix;
       for (ix = 0; ix < numSelects; ix++)
       {
               positions[ix] = 0;
       }
       for (ix = 0; ix < numSelects; ix++)
       {
               positions[eval(eSelect.form[strLevel + ix]).selectedIndex] = 1;
       }
       for (ix = 0; ix < numSelects; ix++)
       {
               if (positions[ix] == 0)
               {
                       iPrevOrder = ix + 1;
                       break;
               }
       }
       if (iNewOrder != iPrevOrder)
       {
               var iInc = iNewOrder > iPrevOrder? -1:1
               var iMin = Math.min(iNewOrder, iPrevOrder);
               var iMax = Math.max(iNewOrder, iPrevOrder);
               for (var iField = 0; iField < numSelects; iField++)
               {
                       if (iField != iCurrentField)
                       {
                               if (eval(eSelect.form[strLevel + iField]).selectedIndex + 1 >= iMin && eval(eSelect.form[strLevel + iField]).selectedIndex + 1<= iMax)
                               {
                                       eval(eSelect.form[strLevel + iField]).selectedIndex += iInc;
                               }
                       }
               }
       }
}

