// JavaScript Document
$(document).ready(function() {
    pic1= new Image(296,119); 
    pic1.src=""; 


    if ($.cookie('quicklinks') == null){
	
        $.cookie('quicklinks','true', { expires: 2000, path: '/'});
        $.cookie('quicklinks_new','true', { expires: 14, path: '/'});
		
    }

    if ($.cookie('quicklinks_new') != null && $.cookie('quicklinks_close') == null){
	//$('redmsg').style.display = "none";
        window.setTimeout(function() {
            if ($.cookie('quicklinks_close') == null){$('#callout').fadeIn("slow");}
        }, 5000);
    }
    
    $('#callout a').click(function(){
		
        $('#callout').hide();
        $.cookie('quicklinks_close','true', {expires: 1, path: '/'});
    });


     $(window).scroll(function(){
        var scrollPosition = $(window).scrollTop(); 
        if (scrollPosition < 10) {$("#callout").css("background-image","url(/images/ql_callout.png)");} else {$("#callout").css("background-image","url(/images/ql_callout_scrolled.png)");}
    });


   
        $('#callout').hide();
		//document.getElementById('Layer2').style.top='764px';
        $('#quicklinks').slideToggle();
        $('#qlButton').css('background-color','#fff');
        $.cookie('quicklinks_close','true', {expires: 1, path: '/'});

    
    $('.kwicks li').each(
        function(i){
            var qlCol =$(this);
            qlCol.css('width', '134px');
            qlCol.css('height','auto');
        }

    );
          
    $('.kwicks').kwicks({
			max : 280,
			spacing : 5 
		});
			
		$("li[id^='kwick_']").each(
			function(idx){
				idx = idx + 1;
				$('#kwick_' + idx + ' a').hover(
					function() {
						if (this.title != ''){
							$('#info_' + idx).html(this.title).show();
							this.title = '';
						}else{
							$('#info_' + idx).html('').hide();
						}
					},
			
					function() {
						$('#info_' + idx).hide();
						this.title = $('#info_' + idx).html();
					}
				);
			}
		);
			
		$('#quicklinks').bind("mouseleave",function(){document.getElementById('redmsg1').style.display='block';document.getElementById('Layer2').style.top='374px';$('#quicklinks').slideUp();$('#qlButton').css('background-color','');});
});

