// JavaScript Document
var lastclicked = "none";
var IsActiveMenu = "root";
var baseURL = "http://www.davidmeade.com";

function hideLoadingPage() {
	if (document.getElementById) {  // DOM3 = IE5, NS6
		document.getElementById('hidepage').style.visibility = 'hidden';
	}
	else {
		if (document.layers) {  // Netscape 4
			document.hidepage.visibility = 'hidden';
		}
		else {  // IE 4
			document.all.hidepage.style.visibility = 'hidden';
		}
	}
}

function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=1,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=620,height=540,left = 100,top = 50');");
}

function popUp2(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=1,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=620,height=540,left = 200,top = 100');");
}


function showplayer(media_id,file_type, file_url,file_height,file_width) {
error_message = false;
rewrite_div = 'mediadiv';

//alert('master: ' + media_id +", "+ file_type +", "+ file_url +", "+ file_height +", "+ file_width);

 switch (file_type)
{
case 'mp3':
case 'm3u':
case 'audio/mpeg':
   file_height = "50";
	 file_width = "320";
	 clsid = "";
	 codebase = "";
	 object_atrbs = "";
   embed_atrbs = "";
   pluginspage="";
 	 file_type_name = "MP3 file";
	 rewrite_div = 'mediacontrols';
  break
case 'wmv':
case 'video/x-ms-wmv':
   file_height = file_height + 50;
	 clsid = "CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95";
	 codebase = "http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715";
	 object_atrbs = "id=\"MediaPlayer\" standby=\"Loading Microsoft Windows Media Player Components...\" type=\"application/x-oleobject\"";
   embed_atrbs = "type=\"application/x-mplayer2\" name=\"MediaPlayer\"";
	 pluginspage="http://www.microsoft.com/isapi/redir.dll?prd=windows&amp;sbp=mediaplayer&amp;ar=media&amp;sba=plugin&amp;";
 	 file_type_name = "Windows Media File";
  break
case 'mov':
case 'video/quicktime':
   file_height = file_height + 16;
	 clsid = "clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B";
	 codebase = "http://www.apple.com/qtactivex/qtplugin.cab";
	 object_atrbs = "";
   embed_atrbs = "";
	 pluginspage="http://www.apple.com/quicktime/";
	 file_type_name = "QuickTime movie";
  break
default:
  error_message = "No embed code was found for this file type.  Please download the requested media file <a href=\"+file_url+\">here</a>";
  break
} 

   playercode = "<center><object CLASSID=\""+clsid+"\" width=\""+file_width+"\" height=\""+file_height+"\" CODEBASE=\""+codebase+"\" "+object_atrbs+"><param name=\"src\" value=\""+file_url+"\"><param name=\"qtsrc\" value=\""+file_url+"\"><param name=\"Filename\" value=\""+file_url+"\"><param name=\"autoplay\" value=\"true\"><param name=\"AutoStart\" value=\"true\"><param name=\"loop\" value=\"false\"><param name=\"controller\" value=\"true\"><embed src=\""+file_url+"\" qtsrc=\""+file_url+"\" width=\""+file_width+"\" height=\""+file_height+"\" autoplay=\"true\" autostart=\"true\" loop=\"false\" controller=\"true\" showcontrols=\"1\" pluginspage=\""+pluginspage+"\" "+embed_atrbs+"></embed></object><br><div class=\"small\" style=\"width: 320px; display: inline;\"></div><center><br clear=\"ALL\">";

if (error_message)
   {
   playercode = error_message;
   }

 document.getElementById(rewrite_div+media_id).innerHTML = playercode;

 //alert(mov_playercode);

}
