google.load("feeds","1");function initialize(){var feed=new google.feeds.Feed("http://blog.shutterfly.com/feed/");feed.setNumEntries(10);feed.load(function(result){if(!result.error){var container=document.getElementById("pictureMoreFeed");var ul=document.createElement("ul");for(var i=0;i<result.feed.entries.length;i++){var entry=result.feed.entries[i];var li=document.createElement("li");var title=document.createElement("p");title.className="title";title.innerHTML=entry.title;var content=document.createElement("p");content.className="content";content.innerHTML=entry.content;var link=document.createElement("a");link.href=entry.link;link.innerHTML="Continue Reading"
li.appendChild(title);li.appendChild(content);li.appendChild(link);ul.appendChild(li);}
container.appendChild(ul);}});var feed2=new google.feeds.Feed("http://twitter.com/statuses/user_timeline/25425478.rss");feed2.setNumEntries(10);feed2.load(function(result){if(!result.error){var container=document.getElementById("twitterFeed");var ul=document.createElement("ul");for(var i=0;i<result.feed.entries.length;i++){var entry=result.feed.entries[i];var li=document.createElement("li");var content=document.createElement("p");content.className="content";content.innerHTML=entry.content;li.appendChild(content);ul.appendChild(li);}
container.appendChild(ul);}});}
google.setOnLoadCallback(initialize);function togglePreview(status,img){this.elemid=img.id.split("thumb");this.currid="fBookPreview"+elemid[1];this.previd;if(this.previd==undefined){this.previd="fBookPreview1";}
document.getElementById(previd).style.display="none";document.getElementById(currid).style.display="block";this.previd=this.currid;}
var xmlReq;function loadXMLDoc(url){xmlReq=false;if(window.XMLHttpRequest){try{xmlReq=new XMLHttpRequest();}catch(e){xmlReq=false;}}else if(window.ActiveXObject){try{xmlReq=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{xmlReq=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){xmlReq=false;}}}
if(xmlReq&&url){xmlReq.onreadystatechange=processReqChange;xmlReq.open("GET",url,true);xmlReq.send("");}
return xmlReq;}
loadXMLDoc();function processReqChange(){if(xmlReq.readyState==4){if(xmlReq.status==200){updateDisplay();}else{alert("There was a problem retrieving the XML data:\n"+xmlReq.statusText);}}}
function updateDisplay(){popContentObj.innerHTML=xmlReq.responseText;popShow();}
function animateCSS(element,numFrames,timePerFrame,animation,whendone){var frame=0;var time=0;var intervalId=setInterval(displayNextFrame,timePerFrame);function displayNextFrame(){if(frame>=numFrames){clearInterval(intervalId);if(whendone)whendone(element);return;}
for(var cssprop in animation){try{element.style[cssprop]=animation[cssprop](frame,time);}catch(e){}}
frame++;time+=timePerFrame;}}
var popAreaObj;function popShow(){if(document.all)setSelect("hidden");var startY=popHandleObj.lastMouseY;popShadeRtObj.style.visibility=popShadeBtObj.style.visibility="visible";animateCSS(popAreaObj,12,30,{top:function(frame,time){return+startY+(frame*21)-232+"px";},clip:function(frame,time){return"rect("+(220-(frame*(21)))+"px 566px 286px 0)";},visibility:function(){return"visible";}});return false;}
function popHide(){if(document.all)setSelect("visible");var startY=popHandleObj.lastMouseY;animateCSS(popAreaObj,12,30,{top:function(frame,time){return+startY+((11-frame)*21)-232+"px";},clip:function(frame,time){return"rect("+(220-((11-frame)*21))+"px 566px 286px 0)";},visibility:function(){return"visible";}},function(){popAreaObj.style.visibility=popShadeRtObj.style.visibility=popShadeBtObj.style.visibility="hidden";prShow(popAreaObj.getAttribute("prOpener"));});return false;}
function prShow(id){if(id){if(document.getElementById("well"+id).className=="hideWell"){document.getElementById("well"+id).className="well";var wellAbsObj=document.getElementById("wellAbs"+id);wellAbsObj.style.position="absolute";wellAbsObj.style.zIndex="1";wellAbsObj.style.clip="rect(0px 0px 0px 0px)";animateCSS(wellAbsObj,8,30,{clip:function(frame,time){return"rect("+(105-(15*frame))+"px 150px 110px 0px)";},marginTop:function(frame,time){return+((-105)+(15*frame))+"px";}});}}}
function setPromoWindow(url){var myWidth=800,myHeight=600;if(typeof(window.innerWidth)=='number'){myWidth=window.innerWidth;myHeight=window.innerHeight;}else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){myWidth=document.documentElement.clientWidth;myHeight=document.documentElement.clientHeight;}
popX=myWidth-566;popY=myHeight-300;try{var tmp=document.createElement('div');tmp.setAttribute('id','popArea');tmp.style.zIndex="100";tmp.style.left=popX+'px';popAreaObj=document.body.appendChild(tmp);tmp=document.createElement('div');tmp.setAttribute('id','popShadeRt');popShadeRtObj=popAreaObj.appendChild(tmp);tmp=document.createElement('div');tmp.setAttribute('id','popShadeBt');popShadeBtObj=popAreaObj.appendChild(tmp);tmp=document.createElement('div');tmp.setAttribute('id','popFrame');popFrameObj=popAreaObj.appendChild(tmp);tmp=document.createElement('div');tmp.setAttribute('id','popHandle');popHandleObj=popFrameObj.appendChild(tmp);tmp=document.createElement('input');tmp.setAttribute('type','image');tmp.setAttribute('src','/img_/misc/popup_close_box.gif');tmp.setAttribute('value','close');popInputBtnObj=popHandleObj.appendChild(tmp);popInputBtnObj.onclick=function(){return popHide()};tmp=document.createElement('div');tmp.setAttribute('id','popContent');popContentObj=popFrameObj.appendChild(tmp);Drag.init(popHandleObj,popAreaObj);popHandleObj.lastMouseY=popY;}
catch(e){popWindowPromo(url)}}
function popPromo(url,well){var well=well||"";if(document.location.href.indexOf("https://")==-1)
if(xmlReq){var xmlURL=url+((url.indexOf("?")==-1)?"?":"&")+"layer=1";if(!popAreaObj)
setPromoWindow(url);loadXMLDoc(xmlURL);popAreaObj.setAttribute("prOpener",well);return false;}
else{popWindowPromo(url);}
return false;}
function popWindowPromo(url){var xpos=screen.width-570;var ypos=screen.height-320;dotWin=window.open(url,"Offer","height=232,width=507,location=no,menubars=no,scrollbars=no,toolbars=no,resizable=no, screenX="+xpos+",screenY="+ypos+",left="+xpos+",top="+ypos);}
function setSelect(hiddenVisible){for(j=0;j<document.forms.length;j++){var theForm=document.forms[j]
for(i=0;i<theForm.elements.length;i++){if(theForm.elements[i].type=="select-one")
theForm.elements[i].style.visibility=hiddenVisible;}}}
var dotWin=null;var Drag={obj:null,init:function(o,oRoot,minX,maxX,minY,maxY,bSwapHorzRef,bSwapVertRef,fXMapper,fYMapper)
{o.onmousedown=Drag.start;o.hmode=bSwapHorzRef?false:true;o.vmode=bSwapVertRef?false:true;o.root=oRoot&&oRoot!=null?oRoot:o;if(o.hmode&&isNaN(parseInt(o.root.style.left)))o.root.style.left="0px";if(o.vmode&&isNaN(parseInt(o.root.style.top)))o.root.style.top="0px";if(!o.hmode&&isNaN(parseInt(o.root.style.right)))o.root.style.right="0px";if(!o.vmode&&isNaN(parseInt(o.root.style.bottom)))o.root.style.bottom="0px";o.minX=typeof minX!='undefined'?minX:null;o.minY=typeof minY!='undefined'?minY:null;o.maxX=typeof maxX!='undefined'?maxX:null;o.maxY=typeof maxY!='undefined'?maxY:null;o.xMapper=fXMapper?fXMapper:null;o.yMapper=fYMapper?fYMapper:null;o.root.onDragStart=new Function();o.root.onDragEnd=new Function();o.root.onDrag=new Function();},start:function(e)
{var o=Drag.obj=this;e=Drag.fixE(e);var y=parseInt(o.vmode?o.root.style.top:o.root.style.bottom);var x=parseInt(o.hmode?o.root.style.left:o.root.style.right);o.root.onDragStart(x,y);o.lastMouseX=e.clientX;o.lastMouseY=e.clientY;if(o.hmode){if(o.minX!=null)o.minMouseX=e.clientX-x+o.minX;if(o.maxX!=null)o.maxMouseX=o.minMouseX+o.maxX-o.minX;}else{if(o.minX!=null)o.maxMouseX=-o.minX+e.clientX+x;if(o.maxX!=null)o.minMouseX=-o.maxX+e.clientX+x;}
if(o.vmode){if(o.minY!=null)o.minMouseY=e.clientY-y+o.minY;if(o.maxY!=null)o.maxMouseY=o.minMouseY+o.maxY-o.minY;}else{if(o.minY!=null)o.maxMouseY=-o.minY+e.clientY+y;if(o.maxY!=null)o.minMouseY=-o.maxY+e.clientY+y;}
document.onmousemove=Drag.drag;document.onmouseup=Drag.end;return false;},drag:function(e)
{e=Drag.fixE(e);var o=Drag.obj;var ey=e.clientY;var ex=e.clientX;var y=parseInt(o.vmode?o.root.style.top:o.root.style.bottom);var x=parseInt(o.hmode?o.root.style.left:o.root.style.right);var nx,ny;if(o.minX!=null)ex=o.hmode?Math.max(ex,o.minMouseX):Math.min(ex,o.maxMouseX);if(o.maxX!=null)ex=o.hmode?Math.min(ex,o.maxMouseX):Math.max(ex,o.minMouseX);if(o.minY!=null)ey=o.vmode?Math.max(ey,o.minMouseY):Math.min(ey,o.maxMouseY);if(o.maxY!=null)ey=o.vmode?Math.min(ey,o.maxMouseY):Math.max(ey,o.minMouseY);nx=x+((ex-o.lastMouseX)*(o.hmode?1:-1));ny=y+((ey-o.lastMouseY)*(o.vmode?1:-1));if(o.xMapper)nx=o.xMapper(y)
else if(o.yMapper)ny=o.yMapper(x)
Drag.obj.root.style[o.hmode?"left":"right"]=nx+"px";Drag.obj.root.style[o.vmode?"top":"bottom"]=ny+"px";Drag.obj.lastMouseX=ex;Drag.obj.lastMouseY=ey;Drag.obj.root.onDrag(nx,ny);return false;},end:function()
{document.onmousemove=null;document.onmouseup=null;Drag.obj.root.onDragEnd(parseInt(Drag.obj.root.style[Drag.obj.hmode?"left":"right"]),parseInt(Drag.obj.root.style[Drag.obj.vmode?"top":"bottom"]));Drag.obj=null;},fixE:function(e)
{if(typeof e=='undefined')e=window.event;if(typeof e.layerX=='undefined')e.layerX=e.offsetX;if(typeof e.layerY=='undefined')e.layerY=e.offsetY;return e;}};
