
function getPageSize(){
	
	var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = window.innerWidth + window.scrollMaxX;
		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;
	
//	console.log(self.innerWidth);
//	console.log(document.documentElement.clientWidth);

	if (self.innerHeight) {	// all except Explorer
		if(document.documentElement.clientWidth){
			windowWidth = document.documentElement.clientWidth; 
		} else {
			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;
	}

//	console.log("xScroll " + xScroll)
//	console.log("windowWidth " + windowWidth)

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = xScroll;		
	} else {
		pageWidth = windowWidth;
	}
//	console.log("pageWidth " + pageWidth)

	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
};
// getPageScroll()
// Returns array with x,y page scroll values.
// Core code from - quirksmode.com
//
function getPageScroll(){

	var xScroll, yScroll;

	if (self.pageYOffset) {
		yScroll = self.pageYOffset;
		xScroll = self.pageXOffset;
	} else if (document.documentElement && document.documentElement.scrollTop){	 // Explorer 6 Strict
		yScroll = document.documentElement.scrollTop;
		xScroll = document.documentElement.scrollLeft;
	} else if (document.body) {// all other Explorers
		yScroll = document.body.scrollTop;
		xScroll = document.body.scrollLeft;	
	}

	arrayPageScroll = new Array(xScroll,yScroll) 
	return arrayPageScroll;
};


function tryit() {
		var dynamic  = "<div id=\"transBack\"><div id=\"movieWrap\"><a href=\"#\" id=\"close\">Close</a><embed style=\"width:400px; height:326px;\" id=\"googleVid\" type=\"application/x-shockwave-flash\"src=\""+vid_src["vid01"]+"\"></embed></div></div>";
		var testBox = "<div id=\"testBox\" style=\"width: 100px; height: 100px; border: 1px solid #000; display: none;\"></div>"
	//	function movieInsert() {
	//		$('#aim').append(dynamic);
		document.getElementById('boxHouse').innerHTML = dynamic;
}

function closer() {
	//	$('#transBack').fadeOut(500);
		new Effect.Fade('aim');
		document.getElementById('aim').innerHTML = "";
		
		return false;
	
}
	
function comeBack() {
	new Effect.Appear('boxHouse');
	
}
function floater(root) {
	document.getElementById('aim').style.display = "block";
	
	//	var movie = "<div id=\"transWrap\"><div id=\"transBack\"><!-- --></div></div><div id=\"aim\"><div id=\"movieWrapWrap\"><div id=\"movieWrap2\"><a href=\"#\" class=\"close\">Close</a><object classid=\"clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B\"codebase=\"http://www.apple.com/qtactivex/qtplugin.cab\"width=\"500\" height=\"266\"id=\"movie1\" ><param name=\"src\" value=\"movies/ddd.mov\"><param name=\"controller\" value=\"true\" /><param name=\"autoplay\" value=\"false\" /><param name=\"loop\" value=\"false\" /><embed height=266 width=500 SRC=\"movies/ddd.mov\" type=\"video/quicktime\" PLUGINSPAGE=\"www.apple.com/quicktime/download\" autoplay=\"false\" enableJavaScript=\"true\" name=\"standard\" id=\"standard\" /></embed></object></div></div></div>";
		
		var dynamic  = "<div id=\"transBack\"><div id=\"movieWrap\"><a href=\"#\" id=\"close\" onclick=\"closer(); return false;\">Close</a><embed style=\"width:400px; height:326px;\" id=\"googleVid\" type=\"application/x-shockwave-flash\"src=\""+vid_src[root]+"\"></embed></div></div>";
		var arrayPageSize = getPageSize();
		var arrayPageScroll = getPageScroll();
		var topSet = ((arrayPageSize[3]-500)/2)+arrayPageScroll[1];
		document.getElementById('aim').style.top = topSet+"px";
		document.getElementById('aim').style.left = "0px";
		document.getElementById('aim').innerHTML = dynamic;
		

}	
	



