// JavaScript Document
$(document).ready(function() {
	 $('a[rel="nofollow"]').attr('target', '_blank');
	 
	 if(window.opera) {
		if ($(".outer-right a").attr("rel") != ""){ // don't overwrite the rel attrib if already set
			$(".outer-right a").attr("rel","sidebar");
		}
	}

	$(".bookmark a").click(function(event){
		event.preventDefault(); // prevent the anchor tag from sending the user off to the link
		var url = this.href;
		var title = this.title;
		 var ua=navigator.userAgent.toLowerCase(),isMac=(ua.indexOf('mac')!=-1),
      	isWebkit=(ua.indexOf('webkit')!=-1),str=(isMac?'Command/Cmd':'CTRL');
		if (window.sidebar) { // Mozilla Firefox Bookmark
			window.sidebar.addPanel(title, url,"");
		} else if( window.external && !isWebkit && !isMac) { // IE Favorite
			window.external.AddFavorite( url, title);
		//} else if(window.opera && window.print) { // Opera 7+
			//return true; // do nothing - the rel="sidebar" should do the trick
		} else { // for Safari, Konq etc - browsers who do not support bookmarking scripts (that i could find anyway)

			 alert('Unfortunately, this browser does not support the requested action,'
			 + ' please bookmark this page manually.');
		}

	});

});

$(function() {
		// run the currently selected effect
		/*function runEffect() {
			// get effect type from 
			//$( "#display" ).css('margin-top','-1000em');
			$( "#display" ).hide();
		
			// run the effect
			$( "#display" ).slideDown(700);
		};*/

		// callback function to bring a hidden box back
		/*function callback() {
			setTimeout(function() {
				$( "#display" ).removeAttr( "style" ).hide().fadeIn();
			}, 1000 );
		};*/
		 function runEffect(){
			 var options = {};
			 
			 	$("#display").show('clip',options,700,callback);
		 }
		  function callback(){
      setTimeout(function(){
      $("#display:hidden").removeAttr('style').hide().fadeOut();
      }, 1000);
    };
		// set effect from select menu value
		//$( "nav .main li a" ).click(function() {
			runEffect();
			//return false;
		//});
	});
