/****************************************************************************************/
/*																						*/
/*	Accordent Link Menu v2.00															*/
/*	=========================															*/
/*																						*/
/*	Last Edited: 4/4/2007																*/
/*	Please send all comments & bug reports to: support@accordent.com					*/
/*																						*/
/****************************************************************************************/

var openThumbPage = false;

function openThumbWindow() {
	if (openThumbPage.window){
		openThumbPage.focus();
	} else {
		openThumbPage=window.open('thumbs.htm','thumbpage','scrollbars=yes,resizable=yes,width=194,height=627');
		openThumbPage.focus();
	}
}

function closeThumbWindow() {
	if (openThumbPage){
		openThumbPage.close();
	}
}

function isPlayerReal(){
	try{
		var realvid = false;
		var vidLayerContent = new String(top.video.document.getElementById("vidLayer").innerHTML);
		var realMediaObject = /(videorn)/i;
		if(realMediaObject.test(vidLayerContent))
			realvid = true
			return realvid;
	} catch(e) {}
}

function isBrowserIeWin() {
	var iewin = false;
	var ua = navigator.userAgent.toLowerCase();
	if ((ua.indexOf('ie') > -1) & (ua.indexOf('win') > -1))
		iewin = true;
	return iewin;
}

function isBrowserIe() {
	var ie = false;
	var ua = navigator.userAgent.toLowerCase();
	if (ua.indexOf('ie') > -1)
		ie = true;
	return ie;
}

function MenuCheck() {
	try{
		var onDemand = 'visible';
		var chaptersEnabled = 'visible';
		//hide CHAPTERS LINK from non-windows os and non-ie browsers, 
		//if it is NOT an on demand event, 
		//if the visible tag is NOT se to visible - meaning that details.txt has not "chapters" set to "yes"
		//if (!isBrowserIeWin() || onDemand != 'visible' || chaptersEnabled != 'visible')	
		if ((!isBrowserIe() && !isPlayerReal()) || onDemand != 'visible' || chaptersEnabled != 'visible')
			document.getElementById('chapters').innerHTML = '';
			
		var emailHtml = '';
		var emailTo = '';
		var chkNoTag = emailTo.indexOf("<<@");
		if (emailTo != '' & chkNoTag < 0) {	// email address
			var ty4 = "Exploring Clinical Microsystems with Different Lenses";
			var ty4a = escape(ty4);
			emailHtml = '&nbsp;&nbsp;|&nbsp;&nbsp;<a href=\"mailto:' + emailTo + '?subject=' + ty4a + '\" id=\"whiteLink\">Email</a>';
		}
		document.getElementById('email').innerHTML = emailHtml;
		
		var downloadFile = '';
		chkNoTag = downloadFile.indexOf("@");
		if (downloadFile == '' || chkNoTag > -1)	// no downloadable file
			document.getElementById('download').innerHTML = '';
	} catch(e) {}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function Lvl_openWin(u,n,w,h,l,t,c,f) {
  var x=((screen.width-w)/2);if(c==1){l=x;t=(screen.height-h)/2;}if(c==2){l=x}
	f+=',top='+t+',left='+l;LvlWin=window.open(u,n,f);LvlWin.focus();
}

function RefreshPage() {
	try {
			document.location.reload();
	} catch(e) {}
}

function RefreshTimer() {
	try {
			var timersec = '60';
			var chkNoTag = timersec.indexOf("<<@");
			if (timersec != '' & chkNoTag < 0) {
				var timerms = timersec * 1000;
				if (timerms > 0) {
					setTimeout("RefreshPage()", timerms);
				}
			}
	} catch(e) {}
}
