$(document).ready(function(){	
	$('body').append('<div id="bumper"><div id="bumper-holder"><div id="bumper-text"></div><div id="bumper-ok"><a href="#" target="_blank"></a></div><div id="bumper-cancel"><a href="#"></a></div></div><div id="bumper-close"></div></div>');

	// Ok button effects
	$('#bumper-ok a').mouseover(function(){
		$('#bumper-ok a').stop;
		$('#bumper-ok a').animate({opacity:0},300);
		$('#bumper-ok').animate({opacity:1},300);
	});
	$('#bumper-ok a').mouseout(function(){
		$('#bumper-ok a').stop;
		$('#bumper-ok a').animate({opacity:1},300);
	});
	
	
	// Cancel button effects
	$('#bumper-cancel a').mouseover(function(){
		$('#bumper-cancel a').stop;
		$('#bumper-cancel a').animate({opacity:0},300);
	});
	$('#bumper-cancel a').mouseout(function(){
		$('#bumper-cancel a').stop;
		$('#bumper-cancel a').animate({opacity:1},300);
	});
	
	
	$('#bumper').animate({opacity:0},1);
	
	});
	
$(window).scroll(function(){
	$('#bumper-holder').css('margin-top', ($('html').scrollTop()+100)+"px");
});
	
	
	
	
function openBumper(url,target,omniture){
	//$('#bumper').clearQueue();
	$('#bumper').css('display','block');
	$('#bumper').animate({opacity:1});
	$('#bumper').css('height',$('body').outerHeight()+"px");
	$('#bumper-close').animate({opacity:0.8});
	$('#bumper-cancel a').click(function(){closeBumper();});
	$('#bumper-ok a').attr('href',url);
	$('#bumper-ok a').attr('target',target);
	$('#bumper-close').mousedown(function(){closeBumper();});
	$('#bumper-holder').css('margin-top', ($('html').scrollTop()+100)+"px");
	$('#bumper-holder').css('margin-left', $('body').outerWidth()/ 2 - $('#bumper-holder').outerWidth()/2 +"px");
}
	



function closeBumper(){
	//$('#bumper').clearQueue();
	$('#bumper').animate({opacity:0},500,
		function(){
			$('#bumper').css('display','none');
			try{
				if(navigator.appName.indexOf("Microsoft") == -1){
					document['header'].leaving(false);
				}else{
					window['header'].leaving(false);
				}
			}catch(e){console.log(e);}
		}
	);
}
	
