function adjustFrameSize(min){
	var newheight=$("#content").height()+30;
	if (newheight < min){
		newheight=min;
		$("#content").height(min-30);
	}
	$("#frame").height(newheight);
	//$("#frame").width(780);
}

function showMore(){
	var content=$("#content");
	var contentTop=content.offset().top;
	var contentBot=contentTop+content.height();
	var scrollTop=$(document).scrollTop();
	var scrollBot=scrollTop+$(window).height();
	if ((contentBot-scrollBot)>0){
		$("#morearrow")
			.css("top",scrollBot-contentTop-$("#morearrow").height())
			.css("right",6)
			.css("z-index",10)
			.show();
	}else{
		$("#morearrow").hide();		
	}
	
}
$('window').ready(function(){
	//alert("setting frame to "+$("#content").height());
	//Start sIFR
	if(typeof sIFR == "function"){
	    sIFR();
	    sIFR.replaceElement(".fb_share_button span", named( {
	    						sFlashSrc: "/sIFR/relevant-elephants205.swf",
	    						sFlashVars: "underline=true",
	    						sColor: "#FFFFFF",
	    						sBgColor: "#29447e",
	    						sLinkColor: "#FFFFFF",
	    						sWmode: "transparent",
	    						sHoverColor: "#BBBBBB",
	    						sCase: "upper"
	    						}));	 
	    sIFR.replaceElement(".fontify", named( {
	    						sFlashSrc: "/sIFR/relevant-elephants205.swf",
	    						sFlashVars: "underline=true",
	    						sColor: "#000",
	    						sBgColor: "#FFFFFF",
	    						sLinkColor: "#0000FF",
	    						sWmode: "transparent",
	    						sHoverColor: "#BBBBBB"//,
	    						//sCase: "upper"
	    						}));	 
	    sIFR.replaceElement(".fontify-sp", named( {
	    						sFlashSrc: "/sIFR/relevant-elephants205.swf",
	    						sFlashVars: "underline=true",
	    						sColor: "#000",
	    						sBgColor: "#FFFFFF",
	    						sLinkColor: "#0000FF",
	    						sWmode: "transparent",
	    						sHoverColor: "#BBBBBB"//,
	    						//sCase: "upper"
	    						}));	    							
	    sIFR.replaceElement(".fontify-up", named( {
	    						sFlashSrc: "/sIFR/relevant-elephants205.swf",
	    						sFlashVars: "underline=true",
	    						sColor: "#000",
	    						sBgColor: "#FFFFFF",
	    						sLinkColor: "#000000", 
	    						sHoverColor: "#BBBBBB",
	    						sWmode: "transparent",
	    						sCase: "upper"
	    						}));
	    						
	    sIFR.replaceElement(".fontify-cen", named( {
	    						sFlashSrc: "/sIFR/relevant-elephants205.swf",
	    						sFlashVars: "underline=true&textalign=center",
	    						sColor: "#000",
	    						sBgColor: "#FFFFFF",
	    						sLinkColor: "#000000", 
	    						sHoverColor: "#BBBBBB",
	    						sWmode: "transparent",	    						
	    						sCase: "upper"
	    						}));
	    
	};
	$(".addy").click(function(){
		var p1="cartoonist";
		var p2="relevant";
		var p3="elephants";
		var p4="com";
		window.location="m"+"a"+"il"+"t"+"o:"+p1+"@"+p2+p3+"."+p4;
	});
	
	$("#about-port").css("width","221px");
	$(window).resize(showMore).scroll(showMore);
	showMore();
	
	adjustFrameSize(500);	
	window.setTimeout('adjustFrameSize(500);',1000);				
	//window.setTimeout('adjustFrameSize(500);',5000);
	reAdjustFrameSize(500,500);
	FB.init("f2d9c586e0570c6da24314c26afcf248", "/xd_receiver.htm");
	
});

function reAdjustFrameSize(size, interval){
	adjustFrameSize(size);	
	window.setTimeout('reAdjustFrameSize('+size+','+interval+');',interval);
}

function fbs_click(u, t) {
	if (u==="") u=document.href;
	if (t==="") t=location.title;
	
	window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');
	return false;
}

