
// Handle all the FSCommand messages in a Flash movie.
function querystring_DoFSCommand(command, args) {
	var querystringObj = isInternetExplorer ? document.all.querystring : document.querystring;
	//
	// Place your code here.
	//
}

var browserName=navigator.appName; 
var resizable = true;
var isMacIE = false;
var isWinIE = false;
if (browserName=="Microsoft Internet Explorer") { 
	if (navigator.appVersion.indexOf("Mac")!=-1) {
	//alert("IE Mac");
		isMacIE = true;
	} else {
		isWinIE = true;
		//alert("IE Win");
	}
} else if (browserName=="Netscape" && navigator.appVersion.indexOf("Win")!=-1) { 
	//alert("Netscape Win");
} else { 
	//alert("All other browsers");
}

if (!isMacIE) {
	document.write("<style>	body, html { height: 100% }</style>");
}

function vText_getQueryValue(name) {
  var value = "";
  if ( (i=location.search.indexOf('?'+name))==-1 && (i=location.search.indexOf('&'+name,3))==-1 )
    return null;
  else
    i += name.length+2;
  if ( (j=location.search.indexOf("&",i))!=-1 )
    value = location.search.substring(i,j);
  else
    value = location.search.substring(i,location.search.length);
  for ( i=0; i<value.length; i++ )
    if ( value.charAt(i)=='+' )
     value = value.substring(0,i)+' '+value.substring(i+1,value.length);
  return unescape(value);
}
// Hook for Internet Explorer.
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	document.write('<script language=\"VBScript\"\>\n');
	document.write('On Error Resume Next\n');
	document.write('Sub querystring_FSCommand(ByVal command, ByVal args)\n');
	document.write('	Call querystring_DoFSCommand(command, args)\n');
	document.write('End Sub\n');
	document.write('</script\>\n');
}
function vText_getHTMLName() {
	var s = location.pathname.split('/');
	return s[s.length-1];
}


var popUpWin=0;
function vText_popUpWindow(URLStr, left, top, width, height, resizable) {
  if (popUpWin) {
    if(!popUpWin.closed) popUpWin.close();
  }
	if (isMacIE) {
		width -= 16;
		height -= 16;
	}
  popUpWinvText = open(URLStr, 'popUpWinvText','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=no,resizable,copyhistory=yes,width='+width+',height='+height+',left='+left+',top='+top+',screenX='+left+',screenY='+top+'');
  if (window.focus) {popUpWinvText.focus()}
	
}
function isMacIE () {
	return (navigator.platform.indexOf("Mac") != -1 && document.all); 
} // --> 

function vText_gotoPage(htmlpage,p,x,y) {
	if (htmlpage == '') {
		htmlpage = vText_getHTMLName();	
	}
	vText_popUpWindow(htmlpage+"?page="+p+"&anchorx="+x+"&anchory="+y,25,25,960,720,1);
}

function vText_gotoChapter(htmlpage,chapter,x,y) {
	if (htmlpage == '') {
		htmlpage = vText_getHTMLName();	
	}
	vText_popUpWindow(htmlpage+"?chapter="+chapter+"&anchorx="+x+"&anchory="+y,25,25,960,720,1);
}


function vText_launchVPage(htmlpage) {
	var roster = vText_getQueryValue("r");
	if (roster) {
		roster = '&r='+roster;
	}
	vText_popUpWindow(htmlpage+"?chapter="+vText_getQueryValue("chapter")+"&page="+vText_getQueryValue("page")+"&anchory="+vText_getQueryValue("anchory")+roster,25,25,960,720,1);
}