function createAudioPopUp(composer, artist, tune, audioFile, playerLocation){
	newWindow = window.open("","audioPlayer","scrollbars=0,width=720,height=145");
	
	var newContent = "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'><html xmlns='http://www.w3.org/1999/xhtml'>";
	newContent += "<http://www.w3.org/TR/html4/loose.dtd>";
	newContent += "<html xmlns='http://www.w3.org/1999/xhtml'>";
	newContent += "<head><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><title>" + tune + "</title>";
	newContent += "<link href='externalCode/styles.css' rel='stylesheet' type='text/css'>";
	newContent += "<link href='../externalCode/styles.css' rel='stylesheet' type='text/css'></head>";
	newContent += "<body>";
	newContent += "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' width='720' height='145'>";
	newContent += "<param name='movie' value='" + playerLocation + "audio-player.swf?audioFile=" + audioFile + "&tune=" + tune + "&composer=" + composer + "&artist=" + artist + "' />";
	newContent += "<param name='quality' value='high' />";
	newContent += "<embed src='../flash/audio-player.swf?audioFile=" + audioFile + "&tune=" + tune + "&composer=" + composer + "&artist=" + artist + "' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='720' height='145'></embed>";
	newContent += "</object></body><html>";	
	newWindow.document.write(newContent)	
	newWindow.document.close()
}

function createFlashPopUp(windowName,theTitle,swfFile,theW,theH){
	newWindow = window.open("",windowName,"scrollbars=0,width=" + theW + ",height=" + theH);
	
	var newContent = "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'><html xmlns='http://www.w3.org/1999/xhtml'>";
	newContent += "<http://www.w3.org/TR/html4/loose.dtd>";
	newContent += "<html xmlns='http://www.w3.org/1999/xhtml'>";
	newContent += "<head><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><title>" + theTitle + "</title>";
	newContent += "<link href='externalCode/styles.css' rel='stylesheet' type='text/css'>";
	newContent += "<link href='../externalCode/styles.css' rel='stylesheet' type='text/css'></head>";
	newContent += "<body>";
	newContent += "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' width='" + theW + "' height='" + theH + "'>";
	newContent += "<param name='movie' value='" + swfFile + "' />";
	newContent += "<param name='quality' value='high' />";
	newContent += "<embed src='" + swfFile + "' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='" + theW + "' height='" + theH + "'></embed>";
	newContent += "</object></body><html>";	
	newWindow.document.write(newContent)	
	newWindow.document.close()
}

function writeToPicWindow(windowName,theTitle,thePath,theCap,theW,theH){
	var wPad = theW + 45;
	var hPad = theH + 65;
	var graphicString = "resizable=1,scrollbars=1,width=" + wPad + ",height=" + hPad;
	newWindow = window.open("",windowName,graphicString);
	
	var newContent = "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'><html xmlns='http://www.w3.org/1999/xhtml'>";
	newContent += "<http://www.w3.org/TR/html4/loose.dtd>";
	newContent += "<html><head><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><title>" + theTitle + "</title>";
	newContent += "<link href='externalCode/styles.css' rel='stylesheet' type='text/css'>";
	newContent += "<link href='../externalCode/styles.css' rel='stylesheet' type='text/css'></head>";
	newContent += "<body id='picPopUp'><img src=" + thePath + " width='" + theW + "' height='" + theH + "'>";
	newContent += "<br /><p class='caption'>" + theCap + "</p>";
	newContent += "</body><html>";	
	newWindow.document.write(newContent);	
	newWindow.document.close();
}

function writeToVidWindow(windowName,theTitle,thePath){
	newWindow = window.open("",windowName,"scrollbars=0,width=420,height=340")
	
	var newContent = "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>";
	newContent += "<html xmlns='http://www.w3.org/1999/xhtml'>";
	newContent += "<html><head><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><title>" + theTitle + "</title>";
	newContent += "<link href='../externalCode/styles.css' rel='stylesheet' type='text/css' />";
	newContent += "<script language='javascript' src='../externalCode/masterFunctions.js'></script></head>";
	newContent += "<body id='flashVidPopUp' onload='MM_CheckFlashVersion('8,0,0,0','Content on this page requires a newer version of Macromedia Flash Player. Do you want to download it now?\');MM_preloadImages(\'../images/tunes/digital/me-photobooth-330-loop.gif');'>"
	
	newContent += "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='320' height='240' id='FLVPlayer'>";
    newContent += "<param name='movie' value='FLVPlayer_Progressive.swf' />";
    newContent += "<param name='salign' value='lt' />";
    newContent += "<param name='quality' value='high' />";
    newContent += "<param name='scale' value='noscale' />";
	newContent += "<param name='FlashVars' value='&MM_ComponentVersion=1&skinName=Clear_Skin_1&streamName=" + thePath + "&autoPlay=true&autoRewind=false' />";
	newContent += "<embed src='FLVPlayer_Progressive.swf' flashvars='&MM_ComponentVersion=1&skinName=Clear_Skin_1&streamName=" + thePath + "&autoPlay=true&autoRewind=false' quality='high' scale='noscale' width='320' height='240' name='FLVPlayer' salign='LT' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />";
	newContent += "</object>";
	newContent += "</body><html>"		
	newWindow.document.write(newContent)	
	newWindow.document.close()
}

function MM_CheckFlashVersion(reqVerStr,msg){
  with(navigator){
    var isIE  = (appVersion.indexOf("MSIE") != -1 && userAgent.indexOf("Opera") == -1);
    var isWin = (appVersion.toLowerCase().indexOf("win") != -1);
    if (!isIE || !isWin){  
      var flashVer = -1;
      if (plugins && plugins.length > 0){
        var desc = plugins["Shockwave Flash"] ? plugins["Shockwave Flash"].description : "";
        desc = plugins["Shockwave Flash 2.0"] ? plugins["Shockwave Flash 2.0"].description : desc;
        if (desc == "") flashVer = -1;
        else{
          var descArr = desc.split(" ");
          var tempArrMajor = descArr[2].split(".");
          var verMajor = tempArrMajor[0];
          var tempArrMinor = (descArr[3] != "") ? descArr[3].split("r") : descArr[4].split("r");
          var verMinor = (tempArrMinor[1] > 0) ? tempArrMinor[1] : 0;
          flashVer =  parseFloat(verMajor + "." + verMinor);
        }
      }
      // WebTV has Flash Player 4 or lower -- too low for video
      else if (userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 4.0;

      var verArr = reqVerStr.split(",");
      var reqVer = parseFloat(verArr[0] + "." + verArr[2]);
  
      if (flashVer < reqVer){
        if (confirm(msg))
          window.location = "http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash";
      }
    }
  } 
}

function hideIt() {
	document.getElementById("picImg").src="../images/photos/white-spacer.gif";
	document.getElementById("picCaption").innerHTML="caption";
	document.getElementById("picDiv").style.visibility="hidden";
	document.getElementById("picDiv").style.display="none";
	document.getElementById("thumbBlock").style.visibility="visible";
	document.getElementById("thumbBlock").style.display="block";
	window.scroll(xScroll,yScroll);
}

var xScroll,yScroll;
function getScroll() {
	if (self.pageYOffset) {	
		xScroll = self.pageXOffset;
		yScroll = self.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop) {
		xScroll = document.documentElement.scrollLeft;
		yScroll = document.documentElement.scrollTop;
	} else if (document.body) {
		xScroll = document.body.scrollLeft;
		yScroll = document.body.scrollTop;
	}
}

// and then the Dreamweaver functions...

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_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_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];}
}
//-->
