//------------------------------------------------------
function strTrim(tmpStr)
{
	tmpStr = tmpStr.replace(/^\s+/,"");//remove leading
	tmpStr = tmpStr.replace(/\s+$/,"");//remove trailing
	return tmpStr;
}
//------------------------------------------------------
function trimFields()
{
	for(var i=0; i < obj.elements.length; i++)
	{
		if(obj.elements[i].type == "text" || obj.elements[i].type == "textarea" || obj.elements[i].type == "password")
		{
			obj.elements[i].value = strTrim(obj.elements[i].value);
		}
	}
}
//------------------------------------------------------
function chkEmail(tmpStr)
{
	var email_pat = /^[a-z][a-z0-9_\.\-]*[a-z0-9]@[a-z0-9]+[a-z0-9\.\-_]*\.[a-z]+$/i;
	return(email_pat.test(tmpStr));
}
//Checks URL against pattern
function chkURL(tmpStr)
{
	var url_pat = /^(http|https|ftp):\/\/([\w-]+\.)+[\w-]+(\/[\w-\.\/?%&amp;,=#@\/:]*)?/;
	return(url_pat.test(tmpStr));
}
//------------------------------------------------------
function refreshCaptcha(imgid)
{
	var img = new Image();
	img.src = 'captcha/show_captcha.php?hash='+parseInt(Math.random() * 10000000000);
	document.getElementById(imgid).src = img.src;
}
function NewWindow(pageName)
{
	window.open(pageName, '', 'width=920,height=650,toolbar=0,menubar=1,scrollbars=1,location=0,left=25,top=25');
}

function NewWindow1(pageName, width, height)
{
	window.open(pageName, '', 'width='+width+',height='+height+',toolbar=0,menubar=1,scrollbars=1,location=0,left=25,top=25');
}

/*function footerRotator() {
	//Set the opacity of all images to 0
	$('div.raves_img ul li').css({opacity: 0.0});

	//Get the first image and display it (gets set to full opacity)
	$('div.raves_img ul li:first').css({opacity: 1.0}, 1000, function(){
		temp = $(this).attr('rel');
		arrTemp = temp.split('|');
		$('#lnk_more').attr('href', arrTemp[1]);
		$('#lnk_continue').attr('href', 'client_raves/'+arrTemp[0]+'/'+encodeURI(arrTemp[2])+'.html');
		});

	//Call the rotator function to run the slideshow, 6000 = change to next image after 6 seconds
	setInterval('footerRotate()', 5000);


}

function footerRotate() {
	//Get the first image
	var current = ($('div.raves_img ul li.show')?  $('div.raves_img ul li.show') : $('div.raves_img ul li:first'));

	//Get next image, when it reaches the end, rotate it back to the first image
	var next = ((current.next().length) ? ((current.next().hasClass('show')) ? $('div.raves_img ul li:first') :current.next()) : $('div.raves_img ul li:first'));

	//Set the fade in effect for the next image, the show class has higher z-index
	next.css({opacity: 0.0})
	.addClass('show')
	.animate({opacity: 1.0}, 1000, function(){
		temp = $(this).attr('rel');
		arrTemp = temp.split('|');
		$('#lnk_more').attr('href', arrTemp[1]);
		$('#lnk_continue').attr('href', 'client_raves/'+arrTemp[0]+'/'+encodeURI(arrTemp[2])+'.html');
		});

	//Hide the current image
	current.animate({opacity: 0.0}, 1000)
	.removeClass('show');

};

$(document).ready(function() {
	//Load the slideshow
	footerRotator();
});*/