// JavaScript Document

$(document).ready(function() {
	
	if($("#talk-box").length > 0){
		doTalkExpand();	
	}
	
	if($(".searchInp").length > 0){
		$(".searchInp").focus(function(){
			emptyMe(this);
		});
	}
	if($(".talk-to-us").length > 0){
		$(".talk-to-us").focus(function(){
			emptyMe(this);								
		});
	}
	if($(".inlineSearchInp").length > 0){
		$(".inlineSearchInp").focus(function(){
			emptyMe(this);								
		});
	}
	if($(".zebra-table").length > 0){
		$(".zebra-table tr:even").addClass("alt");	
	}

	if($(".datepicker").length > 0){
	    $(".datepicker").datepicker({
	        showOn: 'button'
		    , buttonImage: strThemeDir + '/img/icons/calendar.png'
		    , buttonImageOnly: true
		    , dateFormat: 'dd/mm/yy'
		    , minDate: '2d'
		    , onSelect: function(dateText) {
	            document.all ? $(this).get(0).fireEvent("onchange") : $(this).change();
	    }
		});
	}
	
});

function doTalkExpand(){		
		var talkHid = $("#talk-box-hidden");
		var talkHidInput = $("#talk-box-hidden input");
		var talkText = $("#talk-box textarea");
		$(talkHid).hide();
		
		$(talkText).focus(function() {
			$(talkHid).slideDown("normal");
			$(talkHidInput).css({ color:"#3e4043"});
			$(talkText).css({ color:"#3e4043"});
		});
	}


function emptyMe (target){
	$(target).attr("value","");
}

$(document).ready(function() {
    var options = {
        newsList: "#homeNewsTicker",
        startDelay: 10,
        placeHolder1: " _",
        tickerRate: 80
    }
    $().newsTicker(options);
});

