/**
 * iPhone stuff
 */
if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) {  
	// REMOVES ALL STYLESHEETS ...
	for (var k=0;k < document.styleSheets.length; k++) {
		if (document.styleSheets[k].href != null && document.styleSheets[k].href.lastIndexOf("iphone") == -1) {
			document.styleSheets[k].disabled = true;
		}
	}
	window.scrollTo(0,1);
}

$(document).ready(function(){ 

});


function slideSwitch() {
    var $active = $('#header_image a.active');

    if ( $active.length == 0 ) $active = $('#header_image a:last');

    var $next =  $active.next().length ? $active.next()
        : $('#header_image a:first');

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    setInterval( "slideSwitch()", 6000 );
});

$.fn.equalHeights = function(px) {
    if(!isIP()) {
    var currentTallest = 0;
    $(this).each(function(i){
        if ($(this).height() > currentTallest) { currentTallest = $(this).height(); }
    });
    // for ie6, set height since min-height isn't supported
    if ($.browser.msie && $.browser.version == 6.0) { $(this).css({'height': currentTallest}); }
    $(this).css({'min-height': currentTallest}); 
    return this;
    }
};

function isIP() {
    if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) return true;
    else return false;
}

