/* * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * You can use this script but DO NOT REMOVE THIS LINES 
* * Code made by Iulia Constantin  
* * PHP Coder, Romania, www.phpcoder.ro  
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
//.....................................
function changeOpac(opacity, elemid) // change the opacity for different browsers
{
	var object=document.getElementById(elemid).style; 
	object.opacity=(opacity/100);
	object.MozOpacity=(opacity/100);
	object.KhtmlOpacity=(opacity/100);
	object.filter="alpha(opacity="+opacity+")";
}
//.......NORMAL..............................
function opacity(elemid, opacStart, opacEnd, millisec, gotourl)
{
	var speed=Math.round(millisec / 100); // speed for each frame
	var timer=0;	
	if(opacStart>opacEnd) // determine the direction for the blending, if start and end are the same nothing happens
	{
		for(i=opacStart;i>=opacEnd;i--) 
		{
			setTimeout("changeOpac("+i+",'"+elemid+"')",(timer*speed));
			timer++;
		}
		
	} 
	else if(opacStart<opacEnd)
	{
		for(i=opacStart;i<=opacEnd;i++)
		{
			setTimeout("changeOpac("+i+",'"+elemid+"')",(timer*speed));
			timer++;
		}
	}
	
	if(gotourl!='')
	{
		window.location=gotourl;
	}	
}
//.....................................
function phpcoder_fade_out(elemid, gotourl)
{
	opacity(elemid, 100, 0, 300, gotourl);
}
//.....................................
function phpcoder_fade_in(elemid, gotourl)
{
	opacity(elemid, 0, 100, 1000 , gotourl);
}
//.....................................
function phpcoder_clean_fade_out(elemid, gotourl)
{
	opacity(elemid, 100, 0, 0, gotourl);
}
//.....................................
function phpcoder_clean_fade_in(elemid, gotourl)
{
	opacity(elemid, 0, 100, 0 , gotourl);
}
//.....................................

//.......AJAX..............................
function opacity_ajax(elemid, opacStart, opacEnd, millisec, gotourl, gotoelem)
{
	var speed=Math.round(millisec / 100); // speed for each frame
	var timer=0;	
	if(opacStart>opacEnd) // determine the direction for the blending, if start and end are the same nothing happens
	{
		for(i=opacStart;i>=opacEnd;i--) 
		{
			setTimeout(
			function () {
							var object=document.getElementById(elemid).style; 
							object.opacity=(i/100);
							object.MozOpacity=(i/100);
							object.KhtmlOpacity=(i/100);
							object.filter="alpha(opacity="+i+")";
							
						}
			,
			(timer*speed)
			);
			timer++;
		}
		
	} 
	else if(opacStart<opacEnd)
	{
		for(i=opacStart;i<=opacEnd;i++)
		{
			setTimeout(
			function () {
							var object=document.getElementById(elemid).style; 
							object.opacity=(i/100);
							object.MozOpacity=(i/100);
							object.KhtmlOpacity=(i/100);
							object.filter="alpha(opacity="+i+")";
						}
			,
			(timer*speed)
			);
			timer++;
		}
	}
	
	if(gotourl!='')
	{
		makeRequest(gotourl, gotoelem);
	}	
}
//.....................................
function phpcoder_fade_out_ajax(elemid, gotourl, gotoelem)
{
	opacity_ajax(elemid, 100, 0, 4000, gotourl, gotoelem);
}
//.....................................
function phpcoder_fade_in_ajax(elemid, gotourl, gotoelem)
{
	opacity_ajax(elemid, 0, 100, 4000 , gotourl, gotoelem);
}
//.....................................





function move_opacity(id, opacStart, opacEnd, millisec)
{
	//alert(opacStart);

	var speed=Math.round(millisec / 100); // speed for each frame
	var timer=0;	
	if(opacStart>opacEnd) // determine the direction for the blending, if start and end are the same nothing happens
	{
		for(i=opacStart;i>=opacEnd;i--) 
		{
			setTimeout("move_changeOpac("+i+",'"+id+"')",(timer*speed));
			timer++;
		}
	} 
	else if(opacStart<opacEnd)
	{
		for(i=opacStart;i<=opacEnd;i++)
		{
			setTimeout("move_changeOpac("+i+",'"+id+"')",(timer*speed));
			timer++;
		}
	}
}

function move_changeOpac(opacity, id) // change the opacity for different browsers
{
	var object=document.getElementById(id).style; 
	object.opacity=(opacity/100);
	object.MozOpacity=(opacity/100);
	object.KhtmlOpacity=(opacity/100);
	object.filter="alpha(opacity="+opacity+")";
}
