function confirmation(msg) {
	if (!msg)
		return true;
	return confirm(msg);
}
//calculates view port width and height
function getViewPortSize() {
	var viewPortWidth;
	var viewPortHeight;
 
	// the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
	if(typeof window.innerWidth != 'undefined') {
		viewPortWidth = window.innerWidth,
		viewPortHeight = window.innerHeight
	}
	// IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)
	else if(typeof document.documentElement != 'undefined'
				&& typeof document.documentElement.clientWidth != 'undefined'
				&& document.documentElement.clientWidth != 0) {
		viewPortWidth = document.documentElement.clientWidth,
		viewPortHeight = document.documentElement.clientHeight
	}
	// older versions of IE
	else {
		viewPortWidth = document.getElementsByTagName('body')[0].clientWidth,
		viewPortHeight = document.getElementsByTagName('body')[0].clientHeight
	}
	
	return { width: viewPortWidth, height: viewPortHeight }
}
//calculates absolute position of element oElement
function getAbsoluteY( oElement ) {
	var iReturnValue = 0;
	while(oElement != null) {
		iReturnValue += oElement.offsetTop;
		oElement = oElement.offsetParent;
	}
	
	return iReturnValue;
}
function addParams(url, keyArray, valArray) {
	var idx = url.indexOf("?");
	var p=[];
	
	for(var t=0; t<keyArray.length; t++) {
		p.push(keyArray[t]+"="+escape(valArray[t]));
	}
	
	if(idx==-1) {
		url += "?";
	} else {
		url += "&";
	}	
	
	return url+p.join('&');
}

function submit_rate_form(Rate,CanRate,RateMsg){
	if(CanRate==''){
		alert(RateMsg);
		return;
	}
	if(!document.forms['rate_form']){
		alert(document.forms);
		return;
	}
	document.forms['rate_form'].rate.value = Rate;
	document.forms['rate_form'].submit();
}
