<!--
// 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 openQT(mName, mW, mH) {
	if (mW == null){
		mW = 320;
	}
	if (mH == null){
		mH = 256;
	}
	if (isWinIE) {
		newWindowqt = window.open("", "","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no, resizable=yes, width=" + mW + ", height=" + mH + ";");
		newWindowqt.document.write('<html><head><title>quicktimemovie<\/title><script language="JavaScript" src="ebook_js.js"><\/script><\/head><body bgcolor="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">');
		newWindowqt.document.write('<script language="JavaScript">writeQThtml("'+mName+'")<\/script><\/body><\/html>');
	} else {
		//OLD CODE -- NEW CODE ABOVE FOR IE 6 ACTIVEX
		newWindowqt = window.open("", "","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no, resizable=yes, width=" + mW + ", height=" + mH + ";"); 
		newWindowqt.document.write('<html><head><title>quicktimemovie<\/title><\/head><body bgcolor="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"><embed src="' + mName + '" width="100%" height="100%" ');
		newWindowqt.document.write('bgcolor="000000" pluginspage="http://www.apple.com/quicktime/download/" ');
		newWindowqt.document.write('autoplay="true" controller="true" ');
		newWindowqt.document.write('scale="aspect"></embed><\/body><\/html>');
	}
}

function writeQThtml(mName) {
	document.write('<embed src="' + mName + '" width="100%" height="100%" ');
	document.write('bgcolor="000000" pluginspage="http://www.apple.com/quicktime/download/" ');
	document.write('autoplay="true" controller="true" ');
	document.write('scale="aspect"></embed>');
}



function 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 getHTMLName() {
	var s = location.pathname.split('/');
	return s[s.length-1];
}


var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height, resizable) {
  if (popUpWin) {
    if(!popUpWin.closed) popUpWin.close();
  }
	if (isMacIE) {
		width -= 16;
		height -= 16;
	}
  popUpWin = open(URLStr, '_blank','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) {popUpWin.focus()}
	
}
function isMacIE () {
	return (navigator.platform.indexOf("Mac") != -1 && document.all); 
} // --> 
function launchVPage(htmlpage) {
	popUpWindow(htmlpage+"?chapter="+getQueryValue("chapter")+"&page="+getQueryValue("page")+"&anchory="+getQueryValue("anchory"),25,25,960,720,1);
}
function gotoPage(htmlpage,p,x,y) {
	if (htmlpage == '') {
		htmlpage = getHTMLName();	
	}
	popUpWindow(htmlpage+"?page="+p+"&anchorx="+x+"&anchory="+y,25,25,960,720,1);
}

var bitcasturl = "http://bitcast-a.bitgravity.com/vhl/flash/";
function doThePopup(file) {
	popUpWindow(bitcasturl + "aventuras_video/videoplayer.html?webvideo=" + file, 0, 0, 920, 585, 1);
}

function doThePopupFC(file) {
	popUpWindow(bitcasturl + "flashcultura_video/videoplayer.html?webvideo=" + file, 0, 0, 920, 585, 1);
}

function doThePopupEP(file) {
	popUpWindow(bitcasturl + "enpantalla_video/videoplayer.html?webvideo=" + file, 0, 0, 920, 585, 1);
}

function doThePopupV3e(file) {
	popUpWindow(bitcasturl + "vistas_video/videoplayer.html?webvideo=" + file, 0, 0, 920, 585, 1);
}

function doThePopupClips(file) {
	popUpWindow(bitcasturl + "espaces_video/videoplayer.html?webvideo=" + file, 0, 0, 920, 585, 1);
}

function doThePopupEntire(file) {
	popUpWindow(bitcasturl + "promenades_video/videoplayer.html?webvideo=" + file, 0, 0, 920, 585, 1);
}

function doThePopupLZ(file) {
	popUpWindow(bitcasturl + "lezapping_video/videoplayer.html?webvideo=" + file, 0, 0, 920, 585, 1);
}

function open_activity(navcode) {

	var winH = 580;

	winH = screen.availHeight * .90;

	var recitalWindow = 'win_'+navcode;
	if (recitalWindow == window.name) {
		recitalWindow = recitalWindow+'_1';
	}

	recitalWindow = window.open('http://aventuras3e.vhlcentral.com/home/activity.php?n='+navcode+'&standalone=1&view=student&action=display', recitalWindow, 'height='+winH+',width=792,resizable=yes,scrollbars=1,location=no,menubar=no');

	recitalWindow.focus();
}

function open_toc(url) {
	var winH = 580; 
 	winH = screen.availHeight * .90;
	
	var tocWindow = 'win_toc';
 	if (tocWindow == window.name) {
  		tocWindow = tocWindow+'_1';
 	}
 
 	tocWindow = window.open('http://aventuras3e.vhlcentral.com/home/?view=student&st=all&'+url, tocWindow, 'height='+winH+',width=792,resizable=yes,scrollbars=1,location=yes,menubar=yes');
 	tocWindow.focus();
}

function doThePopupGeneric(url) {
	var winH = 580;

	winH = screen.availHeight * .90;

	var genericWindow= 'win_generic';
	if (genericWindow == window.name) {
		genericWindow = genericWindow+'_1';
	}

	genericWindow = window.open(url, genericWindow, 'height='+winH+',width=792,resizable=yes,scrollbars=1,location=no,menubar=no');

	genericWindow.focus();
}

-->
