//fadeOut
//function start
function fadeOut(ele,speed){
var ele=document.getElementById(ele);
var opacitynum=ele.style.opacity||1;
var speed=(speed/100)||10;
function opacityOff(){
if(opacitynum>0){
ele.style.opacity=opacitynum=(opacitynum-0.01).toFixed(2);
}else{
clearInterval(opacityt);
}
}
var opacityt=setInterval(opacityOff,speed);
}
//function end //fadeIn
//function start
function fadeIn(ele,speed){
var ele=document.getElementById(ele);
var opacitynum=ele.style.opacity||0;
var speed=(speed/100)||10;
function opacityAdd(){
if(opacitynum<1){
ele.style.opacity=opacitynum=(parseFloat(opacitynum)+0.01).toFixed(2);
}else{
clearInterval(opacityt);
}
}
var opacityt=setInterval(opacityAdd,speed);
}
//function end