window.onbeforeunload = function () {return '';}

//The jQuery codes
$(document).ready(function(){
	//setEvents();
	//favorite script
	// add a "rel" attrib if Opera 7+
	if(window.opera) {
		if ($("a.jqbookmark").attr("rel") != ""){ // don't overwrite the rel attrib if already set
			$("a.jqbookmark").attr("rel","sidebar");
		}
	}
	$("a.jqbookmark").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;

		if (window.sidebar) { // Mozilla Firefox Bookmark
			window.sidebar.addPanel(title, url,"");
		} else if( window.external ) { // IE Favorite
			window.external.AddFavorite( url, title);
		} else if(window.opera) { // Opera 7+
			return false; // 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 with CTRL + D.');
		}

	});
});

function digg_click() {
	u=location.href;
	t=document.title;
	window.open('http://digg.com/submit?url='+encodeURIComponent(u)+'&amp;title='+encodeURIComponent(t)+'&amp;bodytext=DESCRIPTION&amp;media=MEDIA&amp;topic=TOPIC','diggsharer','toolbar=0,status=0,width=800,height=600');
	return false;
}

function fbs_click() {
	u=location.href;
	t=document.title;
	window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&amp;t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');
	return false;
} 

function popUp(url, myname, w, h, scroll) { 
  var winl = (screen.width - w) / 2;
	var wint = ((screen.height - h) / 2)-20;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',toolbar=0, status=0, resizable=0,menubar=0'
	eval(myname+" = window.open(url, myname, winprops)");
	if (parseInt(navigator.appVersion) >= 4) { eval(myname+".window.focus()"); }
}

function setEvents() {
	var objChild;                           
	var reWork = new RegExp('object','gi');	

	try {
		objChild = window.open('','child','width=50,height=50,status=no,resizable=yes'); 
		objChild.close();
	}
	catch(e) { }

	if(!reWork.test(String(objChild))) alert('Pop-up Blocker has blocked a pop-up window. You can allow pop-ups from this site by clicking the Information bar at the top of the page.');

}