function getdatefun()
{
	var d =  new Date();
	var  m = d.getMonth()+1;
	return m+"/"+d.getDate()+"/"+d.getFullYear();
}

/*Menu implementation*/
jQuery(document).ready(function(){
	jQuery("#navigation > ul").superfish({
		hoverClass:"hover",
		pathClass:"overideThisToUse",
		delay:800,
		animation:{height:"show"},
		speed:"normal",
		oldJquery:false,
		disableHI:false,
		onInit:function () {},
		onBeforeShow:function () {},
		onShow:function () {},
		onHide:function () {}
	});
	/* remove box from links */
	jQuery("a").focus(function(){
		this.blur();
	});


/* Get the slide index from the hash */	
function getHash(excludeQuestionMark) {
	if (typeof excludeQuestionMark == 'undefined') var excludeQuestionMark = true;
	var hash = window.location.hash;
	var stop = hash.indexOf('?');
	// if there was no question mark in the hash, or if excludeQuestionMark is set to false
	if (stop == -1 || !excludeQuestionMark)
		var returner = hash.substring(1); // remove #
	else
		var returner = hash.substring(1,stop); // remove # and exlude everything after '?'
	return returner;
}

var _hash = getHash();
var _index = _hash != "" ? _hash.substring(6, _hash.length) : 1;

/* jQuery Thumbs Carosel for Before and After on Homepage
jQuery('#mycarousel').jcarousel();*/	


/* Slideshow Before and After Page*/
jQuery("#pikame").PikaChoose({
	transition:[0],
	carousel:true,
	user_thumbs:true, 
	autoPlay:false,
	startOn:_index-1
});
jQuery("#mycarousel").jcarousel({					
	initCallback: function(carousel) 
	{
		jQuery(carousel.list).find('img').click(function() {
			var clicked = parseInt($(this).parents('.jcarousel-item').attr('jcarouselindex'));
			var last = ($(this).parents('ul').find('li:last').index() == clicked-1) ? true : false;
				if(!last){
				clicked = (clicked-2<=0) ? 0 : clicked-2;
				}
				clicked++;
				carousel.scroll(clicked);
		});
	}
});


/* FAQ page */
jQuery('#faq h4').click(function() {
		jQuery(this).toggleClass('active').next().toggle("fast");
		return false;
	}).next().hide();	

	jQuery("#dnn_ctr430_FormMaster_ctl__20110308T002945").text(getdatefun());
	jQuery("#dnn_ctr430_FormMaster_ctl__20110307T064220").attr('disabled', '');
	
	
	/* Free Smile Consutation */	
	jQuery.fn.setFieldText = function(txt) {
		var _field = jQuery(this);
		_field.val(txt).focus(function(){_field.val("");})
		.blur(function(){if(_field.val()=="") _field.val(txt);});
	}
	jQuery(".consult-Name").setFieldText("Name: (Last, First)");
	jQuery(".consult-Phone").setFieldText("Phone:");
	jQuery(".consult-Email").setFieldText("Email:");
	
	jQuery("#dnn_ctr443_FormMaster_lblRequired").text("");
	
	
	/*Preload the menu backgrounds*/
	menuImage = new Image(); 
	menuImage.src = DNN_skinPath + "images/treatment_on.png";
	menuImage1 = new Image(); 
	menuImage1.src = DNN_skinPath + "images/meetourteam_on.png";
	menuImage2 = new Image(); 
	menuImage2.src = DNN_skinPath + "images/newpatient_on.png";	
	menuImage3 = new Image(); 
	menuImage3.src = DNN_skinPath + "images/plogin_on.png";
	menuImage4 = new Image(); 
	menuImage4.src = DNN_skinPath + "images/smilegallary_on.png";
	menuImage5 = new Image(); 
	menuImage5.src = "/Portals/0/banda/interface/banda_interface_bg.png";

});
