function MM_preloadImages() { //v3.0 
	var d=document; 
	if(d.images)
	{ 
		if(location.host == "localhost")
		{
			var domain = "http://" + location.host + "/MORWeb/Images/"
		}
		else
		{
			var domain = "http://" + location.host + "/Images/"
		}
		
		for(x=0;x<MM_preloadImages.arguments.length;x++)
		{
			MM_preloadImages.arguments[x] = domain + MM_preloadImages.arguments[x]
		}
		if(!d.MM_p) d.MM_p=new Array(); 
		var i,j=d.MM_p.length,a=MM_preloadImages.arguments; 
		for(i=0; i<a.length; i++) 
			if (a[i].indexOf("#")!=0)
			{ 
				d.MM_p[j]=new Image; 
				d.MM_p[j++].src=a[i];
			}		
	} 
}

function MM_getImagesList(pageName)
{	
	//alert(pageName)
	
	//MM_preloadImages("groupread.gif","logo.jpg","phone.gif","fileTopRight.gif","fileTopLeft.gif","fileBottomLeft.gif","fileBottomRight.gif","About.jpg","Reading.jpg","Resources.jpg","requsetTutor.jpg")
			
	//switch(pageName) 
	//{					
	//		case "Home":
	//			MM_preloadImages("groupread.jpg")
	//}
}

function refreshOpener()
{
	window.opener.location.href = opener.location;
}	


function windowClose()
{
	window.close();
}


function printWindow(divPrintArea)
{
			newwin=window.open("","Print");
			newwin.document.write("<LINK href='styles.css' type='text/css' rel='stylesheet'>")
			newwin.document.write(divPrintArea.innerHTML);
			newwin.document.write("<script language=javascript>") 
			//hide "print" <div>
			newwin.document.write("document.all(\"print\").style.visibility=\"hidden\"");
			newwin.document.write("</script>")
}

function popup(URL, Title, Width, Height, scrollbars, resize)
{
	var winLeft = (screen.width-Width)/2;
	var winTop = (screen.height-Height)/2;
	if (winLeft < 0) winLeft = 0;
	if (winTop < 0) winTop = 0;
	
	window.open(URL,Title,'height=' + Height + ',width=' + Width + ',top='+ winTop +',left='+ winLeft +',scrollbars=' + scrollbars + ',resizable=' + resize);
}

function LockButtons (whichform, boolVar) {
	ua = new String(navigator.userAgent);
	if (ua.match(/IE/g)) {
		for (i=1; i<=whichform.elements.length-1; i++) {
			if (whichform.elements[i].type == 'submit') {
				whichform.elements[i].disabled = boolVar;
			}
		}
	}
	var useragent = navigator.userAgent;
	var bName = (useragent.indexOf('Opera') > -1) ? 'Opera' : navigator.appName;
	if (bName != "Netscape") {
	}
	if(boolVar = true) {
		//document.body.style.cursor = "wait";
	}
}


function popupResize()
{
	window.focus();
	var h
	var w
	
	img = document.forms[0].getElementById("image");

	h = img.height+20
	w = img.width

	if (h>screen.availHeight && screen.availHeight>0) 
	{
		h=screen.availHeight;
		w=w+28; // a place for the vertical scroller
	}
		
	if (w>screen.availWidth && screen.availWidth>0) 
	{
		img.width=screen.availWidth
		img.height=img.height/(w/(screen.availWidth))
		h=h/(w/(screen.availWidth))
		w=screen.availWidth
	}

	self.moveTo(screen.availTop,screen.availLeft)

	self.resizeTo(w,h);
}

//function openNewWindow(URLtoOpen, windowName, windowFeatures) 
//{
//	newWindow=window.open(URLtoOpen, windowName, windowFeatures);
//}

function defaultButton(btn)
{
    // process only the Enter key
    if (event.keyCode == 13)
    {
        // cancel the default submit
        event.returnValue=false;
        event.cancel = true;
        // submit the form by programmatically clicking the specified button
        btn.click();
    }
}
