var first_ed_cliick=false;function loadEditorsPickXML(murl,f1,f2,f3){var baseUrl="/proxy_editorspicks.cfm";for(var t=1;t<arguments.length;t++){arguments[t]=(t==1)?arguments[t]:baseUrl+'?p='+arguments[t];}
var Files=[f1,f2,f3];var Boxes=["fa0","fa1","fa2","fa3"];var xhttp;var len=155;var x=0;var func_count=-1;var indexes=[];var headline=[];var photo=[];var copy=[];var link=[];var linkTitle=[];var anchor,ul,li,image,text,header,container,img_width,temp,trunc;if(window.XMLHttpRequest){xhttp=new window.XMLHttpRequest();}else{xhttp=new ActiveXObject("Microsoft.XMLHTTP");}/*
xhttp.open("GET",Files[0],false);xhttp.send("");xmlDoc=xhttp.responseXML;x=xmlDoc.getElementsByTagName("headline");for(var j=0;j<x.length;j++){headline[headline.length]=x[j].getAttribute("name");photo[photo.length]=x[j].getElementsByTagName("photo_link")[0].childNodes[0].nodeValue;link[link.length]=x[j].getElementsByTagName("link")[0].childNodes[0].nodeValue;temp=x[j].getElementsByTagName("copytxt")[0].childNodes[0].nodeValue;if(temp.length>len){trunc=temp;trunc=trunc.substring(0,len);trunc=trunc.replace(/\w+$/,'');trunc+='<a href="'+link[j]+'" title="Click for more about this artist">...</a>';copy[copy.length]=trunc;}else{copy[copy.length]=temp;}*/for(var j=0;j<Files[0].length;j++){headline[headline.length]=Files[0][j]["project_title"];photo[photo.length]=murl+Files[0][j]["media_url"];link[link.length]=Files[0][j]["link_url"];temp=Files[0][j]["project_caption"];if(temp.length>len){trunc=temp;trunc=trunc.substring(0,len);trunc=trunc.replace(/\w+$/,'');trunc+='<a href="'+link[j]+'" title="Click for more about this artist">...</a>';copy[copy.length]=trunc;}else{copy[copy.length]=temp;}
anchor=document.createElement("a");anchor.setAttribute("href",link[j]);anchor.setAttribute("title",(""));image=document.createElement("img");image.setAttribute("src",photo[j]);image.setAttribute("height","152");image.setAttribute("width","242");image.setAttribute("alt",headline[j]);anchor.appendChild(image);header=document.createElement("h2");header.appendChild(document.createTextNode(headline[j]));text=document.createElement("p");text.innerHTML+=copy[j];container=YAHOO.util.Dom.get(Boxes[j]);container.appendChild(anchor);container.appendChild(header);container.appendChild(text);}
for(var k=2;k<Files.length;k++){xhttp.open("GET",Files[k],false);xhttp.send("");xmlDoc=xhttp.responseXML;x=xmlDoc.getElementsByTagName("link_title");link.length=0;linkTitle.length=0;ul=document.createElement("ul");ul.className="stripe";for(var m=0;m<x.length;m++){linkTitle[linkTitle.length]=x[m].getAttribute("name");link[link.length]=x[m].getElementsByTagName("link")[0].childNodes[0].nodeValue;anchor=document.createElement("a");anchor.setAttribute("href",link[m]);anchor.setAttribute("title",("Click for more about "+linkTitle[m]));anchor.appendChild(document.createTextNode(linkTitle[m]));li=document.createElement("li");li.appendChild(anchor);if(m%2==0){li.className="even";}
ul.appendChild(li);}
if(k==1){container=YAHOO.util.Dom.get("eventLinks");}else if(k==2){container=YAHOO.util.Dom.get("editorLinks");}
container.appendChild(ul);}}
var fa_animate;function showEdLayer(index,timer){var dotLinks=YAHOO.util.Dom.getElementsByClassName('dot_links','a');var id;if(timer){if(ed_count>3){index=ed_count=0;}
id="fa"+index;var tm=setTimeout(function(){YAHOO.util.Dom.removeClass(dotLinks,'selected');YAHOO.util.Dom.addClass(dotLinks[index],'selected');},1000);}else{id="fa"+index;}
var list=["fa0","fa1","fa2","fa3"];for(var i=0;i<list.length;i++){if(YAHOO.util.Dom.get(list[i]).style.display=="block"){if(timer){swapLayers(list[i],id,timer);}else{swapLayers(list[i],id);}}}}
var ed_count=0;this.myFunction=function(){var delay=15000;var obj=this;fa_animate=setInterval(function(){obj.showEdLayer(++ed_count,'timer')},delay);}
myFunction();function swapLayers(lastId,currId,timer){if(!timer){clearInterval(fa_animate);}
var fadeOut=new YAHOO.util.Anim(lastId,{opacity:{from:96,to:0}},1,YAHOO.util.Easing.easeOut);var fadeIn=new YAHOO.util.Anim(currId,{opacity:{from:0,to:96}},2,YAHOO.util.Easing.easeIn);fadeOut.onComplete.subscribe(function(){YAHOO.util.Dom.setStyle(lastId,'opacity',0);YAHOO.util.Dom.setStyle(lastId,'display','none');YAHOO.util.Dom.setStyle(currId,'display','block');fadeIn.animate();});if(lastId!=currId){fadeOut.animate();}}
