var hasFlash=true;
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;

function putFlash(vTarget,vWidth,vHeight,vName,vPath,swLC,setAlter){
	detectFlash();
    if(setAlter && FlashDetected()){flashConvertion(vTarget,setAlter);}
    if(!hasFlash)return;
    var strObjHTML = "<object align='middle' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' ";
	strObjHTML += "width='" + vWidth + "' ";  
	strObjHTML += "height='" + vHeight + "' ";
	strObjHTML += "id='" + vName + "' >";
	strObjHTML += "<param name='movie' value='" + vPath + "' /><param name='allowScriptAccess' value='sameDomain' /><param name='quality' value='best' /><param name='wmode' value='transparent' /><param name='bgcolor' value='#ffffff' />";
	strObjHTML += "<embed quality='best' wmode='transparent' bgcolor='#ffffff' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' align='right' allowScriptAccess='sameDomain'";
	strObjHTML += " src='" + vPath + "'"; 
	strObjHTML += " width='" + vWidth + "'"; 
	strObjHTML += " height='" + vHeight + "'"; 
	if(swLC==true){
	  strObjHTML += "swLiveConnect=true";
	}
	strObjHTML += " name='" + vName + "' /></object>";
    var targetObj = document.getElementById(vTarget);
	targetObj.innerHTML = strObjHTML;
}
function flashConvertion(vTarget,setAlter){
var targetObj = document.getElementById(vTarget);
	if(setAlter=="getFlash"){
		targetObj.innerHTML = "Get Flash";
	}else{alert(setAlter);
		targetObj.style.width="200px";
		targetObj.parentElement.style.width="200px";
	}
}
function detectFlash(){
	if ((navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.indexOf("Mac") == -1 && navigator.appVersion.indexOf("3.1") == -1) || (navigator.plugins && navigator.plugins["Shockwave Flash"]) || navigator.plugins["Shockwave Flash 2.0"]){
		hasFlash=true; return true;
	}else{
	 	hasFlash=false; return false;
	}
}


