var INIT_SZ, MAX, MIN;

// increases the size of the text
function enlarge(eid)	
{	
	INIT_SZ = 12;
	MAX = 20;
	MIN = 10;
	
	var x = document.getElementsByName(eid);	    
    var i=0;  
    var size=0; 
    
	for (i=0;i<x.length;i++) {	
		
		if (x[i].currentStyle) {
			var y = getStyle(eid,'fontSize',i);			
		}
		else if (window.getComputedStyle) {
			var y = getStyle(eid,'font-size',i);			
		}	
		size = parseInt(y);
		if (size < MAX) {
			x.item(i).style.fontSize = (size + 1) + "px";
		}
	}
}

// decreases the size of the text
function shrink(eid)
{	
	INIT_SZ = 12;
	MAX = 20;
	MIN = 10;
	
	var x = document.getElementsByName(eid);	    
    var i=0;  
    var size=0;   
    
	for (i=0;i<x.length;i++) {	
		
		if (x[i].currentStyle) {
			var y = getStyle(eid,'fontSize',i);			
		}
		else if (window.getComputedStyle) {
			var y = getStyle(eid,'font-size',i);			
		}			

		size = parseInt(y);
		if (size > MIN) {
			x.item(i).style.fontSize = (size - 1) + "px";
		}		
	}	
}

// returns the value of the text-style that is searched for
// the first if tests for internet explorer, the else if tests for mozilla and other browsers
function getStyle(el,styleProp,i)
{	
	var x = document.getElementsByName(el);
	if (x[i].currentStyle)
		var y = x[i].currentStyle[styleProp];
	else if (window.getComputedStyle)
		var y = document.defaultView.getComputedStyle(x[i],null).getPropertyValue(styleProp);
	return y;
}

function validateContact() {
	
	var name = document.contact_form.name;
	var email = document.contact_form.email;
	var verify_email = document.contact_form.verify_email;
	var subject = document.contact_form.subject;
	var message = document.contact_form.message;
	
	if (name.value == "") {
		alert ("Error: Please fill in your Name.");
		name.focus();
		return false;
	}
	
	if (email.value == "") {
		alert ("Error: Please fill in your Email.");
		email.focus();
		return false;
	}
	
	if (verify_email.value == "") {
		alert ("Error: Please Verify your Email.");
		verify_email.focus();
		return false;
	}
	
	if (subject.value == "") {
		alert ("Error: Please fill in the Subject.");
		subject.focus();
		return false;
	}
	
	if (message.value == "") {
		alert ("Error: Please fill in your Message.");
		message.focus();
		return false;
	}
	
	if (email.value != verify_email.value) {
		alert ("Error: Please make sure you verify your Email Address and that they are correct.");
		verify_email.focus();
		return false;
	}
	
	return true;		
}
