/* Declare a namespace for the site */
var Site = window.Site || {};

/* Create a closure to maintain scope of the '$'
   and remain compatible with other frameworks.  */
(function($) {
	
	//same as $(document).ready();
	$(function() {
		if($('#quoteRequest').length != 0){
			 $("input[type=file]").filestyle({ 
			     image: "templates/default/img/browse.png",
			     imageheight : 22, imagewidth : 79, width : 220
			 });
		}
		if (!Modernizr.csscolumns) {
			$('.column2').multilists({ cols: 2 });
		}

	});


	$(window).bind("load", function() {
		
	
	});
	
})(jQuery);

function validator() {
	//First we check for errors.
	var flag = 0;
	var errors = "";
	//If a name is not specified, show an error
	if (document.frm.name.value=="") {    
		flag++;
		errors = errors + "Name\n";
	}
	//Check if email is a valid E-mail id.
	var id = document.frm.email.value;
	//The regular expression for a valid e-mail address
	var re = /^.+\@.+\..{2,4}$/gi; 
	if(!id.match(re)) { //If it is NOT a match
		flag++;
		errors = errors + "E-Mail\n";
	}
	//Dispay an error message if there was any error
	if(flag > 0) {
		alert("Errors were found in these elements.\n"+
			errors+"\nPlease re-enter these elements.");
		return 0; //Exit the function if error is there
	}
	
	
}

