
  function loadSWF(url, targetID,width,height){

	if(isObject(targetID)){
		replaceSwfWithEmptyDiv(targetID);

	}

	//Embed
	if (swfobject.hasFlashPlayerVersion("7")) {
		var attributes = { data: '/flash/admin.swf?flv='+url, width:width, height:height, wmode :"opaque" };
		var params = {allowFullScreen:true, wmode :"opaque"};
		var obj = swfobject.createSWF(attributes, params, targetID);

	}

}


  function loadSWFfront(cfg, targetID, advert){

	if(isObject(targetID)){
		replaceSwfWithEmptyDiv(targetID);

	}

	//Embed SWF
	if (swfobject.hasFlashPlayerVersion("7")) {
		var attributes = { data: '/flash/newvideopleer.swf?cfg='+cfg+'&advert='+(advert != 0 ? 1 : 0), width:400, height:300 };
		var params = {allowFullScreen:true};
		var obj = swfobject.createSWF(attributes, params, targetID);

	}

}
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);

	}

}

