$(document).ready(function(){

	// colorbox
	$("a[rel='lightbox']").colorbox();

	// set heights equal to sibling columns
	$('#side').css('min-height', $('#main').height()+'px');
	
	/* ----- form input functionality ----- */

	$("input.dynamic").focus(function() {
		if ($(this).val() == $(this).attr("title")) $(this).val('');
		$(this).css('color', '#222');
	});

	$("input.dynamic").blur(function() { 
		if ($(this).val() == '') $(this).val($(this).attr("title"));
		$(this).css('color', '#777');
	});

	//$("a[rel='regform']").colorbox({iframe:true, innerWidth:860, innerHeight:1140});

	$("a[rel='regform']").click(function() {
		openWin($(this).attr('href'), 'window');
		return false;
	});

	function openWin(href, myTitle) {
		var myWindow;
	
		var width = 900;
		var height = 750;
	
		var left = parseInt((screen.availWidth/2) - (width/2));
		var top = parseInt((screen.availHeight/2) - (height/2));
	
		var windowFeatures = "width=" + width + ",height=" + height + ",status=no,resizable=no,location=no,scrollbars=1,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;
	
		myWindow = window.open(href, myTitle, windowFeatures);
	}
	
	// add hidden input to comment form on the fly to keep out spammers
	$('<input>').attr({
		type: 'hidden',
		name: 'figuodfh',
		value: 'dfoigudfhdf'
	}).appendTo('#CommentForm_form');

	// add hidden input to support form on the fly to keep out spammers	
	$('#wrap_Inputfield_submit').before('<li><label for="fdhfdvhdffr">Is the sun hot or cold?</label><div><p class="description">We need to make sure you\'re human</p><input type="text" name="fdhfdvhdffr" id="fdhfdvhdffr"></div></li>');

});
