$(document).ready( function(){
        var a = new Array();
        $("#selectCity").children("option").each(function(x){
                test = false;
                b = a[x] = $(this).val();
                for (i=0;i<a.length-1;i++){
                        if (b ==a[i]) test =true;
                }
                if (test) $(this).remove();
        })
        var a = new Array();
        $("#selectMonth").children("option").each(function(x){
                test = false;
                b = a[x] = $(this).val();
                for (i=0;i<a.length-1;i++){
                        if (b ==a[i]) test =true;
                }
                if (test) $(this).remove();
        })
        var a = new Array();
        $("#selectActivity").children("option").each(function(x){
                test = false;
                b = a[x] = $(this).val();
                for (i=0;i<a.length-1;i++){
                        if (b ==a[i]) test =true;
                }
                if (test) $(this).remove();
        })
}); 

function renderList(data)
{
	$('#activitiesListDiv').html(data);
}
function updateActivitiesList() {
	$.ajax({
  		type: 'GET',
  		url: '/listactivities.aspx',
  		data: {city: $('#selectCity').val(),
		activity: $('#selectActivity').val(),
		month: $('#selectMonth').val(),
		cache: Math.random()},
  		success: renderList
		});
}

function lightbox(url, w, h){
$.modal('<iframe style="width:' + w + 'px; height:' + h + 'px" frameborder="no" scrolling="no" src="' + url + '" id="tbframe"></iframe>');
}

function openNewsletterLightbox() {
var path='http://mindstep.us2.list-manage.com/subscribe\?u=73a07e78bc3c38bbd8ef754ea\&id=f2264fb8e7\&MERGE0=';
path = path + $('#newsletterEmailField').val();
lightbox(path, 700, 550);
}
