<!--//
//Various individual functions
var rndmImgs = new Array(
	"fade1",
	"fade2",
	"fade3",
	"fade4",
	"fade5",
	"fade6",
	"fade7"
);

var rndmImg = "#image";

function goBack(){ history.back(); }

function openWin(link,w,h,s,t,u,m,r)  {
/****************      SETTINGS      *******************
		'w' =	width
		'h' = 	height
		's' = 	scrollbars - 'yes' or 'no' 
		't' = 	toolbar - 0 / 1
		'u' = 	status - 'yes' or 'no'
		'm' = 	menubar - 0 / 1
		'r' = 	resizeable - 'yes' or 'no'
		
		eg: <a href="javascript:popup2('link[URL]','width[px]','height[px]','scroll[yes/no]','tools[1/0]','status[yes/no]','menu[0/1]','resize[yes/no]');">link item</a>
*******************************************************/
	sH = ((screen.availHeight - h) / 2);
	sW = ((screen.availWidth - w) / 2);
	dummy2=window.open(link,"newindow","address=yes, toolbar="+t+",status="+u+",menuBar="+m+",scrollbars="+s+",resizable="+r+",width="+w+",height="+h+",left="+sW+",top="+sH+"");
}

function closeWin(){
	close();	
}

function randomValue(rndmImgs){
   return rndmImgs[Math.round(Math.random()*(rndmImgs.length-1))];
}

$.fn.addRandomClass = function (rndmImgs){
	return this.addClass(randomValue(rndmImgs));
};
//Start JQuery
$(document).ready(function() {

	$(rndmImg).addRandomClass(rndmImgs);

//Erase the dotted line around links
	$('a').click( function() { this.blur(); });

	$('.styleswitch').click(function(){
		switchStylestyle(this.getAttribute("rel"));
		return false;
	});
//	var c = readCookie('style');
//	if (c) switchStylestyle(c);

}); ///jquery

//Start jValidation
$().ready(function() {
	// validate signup form on keyup and submit
	$("#casa-contact").validate({
		errorPlacement: function(error, element) {
			 	error.prependTo( element.parent() );
		},	 
		rules: {
			txtFirstname: "required",
			txtLastname: "required",
//			txtMessage: "required",
			txtEmail: {
				required: true,
				email: true
			},
//			numTelephone: "required",
			numAnswer: "required"
		},
		messages: {
			txtFirstname: 	"Inserite il nome",
			txtLastname: 	"Inserite il cognome",
//			txtMesage:		"Please enter your Enquiry and/or Reservation Dates",
			txtEmail: 		"Inserite l'indirizzo e-mail",
//			numTelephone:	"Inserite il numero di telefono",
			numAnswer:		"Rispondete alla domanda di matematica"
		}
	});
});
///jValidation
//-->
