var hwr4browser_detect	= (function x(){})[-5]=='x'?'FF3':(function x(){})[-6]=='x'?'FF2':/a/[-1]=='a'?'FF':'\v'=='v'?'IE':/a/.__proto__=='//'?'Saf':/s/.test(/a/.toString)?'Chr':/^function \(/.test([].sort)?'Op':'Unknown';

String.prototype.trim = function() {
	return this.replace(/^\s+|\s+$/g,"");
}


function showShader() {
	var shade			= document.getElementById('hwr4shade');
	var footer_region	= YAHOO.util.Dom.getRegion("hwr4footer");
	var all_region		= YAHOO.util.Dom.getRegion("hwr4all");

	shade.style.left	= footer_region.left;
	shade.style.top		= 0;
	shade.style.width	= "728px";
	shade.style.height	= footer_region.bottom-all_region.top;
	with(YAHOO.util.Dom) {
    	setStyle(shade, 'opacity', 0.5);
    	setStyle(shade, 'visibility', "visible");
	}
}

function hideShader() {
	var shade	= document.getElementById('hwr4shade');

	shade.style.left	= -9999;
	shade.style.top		= -9999;

	with(YAHOO.util.Dom) {
//    	setStyle(shade, 'opacity', 0);
//    	setStyle(shade, 'visibility', "hidden");
	}
}


function f_clientWidth() {
	return f_filterResults (
		window.innerWidth ? window.innerWidth : 0,
		document.documentElement ? document.documentElement.clientWidth : 0,
		document.body ? document.body.clientWidth : 0
	);
}
function f_clientHeight() {
	return f_filterResults (
		window.innerHeight ? window.innerHeight : 0,
		document.documentElement ? document.documentElement.clientHeight : 0,
		document.body ? document.body.clientHeight : 0
	);
}
function f_scrollLeft() {
	return f_filterResults (
		window.pageXOffset ? window.pageXOffset : 0,
		document.documentElement ? document.documentElement.scrollLeft : 0,
		document.body ? document.body.scrollLeft : 0
	);
}
function f_scrollTop() {
	return f_filterResults (
		window.pageYOffset ? window.pageYOffset : 0,
		document.documentElement ? document.documentElement.scrollTop : 0,
		document.body ? document.body.scrollTop : 0
	);
}
function f_filterResults(n_win, n_docel, n_body) {
	var n_result = n_win ? n_win : 0;
	if (n_docel && (!n_result || (n_result > n_docel)))
		n_result = n_docel;
	return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
}

function getOffsetToObject(obj, parentObjId) {
	var offset_sum = new Array(0, 0);
	var obj_parent = obj.offsetParent;

	while (obj_parent && parentObjId!=obj_parent.id) {
		offset_sum[0]+= obj_parent.offsetTop;
		offset_sum[1]+= obj_parent.offsetLeft;
		obj_parent = obj_parent.offsetParent
	}
	return offset_sum;
}
function validateEmail(elementValue){
   var emailPattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;
   return emailPattern.test(elementValue);
}