




var modalId = "";
var modalContent = "";

//Overlay height calculation
function createOverlay() {
	var yWithScroll, xWithScroll;
	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.documentElement.clientHeight;
		xWithScroll = document.documentElement.clientWidth;
  	}
	
	$('modal_outer_nl').setStyle({
		height: yWithScroll+"px"
	});
}

function setModalContent() {
	if(modalContent == "") {
		modalContent = $('modal_content').innerHTML;	//Rewrite modalContent
	} else {
		$('modal_content').update(modalContent);
		$('modal_content').innerHTML;	//On new open, use rewrited content (on close modal_content is deleted)
	}
}

function prepareFlashObj(name, width, height) {
	responseTemplate = '<object width="600" height="450" id="myFlashMovie">'+
						'<param name="allowfullscreen" value="true" />'+
						'<param name="allowscriptaccess" value="always" />'+
						'<param name="movie" value="'+name+'" />'+
						'<embed name="myFlashMovie" src="'+name+'" '+
						'	type="application/x-shockwave-flash" '+
						'	allowfullscreen="true" '+
						'	allowscriptaccess="always" '+
						'	width="'+width+'" '+
						'	height="'+height+'">'+
						'</embed>'+
						'</object>';

	return responseTemplate;
}

