function showPage(pageID, noOfPages) {

	for (i = 1; i <= noOfPages; i++) {
		document.getElementById(i).style.visibility = "hidden";
	}

	if (pageID == 'all') {
		document.getElementById(pageID).style.visibility = "visible";	
	} else {
		document.getElementById(pageID).style.visibility = "visible";	
	}
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ 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_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function openDialog(type, url, title) {

	var newwindow;
	var autoclose = true;

	var newWindowW = 492;
	var newWindowH = 353;
	var newWindowX = (screen.width/2)-(newWindowW/2);
	var newWindowY = (screen.height/2)-(newWindowH/2);
/*
	var newWindowX = 260;
	var newWindowY = 300;
*/	
	windowSize = "width="+newWindowW+",height="+newWindowH;

//	var beIE = document.all?true:false
	var beIE = false
	
	  if (beIE){
		newwindow = window.open("","popFrameless","fullscreen,"+windowSize)     
		newwindow.blur()
		newwindow.focus() 
		newwindow.resizeTo(newWindowW,newWindowH)
		newwindow.moveTo(newWindowX,newWindowY)
		var frameString=""+
	"<html>"+
	"<head>"+
	"<title>"+title+"</title>"+
	"</head>"+
	"<frameset rows='*,0' framespacing=0 border=0 frameborder=0>"+
	"<frame name='top' src='"+url+"' scrolling=no>"+
	"<frame name='bottom' src='about:blank' scrolling='no'>"+
	"</frameset>"+
	"</html>"
		newwindow.document.open();
		newwindow.document.write(frameString)
		newwindow.document.close()
	  } else {
		newwindow=window.open(url,"popFrameless","scrollbars=no,"+windowSize)
		newwindow.blur()
		newwindow.focus() 
		newwindow.resizeTo(newWindowW,newWindowH)
		newwindow.moveTo(newWindowX,newWindowY)
	  }   
	  newwindow.focus()   
	  if (autoclose){
		window.onunload = function(){
			newwindow.close()
		}
	  }
/*
	switch (type) {
		case 'feedback':
			newwindow = window.open(url,'name', 'height=350,width=618,resizable=no,scrollbars=no,toolbar=no,menubar=no');
			break;
		case 'confirm':
			newwindow = window.open(url,'name', 'height=295,width=510,resizable=no,scrollbars=no,toolbar=no,menubar=no');
			break;
		default:
			newwindow = window.open(url,'name', 'height=220,width=450,resizable=no,scrollbars=no,toolbar=no,menubar=no');
		break;
	}
	
	newwindow.moveTo((screen.width/2)-(windowW/2),(screen.height/2)-(windowH/2));
	
	if ( window.focus ) {
			newwindow.focus()
	}
*/

}


function deleteAndReturn(deleteURLString) {
	parent.location.href='/index.html';
/*
	parent.location.href="'"+deleteURLString+"'";
	self.close();  
*/
}

function scrollText() {
	document.getElementById("writingText").style.visibility = "hidden";
}


/*
	the following two functions scroll the entirety of a page automatically
	not used in this site
*/

function scrollWindow( ) {
    window.scrollBy(0, 1);
}

function initScroll( ) {
    setInterval("scrollWindow( )", 100);
}

