function downloadfiles(whichfile) {
	window.location=whichfile;
}

function viewsample(where) {
	window.open(where,'sample','width=760,height=500,resizable=no,scrollbars=no,toolbar=no,location=no,directories=no,menubar=no,status=no');
}

function showvideoinframe(whichone) {
	var swords=whichone.split("/");
	swords.pop();
	words=swords.join("/");
	downloadlink=words+"/download.zip";
	samplelink=words+"/sample.swf";
	frames['moviehighlight'].location.href='/components/showmovie.php?whichmovie='+whichone;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function openwindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

// Toggle ID layers on and off
function flipLayer (layername) {
	if (document.getElementById(layername).style.display=='block') { document.getElementById(layername).style.display = 'none'; } 
	else { document.getElementById(layername).style.display = 'block';}
}

function writeFlash(movieLocation,flashwidth,flashheight,noflashsrc,noflashurl,myidname) {
	if (myidname) { document.write('<div id="'+myidname+'">'); }
	if ((noflashsrc) && ((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPad/i)) )) {
		if (noflashurl) { document.write('<a href="'+noflashurl+'" >');}
		if (noflashsrc) { document.write('<img src="'+noflashsrc+'" />');}
		if (noflashurl) { document.write('</a>');}
	} else {
		document.write('<object type="application/x-shockwave-flash" width="'+flashwidth+'" height="'+flashheight+'" data="'+movieLocation+'"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="'+movieLocation+'" /><param name="quality" value="high" /><param name="scale" value="noscale" /><param name="wmode" value="transparent" /></object>');
	}

	if (myidname) { document.write('</div>'); }

}

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

MM_preloadImages("/images/misc/topheader.gif","/images/misc/mainmenubackground.gif","/images/misc/background-quantumtips.gif","/images/misc/background-portfolio.gif","/images/misc/background-mypicks.gif","/images/misc/header-flashpodcast.gif","images/misc/podcasthighlightbottom.gif","/images/misc/yellowbackground.gif","/images/misc/moviebackground.gif");

try {
	document.execCommand("BackgroundImageCache", false, true);
} catch(err) {}


function playMovie(movielocation,moviewidth,movieheight,moviename) {
	document.write('<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="'+movieheight+'" width="'+moviewidth+'">');
	document.write('<param name="src" value="'+movielocation+'">');
	document.write('<param name="autoplay" value="true">');
	document.write('<param name="type" value="video/quicktime" height="'+movieheight+'" width="'+moviewidth+'">');
	document.write('<embed src="'+movielocation+'" height="'+movieheight+'" width="'+moviewidth+'" autoplay="true" kioskmode=true scale="tofit" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/">');
	document.write('</object>');
}

function playhtml5movie(h5moviesrc,h5width,h5height) {
	if ((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPad/i))) {
		document.write('<video src="'+h5moviesrc+'" width="'+h5width+'" height="'+h5height+'"controls ></video>');
	} else {
		document.write('<a href="'+h5moviesrc+'" style="display:block;width:'+h5width+'px;height:'+h5height+'px" id="player"></a>');
		flowplayer("player", "/components/flowplayer-3.2.0.swf",  {
			clip: {
				autoPlay: false, 
				autoBuffering: true
			}
		});
	}
}


