$(document).ready(function(){$(".menubutton").click(function(menubutton){$(".menulist").fadeOut();$(this).parent().children(".menulist").fadeIn();$("#overlay").show();$(".image_wrap").hide();$(".image_wrap_gray").show();$(".text").fadeTo(0,0.2);$(this).parent().children(".selected").addClass("unselected");$(this).parent().children(".selected").removeClass("selected");if($("#image").length>0)document.getElementById("image").gogray();menubutton.preventDefault()});$("#enlarge-image").click(function(enlargeimage){if($(this).text()=="Back"){$(this).removeClass("selected");$(this).text("Enlarge");$("#image").css("z-index","-2")}else{$(this).addClass("selected");$(this).text("Back");$("#image").css("z-index","9999")};if($("#image").length>0)document.getElementById("image").enlarge();enlargeimage.preventDefault()});$(".zoom-image").click(function(zoomimage){$(this).hide();$("#zoom-back").show();$("#image").css("z-index","9999");if($("#image").length>0)document.getElementById("image").enlarge();zoomimage.preventDefault()});$("#zoom-back").click(function(zoomimage){$(this).hide();$(".zoom-image").show();$("#image").css("z-index","-2");if($("#image").length>0)document.getElementById("image").enlarge();zoomimage.preventDefault()});$("#overlay").click(function(overlay){$(".menulist").hide();$(this).parent().children(".menulist").hide();$("#overlay").hide();$(".image_wrap").show();$(".image_wrap_gray").hide();$(".text").fadeTo("slow",1);$(".unselected").addClass("selected");$(".unselected").removeClass("unselected");if($("#image").length>0)document.getElementById("image").gocolour();overlay.preventDefault()});$(".nospam").each(function(){start=$(this).attr("href");end=$(this).attr("rel");email=start+"@"+end;console.log(email);$(this).attr("href","mailto:"+email);$(this).text(email)})})
function zoomout(){$("#zoom-back").hide();$(".zoom-image").show();$("#image").css("z-index","-2");if($("#image").length>0)document.getElementById("image").enlarge()};$(window).resize(function(){resizer()});var resizer=function(){if($(document).width()<701){$(".caption").css("right","");$(".caption").css("left","380px");$("#projectcaption").css("right","");$("#projectcaption").css("left","380px")}else{$(".caption").css("right","20px");$(".caption").css("left","");$("#projectcaption").css("right","20px");$("#projectcaption").css("left","")}}
function showimage(num){num=num+1;$("#num").text(num);$(".caption").hide();$("#caption_"+num).show()}
function nextlink(id){$("#nextarrow").attr("href","#/"+id)}
function prevlink(id){$("#prevarrow").attr("href","#/"+id)}
function noflash(e){if(e.success!=true){$("#zoom-image").remove();resizer='';$(".caption").css("right","");$(".caption").css("left","598px");$("#projectcaption").css("right","");$("#projectcaption").css("left","598px");for(i=0;i<=(imagesarray.length-1);i++){var thisimage=imagesarray[i];thisimage=thisimage.replace("http://images.marcquinn.com/","http://images.marcquinn.com/img.php?f=");$("#imageslideshow").append("<img src='"+thisimage+"' class='next' width ='430'style='padding-bottom:50px' />")};var hash=window.location.hash;hash=hash.replace("#","");hash=hash.replace("/","");index=0;for(i=0;i<=(idsarray.length-1);i++)if(idsarray[i]==hash)index=i;console.log(index);$("#imageslideshow").cycle({fx:'fade',speed:'fast',startingSlide:index,timeout:0,after:function(curr,next,opts){showimage(opts.currSlide);window.location.hash="/"+idsarray[opts.currSlide]},next:'.next',prev:'#prevarrow'})}}
function pauseAll(exclude){$(".video_wrap").each(function(key,value){id=$(this).attr("id");id=id.replace("_wrap",'');if(id!=exclude)document.getElementById(id).pauseFLV()})}
