//sIFR implementation
function pageScripts() {
var GillSansMT = {  src: DNN_skinPath + 'GillSansMT.swf' };
sIFR.activate(GillSansMT);
sIFR.replace(GillSansMT, {
  selector: 'h1', 
  wmode: 'transparent', 
  src:  DNN_skinPath +  'GillSansMT.swf',  
  css: [ '.sIFR-root {color:#ffcc00;font-size:24px;}'  ]  
});
}

	//Menu implementation
	jQuery(document).ready(function(){
	jQuery('#MainMenu').accordion({ 
		active: false,
		header: '.menuTitle',
		animation:{height:"show"},
		event: 'click',
		autoheight:false,
		navigation:true,
		showSpeed: 600,
		hideSpeed: 600
	});
	
	/* THIS REMOVE THE LINE FROM THE EMPTY <UL> ELEMENTS (NOTE: be sure there is NO space between the <ul></ul> elements) */
	jQuery("#MainMenu li ul:empty").remove();
	 
	
	/*To Display Submneu after clicking the level2 submenu */
	jQuery(".sel .submenu").show();
	jQuery(".unsel").click(
	function(){ 
	   jQuery(".sel .submenu").hide(350);
	});
	
	
    
	/*To Remove the border line for first element in Level 1 Sub menu*/
	jQuery("div span:first-child a").css("background", "none")

    /*Level 2 Menu Implementation*/ 
    jQuery(".hassub").hover(
	 function(){ 
	  jQuery("#Level2",this).show();
	  /*To append > for the Menu that has Level2 Submenu*/
 	  var parent = jQuery('img',this);
	  var imgtag = parent.attr('src');
      imgtag = imgtag.replace('.jpg','_hover.jpg');
	  parent.attr('src',imgtag);
     },
	 function(){ 
	  jQuery("#Level2",this).hide(); 
	  /*To remove > for the Menu that has Level2 Submenu*/
      var parent = jQuery('img',this);
	  var imgtag = parent.attr('src');
      imgtag = imgtag.replace('_hover','');
	  parent.attr('src',imgtag);	  
    });
	
	/* remove box from links */
 	jQuery("a").focus(function(){
  	this.blur();
 	});
 
	/*Preload the menu backgrounds*/
	menuImage = new Image(); 
	menuImage.src = DNN_skinPath + "images/About_hover.jpg";
	menuImage1 = new Image(); 
	menuImage1.src = DNN_skinPath + "images/Contact_hover.jpg";
	menuImage2 = new Image(); 
	menuImage2.src = DNN_skinPath + "images/CosmeticDentistry_hover.jpg";
	menuImage3 = new Image(); 
	menuImage3.src = DNN_skinPath + "images/Home_hover.jpg";
	menuImage4 = new Image(); 
	menuImage4.src = DNN_skinPath + "images/Locations_hover.jpg";
	menuImage5 = new Image(); 
	menuImage5.src = DNN_skinPath + "images/Orthodontics_hover.jpg";
	menuImage6 = new Image(); 
	menuImage6.src = DNN_skinPath + "images/PediatricDentistry_hover.jpg";
	menuImage7 = new Image(); 
	menuImage7.src = DNN_skinPath + "images/Tips_hover.jpg";
	menuImage8 = new Image(); 
	menuImage8.src = DNN_skinPath + "images/Cary_hover.jpg";
	menuImage9 = new Image(); 
	menuImage9.src = DNN_skinPath + "images/Chapel_hover.jpg";
	menuImage10 = new Image(); 
	menuImage10.src = DNN_skinPath + "images/Durham_hover.jpg";
	menuImage11 = new Image(); 
	menuImage11.src = DNN_skinPath + "images/Raleigh_hover.jpg";
	menuImage12 = new Image(); 
	menuImage12.src = DNN_skinPath + "images/wake_hover.jpg";
	menuImage13 = new Image(); 
	menuImage13.src = DNN_skinPath + "images/Sanford_hover.jpg";
	menuImage14 = new Image(); 
	menuImage14.src = DNN_skinPath + "images/burgaw_hover.jpg";
	
	var opts = {
		"General Dentistry": ["Choose Location", "Cary", "Chapel Hill", "Sanford", "Wake Forest"],
		"Pediatric Dentistry":  ["Choose Location", "Raleigh", "Chapel Hill"],
		Orthodontics: ["Choose Location", "Cary", "Chapel Hill", "Durham", "Mount Airy", "Raleigh", "Sanford", "Wake Forest", "Burgaw"]
	},
	
		selectEL = jQuery("select.txtSpecialty");
	
	
	
	selectEL.change(function() {
			var sel = jQuery(this).val();
			
			for (var i in opts) {
				if (i == sel) {
					
					jQuery("select.txtLocation").empty();
					
					for (var y in opts[i]) {
						jQuery('select.txtLocation')
							.append('<option value="'+opts[i][y]+'">'+opts[i][y]+'</option>');
					}					
				}
			}
			
	}).change();
	
});
