function addToFavorite(title,url)
{
	if (window.sidebar) // firefox
	{
		window.sidebar.addPanel(title, url, "");
	}
	else if(window.opera && window.print) // opera
	{ 
		var elem = document.createElement('a');
		elem.setAttribute('href',url);
		elem.setAttribute('title',title);
		elem.setAttribute('rel','sidebar');
		elem.click();
	} 
	else if(document.all) // ie
	{
		window.external.AddFavorite(url, title);
	}
}

function checkBook()
{
	if (window.sidebar)
	{
		window.sidebar.addPanel(favorite_text, base_url, "");
	}
	else
	{
		window.external.addFavorite(base_url, favorite_text);
	}
}

function openFriend()
{
	$('#send_to_friend').slideDown({duration:1000,easing:'easeOutBack'});
}

function closeFriend()
{
	$('#send_to_friend').fadeOut("slow",function(){
		$(".feedback").hide();
		$("#submit").show();
		$(".loading").hide();
		$("#send_to_friend_container").show();
	});
}

function resizeAd()
{
	$('#ad_peel').css("width","80px");
	$('#ad_peel').css("height","80px");
}

function popupPDF(pdf)
{
	if(pdf!=""){
		var html = "<html><head><title>PDF</title>";
		html += "</head><body style='padding:0px;margin:0px;'>";
		html += "<iframe src='" + pdf +"' width='800px' height='600px'></iframe>";
		html += "</body></html>";
		var win = window.open("","popupPDF","width=800,height=600,resizable=no");
		win.document.write(html);
		win.close;
	}
}