var boxZero=["box00","box10","box20"];var boxOne=["box01","box11","box21"];var boxTwo=["box02","box12","box22"];var fade_counter_zero=0;var fade_counter_one=0;var fade_counter_two=0;var first_time_zero=true;var first_time_one=true;var first_time_two=true;function startFadeShowZero(arr){var fade=new YAHOO.util.Anim(arr[fade_counter_zero],{opacity:{from:96,to:0}},3,YAHOO.util.Easing.easeOut);var fadeInNext=new YAHOO.util.Anim(arr[fade_counter_zero+1],{opacity:{from:0,to:96}},3,YAHOO.util.Easing.easeIn);var fadeInNextFirst=new YAHOO.util.Anim(arr[0],{opacity:{from:0,to:96}},3,YAHOO.util.Easing.easeIn);fade.onComplete.subscribe(function(){YAHOO.util.Dom.setStyle(arr[fade_counter_zero],"display","none");YAHOO.util.Dom.setStyle(arr[fade_counter_zero+1],"opacity","0");YAHOO.util.Dom.setStyle(arr[fade_counter_zero+1],"display","block");if(fade_counter_zero+1==3){YAHOO.util.Dom.setStyle(arr[0],"display","block");fadeInNextFirst.animate();}else{fadeInNext.animate();}});fadeInNextFirst.onComplete.subscribe(function(){fade_counter_zero++;fade_counter_zero=((fade_counter_zero==3)?0:fade_counter_zero);});fadeInNext.onComplete.subscribe(function(){if(first_time_zero){first_time_zero=false;setInterval("startFadeShowZero(boxZero)",30000);}
fade_counter_zero++;fade_counter_zero=((fade_counter_zero==3)?0:fade_counter_zero);});fade.animate();}
function startFadeShowOne(arr){var fade=new YAHOO.util.Anim(arr[fade_counter_one],{opacity:{from:96,to:0}},3,YAHOO.util.Easing.easeOut);var fadeInNext=new YAHOO.util.Anim(arr[fade_counter_one+1],{opacity:{from:0,to:96}},3,YAHOO.util.Easing.easeIn);var fadeInNextFirst=new YAHOO.util.Anim(arr[0],{opacity:{from:0,to:96}},3,YAHOO.util.Easing.easeIn);fade.onComplete.subscribe(function(){YAHOO.util.Dom.setStyle(arr[fade_counter_one],"display","none");YAHOO.util.Dom.setStyle(arr[fade_counter_one+1],"opacity","0");YAHOO.util.Dom.setStyle(arr[fade_counter_one+1],"display","block");if(fade_counter_one+1==3){YAHOO.util.Dom.setStyle(arr[0],"display","block");fadeInNextFirst.animate();}else{fadeInNext.animate();}});fadeInNextFirst.onComplete.subscribe(function(){fade_counter_one++;fade_counter_one=((fade_counter_one==3)?0:fade_counter_one);});fadeInNext.onComplete.subscribe(function(){if(first_time_one){first_time_one=false;setInterval("startFadeShowOne(boxOne)",30000);}
fade_counter_one++;fade_counter_one=((fade_counter_one==3)?0:fade_counter_one);});fade.animate();}
function startFadeShowTwo(arr){var fade=new YAHOO.util.Anim(arr[fade_counter_two],{opacity:{from:96,to:0}},3,YAHOO.util.Easing.easeOut);var fadeInNext=new YAHOO.util.Anim(arr[fade_counter_two+1],{opacity:{from:0,to:96}},3,YAHOO.util.Easing.easeIn);var fadeInNextFirst=new YAHOO.util.Anim(arr[0],{opacity:{from:0,to:96}},3,YAHOO.util.Easing.easeIn);fade.onComplete.subscribe(function(){YAHOO.util.Dom.setStyle(arr[fade_counter_two],"display","none");YAHOO.util.Dom.setStyle(arr[fade_counter_two+1],"opacity","0");YAHOO.util.Dom.setStyle(arr[fade_counter_two+1],"display","block");if(fade_counter_two+1==3){YAHOO.util.Dom.setStyle(arr[0],"display","block");fadeInNextFirst.animate();}else{fadeInNext.animate();}});fadeInNextFirst.onComplete.subscribe(function(){fade_counter_two++;fade_counter_two=((fade_counter_two==3)?0:fade_counter_two);});fadeInNext.onComplete.subscribe(function(){if(first_time_two){first_time_two=false;setInterval("startFadeShowTwo(boxTwo)",30000);}
fade_counter_two++;fade_counter_two=((fade_counter_two==3)?0:fade_counter_two);});fade.animate();}
var opacity=96;var fade_in_opacity=0;var slowly={fade:function(id){this.fadeLoop(id,opacity);},fadeIn:function(id){this.fadeLoopIn(id,fade_in_opacity);},fadeLoopIn:function(id,fade_in_opacity){var o=document.getElementById(id);o.style.visibility="visible";if(fade_in_opacity<=96){slowly.setOpacity(o,fade_in_opacity);fade_in_opacity+=4;window.setTimeout("slowly.fadeLoopIn('"+id+"', "+fade_in_opacity+")",50);}},fadeLoop:function(id,opacity){var o=document.getElementById(id);if(opacity>=5){slowly.setOpacity(o,opacity);opacity-=4;window.setTimeout("slowly.fadeLoop('"+id+"', "+opacity+")",50);}else{o.style.visibility="hidden";}},setOpacity:function(o,opacity){o.style.filter="alpha(style=0,opacity:"+opacity+")";o.style.KHTMLOpacity=opacity/100;o.style.MozOpacity=opacity/100;o.style.opacity=opacity/100;}}
function truncateText(text,box,index){var len,trunc;if(box==0||box==2){len=85;}else if(box==1){len=167;}
if(text.length>len){trunc=text;trunc=trunc.substring(0,len);trunc=trunc.replace(/\w+$/,'');trunc+='<a href="'+link[index]+'" title="Click for more about this artist">...</a>';return trunc;}
return text;}
var copy=[];var link=[];function loadSharedPromoXML(murl,f1,f2,f3){/*var baseUrl="/proxy_3box.cfm";for(var t=0;t<arguments.length;t++){arguments[t]=baseUrl+'?p='+arguments[t];}*/
var Files=[f1,f2,f3];var Boxes=["boxOne","boxTwo","boxThree"];var xhttp;var len=0;var x=0;var func_count=-1;var indexes=[];var headline=[];var photo=[];var anchor,image,text,header,container,img_width,temp;for(var j=0;j<Files.length;j++){/*if(window.XMLHttpRequest){xhttp=new window.XMLHttpRequest();}else{xhttp=new ActiveXObject("Microsoft.XMLHTTP");}
xhttp.open("GET",Files[j],false);xhttp.send("");xmlDoc=xhttp.responseXML;x=xmlDoc.getElementsByTagName("headline");*/for(var i=0;i<3;i++){/*headline[headline.length]=x[i].getAttribute("name");photo[photo.length]=x[i].getElementsByTagName("photo_link")[0].childNodes[0].nodeValue;link[link.length]=x[i].getElementsByTagName("link")[0].childNodes[0].nodeValue;temp=x[i].getElementsByTagName("copytxt")[0].childNodes[0].nodeValue;*/headline[headline.length]=Files[j][i]["project_title"];photo[photo.length]=murl+Files[j][i]["media_url"];link[link.length]=Files[j][i]["link_url"];temp=Files[j][i]["project_caption"];copy[copy.length]=truncateText(temp,i,++func_count);}
if(j==0){img_height=80;indexes=[0,1,2];}else if(j==1){img_height=135;indexes=[3,4,5];}else if(j==2){img_height=80;indexes=[6,7,8];}
for(var t=0;t<3;t++){anchor=document.createElement("a");anchor.setAttribute("href",(link[indexes[t]]));anchor.setAttribute("title",("Click for more about "+headline[indexes[t]]));image=document.createElement("img");image.setAttribute("src",photo[indexes[t]]);image.setAttribute("height",img_height);image.setAttribute("width","120");image.setAttribute("alt",headline[indexes[t]]);image.className="artist";anchor.appendChild(image);header=document.createElement("h2");header.appendChild(document.createTextNode(headline[indexes[t]]));text=document.createElement("p");text.innerHTML+=copy[indexes[t]];container=document.createElement("div");container.setAttribute("id",("box"+j+t));if(j>0){YAHOO.util.Dom.addClass(container,"hide");}
container.appendChild(anchor);container.appendChild(header);container.appendChild(text);YAHOO.util.Dom.get(Boxes[t]).appendChild(container);}}}
