/*
###########################################################################################################################
# DivFade is based on P91Fadeout V.0.9 by PA-S.de, Copyright 2008 PA-S.de
# DidFadein and additional features (opacity_start, opacity_end) added by
# Wolfgang Peters, http://www.seo-knights.com, Copyright 2009 - 2011 Wolfgang Peters
###########################################################################################################################
*/
function DivFadein(id, speed, opacity_start, opacity_end) {
	var fps = Math.round(speed / 100); 
	var tmp = 0;
    for(i = opacity_start; i <= opacity_end; i++) {
        setTimeout("DivFadein_fade('" + id + "'," + i + ")", (tmp * fps));
        tmp++;
    }
}
function DivFadein_fade(id, pas) {
	var heurix = document.getElementById(id).style;
	if(pas >0) {
		heurix.display = "block";
		heurix.opacity = (pas / 100);
		heurix.MozOpacity = (pas / 100);
		heurix.KhtmlOpacity = (pas / 100);
		heurix.filter = "alpha(opacity=" + pas + ")"; 
	} else {
		heurix.display = "none";
	}
}

function DivFadeout(id, speed, opacity_start, opacity_end) {
	var fps = Math.round(speed / 100); 
	var tmp = 0;
    for(i = opacity_start; i >= opacity_end; i--) {
        setTimeout("DivFadeout_fade('" + id + "'," + i + ")", (tmp * fps));
        tmp++;
    }
}
function DivFadeout_fade(id, pas) {
	var heurix = document.getElementById(id).style;
	if(pas > 0) {
		heurix.opacity = (pas / 100);
		heurix.MozOpacity = (pas / 100);
		heurix.KhtmlOpacity = (pas / 100);
		heurix.filter = "alpha(opacity=" + pas + ")"; 
	} else {
		heurix.display = "none";
	}
}

/* Only for use with Firefox - visibility:hidden instead of display:none opacity issue */
function DisplayNone(element_id) {
		document.getElementById(element_id).style.display='none;';
    }
