var opacityEffect = function opacity(id, plus, minus, array)
{
	var object = document.getElementById(id).style;
	object.opacity = 0;
	object.filter = "alpha(opacity=" + 0 + ")";
	object.pos = 0;
	object.delay = 3500;
	
	var increase = function increaselpha(){
		object.delay = 3500;
			var alpha = setInterval(function(){
					object.opacity = parseFloat(object.opacity) + plus;
					object.filter = "alpha(opacity=" + (parseFloat(object.opacity) + plus) * 100 + ")";
					
					if(object.opacity >= 1)
					{
						clearInterval(alpha);
						setTimeout(function(){decrease()},object.delay);
					}
				},50);
	}

	var decrease = function decreaseAlpha(){
			var alpha = setInterval(function(){
					object.opacity = parseFloat(object.opacity) - minus;
					object.filter = "alpha(opacity=" + (parseFloat(object.opacity) - minus) * 100 + ")"; 
					
					if(object.opacity <= 0.10)
					{
						if(array!=null)changeImage();
						clearInterval(alpha);
						increase();
					}
				},50);
	}
	
	var changeImage = function image()
	{	
				array[object.pos] = array[object.pos].replace(/<\!\-\-/gi," ");
				array[object.pos] = array[object.pos].replace(/\-\->/gi," ");
				document.getElementById(id).innerHTML = array[object.pos];
				++object.pos;
				if(object.pos >= 5 || object.pos < 0) object.pos = 0;			
	}
	
	increase();
	return object;
}

var clearInput = function(id)
{
	var object = document.getElementById(id).getElementsByTagName('input');
	for(i = 0; i <object.length; i++)
	{
		object[i].value = "";	
	}
}
