var rootpath;
function setRootPath(v) { rootpath = v; }
function pageTools(name) {
	var title = document.title;
	if ( document.getElementById('pageUrl').innerHTML == "" ) {
		var url = location.href;
	}else{
		var url = document.getElementById('pageUrl').innerHTML;
	}

	switch ( name ) {
		case "print":
			window.print();
			return;
		case "email":
			window.open(rootpath+'contact/form.php?type=emailpage&url='+url,'sharer','toolbar=0,status=0,width=650,height=560,scrollbars=yes');
			return;
		case "feedback":
			window.open(rootpath+'contact/form.php?type=feedback&url='+url,'sharer','toolbar=0,status=0,width=650,height=560,scrollbars=yes');
			return;
		case "bookmark":			
			if (window.sidebar) { // Mozilla Firefox Bookmark
				window.sidebar.addPanel(title, url,"");
			} else if( window.external ) { // IE Favorite
				window.external.AddFavorite( url, title); }
			return;
		case "facebook":
			window.open('http://www.facebook.com/sharer.php?u='+url+'&t='+title,'sharer','toolbar=0,status=0,width=626,height=436');
			return;
		case "delicious":
			window.open('http://del.icio.us/post?url='+url+'&title='+title);
			return;	
	}
}
