	var isW3C = (document.getElementById) ? true : false;
	
	function changeDate(id,val) {
	
		thisForm = document.forms.age_form[id];
		loadingFlag = true;
		if(val > 9){
			createObject('border_' + id +'_' + val,'images/age_gate/'+ id + '_' + val +'_on.gif');
		}else{
			createObject('border_' + id +'_' + val,'images/age_gate/'+ id +'_0'+val+'_on.gif');		
		}
		if (thisForm.value != ''){
			if(thisForm.value > 9){
				createObject('border_' + id +'_'+ thisForm.value +'_off','images/age_gate/'+ id +'_'+thisForm.value+'.gif');
			}else{
				createObject('border_' + id +'_'+ thisForm.value +'_off','images/age_gate/'+ id +'_0'+thisForm.value+'.gif');
			}
		}
		loadingFlag = false;
		
		if (val != thisForm.value) {
			changeImage(null,id + val,'border_' + id +'_' + val);
			if (thisForm.value != ''){
				changeImage(null,id + thisForm.value,'border_' + id +'_'+ thisForm.value +'_off');
			}
			thisForm.value = val;
		}
	}
	
	function roll_over(id,val) {
		thisForm = document.forms.age_form[id];
		loadingFlag = true;
		if(val > 9){
			createObject('border_' + id +'_' +val,'images/age_gate/'+ id + '_' + val +'_on.gif');
		}else{
			createObject('border_' + id +'_' +val,'images/age_gate/'+ id +'_0'+val+'_on.gif');		
		}
		loadingFlag = false;
		
		if (val != thisForm.value) { 
			//alert(thisForm.value);
			changeImage(null,id + val,'border_' + id +'_' +val);
		}
	}
	
	function roll_out(id,val) {
		thisForm = document.forms.age_form[id];
		loadingFlag = true;
		if(val > 9){
			createObject('border_' + id +'_'+ val +'_off','images/age_gate/'+ id +'_'+val+'.gif');
		}else{
			createObject('border_' + id +'_'+ val +'_off','images/age_gate/'+ id +'_0'+val+'.gif');
		}
		loadingFlag = false;
		
		if (val != thisForm.value) {
			changeImage(null,id + val,'border_' + id +'_'+ val +'_off');
		}
		
	}
	// MOUSEOVER IMAGE SWITCHING
	function changeImage(layer,imgName,imgObj) {
		if (isW3C) {
			document.getElementById(imgName).src = eval(imgObj+'.src');
		} else {
			document.images[imgName].src = eval(imgObj+'.src');
		}
	}    
	function createObject(imgName,imgSrc) {
		if (loadingFlag) {
			eval(imgName + ' = new Image()');
			eval(imgName + '.src = "' + imgSrc + '"');
			return imgName;
		}
	}