<!-- // Detect Client Browser type
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;
var isMozilla = (navigator.userAgent.indexOf("Mozilla") != -1) ? true : false;

jsVersion = 1.1;
// JavaScript helper required to detect Flash Player PlugIn version information
function JSGetSwfVer(i){
	// NS/Opera version >= 3 check for Flash plugin in plugin array
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
      		var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
			descArray = flashDescription.split(" ");
			tempArrayMajor = descArray[2].split(".");
			versionMajor = tempArrayMajor[0];
			versionMinor = tempArrayMajor[1];
			if ( descArray[3] != "" ) {
				tempArrayMinor = descArray[3].split("r");
			} else {
				tempArrayMinor = descArray[4].split("r");
			}
      		versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
            flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
      	} else {
			flashVer = -1;
		}
	}
	// MSN/WebTV 2.6 supports Flash 4
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
	// WebTV 2.5 supports Flash 3
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
	// older WebTV supports Flash 2
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
	// Can't detect in all other cases
	else {
		
		flashVer = -1;
	}
	return flashVer;
} 
// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision) 
{
	var hasReqVersion = false;
 	reqVer = parseFloat(reqMajorVer + "." + reqRevision);
   	// loop backwards through the versions until we find the newest version	
	for (i=25;i>0;i--) {	
		if (isIE && isWin && !isOpera) {
			versionStr = VBGetSwfVer(i);
		} else {
			versionStr = JSGetSwfVer(i);		
		}
		if (versionStr == -1 ) { 
			hasReqVersion = false;
		} else if (versionStr != 0) {
			if(isIE && isWin && !isOpera) {
				tempArray         = versionStr.split(" ");
				tempString        = tempArray[1];
				versionArray      = tempString .split(",");				
			} else {
				versionArray      = versionStr.split(".");
			}
			versionMajor      = versionArray[0];
			versionMinor      = versionArray[1];
			versionRevision   = versionArray[2];
			
			versionString     = versionMajor + "." + versionRevision;   // 7.0r24 == 7.24
			versionNum        = parseFloat(versionString);
        	// is the major.revision >= requested major.revision AND the minor version >= requested minor
			if ( (versionMajor > reqMajorVer) && (versionNum >= reqVer) ) {
				hasReqVersion = true;
			} else {
				hasReqVersion = ((versionNum >= reqVer && versionMinor >= reqMinorVer) ? true : false );	
			}
		}
	}
	return hasReqVersion;
}

//Added on august 1st 06
//To replace <object> tags preesnt in the source by a hidden span tag
//This will ensure that the Flash content gets activated

function objectReplace()
{
	// Decide whether control should work only for Flash objects or any
	// activeX objects
	var flashOnly = true;
	//Check if current browser is IE or not. Execute the object swapping
	//only if the browser is IE
	var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
	if(isIE==true)
	{									
		//Add a stylesheet for the hidden/visible classes, to prevent a jump after
		//the object is replaced.
		document.write("<style> object{visibility:hidden;}</style>");									
		//Get a list of all ActiveX objects
		var objects = document.getElementsByTagName('object');
		for (var i=0; i<objects.length; i++)
		{
			var o = objects[i];
			//The outer html omits the param tags, so we must retrieve
			//and insert these separately
			var paramList = o.getElementsByTagName('param');
			var params = "";
								
			//Ideally this should be used but the new Generic Flash template has
			//nearly 100 param tags and this is slowing down the process. 
			/*for (var j = 0; j<=paramList.length; j++)
				{
					if (paramList[j] != null)
					{
						var hasFlash =DetectFlashVer(7,0,0);
						if (!hasFlash)
						{
							stripFlash(o, paramList);
							break;
						}
						params += paramList[j].outerHTML;											       
						
					}
				}*/	
													
			//If flashOnly var is true then only flash objects and those
			//marked with objectH will be replaced.
			if (flashOnly && o.outerHTML.indexOf("application/x-shockwave-flash") == -1 
			&& o.className.indexOf ("replaceFlash") == -1)
			{
					continue;
			}									
			//Get the tag and attributes part of the outer html of the object
			var tag = o.outerHTML.split(">")[0] + ">";	
				//Add up the various bits that comprise the object:
				//The tag with the attributes, the params and it's inner html
			var newObject = tag + o.innerHTML + " </OBJECT>";
				//And rewrite the outer html of the tag 
			o.outerHTML = newObject;
		}
		//Make the object visible again
		document.write ("<style> object{visibility:visible;}</style>");
									
	}
}
//Replace the object by a div tag containing the same innerHTML.
//To display a message for the user and a link to the flash installation
//page, place it inside the object tag.
stripFlash = function (o, paramList){
	var newHTML = o.innerHTML
	newHTML = newHTML.replace ("embed", "span")	
	var d = document.createElement("div")
	d.innerHTML = newHTML
	d.className = o.className
	d.id = o.id
	o.parentNode.replaceChild(d, o)
}
