// MOUSE OVER //
function MOverSubmit(button)
{
	document.all(button).className = 'button_mover';
}
function MOutSubmit(button)
{
	document.all(button).className = 'button_mout';
}

function MOverSubmitSmall(button)
{
	document.all(button).className = 'button_mover_small';
}
function MOutSubmitSmall(button)
{
	document.all(button).className = 'button_mout_small';
}

// Highlight text on MouseOver
function dhtmlHighlight(obj)
{
	var itm = document.getElementById(obj);
	itm.style.fontWeight = 700;
}

// Unhighlight text on MouseOver
function dhtmlUnhighlight(obj)
{
	var itm = document.getElementById(obj);
	itm.style.fontWeight = 400;
}

function rollover(imgID) {
    // get the image object we're referring to
    var thisimg = document.getElementById(imgID);
    // and add "_on" to its src
    thisimg.src = thisimg.src.replace(/(\.[a-z0-9]+)$/i,'_on$1');
}

function rollout(imgID) {
    // get the image object we're referring to
	var thisimg = document.getElementById(imgID);
    // and remove "_on" from its src
    thisimg.src = thisimg.src.replace(/_on(\.[a-z0-9]+)$/i,'$1');
}

// EMAIL VALIDATION //
function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert('Please enter a valid email address!')
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert('Please enter a valid email address!')
		   return false
		}
		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert('Please enter a valid email address!')
		    return false
		}
		if (str.indexOf(at,(lat+1))!=-1){
		    alert('Please enter a valid email address!')
		    return false
		}
		if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert('Please enter a valid email address!')
		    return false
		}
		if (str.indexOf(dot,(lat+2))==-1){
		    alert('Please enter a valid email address!')
		    return false
		}
		if (str.indexOf(" ")!=-1){
		    alert('Please enter a valid email address!')
		    return false
		}

 		return true					
	}


// RIGHT CLICK //
var message="Failte go dt" + unescape("%ED") + " an suiomh \n Welcome to our website";

///////////////////////////////////
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("alert(message);return false")
