/*
	dresner facial plastic surgery - healthpartners 2010
	global js
*/

$(document).ready(function() {
	
		// Adds the class .has-js to <html> if javascript is enabled
	$("html").addClass("has-js");

 		// Adds the class .mac to <html> if OS is Mac OS X
 	if ($.client.os == "Mac") {
    		$("html").addClass("mac");
 	}
		// Adds the class .win to <html> if OS is Windows
 	if ($.client.os == "Windows") {
    		$("html").addClass("win");
 	}
 		// Adds the class .moz to <html> if user-agent is mozilla
	if ($.browser.mozilla) {
    	$("html").addClass("moz");
 	}
 		// Adds the class .webkit to <html> if user-agent is webkit
 	if ($.browser.webkit) {
    	$("html").addClass("webkit");
 	}
 		// Adds the class .ipad to <html> if OS is iPad 
 	if ($.client.os == "iPad") {
    		$("html").addClass("ipad");
 	}
 		// Adds the class .iphone to <html> if OS is iPhone/iPod Touch 
 	if ($.client.os == "iPhone") {
    		$("html").addClass("iphone");
 	}
 		
		// Open links in new blank window
 	$("a[rel*=external], a[rel*=nofollow]").live("click", function() {
  		window.open(this.href);
  		return false;
  	}); 
  	
		// ie roundies - top left - top right - bottom right - bottom left
	if ($.browser.msie && $.browser.version <= 8 ) {
		DD_roundies.addRule('ul#navigation', '0 0 8px 8px');
		DD_roundies.addRule('#navigation a#home', '0 0 0 8px');
		DD_roundies.addRule('#navigation a#contact', '0 0 8px 0');
		DD_roundies.addRule('.bordered', '8px');
		DD_roundies.addRule('.container-header', '8px 8px 0 0');
		DD_roundies.addRule('.container-body', '0 0 8px 8px');
	}
	
  		// reposition banner
	if ($("#banner").attr("id") == "banner") { 
		$("h1").addClass("banner-title");
	}
	
		// Gecko 1.9.0 or less font-face override
	$.each($.browser, function(i, val) {
   		if(i=="mozilla" && $.browser.version.substr(0,5)<="1.9.0") {
	  		$(".container-header h1").css({'font-size' : '23px', 'margin-top' : '8px'});
	  		$("a.schedule").css({'font-size' : '17px', 'padding-left' : '24px'});
	  	}
 	});
 	
		// Schedule Animation
/*	$("a.schedule").css({backgroundPosition: '0 0'}).mouseover(function() {
			$(this).stop().animate({ backgroundPosition:"(0 -93px)"}, {duration:500})
		}).mouseout(function() {
			$(this).stop().animate({ backgroundPosition:"(0 0)" }, {duration:500})
	});
*/	
		// Phone Number
	if (location.hash == "#phone-number") {
			$.fn.colorbox({open:true, inline:true, scrolling:false, href:"#main-phone-number"});
	}
	
	if ($.client.os != "iPad" && $.client.os != "iPhone") {
		$("a[rel*=phone-number]").click(function() {
			$.fn.colorbox({open:true, inline:true, scrolling:false, href:"#main-phone-number"});	
			return false;
		});
	}
	
		// Button Color Hover
	$(".button").hover(function() {
    	$(this).stop().animate({textShadow: "#26a69e"}, 200);
	}, function() {
		$(this).stop().animate({textShadow: "#42c5bd"}, 200);
	});
	
		// Navigation Button Color Hover
	$("ul#navigation a").hover(function() {
    	$(this).stop().animate({backgroundColor: "#bcbcbc"}, 100);
	}, function() {
		$(this).stop().animate({backgroundColor: "#dbdcdd"}, 100);
	});
	
	$("ul#navigation a.active").hover(function() {
    	$(this).stop().animate({backgroundColor: "#bcbcbc"});
	});
		
});

