
var currentUrl = new String(location.href);
currentDomain = currentUrl.split(".");
var fullUrl = " ";
if(currentDomain[0] == "http://harrisschool"){
fullUrl="http://www.google.com/uds/api?file=uds.js&amp;v=1.0&amp;key=ABQIAAAAhoDIlu7DKwPphkUTxFkHrxTs96_ae_n2JL27CSWGGXmEkkDHORR-_iiT47yE-KbvWbQzpgmF_0i6pQ";
}
if(currentDomain[0] == "http://theharrisschool"){
fullUrl="http://www.google.com/uds/api?file=uds.js&amp;v=1.0&amp;key=ABQIAAAAhoDIlu7DKwPphkUTxFkHrxS5WmREMJsoW68VCS2kod_a5CtltxQkJ5UWBqyffqk9iT5nC05mA7KPMQ";
}
else if(currentDomain[0] == "http://harris"){
fullUrl="http://www.google.com/uds/api?file=uds.js&amp;v=1.0&amp;key=ABQIAAAAhoDIlu7DKwPphkUTxFkHrxQiJ4jjswPxRhn_xHAsdKwV6CdjphQTQvvSH7jORVIoDF6DP8N8Eke7IA"
}
document.write("\n<script type=\"text/javascript\" src=\"" + fullUrl + "\" ></script>\n");

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 that executes a search and makes the 'lightbox'
//<![CDATA[
var searchControl;
function searchExecute(){
	
	if(document.getElementById("searchBox").value != ""){
	
	var query = document.getElementById("searchBox").value;
	
	var siteSearch = new GwebSearch();
	siteSearch.setSiteRestriction("005337944712473092382:-wlgv21j0js");
	
	var options = new GsearcherOptions();
	options.setExpandMode(GSearchControl.EXPAND_MODE_OPEN);
	
	searchControl = new GSearchControl();
	searchControl.addSearcher(siteSearch, options);
	
	searchControl.setLinkTarget(GSearch.LINK_TARGET_SELF);
	searchControl.setResultSetSize(GSearch.LARGE_RESULTSET);
	searchControl.setNoResultsString("Sorry, \"" + query + "\" did not return any results.");
	
	searchControl.draw(document.getElementById("searchResults"));
	
	var arrayPageSize = getPageSize();
	
	//size background and make the rest visible
	document.getElementById("bbg").style.height = (arrayPageSize[1] + 'px');
	document.getElementById("bbg").style.display = 'block';
	document.getElementById("searchWrap").style.display = 'block';
	document.getElementById("searchResults").style.display = 'block';
	
	searchControl.execute(query);
	}
	else return;
}
//]]>
function closeLightBox(){
	document.getElementById("searchResults").style.display = 'none';
	document.getElementById("searchWrap").style.display = 'none';
	document.getElementById("bbg").style.display = 'none';
	document.getElementById("videoDiv").style.display = 'none';
}

function videoLightBox(){
	var arrayPageSize = getPageSize();
	
	//size background and make the rest visible
	document.getElementById("bbg").style.height = (arrayPageSize[1] + 'px');
	document.getElementById("bbg").style.width = (arrayPageSize[0] + 'px');
	document.getElementById("bbg").style.display = 'block';
	if((.5 * (arrayPageSize[2] - 750)) >= 0){
	document.getElementById("videoDiv").style.left = (.5 * (arrayPageSize[2] - 750) + 'px');
	}
	if((.5 * (arrayPageSize[3] - 500)) >= 0){
	document.getElementById("videoDiv").style.top = (.5 * (arrayPageSize[3] - 500) + 'px');
	}
	document.getElementById("videoDiv").style.display = 'block';
}
function chatLightBox(){
	var arrayPageSize = getPageSize();

	document.getElementById("bbg2").style.height = (arrayPageSize[1] + 'px');
	document.getElementById("bbg2").style.width = (arrayPageSize[0] + 'px');
	document.getElementById("bbg2").style.display = 'block';
	if((.5 * (arrayPageSize[2] - 650)) >= 0){
	document.getElementById("chatBox").style.left = (.5 * (arrayPageSize[2] - 650) + 'px');
	}
	if((.5 * (arrayPageSize[3] - 650)) >= 0){
	document.getElementById("chatBox").style.top = (.5 * (arrayPageSize[3] - 650) + 'px');
	}
	document.getElementById("chatBox").style.display = 'block';
}

function openit(){
window.open('../chat/StreamsPlayer/Recorded.html','PlayRecordedVideo', 'width=750,height=500');
}

function openit2(){
window.open('../chat/StreamsPlayer/Recorded2.html','PlayRecordedVideo', 'width=750,height=500');
}
