var ar=getPageSize();
//ar[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 aa(){
	var dougaW="420";
	var dougaH="315";
	var sw=screen.width;
	var sh=ar[1];
	var d=document.createElement("div");
	d.setAttribute("id","bg");
	var d_property="width:"+sw+"px;height:"+sh+"px;background-color:#000000;opacity:0.8;position:absolute;top:0;left:0;z-index:1;";
	d.setAttribute("style",d_property);
	document.getElementsByTagName("body")[0].appendChild(d);
	var w=document.createElement("div");
	w.setAttribute("id","naka");
	var w_property="width:"+dougaW+"px;height:"+dougaH+"px;background-color:#000000;margin:auto;position:absolute;top:0;left:0;z-index:2;"
	w.setAttribute("style",w_property);
	//親ノード.insertBefore(追加するノード, 親ノード.firstChild);
	document.getElementsByTagName("body")[0].insertBefore(w);
	//document.getElementsByTagName("body")[0].appendChild(w);
	document.getElementById("naka").innerHTML='<div style="width:420px;height:315px;margin:auto;"><iframe width="420" height="315" src="http://www.youtube.com/embed/oKclIWScvBE" frameborder="0" allowfullscreen></iframe></div>'
}
