if (navigator.platform == "Win32" && navigator.appName == "Microsoft Internet Explorer" && window.attachEvent && navigator.userAgent.indexOf("Opera")==-1)
{
	document.writeln('<style type="text/css"></style>');//img { visibility:hidden; } 
	window.attachEvent("onload", LoadPng);
}

function LoadPng()
{
	var rslt = navigator.appVersion.match(/MSIE (\d+\.\d+)/, '');
	var itsAllGood = (rslt != null && Number(rslt[1]) >= 5.5);

	for (var i = document.images.length - 1, img = null; (img = document.images[i]); i--)
	{
		if (itsAllGood && img.src.match(/\.png$/i) != null)
		{
			var src = img.src;
			img.style.width = img.width + "px";
			img.style.height = img.height + "px";
			img.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='scale')"
			img.src = "images/1px.gif";
		}
		img.style.visibility = "visible";
	}
}

/*
var isNetscape6=false;
if (navigator.appName == "Netscape" && parseFloat(navigator.appVersion) >= 5) 
isNetscape6=true;


This script has been disabled for 
Netscape 6 due to ugly scrollbar 
activety. Could probably be fixed 
with a clipped container div but 
can't be bothered.


if (!isNetscape6)
{
	//So hinh
	num=15; //Smoothness depends on image file size, the smaller the size the more you can use!
	//thoi gian dung lai
	stopafter=30000; //seconds!
	//load danh sach hinh
	//pics=new Array("al.gif","bl.gif","cl.gif","dl.gif","el.gif","fl.gif"); 
	//pics=new Array("../images/maicopy2.png","../images/maicopy3.png","../images/maicopy5.png"); 
	pics=new Array("../images/mai1.png","../images/mai2.png","../images/mai3.png"); 
	
	load=new Array();
	for(i=0; i < pics.length; i++){
 	load[i]=new Image();
 	load[i].src=pics[i];
}
stopafter*=1000;
timer=null;
y=new Array();
x=new Array();
s=new Array();
s1=new Array();
s2=new Array();
if (document.layers)
{
	for (i=0; i < num; i++)
	{
 		randomleaf = pics[Math.floor(Math.random()*pics.length)];
 		document.write("<LAYER NAME='leaf"+i+"' LEFT=0 TOP=0><img src="+randomleaf+"></LAYER>");
 	}
}
if (document.all){
document.write('<div style="position:absolute;top:0px;left:0px"><div style="position:relative">');
 for (i=0; i < num; i++){
 randomleaf = pics[Math.floor(Math.random()*pics.length)];
 document.write('<img id="leaf'+i+'" src="'+randomleaf+'" style="position:absolute;top:0px;left:0px">');
 }
 document.write('</div></div>');
}
if (!document.all&&!document.layers){
 for (i=0; i < num; i++){
 randomleaf = pics[Math.floor(Math.random()*pics.length)];
 document.write("<div id='leaf"+i+"' style='position:absolute;top:0px;left:0px'><img src="+randomleaf+"></div>");
 }
}
//inih=(document.all)?window.document.body.clientHeight:window.innerHeight-100;
//iniw=(document.all)?window.document.body.clientWidth:window.innerWidth-100;
inih =(document.all)?window.document.body.clientHeight:window.innerHeight-100;
iniw = (document.all)?window.document.body.clientWidth-100:window.innerWidth-100;
for (i=0; i < num; i++){                                                                
 y[i]=Math.round(Math.random()*inih);
 x[i]=Math.round(Math.random()*iniw);
 if(x[i] > iniw )
 	x[i]=iniw ;
 s[i]=Math.random()*5+3;
 s1[i]=0;
 s2[i]=Math.random()*0.1+0.05;
}
function fall(){
h=(document.all)?window.document.body.clientHeight:window.innerHeight;
w=(document.all)?window.document.body.clientWidth:window.innerWidth;
scy=(document.all)?document.body.scrollTop:window.pageYOffset;
scx=(document.all)?document.body.scrollLeft:window.pageXOffset;
for (i=0; i < num; i++){
sy=s[i]*Math.sin(90*Math.PI/180);
sx=s[i]*Math.cos(s1[i]);
y[i]+=sy;
x[i]+=sx; 
if(x[i] > iniw)
	x[i]=iniw;
if (y[i] > h){
 y[i]=-60;
 x[i]=Math.round(Math.random()*w);
 if(x[i] >iniw)
	x[i]=iniw;
 s[i]=Math.random()*5+3;
}
s1[i]+=s2[i];
if (document.layers){
 document.layers["leaf"+i].left=x[i];
 document.layers["leaf"+i].top=y[i]+scy;
}
else{
 document.getElementById("leaf"+i).style.left=x[i];
 document.getElementById("leaf"+i).style.top=y[i]+scy;
} 
}
timer=setTimeout('fall()',50);
}
fall();

function dsbl(){
for (i=0; i < num; i++){
 if (document.layers)
 document.layers["leaf"+i].visibility="hide";
 else
 document.getElementById("leaf"+i).style.visibility="hidden";
}
clearTimeout(timer);
}
setTimeout('dsbl()',stopafter);
}*/
