// JavaScript Document
function fade_out(id,max,min) {
	var ct = min;
	var waiter = 123;
	var delay = waiter;
	var max = parseInt(max)-1;
	//alert(id);
	while (ct > max) {
		if (ct<10) {
	  		var opacity="." + ct;
			var filter = ct+'0';
		} else {
		  	var opacity=ct;
			var filter = ct+'0';
		}
		setTimeout("top.document.getElementById('"+id+"').style.opacity='"+opacity+"'",parseInt(delay)); 
		setTimeout("top.document.getElementById('"+id+"').style.filter='alpha(opacity="+filter+")'",parseInt(delay)); 
		var ct = parseInt(ct)-1;
		var delay = delay+waiter;

		}

	
}
function fade_in(id,max,min) {
	var ct = min;
	var waiter = 123;
	var delay = waiter;
	var max = parseInt(max)+1;
	while (ct < max) {
		if (ct<10) {
	  		var opacity="." + ct;
			var filter = ct+'0';
		} else {
		  	var opacity=1;
			var filter = ct+'0';
		}
		if (id == 'loadbody') {
		//	alert(opacity);
		}
		setTimeout("top.document.getElementById('"+id+"').style.opacity='"+opacity+"'",parseInt(delay)); 
		setTimeout("top.document.getElementById('"+id+"').style.filter='alpha(opacity="+filter+")'",parseInt(delay)); 
		//setTimeout("document.getElementById('"+id+"').className='o"+ct+"'",parseInt(delay)); 
		var ct = parseInt(ct)+1;
		var delay = delay+waiter;

		//alert(id);
	}
	
}
function slideshow(id,imagecount,current) {
	var next = parseInt(current)+1;
	//alert(next);
	if (next > parseInt(imagecount)) {
		var next = 1;
		count = 1;
	}
	if (slidecount%2 == 0) {
		//even
		document.getElementById(id+'img_1').src=headimage[next];
		fade_out(id+"2",0,10);
		fade_in(id+"1",10,0);
		//alert(headimage[next]);
		//alert(id+"1");
	} else {
		//odd
		document.getElementById(id+'img_2').src=headimage[next];
		fade_out(id+"1",0,10);
		fade_in(id+"2",10,0);
		//alert(headimage[next]);
		//alert(next);
	}
	slidecount = slidecount+1;
	//alert(count);
	setTimeout("slideshow('"+id+"','"+imagecount+"','"+next+"')",10000);
	//alert();
	//alert(imagecount);
}
