try{document.execCommand("BackgroundImageCache",false,true);}catch(err){}var age=new Array();var prepared=0;var selectedAges=new Array();var selectedEvents=new Array();var selectedArtists=new Array();var selectedAlbums=new Array();var usrSettings=new Object();var ageJSON=new Array();var lastpointerleft=false;var absolutepath="http://www.bbc.co.uk/music/sevenages";var timelineEmbedWidth="410";var timelineEmbedHeight="355";var ages={"agesofrock":{"rock":"Birth of Rock","art":"Art Rock","punk":"Punk Rock","metal":"Heavy Metal","stadium":"Stadium Rock","alternative":"Alternative Rock","indie":"Indie"}};var ageObj={"age":[{"bg_hi":absolutepath+"/assets/timeline/tl.back.birth.of.rock2.gif","id":"timeline-position-left-0"},{"bg_hi":absolutepath+"/assets/timeline/tl.back.art.rock2.gif","id":"timeline-position-left-1865"},{"bg_hi":absolutepath+"/assets/timeline/tl.back.punk.rock2.gif","id":"timeline-position-left-3730"},{"bg_hi":absolutepath+"/assets/timeline/tl.back.metal.rock2.gif","id":"timeline-position-left-5595"},{"bg_hi":absolutepath+"/assets/timeline/tl.back.stadium.rock2.gif","id":"timeline-position-left-7460"},{"bg_hi":absolutepath+"/assets/timeline/tl.back.alt.rock2.gif","id":"timeline-position-left-9325"},{"bg_hi":absolutepath+"/assets/timeline/tl.back.indie.rock2.gif","id":"timeline-position-left-11190"}]};var foregroundImages=new Array();var backgroundImages=new Array();var hideinstructions=false;var imageLoadNum=10;var imageLoadingCounter=0;var numImagesLoaded=0;function generateTimelineObscurer(){var _1=usrSettings.ages;var _2,temprightval;var _3=99999999;var _4=0;for(var _5=0;_5<_1.length;_5++){selectedbandname=_1[_5];if(selectedbandname=="rock"){selectedbandname="birth-of-rock";}else{selectedbandname+="-rock";}_2=parseInt($("div#timeline-band-"+selectedbandname).css("left"));if(_2<_3){_3=_2;}temprightval=_2+$("div#timeline-band-"+selectedbandname).width();if(temprightval>_4){_4=temprightval;}}var _6="<div id=\"timeline-left-obscurer\"></div>";_6+="<div id=\"timeline-right-obscurer\"></div>";_6+="<div id=\"timeline-left-obscurer-fade\"></div>";_6+="<div id=\"timeline-right-obscurer-fade\"></div>";$("div#timeline-stage").append(_6);$("div#timeline-left-obscurer").css("width",(_3-100));$("div#timeline-right-obscurer").css("left",(_4+100));$("div#timeline-left-obscurer-fade").css("left",(_3-100));$("div#timeline-right-obscurer-fade").css("left",(_4+50));var _7=-34.63013698630137;var _8=parseInt((-(_3-100))/_7);$("div#timeline-scrollbar").css("left",_8);var _9=_8*_7;$("div#timeline-stage").css("left",parseInt(_9));$("div#timeline-holder").append("<div id=\"my-timeline-user-info\"><h3>I was born in "+usrSettings.year+"</h3><h4>This is my timeline</h4><a href=\"http://www.bbc.co.uk/music/sevenages/my-timeline/\" target=\"_top\">Get your own Timeline</a></div>");$("div#my-timeline-user-info").click(function(){$(this).fadeOut("slow",function(){$("div#my-timeline-user-info").remove();});});}function cancelImageDrag(){return false;}function generatepopup(_a,_b,_c,_d,_e,_f,_10){$("div#timeline-popup-content").css("border-color",_a);$("div#timeline-popup-content h1").text(_d);$("div#timeline-popup-content h4").text(_c);$("div#timeline-popup-content h3").text(_b);$("div#timeline-popup-content h3").css("color",_a);$("div#timeline-popup-content p").text(_e);$("div#timeline-popup-content img").attr("src",_10);$("div#timeline-popup-content a.more").attr("href",_f);$("div#timeline-popup-content a.more").text("Find out more");$("div#timeline-popup-content a.close").text("Close");$("div#timeline-popup-background").height($("div#timeline-holder").height());$("div#timeline-popup-background").width($("div#timeline-holder").width());$("div#timeline-popup-background").css("left","0");$("div#timeline-popup-background").css("top","0");$("div#timeline-popup-background").css("display","block");$("div#timeline-popup").height($("div#timeline-holder").height());$("div#timeline-popup").width($("div#timeline-holder").width());$("div#timeline-popup").css("left","0");$("div#timeline-popup").css("top","0");$("div#timeline-popup").css("display","block");}function loadArtistImagesBasic(){var _11;var _12=foregroundImages.length;for(counter=0;counter<(_12);counter++){_11=foregroundImages[counter];$("div#timeline-stage").append(_11);}setTimeout("checkImagesLoaded()",20);}function checkImagesLoaded(){var _13=$("div#timeline-stage img.timeline-image-artist").get();var _14=_13.length;var _15=0;for(counter=0;counter<(_14);counter++){if(_13[counter].complete){_15++;}}$("div#timeline-popup-loading h4").text("Loading: "+parseInt(_15/_14*100)+"%");if(_15>=_14){$("div#timeline-stage img.timeline-image-artist").each(function(){var _16=$(this).get()[0].id;$(this).mouseover(function(){if(this.className.indexOf("timeline-image-artist-no-fade")==-1){return false;}$("div#timeline-stage a.artist-popup").remove();insertHTML="<a href=\"javascript: void(0)\" class=\"artist-popup\">";insertHTML+="<h2>"+$(this).attr("longdesc").split("#")[5]+"</h2>";insertHTML+="<span class=\"relatedimageid\" title=\""+"img#foreground"+_16.slice(10)+"\"></span>";insertHTML+="</a>";$("div#timeline-stage").append(insertHTML);$("div#timeline-stage a.artist-popup").css("left",(parseInt($(this).css("left"))+70)+"px");$("div#timeline-stage a.artist-popup").click(function(){var _17=$($(this).find("span.relatedimageid").attr("title"));window.top.location=$(_17).attr("longdesc").split("#")[3];return false;generatepopup("#aaaaaa","Artist Bio",$(_17).attr("longdesc").split("#")[1],$(_17).attr("longdesc").split("#")[5],$(_17).attr("longdesc").split("#")[2],$(_17).attr("longdesc").split("#")[3],$(_17).attr("longdesc").split("#")[4]);});return false;});});if(displaybackgroundimage){$("div#full-image-holder").addClass("load-birth-of-rock-background");}$("div#timeline-popup-background").css("left","-5000px");$("div#timeline-popup-background").css("display","none");$("div#timeline-popup-loading").css("left","-5000px");$("div#timeline-popup-loading").css("display","none");$("div#timeline-instructions").click(function(){$(this).fadeOut("slow",function(){$(this).remove();});});for(i=0;i<document.images.length;i++){document.images[i].onmousedown=cancelImageDrag;document.images[i].onmousemove=cancelImageDrag;}hideinstructions=true;generateTimelineObscurer();return;}else{setTimeout("checkImagesLoaded()",20);}}function loadArtistImages(_18){if(_18>=foregroundImages.length){if(displaybackgroundimage){$("div#full-image-holder").addClass("load-birth-of-rock-background");}$("div#timeline-popup-background").css("left","-5000px");$("div#timeline-popup-background").css("display","none");$("div#timeline-popup-loading").css("left","-5000px");$("div#timeline-popup-loading").css("display","none");generateTimelineObscurer();$("div#timeline-instructions").click(function(){$(this).fadeOut("slow",function(){$(this).remove();});});for(i=0;i<document.images.length;i++){document.images[i].onmousedown=cancelImageDrag;document.images[i].onmousemove=cancelImageDrag;}hideinstructions=true;return;}$("div#timeline-popup-loading").height($("div#timeline-holder").height());$("div#timeline-popup-loading").width($("div#timeline-holder").width());$("div#timeline-popup-loading").css("left","0");$("div#timeline-popup-loading").css("top","0");$("div#timeline-popup-loading").css("display","block");percentLoaded=parseInt((_18)/(foregroundImages.length)*100);$("div#timeline-popup-loading h4").text("Loading: "+percentLoaded+"%");var _19=0;var _1a="";var _1b=0;for(_1b=_18;_1b<(_18+imageLoadNum);_1b++){if(_1b<foregroundImages.length){_1a=foregroundImages[_1b];$("div#timeline-stage").append(_1a);$("div#timeline-stage img#foreground"+_1b).load(function(){var _1c=$(this).get()[0].id;$(this).mouseover(function(){if(this.className.indexOf("timeline-image-artist-no-fade")==-1){return false;}$("div#timeline-stage a.artist-popup").remove();_1a="<a href=\"javascript: void(0)\" class=\"artist-popup\">";_1a+="<h2>"+$(this).attr("longdesc").split("#")[5]+"</h2>";_1a+="<span class=\"relatedimageid\" title=\""+"img#foreground"+_1c.slice(10)+"\"></span>";_1a+="</a>";$("div#timeline-stage").append(_1a);$("div#timeline-stage a.artist-popup").css("left",(parseInt($(this).css("left"))+70)+"px");$("div#timeline-stage a.artist-popup").click(function(){var _1d=$($(this).find("span.relatedimageid").attr("title"));window.location=$(_1d).attr("longdesc").split("#")[3];return false;generatepopup("#aaaaaa","Artist Bio",$(_1d).attr("longdesc").split("#")[1],$(_1d).attr("longdesc").split("#")[5],$(_1d).attr("longdesc").split("#")[2],$(_1d).attr("longdesc").split("#")[3],$(_1d).attr("longdesc").split("#")[4]);});return false;});numImagesLoaded++;if(numImagesLoaded>=foregroundImages.length){setTimeout("loadArtistImages("+(foregroundImages.length)+")",5);return;}imageLoadingCounter++;if(imageLoadingCounter>=imageLoadNum){imageLoadingCounter=0;setTimeout("loadArtistImages("+(_18+imageLoadNum)+")",5);}});}}}function setup(){if($("div#timeline").css("position")!="relative"){$("div#timeline").css("overflow","visible");$("div#timeline").css("height","auto");return;}$("div#timeline-holder").height("320px");$("div#timeline-popup-background").height($("div#timeline-holder").height());$("div#timeline-popup-background").width($("div#timeline-holder").width());$("div#timeline-popup-background").css("left","0");$("div#timeline-popup-background").css("top","0");$("div#timeline-popup-background").css("display","block");$("div#timeline-popup-loading h4").text("Loading: 0%");$.post(artistInfoURI,function(_1e){var _1f=new Array;$("div.timeline-artist-info").each(function(){_1f[_1f.length]=$(this).find("a").attr("href");});$("div#timeline-stage").prepend(_1e);$("div.timeline-artist-info").each(function(){if(this.className.indexOf("timeline-selected-artist")!=-1){return true;}var _20=false;for(var _21=0;_21<_1f.length;_21++){if($(this).find("a").attr("href")==_1f[_21]){_20=true;break;}}if(_20){$(this).remove();}});$("div.timeline-artist-info").each(function(){var _22="";if(this.className.indexOf("timeline-selected-artist")!=-1){_22=" timeline-image-artist-no-fade";}var _23="<img class=\"timeline-image-artist"+_22+"\" longdesc=\"";_23+=$(this).find("span.timeline-artist-photographer").attr("title")+"#";_23+="#";_23+=$(this).find("p").text()+"#";_23+=$(this).find("a").attr("href")+"#";_23+=$(this).find("span.timeline-artist-thumbnail").attr("title")+"#";_23+=$(this).find("h2").text()+"\" ";_23+="src=\""+absolutepath+$(this).find("span.timeline-artist-image").attr("title")+"\" ";_23+="id=\"foreground"+foregroundImages.length+"\" ";_23+="style=\"left: "+$(this).find("span.timeline-artist-image-left-offset").attr("title")+"px\" />";foregroundImages[foregroundImages.length]=_23;$(this).hide();});if(window.navigator.userAgent.indexOf("Safari")!=-1){loadArtistImages(0);}else{loadArtistImagesBasic();}});}function initTimelineFinal(){if($("div#timeline").css("position")!="relative"){$("div#timeline").css("overflow","visible");$("div#timeline").css("height","auto");return;}$("div#timeline-holder").height("320px");$("div#timeline-popup-background").height($("div#timeline-holder").height());$("div#timeline-popup-background").width($("div#timeline-holder").width());$("div#timeline-popup-background").css("left","0");$("div#timeline-popup-background").css("top","0");$("div#timeline-popup-background").css("display","block");$("div#timeline").each(function(){$(this).css("overflow","hidden");$(this).height("265px");});$("div#timeline-ages-holder").show();$("div#timeline-scrollbar-block").css("display","block");$("timeline-scrollbar").append("<img src=\"assets/timeline/scrollbar.button.gif\"></img>");var _24=false;var _25=285;var _26=0;var _27=1957;var _28=2007.4;var _29=false;var _2a=false;var _2b=false;var _2c=false;var _2d=false;var _2e=document.getElementById("timeline-scrollbar");var _2f=document.getElementById("timeline-scrollbar-holder");var _30=_2f.offsetWidth-_2e.offsetWidth;var _31=document.getElementById("timeline-stage");var _32=document.getElementById("timeline");var _33=parseInt(_31.offsetWidth)-parseInt(_32.offsetWidth);var _34="";_2e.style.left=0;_31.style.left=0;var _35=218-70;function clearinstructions(){if($("div#timeline-instructions")&&hideinstructions){$("div#timeline-instructions").fadeOut("slow",function(){$("div#timeline-instructions").remove();});}if($("div#my-timeline-user-info")&&hideinstructions){$("div#my-timeline-user-info").fadeOut("slow",function(){$("div#my-timeline-user-info").remove();});}}var _36=-((_31.offsetWidth-_32.offsetWidth)/_30);function checkwhere(e){if(document.layers){xCoord=e.x;}else{if(document.all){xCoord=event.clientX;}else{if(document.getElementById){xCoord=e.clientX;}}}return xCoord;}function findPos(obj){var _39=curtop=0;if(obj.offsetParent){_39=obj.offsetLeft;curtop=obj.offsetTop;while(obj=obj.offsetParent){_39+=obj.offsetLeft;curtop+=obj.offsetTop;}}return [_39,curtop];}$("body").mouseup(function(){_2b=false;_2c=false;stageDragPosition=false;});$("body").mousemove(function(e){if(_29){var _3b=checkwhere(e);if(!_2a){_2a=_3b;}var _3c=parseInt(_2e.style.left);var _3d=_3c+(_3b-_2a);if(_3d<0){_3d=0;}if(_3d>_30){_3d=_30;}_2a=_2a+(_3d-_3c);_2e.style.left=_3d+"px";_31.style.left=Math.round(_3d*_36)+"px";}if(_2b){var _3e=checkwhere(e);var _3f=_3e-_2c+_2d;if(_3f>0){_3f=0;}if(_3f<(-_33)){_3f=-_33;}_31.style.left=_3f+"px";_2e.style.left=Math.round((_3f)/_36)+"px";}return false;});function animatestageto(_40){_24=true;var _41=Math.round((-_40)/_36);$("div#timeline-stage").animate({left:(-_40)},2000,"",function(){_24=false;});$("div#timeline-scrollbar").animate({left:_41},2000);}$("div#timeline-scrollbar").mouseup(function(e){_29=false;_2a=false;});$("div#timeline-scrollbar").mousedown(function(e){clearinstructions();_29=true;});$("html").mouseup(function(e){_29=false;_2a=false;});$("a.timeline-stage-pointer").click(function(){generatepopup($(this).find("span.timeline-pointer-headline").css("background-color"),$(this).find("span.timeline-age-wording").attr("title"),$(this).find("span.timeline-pointer-date").text(),$(this).find("span.timeline-pointer-headline").text(),$(this).find("span.timeline-pointer-intro").text(),$(this).find("span.timeline-pointer-link").attr("title"),$(this).find("span.timeline-pointer-image").attr("title"));if($(this).attr("name")!="selected"){$(this).find("span.timeline-pointer-headline").hide();$(this).find("span.timeline-pointer-block").hide();$(this).css("z-index","10");}return false;});$("a.timeline-stage-pointer span.timeline-pointer-block").hide();$("a.timeline-stage-pointer").mouseover(function(){if($("div#timeline").css("position")!="relative"){return;}if($(this).attr("name")!="selected"){$(this).find("span.timeline-pointer-block").css("visibility","hidden");$(this).find("span.timeline-pointer-headline").css("visibility","hidden");$(this).find("span.timeline-pointer-block").show();$(this).find("span.timeline-pointer-headline").show();var _45=$(this).find("span.timeline-pointer-headline").get()[0].offsetHeight;var _46=(-_45-16)+"px";$(this).find("span.timeline-pointer-block").css("top",_46);$(this).css("z-index","25");$(this).find("span.timeline-pointer-block").css("visibility","visible");$(this).find("span.timeline-pointer-headline").css("visibility","visible");}});$("a.timeline-stage-pointer").mouseout(function(){if($(this).attr("name")!="selected"){$(this).css("z-index","10");$(this).find("span.timeline-pointer-block").hide();$(this).find("span.timeline-pointer-headline").hide();}});$("div#timeline-ages-holder a").click(function(){clearinstructions();if(_34){$("div#"+_34+"-holder a.timeline-stage-pointer span.timeline-pointer-block").hide();$("div#"+_34+"-holder a.timeline-stage-pointer[@name=selected]").attr("name","").css("z-index","10");$("div.timeline-group-popup").remove();}if($(this).attr("title")=="clear-all"){$("div#timeline-ages-holder a").removeClass("select");return;}$("div#timeline-ages-holder a").removeClass("select");$(this).addClass("select");var _47=$(this).css("background-color");var _48=$(this).attr("title");_34=_48;$("div#"+_34+"-holder a.timeline-stage-pointer").each(function(){if($(this).attr("name")!="selected"){var _49=$(this).parent().get()[0];if(_49.className=="pointer-group"){var _4a="<div class='timeline-group-popup'>";var _4b=$(this).parent().find("a.timeline-stage-pointer");var _4c=_4b.length;var i=0;for(i=0;i<_4c;i++){var _4e=_4b[i];_4a+="<a name='"+i+"' href='"+$(_4e).find("span.timeline-pointer-link").attr("title")+"'>";_4a+=$(_4e).find("span.timeline-pointer-headline").text()+"</a>";if(i<_4b.length-1){_4a+="<div></div>";}}$(this).parent().find("a.timeline-stage-pointer").attr("name","selected");$(this).parent().append(_4a);$(this).parent().find("div.timeline-group-popup").css("background-color",_47);$(this).parent().find("div.timeline-group-popup").css("z-index","20");var _4f=(parseInt($(this).css("left"))+7)+"px";$(this).parent().find("div.timeline-group-popup").css("left",_4f);var _50=(parseInt($(this).css("top"))-$(this).parent().find("div.timeline-group-popup").height()-15);$(this).parent().find("div.timeline-group-popup").css("top",_50);$(this).parent().find("div.timeline-group-popup").show();$(this).parent().find("a.timeline-stage-pointer span.timeline-pointer-block").css("top","-15px");$(this).parent().find("a.timeline-stage-pointer span.timeline-pointer-block").show();$(this).parent().find("div.timeline-group-popup a").click(function(){var _51=$(this).parent().parent().find("a.timeline-stage-pointer")[parseInt($(this).attr("name"))];generatepopup($(this).parent().css("background-color"),$(_51).find("span.timeline-age-wording").attr("title"),$(_51).find("span.timeline-pointer-date").text(),$(_51).find("span.timeline-pointer-headline").text(),$(_51).find("span.timeline-pointer-intro").text(),$(_51).find("span.timeline-pointer-link").attr("title"),$(_51).find("span.timeline-pointer-image").attr("title"));return false;});}else{$(this).find("span.timeline-pointer-block").show();$(this).find("span.timeline-pointer-headline").show();var _52=$(this).find("span.timeline-pointer-headline").get()[0].offsetHeight;var _53=(-_52-16)+"px";$(this).find("span.timeline-pointer-block").css("top",_53);$(this).css("z-index","20");$(this).attr("name","selected");}}});var _54="div#timeline-band-"+$(this).attr("title");animatestageto(parseInt($(_54).css("left"))-100);});$("div#timeline-popup-content a.close").click(function(){$("div#timeline-popup").css("left","-5000px");$("div#timeline-popup").css("display","none");$("div#timeline-popup-background").css("left","-5000px");$("div#timeline-popup-background").css("display","none");});$("div#timeline").mousedown(function(e){clearinstructions();_2b=true;_2c=checkwhere(e);_2d=parseInt(_31.style.left);return false;});$("div#timeline").mouseup(function(e){_2b=false;_2c=false;_2d=false;return false;});$("div#timeline-scrollbar").click(function(){return false;});$("div#timeline-scrollbar-block").click(function(e){clearinstructions();var _58=Math.round((checkwhere(e)*_36)+730);if(_58>0){_58=0;}if(_58<(-_33)){_58=-_33;}animatestageto(-_58);});}function isAgeSelected(_59){var _5a;for(var i=0;i<selectedAges.length;i++){_5a=ages.agesofrock[selectedAges[i]];if(_5a==_59){return true;}}return false;}function updateAgeSelect(){$("#frmAge optgroup").empty();if(!isAgeSelected("Birth of Rock")){$("#frmAge optgroup").append("<option value=\"rock\" style=\"color: #000000\">1. Birth of Rock</option>");}else{$("#frmAge optgroup").append("<option value=\"rock\" style=\"color: #bbbbbb\" disabled=\"disabled\">1. Birth of Rock</option>");}if(!isAgeSelected("Art Rock")){$("#frmAge optgroup").append("<option value=\"art\" style=\"color: #000000\">2. Art Rock</option>");}else{$("#frmAge optgroup").append("<option value=\"art\" style=\"color: #bbbbbb\" disabled=\"disabled\">2. Art Rock</option>");}if(!isAgeSelected("Punk Rock")){$("#frmAge optgroup").append("<option value=\"punk\" style=\"color: #000000\">3. Punk Rock</option>");}else{$("#frmAge optgroup").append("<option value=\"punk\" style=\"color: #bbbbbb\" disabled=\"disabled\">3. Punk Rock</option>");}if(!isAgeSelected("Heavy Metal")){$("#frmAge optgroup").append("<option value=\"metal\" style=\"color: #000000\">4. Heavy Metal</option>");}else{$("#frmAge optgroup").append("<option value=\"metal\" style=\"color: #bbbbbb\" disabled=\"disabled\">4. Heavy Metal</option>");}if(!isAgeSelected("Stadium Rock")){$("#frmAge optgroup").append("<option value=\"stadium\" style=\"color: #000000\">5. Stadium Rock</option>");}else{$("#frmAge optgroup").append("<option value=\"stadium\" style=\"color: #bbbbbb\" disabled=\"disabled\">5. Stadium Rock</option>");}if(!isAgeSelected("Alternative Rock")){$("#frmAge optgroup").append("<option value=\"alternative\" style=\"color: #000000\">6. Alternative Rock</option>");}else{$("#frmAge optgroup").append("<option value=\"alternative\" style=\"color: #bbbbbb\" disabled=\"disabled\">6. Alternative Rock</option>");}if(!isAgeSelected("Indie")){$("#frmAge optgroup").append("<option value=\"indie\" style=\"color: #000000\">7. Indie</option>");}else{$("#frmAge optgroup").append("<option value=\"indie\" style=\"color: #bbbbbb\" disabled=\"disabled\">7. Indie</option>");}$("#frmAge").each(function(){this.selectedIndex=0;});}function hideSelectedEvents(){var _5c=false;var _5d=$("#frmEvents").find("option");var _5e=$("#selected-events").find("option");if((!_5d)||(!_5e)){return false;}for(var i=0;i<_5d.length;i++){_5c=false;for(i2=0;i2<_5e.length;i2++){if($(_5d[i]).text()==$(_5e[i2]).text()){_5c=true;break;}}if(_5c){$(_5d[i]).css("color","#bbbbbb");$(_5d[i]).attr("disabled","disabled");}else{$(_5d[i]).css("color","#000000");$(_5d[i]).attr("disabled","");}}}function hideSelectedArtists(){var _60=false;var _61=$("#frmArtists").find("option");var _62=$("#selected-artists").find("option");if((!_61)||(!_62)){return false;}for(var i=0;i<_61.length;i++){_60=false;for(i2=0;i2<_62.length;i2++){if($(_61[i]).text()==$(_62[i2]).text()){_60=true;break;}}if(_60){$(_61[i]).css("color","#bbbbbb");$(_61[i]).attr("disabled","disabled");}else{$(_61[i]).css("color","#000000");$(_61[i]).attr("disabled","");}}}function hideSelectedAlbums(){var _64=false;var _65=$("#frmAlbums").find("option");var _66=$("#selected-albums").find("option");if((!_65)||(!_66)){return false;}for(var i=0;i<_65.length;i++){_64=false;for(i2=0;i2<_66.length;i2++){if($(_65[i]).text()==$(_66[i2]).text()){_64=true;break;}}if(_64){$(_65[i]).css("color","#bbbbbb");$(_65[i]).attr("disabled","disabled");}else{$(_65[i]).css("color","#000000");$(_65[i]).attr("disabled","");}}}function initMyTimelineForm(){}String.prototype.toProperCase=function(){return this.toLowerCase().replace(/\w+/g,function(s){return s.charAt(0).toUpperCase()+s.substr(1);});};function generateEmbedUrl(_69){if(_69==undefined){selectedEvents.sort();var _6a=new Array();var _6b=new Array();var id=-1;for(var i=0;i<selectedEvents.length;i++){var _6e=selectedEvents[i].split("-");for(var j=0;j<_6b.length;j++){if(_6b[j]==_6e[0]){id=j;break;}}if(id==-1){_6b.push(_6e[0]);_6a.push(new Array());id=_6b.length-1;}_6a[id].push(_6e[1]);id=-1;}var _70="";for(var i=0;i<selectedAges.length;i++){_70+="\""+selectedAges[i]+"\",";}_70=_70.substr(0,_70.length-1);var _72="";for(var i=0;i<_6b.length;i++){_72+="\""+_6b[i]+"\" : [ ";_72+=_6a[i].toString();_72+=" ],";}_72=_72.substr(0,_72.length-1);selectedArtists.sort();var _74=new Array();var _75=new Array();var id=-1;for(var i=0;i<selectedArtists.length;i++){var _78=selectedArtists[i].split("-");for(var j=0;j<_75.length;j++){if(_75[j]==_78[0]){id=j;break;}}if(id==-1){_75.push(_78[0]);_74.push(new Array());id=_75.length-1;}_74[id].push(_78[1]);id=-1;}var _7a="";for(var i=0;i<_75.length;i++){_7a+="\""+_75[i]+"\" : [ ";_7a+=_74[i].toString();_7a+=" ],";}_7a=_7a.substr(0,_7a.length-1);selectedAlbums.sort();var _7c=new Array();var _7d=new Array();var id=-1;for(var i=0;i<selectedAlbums.length;i++){var _80=selectedAlbums[i].split("-");for(var j=0;j<_7d.length;j++){if(_7d[j]==_80[0]){id=j;break;}}if(id==-1){_7d.push(_80[0]);_7c.push(new Array());id=_7d.length-1;}_7c[id].push(_80[1]);id=-1;}var _82="";for(var i=0;i<_7d.length;i++){_82+="\""+_7d[i]+"\" : [ ";_82+=_7c[i].toString();_82+=" ],";}_82=_82.substr(0,_82.length-1);_69="usrSettings = {\"year\":"+$("select#my-timeline-year").val()+",\"ages\": ["+_70+"],\"events\" : { "+_72+" },\"artists\" : { "+_7a+" },\"albums\" : { "+_82+" }};";}var _84=base64encode(_69);var _85="";if($("select#my-timeline-select-timeline-size").val()!=""){_85="-"+$("select#my-timeline-select-timeline-size").val();}var url=absolutepath+"/my-timeline/complete"+_85+"/?v="+_84;var _87=absolutepath+"/assets/timeline/my-timeline/no.js.my.timeline"+_85+".gif";var _88="";$("#timelineLink").attr("href",url);$("#timeline-link-textarea").text(url);if($("select#my-timeline-select-timeline-size").val()=="medium"){timelineEmbedWidth=660;}if($("select#my-timeline-select-timeline-size").val()=="large"){timelineEmbedWidth=770;}if($("select#my-timeline-select-blog").val()=="myspace"){_88="<a href=\""+url+"\"><img src=\""+_87+"\" /></a>";}else{if($("select#my-timeline-select-blog").val()=="facebook"){_88="Click on the following link to see my rock timeline - "+url;}else{if($("select#my-timeline-select-blog").val()=="bebo"){_88="Click on the following link to see my rock timeline - "+url;}else{_88="<noscript><a href=\""+url+"\"><img src=\""+_87+"\" /></a></noscript><iframe src=\""+url+"\" height=\""+timelineEmbedHeight+"\" width=\""+timelineEmbedWidth+"\" scrolling=\"no\"></iframe>";}}}$("#timelineCode").text(_88);return _84;}function alertDecodedString(_89){}function buildPointerHTML(_8a,_8b){var _8c="";if(_8b){if((_8b.x-_8a.x<150)&&lastpointerleft===false){lastpointerleft=_8a.x;_8c+="<div class=\"pointer-group\">";}}_8c+="<a href=\""+absolutepath+_8a.link+"\" id=\""+_8a.id+"\" class=\"timeline-stage-pointer "+_8a.age_class+"\">";_8c+="<span class=\"timeline-pointer-date\" title=\""+_8a.y+","+_8a.x+"\">"+_8a.date+"</span><br />";_8c+="<span class=\"timeline-pointer-block\"><span class=\"timeline-pointer-headline\">"+_8a.title+"</span></span><br />";_8c+="<span class=\"timeline-pointer-intro\" >"+_8a.desc+"</span>";_8c+="<span title=\""+absolutepath+_8a.link+"\" class=\"timeline-pointer-link\"></span>";_8c+="<span title=\""+absolutepath+_8a.thumb+"\" class=\"timeline-pointer-image\"></span>";_8c+="<span title=\""+_8a.age_name+"\" class=\"timeline-age-wording\"></span><br /><br />";_8c+="</a>";if(_8b&&lastpointerleft){if(_8b.x-lastpointerleft>150){lastpointerleft=false;_8c+="</div>";}}if(!_8b&&lastpointerleft){lastpointerleft=false;_8c+="</div>";}return _8c;}function buildAlbumHTML(_8d){var _8e="";var _8f=32,yearsize=285,monthsize=24,startyear=1962;var _90=_8d.date.split(",");var _91=Math.floor(_8f+((_90[1]-startyear)*yearsize)+((_90[0]-1)*monthsize));var _92=parseInt(Math.random()*70)+150;_8e+="<a class=\"timeline-album\" target=\"_top\" href=\""+_8d.link+"\" style=\"position: absolute; left: "+_91+"px; top: "+_92+"px;\">";_8e+="<img src=\""+absolutepath+_8d.thumb+"\" alt=\""+_8d.title+"\" title=\""+_8d.title+"\" />";_8e+="</a>";return _8e;}function buildArtistHTML(_93){var _94="";_94+="<div class=\"timeline-artist-info timeline-selected-artist\">";_94+="<h2>"+_93.name+"</h2>";_94+="<a href=\""+absolutepath+_93.link+"\">More info</a>";_94+="<span title=\""+_93.image+"\" class=\"timeline-artist-image\"></span>";_94+="<span title=\""+_93.pos+"\" class=\"timeline-artist-image-left-offset\"></span>";_94+="<span title=\"Redfern\" class=\"timeline-artist-photographer\"></span>";_94+="</div>";return _94;}function buildAgeWrapperHTML(_95){var _96="";_96+="<div id=\""+_95.sub_class+"-holder\">";_96+="<h2>"+_95.number+" "+_95.name+"</h2>";_96+="<h4>"+_95.date+"</h4>";_96+="<div id=\"timeline-band-"+_95.sub_class+"\">";_96+="<span></span>";_96+="<div></div>";_96+="</div>";_96+="</div>";return _96;}function buildAgeLinkHTML(_97){var _98="<a href=\"javascript: void(0)\" title=\""+_97.sub_class+"\" class=\""+_97.sub_class+"\">"+_97.name+"</a>";return _98;}function prepareAge(_99){return _99;}function getPointers(_9a,_9b,_9c){var _9d="";var _9e=_9a.events[_9c];for(var k in _9a.events){if(_9a.events[k]==_9c){_9e=_9a.events[k];}}if(_9e){for(var j=0;j<_9e.length;j++){_9d+=buildPointerHTML(_9b.events[_9e[j]],_9b.events[_9e[j+1]]);}}return _9d;}function getAlbums(_a1,_a2,_a3){var _a4="";var _a5=_a1.albums[_a3];for(var k in _a1.albums){if(_a1.albums[k]==_a3){_a5=_a1.albums[k];}}if(_a5==undefined){return _a4;}for(var j=0;j<_a5.length;j++){_a4+=buildAlbumHTML(_a2.albums[_a5[j]]);}return _a4;}function getArtists(_a8,_a9,_aa){var _ab="";var _ac=_a8.artists[_aa];for(var k in _a8.artists){if(_a8.artists[k]==_aa){_ac=_a8.artists[k];}}if(_ac){for(var j=0;j<_ac.length;j++){_ab+=buildArtistHTML(_a9.artists[_ac[j]]);}}return _ab;}function addAge(_af){if(_af==undefined){return false;}for(var i=0;i<selectedAges.length;i++){if(selectedAges[i]==_af){return false;}}selectedAges.push(_af);return true;}function removeChildrenSelection(_b1){$("option[@value="+_b1+"-0]").each(function(){$(this).parent().remove();});for(var i=0;i<selectedEvents.length;i++){if(selectedEvents[i].indexOf(_b1)!=-1){selectedEvents.splice(i,1);i--;}}checkEventsArea(undefined);for(var i=0;i<selectedArtists.length;i++){if(selectedArtists[i].indexOf(_b1)!=-1){selectedArtists.splice(i,1);i--;}}checkArtistsArea(undefined);for(var i=0;i<selectedAlbums.length;i++){if(selectedAlbums[i].indexOf(_b1)!=-1){selectedAlbums.splice(i,1);i--;}}checkAlbumsArea(undefined);}function removeAge(_b5){if(_b5==undefined){return false;}for(var i=0;i<selectedAges.length;i++){if(selectedAges[i]==_b5){selectedAges.splice(i,1);checkAgesArea(undefined);removeChildrenSelection(_b5);updateAgeSelect();hideSelectedEvents();hideSelectedArtists();hideSelectedAlbums();return true;}}return false;}function checkAgesArea(_b7){if(addAge(_b7)){url=absolutepath+"/includes/ajax/timeline."+_b7+".ajax";$.getJSON(url,undefined,function(_b8){age.push(_b8);setEventsAndArtists(age.length);});}$("#selected-ages").empty();for(var i=0;i<selectedAges.length;i++){var _ba=ages.agesofrock[selectedAges[i]].toLowerCase().replace(/ /g,"-");var _bb;if(window.navigator.userAgent.indexOf("Safari")!=-1){_bb="";}else{_bb=" disabled=\"disabled\"";}$("#selected-ages").append("<div class=\"my-timeline-select-holder\"><a href=\"#\" onclick=\"removeAge('"+selectedAges[i]+"');return false;\">remove</a><select"+_bb+"><option>"+ages.agesofrock[selectedAges[i]]+"</option></select></div>");}}function addEvent(_bc){if(_bc==undefined){return false;}for(var i=0;i<selectedEvents.length;i++){if(selectedEvents[i]==_bc){return false;}}selectedEvents.push(_bc);return true;}function removeEvent(_be){if(_be==undefined){return false;}for(var i=0;i<selectedEvents.length;i++){if(selectedEvents[i]==_be){selectedEvents.splice(i,1);checkEventsArea(undefined);hideSelectedEvents();return true;}}return false;}function getEventAge(_c0){for(var j=0;j<age.length;j++){if(age[j].age.ident==_c0){return j;}}return -1;}function checkEventsArea(_c2){if(addEvent(_c2)){var _c3=_c2.split("-")[0];var _c4=_c2.split("-")[1];var _c5=getEventAge(_c3);var _c6=-1;for(var j=0;j<selectedAges.length;j++){if(selectedAges[j]==_c3){_c6=j;}}if(_c6<0){return false;}}$("#selected-events").empty();for(var i=0;i<selectedEvents.length;i++){_c3=selectedEvents[i].split("-")[0];_c4=selectedEvents[i].split("-")[1];_c5=getEventAge(_c3);var _c9=_c3;var _ca;if(window.navigator.userAgent.indexOf("Safari")!=-1){_ca="";}else{_ca=" disabled=\"disabled\"";}$("#selected-events").append("<div class=\"my-timeline-select-holder\"><a href=\"#\" onclick=\"removeEvent('"+selectedEvents[i]+"');return false;\">remove</a><select"+_ca+"><option>"+age[_c5].events[_c4].title+"</option></select></div>");}}function addArtist(_cb){if(_cb==undefined){return false;}for(var i=0;i<selectedArtists.length;i++){if(selectedArtists[i]==_cb){return false;}}selectedArtists.push(_cb);return true;}function removeArtist(_cd){if(_cd==undefined){return false;}for(var i=0;i<selectedArtists.length;i++){if(selectedArtists[i]==_cd){selectedArtists.splice(i,1);checkArtistsArea(undefined);hideSelectedArtists();return true;}}return false;}function checkArtistsArea(_cf){if(addArtist(_cf)){var _d0=_cf.split("-")[0];var _d1=_cf.split("-")[1];var _d2=getEventAge(_d0);var _d3=-1;for(var j=0;j<selectedAges.length;j++){if(selectedAges[j]==_d0){_d3=j;}}if(_d3<0){return false;}}$("#selected-artists").empty();for(var i=0;i<selectedArtists.length;i++){_d0=selectedArtists[i].split("-")[0];_d1=selectedArtists[i].split("-")[1];_d2=getEventAge(_d0);var _d6=_d0;var _d7;if(window.navigator.userAgent.indexOf("Safari")!=-1){_d7="";}else{_d7=" disabled=\"disabled\"";}$("#selected-artists").append("<div class=\"my-timeline-select-holder\"><a href=\"#\" onclick=\"removeArtist('"+selectedArtists[i]+"');return false;\">remove</a><select"+_d7+"><option>"+age[_d2].artists[_d1].name+"</option></select></div>");}}function addAlbum(_d8){if(_d8==undefined){return false;}for(var i=0;i<selectedAlbums.length;i++){if(selectedAlbums[i]==_d8){return false;}}selectedAlbums.push(_d8);return true;}function removeAlbum(_da){if(_da==undefined){return false;}for(var i=0;i<selectedAlbums.length;i++){if(selectedAlbums[i]==_da){selectedAlbums.splice(i,1);checkAlbumsArea(undefined);hideSelectedAlbums();return true;}}return false;}function checkAlbumsArea(_dc){if(addAlbum(_dc)){var _dd=_dc.split("-")[0];var _de=_dc.split("-")[1];var _df=getEventAge(_dd);var _e0=-1;for(var j=0;j<selectedAges.length;j++){if(selectedAges[j]==_dd){_e0=j;}}if(_e0<0){return false;}}$("#selected-albums").empty();for(var i=0;i<selectedAlbums.length;i++){_dd=selectedAlbums[i].split("-")[0];tmpAlbum=selectedAlbums[i].split("-")[1];albumAge=getEventAge(_dd);var _e3=_dd;var _e4;if(window.navigator.userAgent.indexOf("Safari")!=-1){_e4="";}else{_e4=" disabled=\"disabled\"";}var _e5=age[albumAge].albums[tmpAlbum].thumb;_e5=_e5.split("/");_e5=_e5[3];_e5=_e5.replace("-"," ");_e5=_e5.toProperCase();$("#selected-albums").append("<div class=\"my-timeline-select-holder\"><a href=\"#\" onclick=\"removeAlbum('"+selectedAlbums[i]+"');return false;\">remove</a><select"+_e4+"><option>"+age[albumAge].albums[tmpAlbum].title+" ("+_e5+")"+"</option></select></div>");}}function getEventOptions(_e6,_e7){var _e8="";for(var i=0;i<_e6.length;i++){_e8+="<option value=\""+_e7+"-"+i+"\">"+_e6[i].title+"</option>";}return _e8;}function getArtistsOptions(_ea,_eb){var _ec="";for(var i=0;i<_ea.length;i++){_ec+="<option value=\""+_eb+"-"+i+"\">"+_ea[i].name+"</option>";}return _ec;}function getAlbumsOptions(_ee,_ef){var _f0="";for(var i=0;i<_ee.length;i++){var _f2=_ee[i].thumb;_f2=_f2.split("/");_f2=_f2[3];_f2=_f2.replace("-"," ");_f2=_f2.toProperCase();_f0+="<option value=\""+_ef+"-"+i+"\">"+_ee[i].title+" ("+_f2+")"+"</option>";}return _f0;}function setEventsAndArtists(_f3){_f3=_f3-1;var _f4=getEventOptions(age[_f3].events,age[_f3].age.ident);var _f5=getArtistsOptions(age[_f3].artists,age[_f3].age.ident);var _f6=getAlbumsOptions(age[_f3].albums,age[_f3].age.ident);$("#frmEvents").append("<optgroup label=\""+age[_f3].age.name+"\">"+_f4+"</optgroup>");$("#frmArtists").append("<optgroup label=\""+age[_f3].age.name+"\">"+_f5+"</optgroup>");$("#frmAlbums").append("<optgroup label=\""+age[_f3].age.name+"\">"+_f6+"</optgroup>");}function buildTimeLineHTML(_f7){var _f8=buildAgeWrapperHTML(_f7.age);$("div#timeline-stage").append(_f8);var _f9=buildAgeLinkHTML(_f7.age);$("div#timeline-ages-holder").prepend(_f9);var _fa=getArtists(usrSettings,_f7,_f7.age.ident);$("div#timeline-stage").append(_fa);var _fb=getPointers(usrSettings,_f7,_f7.age.ident);$("div#"+_f7.age.sub_class+"-holder").append(_fb);var _fc=getAlbums(usrSettings,_f7,_f7.age.ident);$("div#"+_f7.age.sub_class+"-holder").append(_fc);prepared++;if(prepared>=usrSettings.ages.length){initTimelineFinal();}}function initBuild(){for(var i=0;i<usrSettings.ages.length;i++){buildTimeLineHTML(ageJSON[i]);}}function handleAgeJSON(_fe){ageJSON.push(_fe);prepared++;if(prepared>=usrSettings.ages.length){prepared=0;initBuild();}}$(document).ready(function(){$("li#my-timeline-view").hide();if(!displaybackgroundimage){$("body").css("background","none");}else{$("div#full-image-holder").addClass("load-birth-of-rock-background");}var _ff=new Object();window.location.search.replace(new RegExp("([^?=&]+)(=([^&]*))?","g"),function($0,$1,$2,$3){_ff[$1]=$3;});if(_ff["v"]==undefined){$("#frmAge").change(function(){checkAgesArea($(this).val());updateAgeSelect();setTimeout(function(){$("#frmEvents").each(function(){this.selectedIndex=0;});$("#frmArtists").each(function(){this.selectedIndex=0;});$("#frmAlbums").each(function(){this.selectedIndex=0;});},400);return true;});$("#frmEvents").change(function(){checkEventsArea($(this).val());hideSelectedEvents();this.selectedIndex=0;return true;});$("#frmArtists").change(function(){checkArtistsArea($(this).val());hideSelectedArtists();this.selectedIndex=0;return true;});$("#frmAlbums").change(function(){checkAlbumsArea($(this).val());hideSelectedAlbums();this.selectedIndex=0;return true;});$("#createTimeline").click(function(){var _104=false;var _105="";$("select#my-timeline-year").change(function(){if($("div#selected-year").find("span")){$("div#selected-year").find("span").remove();$("div#selected-year").css("display","none");}});if(!$("select#my-timeline-year").val()){$("div#selected-year").css("display","block");$("div#selected-year").empty().append("<span style=\"color: red\" class=\"my-timeline-error\">You must enter a valid year.</span>");_104=true;_105="year-error-anchor";}if($("select#my-timeline-year").val()){var _106=parseInt($("select#my-timeline-year").val());if((_106<1850)||(_106>2010)){$("div#selected-year").css("display","block");$("div#selected-year").empty().append("<span style=\"color: red\" class=\"my-timeline-error\">You must enter a valid year.</span>");_105="year-error-anchor";_104=true;}}if(selectedAges.length==0){$("div#selected-ages").empty().append("<span style=\"color: red\" class=\"my-timeline-error\">You must select at least one age.</span>");if(!_105){_105="age-error-anchor";}_104=true;}if(selectedEvents.length==0){$("div#selected-events").empty().append("<span style=\"color: red\" class=\"my-timeline-error\">You must select at least one event.</span>");if(!_105){_105="event-error-anchor";}_104=true;}if(selectedArtists.length==0){$("div#selected-artists").empty().append("<span style=\"color: red\" class=\"my-timeline-error\">You must select at least one artist.</span>");if(!_105){_105="artist-error-anchor";}_104=true;}if(selectedAlbums.length==0){$("div#selected-albums").empty().append("<span style=\"color: red\" class=\"my-timeline-error\">You must select at least one album.</span>");if(!_105){_105="album-error-anchor";}_104=true;}if(!$("select#my-timeline-select-blog").val()){$("div#selected-blog").css("display","block");$("div#selected-blog").empty().append("<span style=\"color: red\" class=\"my-timeline-error\">You must select your blogging software.</span>");if(!_105){_105="blog-error-anchor";}_104=true;}$("select#my-timeline-select-blog").change(function(){if($("div#selected-blog").find("span")){$("div#selected-blog").find("span").remove();$("div#selected-blog").css("display","none");}});if(_105){window.location=("#"+_105);}if(!_104){generateEmbedUrl();$("p#my-timeline-confirm-message").remove();$("input#createTimeline").after("<p id=\"my-timeline-confirm-message\">Your Timeline has now been generated. Paste the html below into your site.</p>");setTimeout(function(){$("p#my-timeline-confirm-message").fadeOut();},5000);$("li#my-timeline-view").show();$("form#tear-off-code").css("display","block");$("ul.caveat-list").css("display","block");$("form#tear-off-code").find("textarea:eq(0)").click(function(){$(this).select();});$("form#tear-off-code").find("textarea:eq(1)").click(function(){$(this).select();});$(this).val("Add to timeline");window.location="#embed-code-anchor";}return false;});}else{var _107=base64decode(_ff["v"]);eval(_107);for(var i=0;i<ageObj.age.length;i++){var _109=$("<a style=\"position: absolute;\" id=\""+ageObj.age[i].id+"\"><img src=\""+ageObj.age[i].bg_hi+"\" /></a>");$("div#timeline-stage").prepend(_109);}for(var i=0;i<usrSettings.ages.length;i++){var url=absolutepath+"/includes/ajax/timeline."+usrSettings.ages[i]+".ajax";$.getJSON(url,function(json){ageJSON.push(json);prepared++;if(prepared>=usrSettings.ages.length){prepared=0;initBuild();}});}}});