﻿/* -----------------------------------------------
   Explorer Object Starter - v.1.1
   (c) 2007 www.haan.net
   contact: jeroen@haan.net
   You may use this script but please leave the credits on top intact.
   Please inform us of any improvements made.
   When usefull we will add your credits.
  ------------------------------------------------ */

// fixes the Internet Explorer ActiveX update 912812 which prevents third party plugins from running automatically


window.onload = function()
{
	//alert("Dang Vao day roi");
	//fixFlash();
}
function fixFlash()
{
	//alert("Vao day roi");
	objects = document.getElementsByTagName("object");
	for (var i = 0; i < objects.length; i++)
	{
		objects[i].outerHTML = objects[i].outerHTML;
	}

	embed = document.getElementsByTagName("embed");
	for (var i = 0; i < embed.length; i++)
	{
		embed[i].outerHTML = embed[i].outerHTML;
	}
}



function fixFlashByID(id , strLink)
{
	var objects = document.getElementById(id);
	 var theFlashVars = "";
	var theParams = objects.getElementsByTagName("param");
	var theParamsLength = theParams.length;
	//alert(strLink);
	for (var j = 0; j < theParamsLength; j++) {
	       if(theParams[j].name.toLowerCase() == 'flashvars')
	       {
			
			 theFlashVars = theParams[j].value;      
			 
	       }
	 }
	 
	//alert(strLink);
	//alert(theFlashVars);
	strLink = "link="+ strLink;
	 var theOuterHTML = objects.outerHTML;    
	 var re = '<PARAM NAME="FlashVars" VALUE="">';
	 theOuterHTML = theOuterHTML.replace(re,"<param name='FlashVars' value='" + strLink + "'>");    
 	objects.outerHTML = theOuterHTML;
 	
	//alert(objects.outerHTML);
	//alert(theFlashVars);
	
}



// FIX EOLAS version 2
//
// (c) David Grudl
//
// more info: http://knowhow.dgx.cz/eolas-workaround/

/*
var objects = document.getElementsByTagName("object");

function eolas(i)
{
    objects[i].outerHTML = objects[i].outerHTML;
}

for (var i=0; i<objects.length; i++)
    window.setTimeout("eolas(" + i + ")", 1);
*/