var originalFormAction='';function customRange(input){return{minDate:(input.id=="search_enddate"?$("#search_startdate").datepicker("getDate"):null),maxDate:(input.id=="search_startdate"?$("#search_enddate").datepicker("getDate"):null)};}
$(document).ready(function(){if($('#search_startdate').exists()&&$('#search_enddate').exists()){$("#search_startdate,#search_enddate").datepicker({dateFormat:iwp_short_date_format,beforeShow:customRange,showOn:"both",buttonImage:iwp_global_tpl_path+"/images/calendar.gif",buttonImageOnly:true});}
if($('#toggleSearchOptionsLinkShow').css('display')=='none'){ToggleSearchForm("show");}else{ToggleSearchForm("hide");}
originalFormAction=$('#advancedSearchForm').attr('action');});function CheckSearchForm(){$('#advancedSearchForm').submit();}
function ToggleSearchForm(action){if(action=='show'){$('.tplflag-searchAdvancedOption').show('fast');$('#toggleSearchOptionsLinkShow').hide();$('#toggleSearchOptionsLinkHide').show();$('#advancedSearchForm_searchadvanced').val(1);}else if(action=='hide'){$('.tplflag-searchAdvancedOption').hide('fast');$('#toggleSearchOptionsLinkShow').show();$('#toggleSearchOptionsLinkHide').hide();$('#advancedSearchForm_searchadvanced').val(0);}}
function ShowSearchOperators(){$('#search_operators').show('fast');$('#hideoperators').show();$('#showoperators').hide();HideSearchExamples();}
function HideSearchOperators(){$('#search_operators').hide('fast');$('#showoperators').show();$('#hideoperators').hide();}
function ShowSearchExamples(){$('#search_examples').show('fast');$('#hideexamples').show();$('#showexamples').hide();HideSearchOperators();}
function HideSearchExamples(){$('#search_examples').hide('fast');$('#showexamples').show();$('#hideexamples').hide();}