
$(document).ready(function()
{
		// hide overlay
		$('#overlay').hide();
		
		$('#top_ad').click(function(){
			// show the ad window
			$('#ad_window').show(0,function()
			{
				// put the add in the ad window
				var banner = "<a href='javascript:close_ad()'><img src='http://www.ktools.net/images/close.button.png' style='position: absolute; margin-left: 10px; margin-top: 10px; border: 0;' id='ad_close' /></a>";
				// ktools 30% off bundle special
				banner += "<a href='http://www.ktools.net/cart.php?add=127'><img src='http://www.ktools.net/images/banners/sale.bundle.345.jpg' style='border: 0;' /></a>";
				$('#ad_window').html(banner);							
			});
			
			// show overlay
			overlay();
			
			return false;
		});
		
		$('#ps_banner_bundle').click(function(){
			// show the ad window
			$('#ad_window').show(0,function()
			{
				// put the add in the ad window
				var banner = "<a href='javascript:close_ad()'><img src='http://www.ktools.net/images/close.button.png' style='position: absolute; margin-left: 10px; margin-top: 10px; border: 0;' id='ad_close' /></a>";
				// ktools 30% off bundle special
				banner += "<a href='http://www.ktools.net/cart.php?add=127'><img src='http://www.ktools.net/images/banners/sale.bundle.345.jpg' style='border: 0;' /></a>";
				$('#ad_window').html(banner);							
			});
			
			// show overlay
			overlay();
			
			return false;
		});
		
		//$('#top_ad_div').css("opacity","0.0");
		//$('#top_ad_div').stop().animate({opacity: 1.0},700);
		//$('#top_ad').hide();
		//$('#top_ad_div').slideDown('slow');
		
		//$('#top_ad_div').stop().animate({height: '22px'},700,function(){
		//});
});

function close_ad()
{
	$('#ad_window').hide();
	$('#overlay').hide();
}

function overlay()
{
	// set the opactity to 0 initially
	$('#overlay').css("opacity","0.0");
	$('#overlay').show(0,function()
	{
		$('#overlay').stop().animate({opacity: 0.7},700);
	});
}

// added in for old FAQs
function displaybool(div_id){
	if(document.getElementById(div_id).style.display == "block"){
		document.getElementById(div_id).style.display='none';
		//document.more["'+div_id+'"].style.display='none';
	} else {
		document.getElementById(div_id).style.display='block';
	}
}

function show_div(div_id){
	document.getElementById(div_id).style.display='block';
}

function hide_div(div_id){
	document.getElementById(div_id).style.display='none';
}

function hide_timer(id){
	document.getElementById(id).style.display='none';
}