/// <reference path="jquery-1.2.6-vsdoc.js" />

$(document).ready(function(){
	/* IE only */
	DD_roundies.addRule('#CommonSidebarRight .CommonSidebar', '5px');
	
	$('#Evaluate-link').click( function(e) {
		EvaluatePopUp($(this).attr('href'));
		e.preventDefault();
	});
	
	anchors.addBehaviors();
});


function EvaluatePopUp(url) {
	window.open(url,'SelfEval','height=550,width=750,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,directories=no,status=no');

}	


/* =================================================================== */
// various link functionality - popups, external, onstate
// original script taken from Jeremy Keith
// dependencies: jQuery
var anchors = {
	a: Object,
	addBehaviors : function() {
		$('a').each( function() {
			var $a = $(this);
			// external links
			if ( ($a.attr('href')) && ($a.attr('rel')=='external') ) {
				$a.click( function() {
					return anchors.openWin(this,"");
				});
			}
			if ( $a.hasClass('external') || $a.hasClass('pdf') ) {
				$a.click( function(e) {
					$(e).preventDefault;
					return anchors.openWin(this,"");
				});
			}
			// popup
			if ( $a.hasClass('popup') ) {
				$a.click( function() {
					return anchors.openWin(this,"height=550,width=600,scrollbars=yes");
				});
			}
			// onstate
			if ( $a.attr('href') == location.href ) {
				$a.addClass('onstate');
			}
		});
	},
	openWin : function(o,params) {
		window.open(o.href, "newwin","" + params + "");
		return false;
	}
};
/* =================================================================== */