function loadMedia(url, playlist, targetID, xvalue, yvalue, zvalue)
{
	//Check for existing SWF
	if(isObject(targetID)){

		//replace object/element with a new div
		replaceSwfWithEmptyDiv(targetID);

	}
	
	//Embed SWF
	if (swfobject.hasFlashPlayerVersion("9")) {
		var attributes = { data:url, width:"936", height:"520" };
		var params = { flashvars:"playlist=" + playlist + "&xstart=" + xvalue + "&ystart=" + yvalue + "&zstart=" + zvalue }; 
		var obj = swfobject.createSWF(attributes, params, targetID);
		
	}
	
	/*if (swfobject.hasFlashPlayerVersion("7")) {
		var attributes = { data:"grow_logo.swf", width:"140", height:"45" };
		var params = { wmode:"transparent" }; 
		var obj = swfobject.createSWF(attributes, params, "flashcontent");
		
	}*/

}


function isObject(targetID){

	var isFound = false;
	var el = document.getElementById(targetID);
	
	if(el && (el.nodeName === "OBJECT" || el.nodeName === "EMBED")){
	
		isFound = true;
	
	}
	
	return isFound;

}


function replaceSwfWithEmptyDiv(targetID){

	var el = document.getElementById(targetID);
	
	if(el){
	
		var div = document.createElement("div");
	
		el.parentNode.insertBefore(div, el);
	
		//Remove the SWF
		swfobject.removeSWF(targetID);
	
		//Give the new DIV the old element's ID
		div.setAttribute("id", targetID);
		
	}

}
