<!--//
//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
	$('#bluConnect').validate({
		errorPlacement: function(error, element) {
			 	error.prependTo( element.parent() );
		},	 
		rules: {
			txtName: {
				required: true
			},
			txtEmail: {
				required: true,
				email: true
			},
			txtEmailChk: {
					required: "#txtEmail:filled",
					equalTo: "#txtEmail"
			},
			numMobile: {
					required: true
			},
			numPhone: {
					required: "#optPrefPhone:selected"
			},
			memoMsg: {
				required: true,
//				maxLength: 400,
				maxWords: 201 //Need to add one more to the count than actually needed as the script checks for spaces; think about it!
			},
			numAnswer: "required"
		},
		messages: {
			txtName: 			"Please enter your Full Name",
			txtEmail: 			"Please enter a valid Email Address",
			txtEmailChk: {
				required: 		"Please provide the same Valid Email Address",
				equalTo: 		"Please enter the same Valid Email Address as above "
			},
			numMobile:			"Please enter your Mobile Number",
			numPhone:			"Please enter your Phone Number",
			memoMsg: {
				required: 		"Please leave a message",
				maxWords: 		"Your message must use<br />no more than 200 words"
			},
			numAnswer:			"Please answer the spam control question"
		}
	});
});
///jValidation
//-->
