var currentstart = 0; var finalwidth = 257; var range = 0; var timer = 0; var maxvideo = 7; var vrange = 0; $(document).ready(function () { $("#backbutton").css({ opacity: .1 }); if(mainslider.length > 3){ $("#nextbutton").css({ opacity: 1 }); $("#nextbutton").click(buttonup); } rendertitles(); $(".mainitem").each(function () { $(this).mouseover(function () { clearInterval(timer); }); $(this).mouseout(function () { timer = setInterval(refesher,5000); }); }); $("#vbackbutton").css({ opacity: .1 }); if(maxvideo > 3){ $("#vnextbutton").css({ opacity: 1 }); $("#vnextbutton").click(vbuttonup); } else { $("#vnextbutton").css({ opacity: .1 }); } timer = setInterval(refesher,5000); }); function vbuttonup () { if(vrange < (maxvideo - 3)){ vrange++; $("#vidinner").animate({ left: '-' + (vrange * finalwidth ) + 'px' }); } if(vrange == (maxvideo - 3)){ $("#vnextbutton").css({ opacity: .1 }); $("#vnextbutton").unbind('click',vbuttonup); } else { $("#vnextbutton").css({ opacity: 1 }); $("#vnextbutton").click(vbuttonup); } if(vrange > 0){ $("#vbackbutton").css({ opacity: 1 }); $("#vbackbutton").click(vbuttondown); } else { $("#vbackbutton").css({ opacity: .1 }); $("#vbackbutton").unbind('click',vbuttondown); } } function vbuttondown () { if(vrange > 0){ vrange--; $("#vidinner").animate({ left: '-' + (vrange * finalwidth ) + 'px' }); } if(vrange == (maxvideo - 3)){ $("#vnextbutton").css({ opacity: .1 }); $("#vnextbutton").unbind('click',vbuttonup); } else { $("#vnextbutton").css({ opacity: 1 }); $("#vnextbutton").click(vbuttonup); } if(vrange > 0){ $("#vbackbutton").css({ opacity: 1 }); $("#vbackbutton").click(vbuttondown); } else { $("#vbackbutton").css({ opacity: .1 }); $("#vbackbutton").unbind('click',vbuttondown); } } function refesher () { if(range == (mainslider.length - 3)){ range = -1; } buttonup(true); } function rendertitles (){ var outerloop = 0; var starter = range; $(".mainitem").each(function () { if(outerloop >= starter && outerloop < (starter + 3)){ $(this).html('
'+mainslider[outerloop].title+'

'+mainslider[outerloop].description+'

'); } else { $(this).html(''); } outerloop++; }); if(range == (mainslider.length - 3)){ $("#nextbutton").css({ opacity: .1 }); $("#nextbutton").unbind('click', buttonup); } else { $("#nextbutton").css({ opacity: 1 }); $("#nextbutton").click(buttonup); } if(range == 0){ $("#backbutton").css({ opacity: .1 }); $("#backbutton").unbind('click', buttondown); } else { $("#backbutton").css({ opacity: 1 }); $("#backbutton").click(buttondown); } } function buttonup (isnotclick) { if(range < (mainslider.length - 3)){ range++; $("#sliderinner").animate({ left: '-' + (range * finalwidth ) + 'px' }); } rendertitles(); if(isnotclick){ clearInterval(timer); timer = setInterval(refesher,5000); } } function buttondown (isclick) { if(range > 0){ range--; $("#sliderinner").animate({ left: '-' + (range * finalwidth ) + 'px' }); } rendertitles(); clearInterval(timer); timer = setInterval(refesher,5000); } function handlebox (target) { $('#' + target).css({ top: (($(document).height()) - 500) + 'px' }); var pvp = document.createElement("div"); pvp.id = "outerblack"; document.getElementById('outer').appendChild(pvp); $("#outerblack").hide(); $("#outerblack").css( { height: $("#outer").height() + "px" }); $('#outerblack').fadeIn("slow", function () { $('#' + target).fadeIn(); }); } function handleboxclose (target) { $('#outerblack').fadeOut("slow", function () { var ob = document.getElementById('outerblack'); document.getElementById('outer').removeChild(ob); $('#' + target).fadeOut(); }); } function changetext(textid) { var Desc = $("li#e"+ textid).find('#block').html(); //Get HTML of block if ($("li#e"+ textid).is(".on")) { //If it's already active, then... return false; // Don't click through } else { //Animate the Teaser $("#openint").fadeOut('quick', function() { $(this).html(Desc).fadeIn('slow'); $("li#e"+ textid).addClass('on'); }); } } function changeshowtext(textid) { var Desc = $("li#e"+ textid).find('#block').html(); //Get HTML of block if ($("li#e"+ textid).is(".on")) { //If it's already active, then... return false; // Don't click through } else { //Animate the Teaser $("#openvid").fadeOut('quick', function() { $(this).html(Desc).fadeIn('slow'); $("li#e"+ textid).addClass('on'); }); } } var currentid = new Array(); currentid[0] = 'frol02s29cbq9d8'; currentid[1] = 'frol02s1f66q752'; function videoupdate (divid,thisdiv,videoid,typ){ var thisletter = (typ == 1)? 'i':'e'; if(currentid[typ] != videoid){ _pap_videoload(videoid,typ); currentid[typ] = videoid; thisdiv.className = 'on'; } for (var x = 0; x < 80; x++){ if(x != divid){ document.getElementById('e'+x).className = 'off'; } } }