
$(document).ready(function() {
	
	// Load navigation handler
  $('#nav').droppy();
	$('#topnav').droppy();
	
	// Handle form field focus (in lieu of :focus)
	$('input, textarea, select').focus(function(){
		  $(this).addClass('focus');
	  });
	$('input, textarea, select').blur(function(){
		  $(this).removeClass('focus');
	  });
	  
	/*var leftHeight = $('#content_left').height();
	var rightHeight = $('#content_right').height();
	
	if(leftHeight>rightHeight){
		$('#content_right').css('height',(leftHeight+100)+'px');
	}*/
	
	
});

function emailPage(){
	var e = $('#email_address').val();
	var p = $('#email_location').val();
	$.get('email_page.php?e='+e+'&p='+p,function(){
		$('#email_return_msg').show();
		$('#email_return_msg').fadeOut(8000);
	})
}

// POPUP WINDOW 
// Example:
// onclick="popUp('http://www.*.com','','750','450','resizable,scrollbars,status,toolbar')"

var win = null;
function popUp(url,name,w,h,features) {
    var winl = (screen.width-w)/2;
    var wint = (screen.height-h)/2;
    if (winl < 0) winl = 0;
    if (wint < 0) wint = 0;
    var settings = 'height=' + h + ',';
    settings += 'width=' + w + ',';
    settings += 'top=' + wint + ',';
    settings += 'left=' + winl + ',';
    settings += features;
    win = window.open(url,name,settings);
    win.window.focus();
}