/**
 *  Ozhan Binici - http://www.ozhanbinici.com - http://www.katalist.com.tr
 *
 *	Banner Sliding
 *	
 */
 
var showInterval;
var hideInterval;
var start = 597;
var end = 397;
var step = 0;
var totalSteps = 40;
var stepSize = 5;

// the onload event handler that starts the transitions.
function showBanner() {
	if (document.getElementById("banner") != null){
		step = 0;
		showInterval = setInterval("showBannerStep()", 20);
	}
}

function hideBanner() {
	if (document.getElementById("banner") != null){
		step = 0;
		hideInterval = setInterval("hideBannerStep()", 20);
	}
}

function showBannerStep(){
	if (step <= totalSteps){
		banner = document.getElementById("banner");
		banner.style.marginTop = "-" + (start - step * stepSize) + "px";
		banner.style.height = (start - step * stepSize) + "px";
		step ++;
	}
	else{
		//setTimeout("hideBanner()", 20000);
		clearInterval(showInterval);
	}
}

function hideBannerStep(){
	if (step <= totalSteps){
		banner = document.getElementById("banner");
		banner.style.marginTop = "-" + (end + step * stepSize) + "px";
		banner.style.height = (end + step * stepSize) + "px";
		step ++;
	}
	else{
		clearInterval(hideInterval);
	}
	
}

