$(function () {
	$('h2').sifr({
		path:'/wp-content/themes/city/images/',
		font:'trade_gothic_bold',
		height:50
	});
	$('h3').sifr({
		path:'/wp-content/themes/city/images/',
		font:'trade_gothic',
		height:30
	});	
	
	$('#topSquares').flash({
        src: '/wp-content/themes/city/images/squares.swf',
        width: 57,
        height: 28,
        wmode: 'transparent'
		});
	

jQuery.each(jQuery.browser, function(i) {
  if($.browser.msie && jQuery.browser.version.substr(0,1) < 7){
     var iesix = 'true';
  }
});

  // only do this if it's NOT ie6
	if (iesix != 'true') setTimeout("doHeaderImages();",10000);
	
  $("#navigation h1").click(function() {
      window.location="/";
  });
  
  $("#navigation h1").hover(function() {
  	$(this).addClass("pointer");
  },function(){
    $(this).removeClass("pointer");
  });
	

	
});

function doHeaderImages() {
	$('#navigation h1 a').fadeOut(2000, function() {
		 $('#navigation h1 a').css('background-image', 'url(/wp-content/themes/city/images/header.php?foo='+rnd()+')');
		 $('#navigation h1 a').wait(10000).fadeIn(2000, function(){
		 	$('#navigation h1').css('background-image', 'url(/wp-content/themes/city/images/header.php?foo='+rnd()+')');
		 	setTimeout("doHeaderImages();",10000);
		}); 
	});
}


    $.fn.wait = function(time, type) {
        time = time || 1000;
        type = type || "fx";
        return this.queue(type, function() {
            var self = this;
            setTimeout(function() {
                $(self).dequeue();
            }, time);
        });
    };

function rnd(){ return String((new Date()).getTime()).replace(/\D/gi,'') }
