jQuery(document).ready(function(){	
								
	//hide menu on load
	jQuery("p.active").hide();
	
	//add class 'last' to last topper element
	jQuery("#innermenu > .abscontainer").last().addClass('last');
	
	//add the brackets around submenu hover //<div class="flasher" style="filter: alpha(opacity=0); ZOOM: 1;"></div>
	var txt;
	jQuery("p.active > a").hover(
		function() {
			txt = jQuery(this).html();
			jQuery(this).prepend("[&nbsp;&nbsp;").append("&nbsp;&nbsp;]").append("<div class='flasher' style='filter: alpha(opacity=0); ZOOM: 1;'></div>");
			jQuery(this).find('.flasher').stop().animate({opacity: .65}, 175, "easeOutSine", function(){
				jQuery(this).fadeOut(100, "easeOutExpo");
			});
		}, 
		function() {
			jQuery(this).find('.flasher').hide().parent().css({'background-position':'0 0'}).css({'font-weight':'normal'}).html(txt);
		}
	);
	
	/*jQuery("p.active > a").each(function() {
		jQuery(this).append("<div class='flasher'></div>");
	});*/
	
	//jQuery("div.sub").fadeTo("0", 0.9);
	jQuery("a.active").mouseover(function(){menuShow(this); return(false);});
													
	jQuery(".content").mouseover(function(){
		jQuery(".topsub > p.active").stop().slideUp(800).removeClass("topsub");
 	});
	
	//no boxy outline on clicks
	jQuery("a").focus(function() {
		jQuery(this).blur();
	});
	
	
	//callout actions/movements
	var ind;
	jQuery("area").hover(
		function() {
			ind = jQuery(this).index();
			jQuery('.oranges').children().eq(ind).stop().animate({left:"18px"},350, "easeOutExpo");
		},
		function() {
			jQuery('.oranges').children().eq(ind).stop().animate({left: "0px"}, 400, "easeOutExpo");
		}
	);
	
	moveArrow('.call-bill');
	moveArrow('.call-apt');
	moveArrow('.call-invis');
	
	jQuery('.call-apt').hover(
		function() {
			jQuery(this).children('.mouse').stop().animate({
				top: "-=10"	
			}, 500, "easeOutExpo");
		},
		function() {
			jQuery(this).children('.mouse').stop().animate({
				top: "50px"
			}, 400, "easeOutExpo");
		}
		
	
	);
	
	
	jQuery('.call-bill').hover(
		function() {
			jQuery(this).children('.pay').stop().animate({
				top: "-=10"	
			}, 500, "easeOutExpo");
		},
		function() {
			jQuery(this).children('.pay').stop().animate({
				top: "50px"
			}, 400, "easeOutExpo");
		}
		
	
	);
	

	jQuery('.call-apt').click(function() {
		window.location.href="/OfficeInfo/RequestanAppointment/tabid/63/Default.aspx";
	});
	
	jQuery('.call-invis').click(function() {
		window.location.href="/Treatment/Invisalign/tabid/85/Default.aspx";
	});
	
	//remove border on blank images
	if(jQuery(".sidepic > img").width() == 1) {
		jQuery(".sidepic > img").css({'border-color': "#B0D7E5"});
	}
	
	//accordion for INVISALIGN FAQ page
	jQuery('.accordion h3').click(function() {
		jQuery(this).toggleClass('active').next().toggle('blind', 'normal');
		return false;
	}).next().hide();
	
});

//make menu work
function menuShow(menuitem){
	jQuery(".topsub > p.active").stop().slideUp(800).removeClass("topsub");
	jQuery(menuitem).next().css("height", "auto").stop().slideDown(500).parent().addClass("topsub");
}

//sifr script
function pageScripts(){
var kozuka = {  src: DNN_skinPath + 'kozuka.swf' };
sIFR.activate(kozuka);
	sIFR.replace(kozuka, {
	  selector: 'h1', 
	  wmode: 'transparent', 
	  src:  DNN_skinPath +  'kozuka.swf', 
	  css: [ '.sIFR-root {color:#843501;}']
	});
}

function moveArrow(dv) {
	jQuery(dv).hover(
		function() {
			jQuery(this).children('.arrow').stop().animate({
				right: '-=4'
			}, 300, 'easeOutExpo');
		},
		function() {
			jQuery(this).children('.arrow').stop().animate({
				right: '22px'
			}, 250, 'easeOutExpo');
		}
	);
}


