// 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,headimage2,headimagelink2,slidecount) {
	headerimage = headimage2.split(",");
	headerimagelink = headimagelink2.split(",");
	var next = parseInt(current)+1;
	//alert(headimage2[1]);
	if (next > parseInt(imagecount)) {
		var next = 1;
		count = 1;
	}
	if (slidecount%2 == 0) {
		//even
		document.getElementById(id+'img_1').src=headerimage[next];
		document.getElementById('galleryid').value=headerimagelink[next]
		fade_out(id+"2",0,10);
		fade_in(id+"1",10,0);
		//alert(headimage[next]);
		//alert(id+"1");
		var slidecount =1;
	} else {
		//odd
		document.getElementById(id+'img_2').src=headerimage[next];
		fade_out(id+"1",0,10);
		fade_in(id+"2",10,0);
		//alert(headimage[next]);
		//alert(next);
		var slidecount = 2;
	}
	//alert(count);
	setTimeout("slideshow('"+id+"','"+imagecount+"','"+next+"',\""+headimage2+"\",\""+headimagelink2+"\",'"+slidecount+"')",10000);
	//alert();
	//alert(imagecount);
}
function loadpage() {
		fade_out('loaderwin','0','10');
		setTimeout("fade_in('maincontent','10','0')",1500);
		//makeWimpyPlayer('/music/playlist.xml');
		//setTimeout("wimpy_play()",10000);
}