nereidFadeObjects = new Object();
nereidFadeTimers = new Object();

function nereidFade(object, destOp, rate, delta){
if (!document.all)
return
    if (object != "[object]"){  
        setTimeout("nereidFade("+object+","+destOp+","+rate+","+delta+")",0);
        return;
    }
        
    clearTimeout(nereidFadeTimers[object.sourceIndex]);
    
    diff = destOp-object.filters.alpha.opacity;
    direction = 1;
    if (object.filters.alpha.opacity > destOp){
        direction = -1;
    }
    delta=Math.min(direction*diff,delta);
    object.filters.alpha.opacity+=direction*delta;
    if (object.filters.alpha.opacity != destOp){
        nereidFadeObjects[object.sourceIndex]=object;
        nereidFadeTimers[object.sourceIndex]=setTimeout("nereidFade(nereidFadeObjects["+object.sourceIndex+"],"+destOp+","+rate+","+delta+")",rate);
    }
}
function onlynum(eventObj, obj)
{
	var keyCode

	// Check For Browser Type
	if (document.all){ 
		keyCode=eventObj.keyCode
	}
	else{
		keyCode=eventObj.which
	}
	var str=obj.value
	if(keyCode!=0){
	if(keyCode!=8){
	if(keyCode==46){ 
			if (str.indexOf(".")>0){
				return false
			}
		}
	if(keyCode==46){ 
			if (str.indexOf(".")>0){
				return false
			}
		}
		if((keyCode<48 || keyCode >58)   &&   (keyCode != 46)){ // Allow only integers and decimal points
			return false
		}
	}}
	return true
}


function contactcheck(){
	if(contact.fname.value==""){
		alert ("Please enter the information for the \"First Name\" field." )
		contact.fname.focus();
		return false;
	}
	if(contact.lname.value==""){
		alert ("Please enter the information for the \"Last Name\" field." )
		contact.lname.focus();
		return false;
	}
	if(contact.email.value == ""){ 
		alert ("Please enter the information for the \"Email\" field." );
		contact.email.focus();   
		return false;
	}
    if ((contact.email.value.indexOf('@', 0) == -1) || (contact.email.value.indexOf('.') == -1)){ 
		alert ("Please fill in a correct email address" );    
		contact.email.focus();
		return false;
	}
	if(contact.phone.value==""){
		alert ("Please enter the information for the \"Phone\" field." );
		contact.phone.focus();
		return false;
	}
	if(contact.gender.value==""){
		alert ("Please choose the information for the \"Gender\" field." );
		contact.gender.focus();
		return false;
	}
	if(contact.postal.value==""){
		alert ("Please enter the information for the \"Postal\" field." );
		contact.postal.focus();
		return false;
	}
	if(contact.city.value==""){
		alert ("Please enter the information for the \"City\" field." );
		contact.city.focus();
		return false;
	}
}

function clubmembercheck(){
	var numericexpression=/^[0-9]+$/;
	if(members.title.value==""){
		alert ("Please enter the information for the \"Title\" field." )
		members.title.focus();
		return false;
	}
	if(members.fname.value==""){
		alert ("Please enter the information for the \"First Name\" field." )
		members.fname.focus();
		return false;
	}
	if(members.lname.value==""){
		alert ("Please enter the information for the \"Last Name\" field." )
		members.lname.focus();
		return false;
	}
	if(members.email.value == ""){ 
		alert ("Please enter the information for the \"Email\" field." )
		members.email.focus()   
		return false;
	}
    if ((members.email.value.indexOf('@', 0) == -1) || (members.email.value.indexOf('.') == -1)){ 
		alert ("Please fill in a correct email address" )  ;    
		members.email.focus()   
		return false;
	}
	if(members.country.value==""){
		alert ("Please enter the information for the \"Country\" field." )
		members.country.focus();
		return false;
	}
}

function subform1(idsub){
		document.getElementById(idsub).style.display= 'inline';
}
function subform2(idsub){
		document.getElementById(idsub).style.display= 'none';
}
function subform3(){
		empsubform.style.display= 'inline';
		pftime.style.display= 'inline';
		paidsubform.style.display= 'inline';
}
function subform4(){
		empsubform.style.display= 'none';
		pftime.style.display= 'none';
		paidsubform.style.display= 'none';
}
function subform5(){
		childsub.style.display= 'none';
		hwnamesubform.style.display= 'none';
		hwphonesubform.style.display= 'none';
}
function subform6(){
		childsub.style.display= 'inline';
		hwnamesubform.style.display= 'inline';
		hwphonesubform.style.display= 'inline';
}
function subform7(){
		childsub.style.display= 'inline';
		hwnamesubform.style.display= 'inline';
		hwphonesubform.style.display= 'none';
}
function subform8(){
		childsub.style.display= 'inline';
		hwnamesubform.style.display= 'inline';
		hwphonesubform.style.display= 'inline';
}
function careercheck(){
	if(career.fname.value==""){
		alert ("Please enter the information for the \"Full Name\" field." )
		career.fname.focus();
		return false;
	}
	if(career.lname.value==""){
		alert ("Please enter the information for the \"Full Name\" field." )
		career.lname.focus();
		return false;
	}
	if(career.email.value == ""){ 
		alert ("Please enter the information for the \"Email\" field." );
		career.email.focus();   
		return false;
	}
    if ((career.email.value.indexOf('@', 0) == -1) || (career.email.value.indexOf('.') == -1)){ 
		alert ("Please fill in a correct email address" );    
		career.email.focus();
		return false;
	}
	if(career.mobile.value==""){
		alert ("Please enter the information for the \"Phone\" field." );
		career.mobile.focus();
		return false;
	}
	
}
function changesubcol(idcol)
  {
  	if(idcol==1){
		document.getElementById("white").style.display='inline';
		document.getElementById("plschoose").style.display='none';
		document.getElementById("nosub").style.display='none';
	}
	if(idcol!=1 && idcol!='%'){
		document.getElementById("white").style.display='none';
		document.getElementById("plschoose").style.display='none';
		document.getElementById("nosub").style.display='inline';
	}
	if(idcol=='%'){
		document.getElementById("white").style.display='none';
		document.getElementById("plschoose").style.display='inline';
		document.getElementById("nosub").style.display='none';
	}
  }
function changesubcolprod(idcol)
  {
	document.getElementById("subcol").style.display='none';
  	if(idcol==1){
		document.getElementById("white").style.display='inline';
		document.getElementById("plschoose").style.display='none';
		document.getElementById("nosub").style.display='none';
	}
	if(idcol!=1 && idcol!='%'){
		document.getElementById("white").style.display='none';
		document.getElementById("plschoose").style.display='none';
		document.getElementById("nosub").style.display='inline';
	}
	if(idcol=='%'){
		document.getElementById("white").style.display='none';
		document.getElementById("plschoose").style.display='inline';
		document.getElementById("nosub").style.display='none';
	}
  }
function disableCtrlKeyCombination(e)
{
        //list all CTRL + key combinations you want to disable
        var forbiddenKeys = new Array('a', 'n', 'c', 'x', 'v', 'j');
        var key;
        var isCtrl;

        if(window.event)
        {
                key = window.event.keyCode;     //IE
                if(window.event.ctrlKey)
                        isCtrl = true;
                else
                        isCtrl = false;
        }
        else
        {
                key = e.which;     //firefox
                if(e.ctrlKey)
                        isCtrl = true;
                else
                        isCtrl = false;
        }

        //if ctrl is pressed check if other key is in forbidenKeys array
        if(isCtrl)
        {
                for(i=0; i<7; i++)
                {
                        //case-insensitive comparation
                        if(forbiddenKeys[i].toLowerCase() == String.fromCharCode(key).toLowerCase())
                        {
                                alert('Key combination CTRL + '
                                        +String.fromCharCode(key)
                                        +' has been disabled.');
                                return false;
                        }
                }
        }
        return true;
}
