

function initScroll()
{
	var compliteScroll = 1;
	var sub_scroll = document.getElementById("sub_slideshow");
	var next_but = document.getElementById("nextbutton");
	var prev_but = document.getElementById("prevbutton");
	var comm_head = document.getElementById("commhead");
	var school_head = document.getElementById("schoolhead");
	var comm_list = document.getElementById("comm_list");
	var school_list = document.getElementById("school_list");
	if (sub_scroll /*&& next_but && prev_but*/){
	sub_scroll.style.left = 0 + 'px';
	if (next_but)
	{
		next_but.onclick = function()
		{
			if (compliteScroll)
			{
						sub_scroll.mooeffect = new Fx.Styles( sub_scroll, {duration: 500,
										onStart: function(){
											compliteScroll = 0;
										},
										onComplete: function(){
											compliteScroll = 1;
											school_head.className = "active";
											comm_head.className = "";
											comm_list.className = "";
											school_list.className = "activeul";
										}		
		});
						sub_scroll.mooeffect.custom({'left':[0]});
			}
		}
	}
	if (prev_but)
	{
		prev_but.onclick = function()
		{	
				if (compliteScroll)
				{
							sub_scroll.mooeffect = new Fx.Styles( sub_scroll, {duration: 500,
											onStart: function(){
												compliteScroll = 0;
											},
											onComplete: function(){
												compliteScroll = 1;
												comm_head.className = "active";
												school_head.className = "float_right";
												comm_list.className = "activeul";
												school_list.className = "";
											}		
			});
							sub_scroll.mooeffect.custom({'left':[-450]});
				}
		}		
	}
}
}


if (window.addEventListener)
	window.addEventListener("load", initScroll, false);
else if (window.attachEvent)
	window.attachEvent("onload", initScroll);