﻿// JScript File

//Do not remove this function
function Page_Load()
{

}

function AdvancedSearch(keywords,startdate,enddate,meettypes)
{
    var WindowLocation = ""
    var MeetingTypes = ""
    
    if (startdate != "" && enddate != ""){
        WindowLocation = "meetresults.aspx?startdate="+startdate+"&enddate="+enddate
    }
    if (keywords != ""){
        if (WindowLocation == ""){
            WindowLocation = "meetresults.aspx?keywords="+keywords
        }
        else{
            WindowLocation = WindowLocation+"&keywords="+keywords
        }
    }
    
    for (var i=0; i<meettypes.length; i++)
    {
	    if (meettypes[i].type == "checkbox")
	    {
	        if (meettypes[i].checked == true){
	            if (MeetingTypes == "")
		        {
			        MeetingTypes = meettypes[i].id;
		        }
		        else
		        {
			        MeetingTypes = MeetingTypes+"|"+meettypes[i].id;
		        }
	        }  
	    }
    } 
    if (MeetingTypes != ""){
	    if (WindowLocation == ""){
		    WindowLocation = "meetresults.aspx?meettype="+MeetingTypes
    	}else{
		    WindowLocation = WindowLocation+"&"+MeetingTypes
    	}
    }  
    
    window.location = WindowLocation
}
function ShowPopup(URL)
{
    window.open(URL,"","status=no,toolbar=no,menubar=no,scrollbars=no,width=400,height=200")
}
function RunSearchOptions(URL,CallingWindow,startdate,enddate,keywords,meettypes)
{
    var ReturnValue = window.showModalDialog(URL,"","center=yes,status=no,scroll=no,dialogWidth=400,dialogHeight=200")
    
}
function ChangeYear(year){
    window.location = "meetresults.aspx?year="+year+"&startdate=1/1/"+year+"&enddate=12/31/"+year
}
