var Revtimer,Revloadflag=0;
function Revresize(){
	
	var arrayPageSize = getPageSize();
	
	document.getElementById("Revbox2").style.height= arrayPageSize[3] + 'px';
	document.getElementById("Revbox2").style.width =arrayPageSize[2] + 'px';
	
	
	
	Revtimer = setTimeout("Revresize()", 250);
}
function RevInitPos(){
	var arrayPageSize = getPageSize();
	var arrayPageScroll = getPageScroll();
	
	document.getElementById("Revbox2").style.top =arrayPageScroll[1]+20+"px";
	document.getElementById("Revbox").style.height = arrayPageSize[1] + 'px';
	document.getElementById("Revbox").style.width  = arrayPageSize[0] + 'px';
	
}
function Revopen(id){
	
	var tag='<IFRAME src="http://app.mcnt.jp/?country=JP&id='+id+'" width=100% height=100% scrolling=AUTO frameborder=0 marginwidth=5 marginheight=2></IFRAME>';
	
	if(Revloadflag){
		RevInitPos();
		Revresize();
		document.getElementById("Revbox_top").innerHTML="&nbsp;App Users Review"+' <IMG SRC="http://app.mcnt.jp/img/exit.png" border=0 title=exit id=Revbox_exit>';
		document.getElementById("Revbox_tag").innerHTML=tag;
		document.getElementById("Revbox2").style.visibility="visible";
		document.getElementById("Revbox").style.visibility="visible";
	}else{
		setTimeout("Revopen('"+tag+"','"+title+"');", 300);
	}
	return false;
}
function Revclose(){
clearTimeout(Revtimer);
document.getElementById("Revbox2").style.visibility=document.getElementById("Revbox").style.visibility="hidden";
document.getElementById("Revbox_bn").innerHTML=document.getElementById("Revbox_tag").innerHTML="";
return false;
}
onload=function () {

var ob_Body = document.getElementsByTagName("body").item(0);

var ob_Revbox = document.createElement("div");
ob_Revbox.setAttribute('id','Revbox');
ob_Body.insertBefore(ob_Revbox, ob_Body.firstChild);




var ob_Revbox2 = document.createElement("div");
ob_Revbox2.setAttribute('id','Revbox2');
ob_Body.insertBefore(ob_Revbox2, ob_Body.firstChild);

var ob_Revbox_inner = document.createElement("div");
ob_Revbox_inner.setAttribute('id','Revbox_inner');
ob_Revbox2.appendChild(ob_Revbox_inner);

var ob_Revbox_top = document.createElement("div");
ob_Revbox_top.setAttribute('id','Revbox_top');
ob_Revbox_top.setAttribute('title','Close');
ob_Revbox_top.onclick = function () {return Revclose();}



ob_Revbox_inner.appendChild(ob_Revbox_top);

var ob_Revbox_tag = document.createElement("div");
ob_Revbox_tag.setAttribute('id','Revbox_tag');
ob_Revbox_inner.appendChild(ob_Revbox_tag);

var ob_Revbox_bn = document.createElement("div");
ob_Revbox_bn.setAttribute('id','Revbox_bn');
ob_Revbox2.appendChild(ob_Revbox_bn);

ob_Revbox2.onclick = function () {return Revclose();}


Revloadflag=1;
}
function getPageSize(){
	
	var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	
	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}


	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}
function getPageScroll(){

	var yScroll;

	if (self.pageYOffset) {
		yScroll = self.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop){	 // Explorer 6 Strict
		yScroll = document.documentElement.scrollTop;
	} else if (document.body) {// all other Explorers
		yScroll = document.body.scrollTop;
	}

	arrayPageScroll = new Array('',yScroll) 
	return arrayPageScroll;
}
document.write('<link href="http://app.mcnt.jp/style.css" rel="stylesheet" type="text/css">');

