wimpyFolder = "";
transparentBkgd = "no";
bkgdColor = "#000000";
startPlayingOnload = "yes";
popUpHelp = "no";
loopTrack = "no";
currentVolume = "100";
controllocation = "bottom";
wimpySWFfilename = "wimpyAVsingle.swf";
wimpyHTMLtemplateFilename = "wimpyTemplate.html";


function WimpyAVpopup (filename, width, height){
	rnum = (Math.round((Math.random()*1000000)+1));
	padControls = height+20
	theURL = wimpyFolder+wimpyHTMLtemplateFilename+'?theFile='+filename+'&wW='+width+'&wH='+padControls;
	winName = 'wimpy'+rnum;
	extras = 'width='+width+',height='+padControls
	window.open(theURL,winName,extras);
}

function writeSWFcode(fileSWF, fileIN, theWidth, theHeight){
	rnum = (Math.round((Math.random()*1000000)+1));
	padControls = theHeight+20
	queryString = '';
	queryString += "theFile="+fileIN;
	if(transparentBkgd == "yes"){
		tptBkgd_param = '<param name="wmode" value="transparent" />';
		tptBkgd_embed = 'wmode="transparent" ';
	} else {
		tptBkgd_param = "";
		tptBkgd_embed = "";
	}
	queryString += '&startPlayingOnload='+startPlayingOnload;
	queryString += '&popUpHelp='+popUpHelp;
	queryString += '&loopTrack='+loopTrack;
	queryString += '&controllocation='+controllocation;
	queryString += '&currentVolume='+currentVolume;
	flashCode = '';
	flashCode += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab// - version=7,0,0,0" width="'+theWidth+'" height="'+padControls+' name="wimpy'+rnum+'" id="wimpy'+rnum+'"">';
	flashCode += '<param name="movie" value="'+fileSWF+'?'+queryString+'" />';
	flashCode += '<param name="loop" value="false" />';
	flashCode += '<param name="menu" value="false" />';
	flashCode += '<param name="quality" value="high" />';
	flashCode += '<param name="scale" value="noscale" />';
	flashCode += '<param name="salign" value="lt" />';
	flashCode += '<param name="bgcolor" value="'+bkgdColor+'" />';
	flashCode += tptBkgd_param;
	flashCode += '<embed src="'+fileSWF+'?'+queryString+'" width="'+theWidth+'" height="'+padControls+'" bgcolor="'+bkgdColor+'" loop="false" menu="false" quality="high" scale="noscale" salign="lt" name="wimpy'+rnum+'" id="wimpy'+rnum+'" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"" '+tptBkgd_embed+'/></object>';
	document.write(flashCode);
}

function WimpyAV(){
	var qsParm = new Array();
	var query = window.location.search.substring(1);
	var parms = query.split('&');
	for (var i=0; i<parms.length; i++) {
		var pos = parms[i].indexOf('=');
		if (pos > 0) {
			var key = parms[i].substring(0,pos);
			var val = parms[i].substring(pos+1);
			qsParm[key] = val;
		}
	}
	fileSWFsend = wimpyFolder+wimpySWFfilename;
	fileINsend = wimpyFolder+qsParm['theFile'];
	writeSWFcode(fileSWFsend, fileINsend, "100%", "100%");
}

function WimpyAVembed(theFileIN, theWidthIN, theHeightIN){
	fileSWFsend = wimpyFolder+wimpySWFfilename;
	fileINsend = wimpyFolder+theFileIN;
	writeSWFcode(fileSWFsend, fileINsend, theWidthIN, theHeightIN);
}


