var currentPlacementDiv;
function addEvent(fileType,fileName,fileTitle,divLoc){
	var divToRemove = document.getElementById("flashcontent");
	var linkToRemove = document.getElementById("dllink");
	try{		
		currentPlacementDiv.removeChild(divToRemove);
		currentPlacementDiv.removeChild(linkToRemove);
	}catch(e){
		
	}	
	var placementDiv = document.getElementById(divLoc);
	currentPlacementDiv = placementDiv;		
	
	var newdiv = document.createElement('div');
	newdiv.setAttribute('id', "flashcontent");
	newdiv.style.width = "100px";
	newdiv.style.height = "20px";
	
	placementDiv.appendChild(newdiv);
	
	/*var dLinkDiv = document.createElement('div');
	dLinkDiv.setAttribute('id', "dllink");*/
	var podLink = document.createElement('a');
	podLink.setAttribute('href', fileName);
	podLink.setAttribute('target', "_blank");
	podLink.setAttribute('id', "dllink");
	podLink.appendChild(document.createTextNode("Click here to download"));
	/*dLinkDiv.appendChild(document.createTextNode("Download this Podcast"));*/
	placementDiv.appendChild(podLink);
	
	// <![CDATA[
	var so = new SWFObject("/swf/player_mp3_maxi.swf", "video", "120px", "25px", "8");

    
	so.addVariable("showstop", "1");
	so.addVariable("autoplay", "1");
	so.addVariable("bgcolor1", "667034");
	so.addVariable("bgcolor2", "919B4C");
	so.addVariable("buttoncolor", "F2D15D");
	so.addVariable("buttonovercolor", "AD3E2A");
	so.addVariable("slidercolor1", "919B4C");
	so.addVariable("slidercolor2", "667034");
	so.addVariable("sliderovercolor", "F2D15D");
	so.addVariable("mp3", fileName);
	//so.addVariable("showvolume", "1");
	
	so.addParam("wmode","transparent");
	so.addParam("allowScriptAccess","sameDomain");
	
	so.addVariable("fileType", fileType);
	
	so.addVariable("fileTitle", fileTitle);
	so.write("flashcontent");
	// ]]>
	}


function sh(el){
    var div = document.getElementById(el);
    var divH = document.getElementById(el + 'l');
    if(div.style.display=='none'){
        div.style.display = '';
        divH.innerHTML = 'Close';
    }    
    else{
        div.style.display = 'none';
        divH.innerHTML = 'More';
        }

}

function removeEvent()
	{
	var divToRemove = document.getElementById("flashcontent");
	currentPlacementDiv.removeChild(divToRemove);
	}
