function get_window_title() {
	return document.title;
}


function selectMenuOption(div_id) {
    $('.selected').removeClass('selected');
	$(div_id).addClass('selected');
}

function submit_email_form() {
	alert("submit email form");
	if(document.emailForm.onsubmit()) {
		document.emailForm.submit();
	}
}

function clickclear(thisfield, defaulttext) {
	if(defaulttext == null) {
		defaulttext = 'Search';
	}
	
	if (thisfield.value == defaulttext) {
		thisfield.value = "";
	}
}

function clickrecall(thisfield, defaulttext) {
	if(defaulttext == null) {
		defaulttext = 'Search';
	}

	if (thisfield.value == "") {
		thisfield.value = defaulttext;
	}
}

// turn on active testimonial tab buttons 
function init_spotlight() {
	var MAX_ITEMS = 6;
	var max_height = 0;
	for(i = 0; i < MAX_ITEMS; i++) {
		var s = $("#news_item"+i);
		var btn = $("#news_tab"+i);
		
		if(s.height() > max_height) {
			max_height = s.height();
		}
		
		if(s != null && btn != null){
			btn.css('display', 'block');
		}
	}
	
	for(i = 0; i < MAX_ITEMS; i++) {
		var s = $("#news_item"+i);
		s.height(max_height);
	}
	
	//make first tab active
	toggle_spotlight('0');
}

// homepage spotlight toggle
function toggle_spotlight(spotlight_id) {
	var MAX_ITEMS = 6;
	//turn off all others
	for(i = 0; i < MAX_ITEMS; i++) {
		// tab content
		var s = $("#news_item"+i);
		if(s != null) {
			s.css('display', 'none');
		}
		
		// tab button
		var b = $("#news_tab"+i);
		if(b != null) {
			b.css({'background-color':'#E7E7E7', 'color':'#999'});
		}
	}
	
	//turn on requested div
	s = $("#news_item"+spotlight_id);
	if(s != null) {
		s.css('display', 'block');

		b = $("#news_tab"+spotlight_id);
		if(b != null) {
			b.css({'background-color':'#666', 'color':'#FFF'});
		}
	}
}

/*
(function newsletterSetup() {
    function setupNewsletter() {
        $('#contactForm').ajaxForm({ beforeSubmit: validateNewsletter, success: updateAfterSubmit })
    }

    function updateAfterSubmit(responseText, statusText) {
        $('#contactFormHolder').html(responseText)
    }
    
    function isEmailValid(email) {
        var filter = /^([a-zA-Z0-9_.-\\+])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;
        return filter.test(email)
    }
    
    function validateNewsletter(formData, jqForm, options) {
        return ($("#contactForm_errorloc").html() == "");
    }

    $(setupNewsletter)
})()
*/