/**
 * @author tbianco
 */

function equalizePanels()
{
	if( !$('nav_col') ){
		return false;
	}

	var nav_col		= $('nav_col');
	var conent_col	= $('content_col');

	// Get the height and width of nav column and content column
	var nav_height		= nav_col.getCoordinates().height;
	var content_height	= conent_col.getCoordinates().height;

	if( (conent_col && nav_col) && (nav_height > content_height) ) {
		conent_col.setStyles({height: nav_col});
	}
	else if( (conent_col && nav_col) && (nav_height < content_height) ) {
		nav_col.setStyles({height: content_height});
	}


	//set the default height
	if( (conent_col && nav_col)&& (nav_height < 545) && (content_height < 545) )
	{
		conent_col.setStyles({height: '545px'});
		if(window.ie6) {
			nav_col.setStyles({height: '555px'});
		} else {
			nav_col.setStyles({height: '545px'});
		}
	}
}


function swap_img(img_el,state)
{
	var img_str = $(img_el).src;
	var img_ext_start_pos = img_str.lastIndexOf('.');
	var img_folder_loc = img_str.lastIndexOf('/');
	var file_ext = img_str.substr(img_ext_start_pos,4);
	var file_location = img_str.substr(0,img_folder_loc)+'/';

	if(state == 'off'){
		$(img_el).src = file_location + img_el + '_off' + file_ext;

	}
	else if(state == 'on'){
		$(img_el).src = file_location + img_el + '_on' + file_ext;
	}
}

/* For smooth scrolling */
window.onDomReady(function(){
	new SmoothScroll({duration: 800});
	equalizePanels();
});