//-------------------------------------------------------------

popTimer			= null;
popMsgTime		= 2000;

//-------------------------------------------------------------

function getPageSizeWithScroll(){
	if (window.innerHeight && window.scrollMaxY) {// Firefox
		yWithScroll = window.innerHeight + window.scrollMaxY;
		xWithScroll = window.innerWidth + window.scrollMaxX;
	}
	else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		yWithScroll = document.body.scrollHeight;
		xWithScroll = document.body.scrollWidth;
	}
	else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari
		yWithScroll = document.body.offsetHeight;
		xWithScroll = document.body.offsetWidth;
  }
	arrayPageSizeWithScroll = new Array(xWithScroll,yWithScroll);
	//alert( 'The height is ' + yWithScroll + ' and the width is ' + xWithScroll );
	return arrayPageSizeWithScroll;
}

//-------------------------------------------------------------

function showPopupMessage(msg){
	removePopupMessage();
	var dv = document.createElement("div");
			dv.id = "popupmessage";
			dv.className = "popupmessage";
			dv.innerHTML = "<span>"+ msg +"</span>";
	document.body.appendChild(dv);
	
	//roundPopupMessage();
	
	var pmsg = document.getElementById("popupmessage");
			pmsg.style.left = ((window.screen.availWidth/2)-(pmsg.clientWidth/2))+"px";
			
	dispTime = popMsgTime;
	if(arguments.length > 1){
		dispTime = parseFloat(arguments[1])*1000;
	}
	
	popTimer = setTimeout(removePopupMessage,dispTime);
}

//-------------------------------------------------------------

function roundPopupMessage(){
	new Rico.Effect.Round('div', 'popupmessage',{color:'fromElement', bgColor:'#ffffff', corners:'bottom'} );
}

//-------------------------------------------------------------

function removePopupMessage(){
	clearTimeout(popTimer);
	if(document.getElementById("popupmessage")){
		document.body.removeChild(document.getElementById("popupmessage"));
	}
}

//-------------------------------------------------------------
