/***Date picker****/
	$(function() {
		$( "#txt_from" ).datepicker({
			showOn: "button",
			buttonImage: base_url + "resources/images/calendar.png?a",
			buttonImageOnly: true
		});
		$( "#txt_to" ).datepicker({
			showOn: "button",
			buttonImage: base_url + "resources/images/calendar.png?a",
			buttonImageOnly: true
		});
		$(".datepicker").datepicker();
	});
/*********/

/****Custom Functions*****/
$(document).ready(function(){
	
	$("#advsearch").hide();
	
	$("#advSearchButton").click(function(){
		$("#advsearch").slideToggle("slow");
		$("#advSearchButton.plus_button").toggleClass("minus_button");
	});
	
	$("#advSearchCloseButton").click(function(){
		$("#advsearch").slideToggle("slow");
		$("#advSearchButton.plus_button").toggleClass("minus_button");
	});
	
	
	$("#txt_search").click(function(){
		$(this).val(($(this).val()=="Archive advanced article search")?"":$(this).val());
	});
	
	$("#txt_search").blur(function(){
		$(this).val(($(this).val()=="")?"Archive advanced article search":$(this).val());
	});
 	
/*********/	

	
	
});
/*********/

/*****Dropdown Custom Code****/
(function($){
 $.fn.extend({
 
 	customStyle : function(options) {
	  if(!$.browser.msie || ($.browser.msie&&$.browser.version>6)){
	  return this.each(function() {
	  
			var currentSelected = $(this).find(':selected');
			$(this).after('<span class="customStyleSelectBox"><span class="customStyleSelectBoxInner">'+currentSelected.text()+'</span></span>').css({position:'absolute', opacity:0,fontSize:$(this).next().css('font-size')});
			var selectBoxSpan = $(this).next();
			var selectBoxWidth = parseInt($(this).width()) - parseInt(selectBoxSpan.css('padding-left')) -parseInt(selectBoxSpan.css('padding-right'));			
			var selectBoxSpanInner = selectBoxSpan.find(':first-child');
			selectBoxSpan.css({display:'inline-block'});
			selectBoxSpanInner.css({width:selectBoxWidth, display:'inline-block'});
			var selectBoxHeight = parseInt(selectBoxSpan.height()) + parseInt(selectBoxSpan.css('padding-top')) + parseInt(selectBoxSpan.css('padding-bottom'));
			$(this).height(selectBoxHeight).change(function(){
				var myCurrentSelected = $(this).find(':selected');
				selectBoxSpanInner.text(myCurrentSelected.html()).parent().addClass('changed');
			});
			
	  });
	  }
	}
 });
})(jQuery);
 
 
$(function(){
 
$('select.styled').customStyle();
 
});
/*********/
