// JQUERY SCRIPTS
// ---------------------------------------------------------------------------------------
$(document).ready(function()
{
	// Cufon replace text
	// ---------------------------------------------------------------------------------------
	Cufon.replace('h1');
	Cufon.replace('div#side_col h2');
	Cufon.replace('div#filterbox h2');

	$('.textbox').addClass('modified').wrap('<div class="textbox_wrap"></div>');
	$('.letter').addClass('modified').wrap('<div class="letter_wrap"></div>');
	$('.letter_wrap').append('<div class="letter_btm"></div>');
	
	$('#tabs_nav').addClass('tabs_nav');
	$('#closed_link').addClass('current');
	$('#closed').addClass('tabbed_content');
	$('#open').addClass('tabbed_content').hide();
	
	$('a#closed_link').click(function () {
		if(!$(this).hasClass('current')) {
			$('#closed').show();
			$('#open').hide();
			$(this).addClass('current');
			$('a#open_link').removeClass('current');
		}
    });
	$('a#open_link').click(function () {
		if(!$(this).hasClass('current')) {
			$('#open').show();
			$('#closed').hide();
			$(this).addClass('current');
			$('a#closed_link').removeClass('current');
		}
    });

});

function open_in_popup_window(url, name, width, height) {
	window.open(url.href,name,'width=' + width + ',height=' + height + ',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes');
	return false;
}
function open_in_new_window(url) {
	window.open(url.href,'external_link','toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes');
	return false;
}
function pop(url, target, width, height, scrollbars, top, left)
{
	if(target == null) target = '_blank';
	var props = '';
	if(width != null) props += ',width=' + width;
	if(height != null) props += ',height=' + height;
	if(scrollbars != null) props += ',scrollbars=' + scrollbars;
	if(top != null) props += ',top=' + top + ',screenY=' + top;
	if(left != null) props += ',left=' + left + ',screenX=' + left;
	if(props.length) props = 'resizable=1' + props;
	var win = window.open(url, null, props);
	win.focus();
	return false;
}

function goto(loc) {
	window.location.href="/"+loc;
}

function hideDateDivs(str, day) {
	for(i=1;i<=31;i++) {
		if(i==day) {
			document.getElementById(str+day).style.display='';
		}else{
			document.getElementById(str+i).style.display='none';
		}
	}
}

