$(function(){
	
	var right_side_height = $("#sidebar_wrapper").height() - 50;
	var content_height = $("#main-content").height();
	
	if (content_height < right_side_height){
		$("#content-left-edge, #content-right-edge").css("height",right_side_height);
	}else{
		$("#content-left-edge, #content-right-edge").css("height",content_height);
	}
	
	
	var no_sb_content_height = $("#main_content_no_sidbar").height();
	$("#no_sidbar_right_edge, #no_sidbar_left_edge").css("height",no_sb_content_height);

	$("a[rel='external']").attr("target","_blank");
	
});

//For the downloads
function getUrlVars(setVar) {
	var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
	for(var i = 0; i < hashes.length; i++) {
		hash = hashes[i].split('=');
		if (setVar == hash[0]) return hash[1];
	}
	return false;
}

//Set cookie script
function Set_Cookie( name, value, expires, path, domain, secure ) {
	var today = new Date();
	today.setTime( today.getTime() );
	if ( expires ) {
		expires = expires * 1000 * 60 * 60 * 24;
	}
	var expires_date = new Date( today.getTime() + (expires) );
	document.cookie = name + "=" +escape( value ) +
		( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) +
		( ( path ) ? ";path=" + path : "" ) +
		( ( domain ) ? ";domain=" + domain : "" ) +
		( ( secure ) ? ";secure" : "" );
}
