//<![CDATA[
/* ## Requires betterJS & Prototype ## */
/* [## magicCSS 0.3 - Joshua Jarman (redesigned.com) ##] */
absoluteMiddle = function(obj) { var tmpData = $(obj).outerHTML; $(obj).outerHTML = '<table height="100%" border="0" cellpadding="0" cellspacing="0"><tr height="100%" valign="middle"><td height="100%" valign="middle"><div style="display: inline-block;">'+tmpData+'</div></td></tr></table>'; };
absoluteCenter = function(obj) { var tmpData = $(obj).outerHTML; $(obj).outerHTML = '<table height="100%" width="100%" align="center" border="0" cellpadding="0" cellspacing="0"><tr height="100%" align="center" valign="middle"><td height="100%" width="100%" align="center" valign="middle"><div style="display: inline-block; text-align: left;">'+tmpData+'</div></td></tr></table>'; };
autoVerticalCentering = function() { $$('.AbsoluteCenter', '*[position~="absolutecenter"]').each(function(obj) { absoluteCenter(obj); }); $$('.AbsoluteMiddle', '*[position~="absolutemiddle"]').each(function(obj) { absoluteMiddle(obj); }); }; addEvent(window,'load',autoVerticalCentering,false);
makeListSortable = function(id, ajaxFile) { Sortable.create(id, { onUpdate: function() { new Ajax.Request(ajaxFile, { method: 'post', parameters: { data: Sortable.serialize(id) } }); } }); };
toggleEnabled = function(id) { c = $(id); if (c.className.contains('enabled')) { c.className = c.className.replace('enabled', 'disabled'); } else { c.className = c.className.replace('disabled', 'enabled'); }; return false; };
toggleHidden = function(id) { c = $(id); if (c.style.display == 'none') { c.style.display = ''; } else { c.style.display = 'none'; }; };
showThis = function(id) { c = $(id); c.style.display = ''; }
hideThis = function(id) { c = $(id); c.style.display = 'none'; }
tinyMCEThis = function(id) { tinyMCE.init({ mode: "exact", elements: id, theme: "advanced", plugins: "safari,pagebreak,style,advhr,advimage,inlinepopups,media,contextmenu,paste,directionality,noneditable,visualchars,nonbreaking,xhtmlxtras,template,table", theme_advanced_buttons1: "undo,redo,|,copy,cut,paste,|,justifyleft,justifycenter,justifyright,justifyfull,outdent,indent,blockquote,bullist,numlist,|,pagebreak,hr,charmap,anchor,image,media,|,pasteword,cleanup,removeformat,|,code", theme_advanced_buttons2: "formatselect,fontselect,fontsizeselect,|,forecolor,backcolor,bold,italic,underline,strikethrough,sub,sup", theme_advanced_buttons3: "tablecontrols", theme_advanced_toolbar_location: "top", theme_advanced_toolbar_align: "center", theme_advanced_resizing: true, template_external_list_url: "lists/template_list.js", external_link_list_url: "lists/link_list.js", external_image_list_url: "lists/image_list.js", media_external_list_url: "lists/media_list.js" }); };
hideAdminLayout = function() { body.className = 'bgmain'; $('AdminNavigation').hide(); $('ContentContainer').style.margin = '0px'; $('htmldoc').style.background = 'none'; };
/* iPhone */
iPhone = function(){};
iPhone.is_iPhone = function() { if ((navigator.userAgent.indexOf('iPhone') != -1) || (navigator.userAgent.indexOf('iPod') != -1)) { return true; } else { return false; }; };
iPhone.fullSize = function() { if (iPhone.is_iPhone()) { document.getElementById("viewport").setAttribute('content','device-width = device-width, minimum-scale = 1, maximum-scale = 1'); }; };
/* callTo */
callTo = function(phoneNumber) { if (iPhone.is_iPhone()) { document.location = 'tel:'+phoneNumber; } else { document.location = 'callto:'+phoneNumber; }; return false;};
/* slideshow of objects */
quickSwap = function(id1, id2) { if (id1 != id2) { $(id1).style.display = 'none'; $(id2).style.display = 'block'; }; };
fadeSwap = function(id1, id2) { if (id1 != id2) { new Effect.Fade(id1, {duration: 3.0}); new Effect.Appear(id2, {duration: 3.0}); }; };
fadeThenShow = function(id1, id2, myduration, myscope) { myduration=myduration||3.0; myscope=myscope||'global'; new Effect.Fade(id1, {duration: myduration, queue: { position: 'end', scope: myscope } }); new Effect.Appear(id2, {duration: myduration, queue: { position: 'end', scope: myscope } }); };
justShow = function(id1, myduration, myscope) { myduration=myduration||3.0; myscope=myscope||'global'; new Effect.Appear(id1, {duration: myduration, queue: { position: 'end', scope: myscope } }); };
autoSlideshows = function() { $$('.slideshow').each(function(obj) { makeSlideshow(obj.id); }); }; addEvent(window,'load',autoSlideshows,false);
makeSlideshow = function(id) {
	if ($(id)) {
		var thisSlideshow = $(id);
		thisSlideshow.State = 'stop';
		thisSlideshow.NumberOfSlides = thisSlideshow.childElements().length;
		thisSlideshow.setAttribute("numberofslides", thisSlideshow.NumberOfSlides);
		thisSlideshow.Delay = thisSlideshow.getAttribute("delay");
		thisSlideshow.Delay = thisSlideshow.Delay || 6;
		thisSlideshow.setAttribute("delay", thisSlideshow.Delay);
		thisSlideshow.SlideOrder = thisSlideshow.getAttribute("slideorder");
		thisSlideshow.SlideOrder = thisSlideshow.SlideOrder || 'random';
		if (thisSlideshow.SlideOrder == 'ordered') { thisSlideshow.SlideOrder = 'linear'; };
		thisSlideshow.setAttribute("slideorder", thisSlideshow.SlideOrder);
		thisSlideshow.CurrentSlide = thisSlideshow.getAttribute("currentslide");
		thisSlideshow.CurrentSlide = thisSlideshow.CurrentSlide || 1;
		thisSlideshow.setAttribute("currentslide", thisSlideshow.CurrentSlide);
		thisSlideshow.ControlBar = thisSlideshow.getAttribute("controlbar");
		if (thisSlideshow.ControlBar == 'true') { thisSlideshow.ControlBar = true; } else { thisSlideshow.ControlBar = false; };
		thisSlideshow.setAttribute("controlbar", thisSlideshow.ControlBar);
		thisSlideshow.NumberBoxes = thisSlideshow.getAttribute("numberboxes");
		if (thisSlideshow.NumberBoxes == 'true') { thisSlideshow.NumberBoxes = true; } else { thisSlideshow.NumberBoxes = false; };
		thisSlideshow.setAttribute("numberboxes", thisSlideshow.NumberBoxes);
		thisSlideshow.Autoplay = thisSlideshow.getAttribute("autoplay");
		if (thisSlideshow.Autoplay == 'false') { thisSlideshow.Autoplay = false; } else { thisSlideshow.Autoplay = true; };
		thisSlideshow.setAttribute("autoplay", thisSlideshow.Autoplay);
		thisSlideshow.Slides = new Array();
		thisSlideshow.childElements().each(function(obj) { thisSlideshow.Slides.push(obj.id); });
		thisSlideshow.Slides.each(function(id) { $(id).style.display = 'none'; });
		if (thisSlideshow.SlideOrder != 'linear') { thisSlideshow.Slides = thisSlideshow.Slides.shuffle(); };
		$(''+thisSlideshow.Slides[thisSlideshow.CurrentSlide - 1]).style.display = "";
		thisSlideshow.Play = function() { var currentState = this.State; this.State = 'play'; this.Refresh(); if (currentState != 'play' && currentState != 'fastforward') { playNextSlide(''+this.id); }; };
		thisSlideshow.Fastforward = function() { var currentState = this.State; this.State = 'fastforward'; if (currentState != 'play' && currentState != 'fastforward') { playNextSlide(''+this.id); }; };
		thisSlideshow.Pause = function() { this.State = 'pause'; this.Refresh(); };
		thisSlideshow.Stop = function() { this.State = 'stop'; this.Refresh(); };
		thisSlideshow.Reverse = function() { var currentState = this.State; this.State = 'reverse'; if (currentState != 'reverse' && currentState != 'rewind') { playPreviousSlide(''+this.id); }; };
		thisSlideshow.Rewind = function() { var currentState = this.State; this.State = 'rewind'; if (currentState != 'reverse' && currentState != 'rewind') { playPreviousSlide(''+this.id); }; };
		thisSlideshow.First = function() { this.Stop(); quickShowSlide(this.id, 1); };
		thisSlideshow.Last = function() { this.Stop(); quickShowSlide(this.id, thisSlideshow.NumberOfSlides); };
		thisSlideshow.Shuffle = function() { this.Slides = this.Slides.shuffle(); };
		thisSlideshow.Refresh = function() { this.Slides.each(function(id) { if ($(id) && $(id).style) { $(id).style.display = 'none'; }; }); if ($(this.Slides[this.CurrentSlide - 1]) && $(this.Slides[this.CurrentSlide - 1]).style) { $(this.Slides[this.CurrentSlide - 1]).style.display = 'block'; }; };
		if (thisSlideshow.ControlBar) { createSlideshowControlBar(thisSlideshow.id); };
		if (thisSlideshow.NumberBoxes) { createSlideshowNumberBoxes(thisSlideshow.id); };
		if (thisSlideshow.Autoplay) { thisSlideshow.Play(); if ($(id+'_PlayButton')) { $(id+'_PlayButton').hide(); }; if ($(id+'_PauseButton')) { $(id+'_PauseButton').show(); }; } else { thisSlideshow.Stop(); if ($(id+'_PauseButton')) { $(id+'_PauseButton').hide(); }; if ($(id+'_PlayButton')) { $(id+'_PlayButton').show(); }; };
	};
};
nextSlide = function(id) { if ($(id)) { var thisSlideshow = $(id); var currentSlide = ''+thisSlideshow.Slides[thisSlideshow.CurrentSlide - 1]; ++thisSlideshow.CurrentSlide; if (thisSlideshow.CurrentSlide > thisSlideshow.NumberOfSlides) { thisSlideshow.CurrentSlide = 1; }; thisSlideshow.setAttribute("currentslide", thisSlideshow.CurrentSlide); var newSlide = ''+thisSlideshow.Slides[thisSlideshow.CurrentSlide - 1]; if (thisSlideshow.NumberBoxes && $(id+'_NumberBoxesBar')) { $(id+'_NumberBoxesBar').setAttribute('currentslide', thisSlideshow.CurrentSlide); $(id+'_NumberBoxesBar').innerHTML = ''+$(id+'_NumberBoxesBar').innerHTML; }; fadeSwap(currentSlide, newSlide); }; };
playNextSlide = function(id) { if ($(id) && ($(id).State == 'play' || $(id).State == 'fastforward')) { var thisSlideshow = $(id); var currentSlide = ''+thisSlideshow.Slides[thisSlideshow.CurrentSlide - 1]; ++thisSlideshow.CurrentSlide; if (thisSlideshow.CurrentSlide > thisSlideshow.NumberOfSlides) { thisSlideshow.CurrentSlide = 1; }; thisSlideshow.setAttribute("currentslide", thisSlideshow.CurrentSlide); var newSlide = ''+thisSlideshow.Slides[thisSlideshow.CurrentSlide - 1]; if (thisSlideshow.NumberBoxes && $(id+'_NumberBoxesBar')) { $(id+'_NumberBoxesBar').setAttribute('currentslide', thisSlideshow.CurrentSlide); $(id+'_NumberBoxesBar').innerHTML = ''+$(id+'_NumberBoxesBar').innerHTML; }; var Delay = thisSlideshow.getAttribute("delay")+"000"; if ($(id).State == 'fastforward') { Delay = '1500'; quickSwap(currentSlide, newSlide); } else { fadeSwap(currentSlide, newSlide); }; setTimeout("playNextSlide('"+id+"');", ""+Delay); }; };
previousSlide = function(id) { if ($(id)) { var thisSlideshow = $(id); var currentSlide = ''+thisSlideshow.Slides[thisSlideshow.CurrentSlide - 1]; --thisSlideshow.CurrentSlide; if (thisSlideshow.CurrentSlide < 1) { thisSlideshow.CurrentSlide = thisSlideshow.NumberOfSlides; }; thisSlideshow.setAttribute("currentslide", thisSlideshow.CurrentSlide); var newSlide = ''+thisSlideshow.Slides[thisSlideshow.CurrentSlide - 1]; if (thisSlideshow.NumberBoxes && $(id+'_NumberBoxesBar')) { $(id+'_NumberBoxesBar').setAttribute('currentslide', thisSlideshow.CurrentSlide); $(id+'_NumberBoxesBar').innerHTML = ''+$(id+'_NumberBoxesBar').innerHTML; }; fadeSwap(currentSlide, newSlide); }; };
playPreviousSlide = function(id) { if ($(id) && ($(id).State == 'reverse' || $(id).State == 'rewind')) { var thisSlideshow = $(id); var currentSlide = ''+thisSlideshow.Slides[thisSlideshow.CurrentSlide - 1]; --thisSlideshow.CurrentSlide; if (thisSlideshow.CurrentSlide < 1) { thisSlideshow.CurrentSlide = thisSlideshow.NumberOfSlides; }; thisSlideshow.setAttribute("currentslide", thisSlideshow.CurrentSlide); var newSlide = ''+thisSlideshow.Slides[thisSlideshow.CurrentSlide - 1]; if (thisSlideshow.NumberBoxes && $(id+'_NumberBoxesBar')) { $(id+'_NumberBoxesBar').setAttribute('currentslide', thisSlideshow.CurrentSlide); $(id+'_NumberBoxesBar').innerHTML = ''+$(id+'_NumberBoxesBar').innerHTML; }; var Delay = thisSlideshow.getAttribute("delay")+"000"; if ($(id).State == 'rewind') { Delay = '1500'; quickSwap(currentSlide, newSlide); } else { fadeSwap(currentSlide, newSlide); }; setTimeout("playPreviousSlide('"+id+"');", ""+Delay); }; };
showSlide = function(id, slide) { if ($(id) && slide > 0 && slide <= $(id).NumberOfSlides) { var thisSlideshow = $(id); var currentSlide = ''+thisSlideshow.Slides[thisSlideshow.CurrentSlide - 1]; thisSlideshow.CurrentSlide = slide; thisSlideshow.setAttribute("currentslide", thisSlideshow.CurrentSlide); var newSlide = ''+thisSlideshow.Slides[thisSlideshow.CurrentSlide - 1]; if (thisSlideshow.NumberBoxes && $(id+'_NumberBoxesBar')) { $(id+'_NumberBoxesBar').setAttribute('currentslide', thisSlideshow.CurrentSlide); $(id+'_NumberBoxesBar').innerHTML = ''+$(id+'_NumberBoxesBar').innerHTML; }; fadeSwap(currentSlide, newSlide); }; };
quickShowSlide = function(id, slide) { if ($(id) && slide > 0 && slide <= $(id).NumberOfSlides) { var thisSlideshow = $(id); var currentSlide = ''+thisSlideshow.Slides[thisSlideshow.CurrentSlide - 1]; thisSlideshow.CurrentSlide = slide; thisSlideshow.setAttribute("currentslide", thisSlideshow.CurrentSlide); var newSlide = ''+thisSlideshow.Slides[thisSlideshow.CurrentSlide - 1]; if (thisSlideshow.NumberBoxes && $(id+'_NumberBoxesBar')) { $(id+'_NumberBoxesBar').setAttribute('currentslide', thisSlideshow.CurrentSlide); $(id+'_NumberBoxesBar').innerHTML = ''+$(id+'_NumberBoxesBar').innerHTML; }; quickSwap(currentSlide, newSlide); }; };
createSlideshowControlBar = function(id) {
	var controlBar = document.createElement('div');
	controlBar.setAttribute('id', id+'_ControlBar');
	$(id).parentNode.appendChild(controlBar);
	/* Play */ var playButton = document.createElement('a'); playButton.setAttribute('href', '#'); playButton.setAttribute('id', id+'_PlayButton'); playButton.setAttribute('class', 'PlayButton'); playButton.setAttribute('title', 'Play'); $(id+'_ControlBar').appendChild(playButton); var playButtonText = document.createTextNode("▶"); $(id+'_PlayButton').appendChild(playButtonText); playButton.setAttribute('onclick', "$('"+id+"').Play(); $('"+id+"_PlayButton').hide(); $('"+id+"_PauseButton').show(); return false;");
	/* Pause */ var pauseButton = document.createElement('a'); pauseButton.setAttribute('href', '#'); pauseButton.setAttribute('id', id+'_PauseButton'); pauseButton.setAttribute('class', 'PauseButton'); pauseButton.setAttribute('title', 'Pause'); $(id+'_ControlBar').appendChild(pauseButton); var pauseButtonText = document.createTextNode('"'); $(id+'_PauseButton').appendChild(pauseButtonText); pauseButton.setAttribute('onclick', "$('"+id+"').Pause(); $('"+id+"_PauseButton').hide(); $('"+id+"_PlayButton').show(); return false;");
	/* Stop */ var stopButton = document.createElement('a'); stopButton.setAttribute('href', '#'); stopButton.setAttribute('id', id+'_StopButton'); stopButton.setAttribute('class', 'StopButton'); stopButton.setAttribute('title', 'Stop'); $(id+'_ControlBar').appendChild(stopButton); var stopButtonText = document.createTextNode("◼"); $(id+'_StopButton').appendChild(stopButtonText); stopButton.setAttribute('onclick', "$('"+id+"').Stop(); $('"+id+"_PauseButton').hide(); $('"+id+"_PlayButton').show(); return false;");
	/* Reverse */ var reverseButton = document.createElement('a'); reverseButton.setAttribute('href', '#'); reverseButton.setAttribute('id', id+'_ReverseButton'); reverseButton.setAttribute('class', 'ReverseButton'); reverseButton.setAttribute('title', 'Reverse'); $(id+'_ControlBar').appendChild(reverseButton); var reverseButtonText = document.createTextNode("◀"); $(id+'_ReverseButton').appendChild(reverseButtonText); reverseButton.setAttribute('onclick', "$('"+id+"').Reverse(); $('"+id+"_PlayButton').hide(); $('"+id+"_PauseButton').show(); return false;");
	/* First */ var firstButton = document.createElement('a'); firstButton.setAttribute('href', '#'); firstButton.setAttribute('id', id+'_FirstButton'); firstButton.setAttribute('class', 'FirstButton'); firstButton.setAttribute('title', 'Beginning'); $(id+'_ControlBar').appendChild(firstButton); var firstButtonText = document.createTextNode("⇤"); $(id+'_FirstButton').appendChild(firstButtonText); firstButton.setAttribute('onclick', "$('"+id+"').First(); $('"+id+"_PauseButton').hide(); $('"+id+"_PlayButton').show(); return false;");
	/* Rewind */ var rewindButton = document.createElement('a'); rewindButton.setAttribute('href', '#'); rewindButton.setAttribute('id', id+'_RewindButton'); rewindButton.setAttribute('class', 'RewindButton'); rewindButton.setAttribute('title', 'Rewind'); $(id+'_ControlBar').appendChild(rewindButton); var rewindButtonText = document.createTextNode("⇠"); $(id+'_RewindButton').appendChild(rewindButtonText); rewindButton.setAttribute('onclick', "$('"+id+"').Rewind(); $('"+id+"_PlayButton').hide(); $('"+id+"_PauseButton').show(); return false;");
	/* Fastforward */ var fastforwardButton = document.createElement('a'); fastforwardButton.setAttribute('href', '#'); fastforwardButton.setAttribute('id', id+'_FastforwardButton'); fastforwardButton.setAttribute('class', 'FastforwardButton'); fastforwardButton.setAttribute('title', 'Fastforward'); $(id+'_ControlBar').appendChild(fastforwardButton); var fastforwardButtonText = document.createTextNode("⇢"); $(id+'_FastforwardButton').appendChild(fastforwardButtonText); fastforwardButton.setAttribute('onclick', "$('"+id+"').Fastforward(); return false;");
	/* Last */ var lastButton = document.createElement('a'); lastButton.setAttribute('href', '#'); lastButton.setAttribute('id', id+'_LastButton'); lastButton.setAttribute('class', 'LastButton'); lastButton.setAttribute('title', 'End'); $(id+'_ControlBar').appendChild(lastButton); var lastButtonText = document.createTextNode("⇥"); $(id+'_LastButton').appendChild(lastButtonText); lastButton.setAttribute('onclick', "$('"+id+"').Last(); $('"+id+"_PauseButton').hide(); $('"+id+"_PlayButton').show(); return false;");
	/* Forward */ var forwardButton = document.createElement('a'); forwardButton.setAttribute('href', '#'); forwardButton.setAttribute('id', id+'_ForwardButton'); forwardButton.setAttribute('class', 'ForwardButton'); forwardButton.setAttribute('title', 'Forward'); $(id+'_ControlBar').appendChild(forwardButton); var forwardButtonText = document.createTextNode("▶"); $(id+'_ForwardButton').appendChild(forwardButtonText); forwardButton.setAttribute('onclick', "$('"+id+"').Play(); $('"+id+"_PlayButton').hide(); $('"+id+"_PauseButton').show(); return false;");
	/* Shuffle */ var shuffleButton = document.createElement('a'); shuffleButton.setAttribute('href', '#'); shuffleButton.setAttribute('id', id+'_ShuffleButton'); shuffleButton.setAttribute('class', 'ShuffleButton'); shuffleButton.setAttribute('title', 'Shuffle'); $(id+'_ControlBar').appendChild(shuffleButton); var shuffleButtonText = document.createTextNode("↺"); $(id+'_ShuffleButton').appendChild(shuffleButtonText); shuffleButton.setAttribute('onclick', "$('"+id+"').Shuffle(); quickShowSlide('"+id+"', 1); return false;");
};
createSlideshowNumberBoxes = function(id) { var numberBoxesBar = document.createElement('div'); numberBoxesBar.setAttribute('id', id+'_NumberBoxesBar'); numberBoxesBar.setAttribute('currentslide', 1); $(id).parentNode.appendChild(numberBoxesBar); for (var i = 1; i <= $(id).NumberOfSlides; i++) { var numberButton = document.createElement('a'); numberButton.setAttribute('href', '#'); numberButton.setAttribute('id', id+'_NumberButton_'+String(i).lPad(2,'0')); numberButton.setAttribute('class', 'NumberButton'); numberButton.setAttribute('boxnumber', i); numberButton.setAttribute('title', 'Go To Slide #'+String(i).lPad(2,'0')); $(id+'_NumberBoxesBar').appendChild(numberButton); var numberButtonText = document.createTextNode(i); $(id+'_NumberButton_'+String(i).lPad(2,'0')).appendChild(numberButtonText); numberButton.setAttribute('onclick', "quickShowSlide('"+id+"', "+i+"); return false;"); }; };
/* marquee */
autoMarquees = function() { $$('.marquee').each(function(obj) { makeMarquee(obj.id); }); }; addEvent(window,'load',autoMarquees,false);
makeMarquee = function(id) { if ($(id)) { var thisMarquee = $(id); thisMarquee.State = 'stop'; thisMarquee.setAttribute('test','testing123'); thisMarquee.NumberOfThumbnails = thisMarquee.childElements().length; thisMarquee.setAttribute("numberofthumbnails", thisMarquee.NumberOfThumbnails); thisMarquee.Speed = thisMarquee.getAttribute("speed"); thisMarquee.Speed = thisMarquee.Speed || 6; thisMarquee.setAttribute("speed", thisMarquee.Speed); thisMarquee.Order = thisMarquee.getAttribute("order"); thisMarquee.Order = thisMarquee.Order || 'ordered'; if (thisMarquee.Order == 'random') { thisMarquee.SlideOrder = 'ordered'; }; thisMarquee.setAttribute("order", thisMarquee.Order); thisMarquee.Thumbnails = new Array(); thisMarquee.childElements().each(function(obj) { thisMarquee.Thumbnails.push(obj.id); }); thisMarquee.Play = function() { this.State = 'play'; this.Slide(); }; thisMarquee.Pause = function() { this.State = 'pause'; }; thisMarquee.Slide = function() { if (thisMarquee.State == 'play') { this.SlideLeft(); setTimeout("$('"+this.id+"').Slide();", ""+(10-parseInt(this.Speed))+"0"); }; }; thisMarquee.Refresh = function() { this.Thumbnails.each(function(id) { var tmp = document.getElementById(id); var tmpParent = tmp.parentNode; tmpParent.appendChild(tmp); }); }; thisMarquee.Shuffle = function() { this.Thumbnails = this.Thumbnails.shuffle(); this.Refresh(); }; thisMarquee.SlideLeft = function() { var item = $(''+this.Thumbnails[0]); var current = parseInt(item.style.marginLeft); var over = -1; current = current || 0; item.style.marginLeft = ''+(current - 1)+'px'; if (-1 * (current - 1) >= item.getWidth()) { over =  -1 * (current - 1) - item.getWidth(); }; if (over >= 0) { item.style.marginLeft = '0px'; this.Thumbnails.shift(); this.Thumbnails.push(item.id); $(''+this.Thumbnails[0]).style.marginLeft = '-'+over+'px'; this.Refresh(); }; }; if (thisMarquee.Order != 'ordered') { thisMarquee.Shuffle(); }; thisMarquee.Autoplay = thisMarquee.getAttribute("autoplay"); if (thisMarquee.Autoplay == 'false') { thisMarquee.Autoplay = false; } else { thisMarquee.Autoplay = true; }; thisMarquee.setAttribute("autoplay", thisMarquee.Autoplay); if (thisMarquee.Autoplay) { thisMarquee.Play(); }; thisMarquee.Autopause = thisMarquee.getAttribute("autopause"); if (thisMarquee.Autopause == 'false') { thisMarquee.Autopause = false; } else { thisMarquee.Autopause = true; }; thisMarquee.setAttribute("autopause", thisMarquee.Autopause); if (thisMarquee.Autopause) { thisMarquee.setAttribute('onmouseover', "this.Pause();"); thisMarquee.setAttribute('onmouseout', "this.Play();"); }; }; };
/* sortable */
var image_path="/config/admin/sortable_";
var image_up="down.png";var image_down="up.png";var image_none="x.gif";var europeandate=false;var alternate_row_colors=true;addEvent(window,"load",sortables_init);var SORT_COLUMN_INDEX;var thead=false;function sortables_init(){if(!document.getElementsByTagName){return }tbls=document.getElementsByTagName("table");for(ti=0;ti<tbls.length;ti++){thisTbl=tbls[ti];if(((" "+thisTbl.className+" ").indexOf("sortable")!=-1)&&(thisTbl.id)){ts_makeSortable(thisTbl)}}}function ts_makeSortable(D){if(D.rows&&D.rows.length>0){if(D.tHead&&D.tHead.rows.length>0){var E=D.tHead.rows[D.tHead.rows.length-1];thead=true}else{var E=D.rows[0]}}if(!E){return }for(var C=0;C<E.cells.length;C++){var B=E.cells[C];var A=ts_getInnerText(B);if(B.className!="unsortable"&&B.className.indexOf("unsortable")==-1){B.innerHTML='<a href="#" class="sortheader" onclick="ts_resortTable(this, '+C+');return false;">'+A+'<span class="sortarrow">  <img src="'+image_path+image_none+'" alt="↓"/></span></a>'}}if(alternate_row_colors){alternate(D)}}function ts_getInnerText(D){if(typeof D=="string"){return D}if(typeof D=="undefined"){return D}if(D.innerText){return D.innerText}var E="";var C=D.childNodes;var A=C.length;for(var B=0;B<A;B++){switch(C[B].nodeType){case 1:E+=ts_getInnerText(C[B]);break;case 3:E+=C[B].nodeValue;break}}return E}function ts_resortTable(G,I){var K;for(var M=0;M<G.childNodes.length;M++){if(G.childNodes[M].tagName&&G.childNodes[M].tagName.toLowerCase()=="span"){K=G.childNodes[M]}}var A=ts_getInnerText(K);var B=G.parentNode;var C=I||B.cellIndex;var L=getParent(B,"TABLE");if(L.rows.length<=1){return }var H="";var E=0;while(H==""&&E<L.tBodies[0].rows.length){var H=ts_getInnerText(L.tBodies[0].rows[E].cells[C]);H=trim(H);if(H.substr(0,4)=="<!--"||H.length==0){H=""}E++}if(H==""){return }sortfn=ts_sort_caseinsensitive;if(H.match(/^\d\d[\/\.-][a-zA-z][a-zA-Z][a-zA-Z][\/\.-]\d\d\d\d$/)){sortfn=ts_sort_date}if(H.match(/^\d\d[\/\.-]\d\d[\/\.-]\d\d\d{2}?$/)){sortfn=ts_sort_date}if(H.match(/^-?[?$????]\d/)){sortfn=ts_sort_numeric}if(H.match(/^-?(\d+[,\.]?)+(E[-+][\d]+)?%?$/)){sortfn=ts_sort_numeric}SORT_COLUMN_INDEX=C;var D=new Array();var F=new Array();for(k=0;k<L.tBodies.length;k++){for(E=0;E<L.tBodies[k].rows[0].length;E++){D[E]=L.tBodies[k].rows[0][E]}}for(k=0;k<L.tBodies.length;k++){if(!thead){for(j=1;j<L.tBodies[k].rows.length;j++){F[j-1]=L.tBodies[k].rows[j]}}else{for(j=0;j<L.tBodies[k].rows.length;j++){F[j]=L.tBodies[k].rows[j]}}}F.sort(sortfn);if(K.getAttribute("sortdir")=="down"){ARROW='  <img src="'+image_path+image_down+'" alt="↓"/>';F.reverse();K.setAttribute("sortdir","up")}else{ARROW='  <img src="'+image_path+image_up+'" alt="↑"/>';K.setAttribute("sortdir","down")}for(E=0;E<F.length;E++){if(!F[E].className||(F[E].className&&(F[E].className.indexOf("sortbottom")==-1))){L.tBodies[0].appendChild(F[E])}}for(E=0;E<F.length;E++){if(F[E].className&&(F[E].className.indexOf("sortbottom")!=-1)){L.tBodies[0].appendChild(F[E])}}var J=document.getElementsByTagName("span");for(var M=0;M<J.length;M++){if(J[M].className=="sortarrow"){if(getParent(J[M],"table")==getParent(G,"table")){J[M].innerHTML='  <img src="'+image_path+image_none+'" alt="↓"/>'}}}K.innerHTML=ARROW;alternate(L)}function getParent(B,A){if(B==null){return null}else{if(B.nodeType==1&&B.tagName.toLowerCase()==A.toLowerCase()){return B}else{return getParent(B.parentNode,A)}}}function sort_date(B){dt="00000000";if(B.length==11){mtstr=B.substr(3,3);mtstr=mtstr.toLowerCase();switch(mtstr){case"jan":var A="01";break;case"feb":var A="02";break;case"mar":var A="03";break;case"apr":var A="04";break;case"may":var A="05";break;case"jun":var A="06";break;case"jul":var A="07";break;case"aug":var A="08";break;case"sep":var A="09";break;case"oct":var A="10";break;case"nov":var A="11";break;case"dec":var A="12";break}dt=B.substr(7,4)+A+B.substr(0,2);return dt}else{if(B.length==10){if(europeandate==false){dt=B.substr(6,4)+B.substr(0,2)+B.substr(3,2);return dt}else{dt=B.substr(6,4)+B.substr(3,2)+B.substr(0,2);return dt}}else{if(B.length==8){yr=B.substr(6,2);if(parseInt(yr)<50){yr="20"+yr}else{yr="19"+yr}if(europeandate==true){dt=yr+B.substr(3,2)+B.substr(0,2);return dt}else{dt=yr+B.substr(0,2)+B.substr(3,2);return dt}}}}return dt}function ts_sort_date(B,A){dt1=sort_date(ts_getInnerText(B.cells[SORT_COLUMN_INDEX]));dt2=sort_date(ts_getInnerText(A.cells[SORT_COLUMN_INDEX]));if(dt1==dt2){return 0}if(dt1<dt2){return -1}return 1}function ts_sort_numeric(B,A){var C=ts_getInnerText(B.cells[SORT_COLUMN_INDEX]);C=clean_num(C);var D=ts_getInnerText(A.cells[SORT_COLUMN_INDEX]);D=clean_num(D);return compare_numeric(C,D)}function compare_numeric(B,A){var B=parseFloat(B);B=(isNaN(B)?0:B);var A=parseFloat(A);A=(isNaN(A)?0:A);return B-A}function ts_sort_caseinsensitive(B,A){aa=ts_getInnerText(B.cells[SORT_COLUMN_INDEX]).toLowerCase();bb=ts_getInnerText(A.cells[SORT_COLUMN_INDEX]).toLowerCase();if(aa==bb){return 0}if(aa<bb){return -1}return 1}function ts_sort_default(B,A){aa=ts_getInnerText(B.cells[SORT_COLUMN_INDEX]);bb=ts_getInnerText(A.cells[SORT_COLUMN_INDEX]);if(aa==bb){return 0}if(aa<bb){return -1}return 1}function addEvent(E,D,B,A){if(E.addEventListener){E.addEventListener(D,B,A);return true}else{if(E.attachEvent){var C=E.attachEvent("on"+D,B);return C}else{alert("Handler could not be removed")}}}function clean_num(A){A=A.replace(new RegExp(/[^-?0-9.]/g),"");return A}function trim(A){return A.replace(/^\s+|\s+$/g,"")}function alternate(E){var C=E.getElementsByTagName("tbody");for(var B=0;B<C.length;B++){var D=C[B].getElementsByTagName("tr");for(var A=0;A<D.length;A++){if((A%2)==0){if(!(D[A].className.indexOf("odd")==-1)){D[A].className=D[A].className.replace("odd","even")}else{if(D[A].className.indexOf("even")==-1){D[A].className+=" even"}}}else{if(!(D[A].className.indexOf("even")==-1)){D[A].className=D[A].className.replace("even","odd")}else{if(D[A].className.indexOf("odd")==-1){D[A].className+=" odd"}}}}}};
/* colorselector */
var colorselector_images="/config/admin/colorselect_";var CROSSHAIRS_LOCATION=colorselector_images+"crosshairs.png";var HUE_SLIDER_LOCATION=colorselector_images+"h.png";var HUE_SLIDER_ARROWS_LOCATION=colorselector_images+"position.png";var SAT_VAL_SQUARE_LOCATION=colorselector_images+"sv.png";function hexToRgb(B,E){if(E==undefined){E=null}if(B.substr(0,1)=="#"){B=B.substr(1)}var D;var C;var A;if(B.length==3){D=B.substr(0,1);D+=D;C=B.substr(1,1);C+=C;A=B.substr(2,1);A+=A}else{if(B.length==6){D=B.substr(0,2);C=B.substr(2,2);A=B.substr(4,2)}else{return E}}D=parseInt(D,16);C=parseInt(C,16);A=parseInt(A,16);if(isNaN(D)||isNaN(C)||isNaN(A)){return E}else{return{r:D/255,g:C/255,b:A/255}}}function rgbToHex(C,B,A,D){C=Math.round(C*255);B=Math.round(B*255);A=Math.round(A*255);if(D==undefined){D=true}C=C.toString(16);if(C.length==1){C="0"+C}B=B.toString(16);if(B.length==1){B="0"+B}A=A.toString(16);if(A.length==1){A="0"+A}return((D?"#":"")+C+B+A).toUpperCase()}var arVersion=navigator.appVersion.split("MSIE");var version=parseFloat(arVersion[1]);function fixPNG(A){if((version>=5.5)&&(version<7)&&(document.body.filters)){var B=document.createElement("span");B.id=A.id;B.className=A.className;B.title=A.title;B.style.cssText=A.style.cssText;B.style.setAttribute("filter","progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+A.src+"', sizingMethod='scale')");B.style.fontSize="0";B.style.width=A.width.toString()+"px";B.style.height=A.height.toString()+"px";B.style.display="inline-block";return B}else{return A.cloneNode(false)}}function trackDrag(D,C){function B(E,G){var F=pageCoords(D);E=(E-F.x)+$("LightBox_ActualContent").scrollLeft;G=(G-F.y)+$("LightBox_ActualContent").scrollTop;if(E<0){E=0}if(G<0){G=0}if(E>D.offsetWidth-1){E=D.offsetWidth-1}if(G>D.offsetHeight-1){G=D.offsetHeight-1}return{x:E,y:G}}function A(G){var J=B(G.clientX,G.clientY);var I=J.x;var F=J.y;C(J.x,J.y);function H(K){var L=B(K.clientX,K.clientY);if(L.x!=I||L.y!=F){I=L.x;F=L.y;C(L.x,L.y)}}function E(K){myRemoveEventListener(document,"mouseup",E);myRemoveEventListener(document,"mousemove",H);myAddEventListener(D,"mousedown",A)}myAddEventListener(document,"mouseup",E);myAddEventListener(document,"mousemove",H);myRemoveEventListener(D,"mousedown",A);if(G.preventDefault){G.preventDefault()}}myAddEventListener(D,"mousedown",A);D.onmousedown=function(E){return false};D.onselectstart=function(E){return false};D.ondragstart=function(E){return false}}var eventListeners=[];function findEventListener(D,C,B){var A;for(A in eventListeners){if(eventListeners[A].node==D&&eventListeners[A].event==C&&eventListeners[A].handler==B){return A}}return null}function myAddEventListener(C,B,A){if(findEventListener(C,B,A)!=null){return }if(!C.addEventListener){C.attachEvent("on"+B,A)}else{C.addEventListener(B,A,false)}eventListeners.push({node:C,event:B,handler:A})}function removeEventListenerIndex(B){var A=eventListeners[B];delete eventListeners[B];if(!A.node.removeEventListener){A.node.detachEvent("on"+A.event,A.handler)}else{A.node.removeEventListener(A.event,A.handler,false)}}function myRemoveEventListener(C,B,A){removeEventListenerIndex(findEventListener(C,B,A))}function cleanupEventListeners(){var A;for(A=eventListeners.length;A>0;A--){if(eventListeners[A]!=undefined){removeEventListenerIndex(A)}}}myAddEventListener(window,"unload",cleanupEventListeners);function hsvToRgb(G,F,I){var C;var D;var J;if(I==0){C=0;D=0;J=0}else{var E=Math.floor(G*6);var H=(G*6)-E;var B=I*(1-F);var A=I*(1-(F*H));var K=I*(1-(F*(1-H)));switch(E){case 1:C=A;D=I;J=B;break;case 2:C=B;D=I;J=K;break;case 3:C=B;D=A;J=I;break;case 4:C=K;D=B;J=I;break;case 5:C=I;D=B;J=A;break;case 6:case 0:C=I;D=K;J=B;break}}if(C>255){C=255}if(D>255){D=255}if(J>255){J=255}if(C<0){C=0}if(D<0){D=0}if(J<0){J=0}return{r:C,g:D,b:J}}function rgbToHsv(A,B,H){var F=Math.max(Math.max(A,B),H);var C=Math.min(Math.min(A,B),H);var E;var D;var G=F;if(C==F){E=0;D=0}else{var I=(F-C);D=I/F;if(A==F){E=(B-H)/I}else{if(B==F){E=2+((H-A)/I)}else{E=4+((A-B)/I)}}E/=6;if(E<0){E+=1}if(E>1){E-=1}}return{h:E,s:D,v:G}}function pageCoords(C){var A=C.offsetLeft;var D=C.offsetTop;var B=C.offsetParent;while(B!=null){A+=B.offsetLeft;D+=B.offsetTop;B=B.offsetParent}return{x:A,y:D}}var huePositionImg=document.createElement("img");huePositionImg.galleryImg=false;huePositionImg.width=20;huePositionImg.height=10;huePositionImg.src=HUE_SLIDER_ARROWS_LOCATION;huePositionImg.style.position="absolute";var hueSelectorImg=document.createElement("img");hueSelectorImg.galleryImg=false;hueSelectorImg.width=20;hueSelectorImg.height=100;hueSelectorImg.src=HUE_SLIDER_LOCATION;hueSelectorImg.style.display="block";var satValImg=document.createElement("img");satValImg.galleryImg=false;satValImg.width=100;satValImg.height=100;satValImg.src=SAT_VAL_SQUARE_LOCATION;satValImg.style.display="block";var crossHairsImg=document.createElement("img");crossHairsImg.galleryImg=false;crossHairsImg.width=14;crossHairsImg.height=14;crossHairsImg.src=CROSSHAIRS_LOCATION;crossHairsImg.style.position="absolute";function makeColorSelector(E){var N,G;function J(){var R=rgbToHex(N.r,N.g,N.b);var S=hsvToRgb(G.h,1,1);var Q=rgbToHex(S.r,S.g,S.b);K.style.background=R;E.value=R;E.onchange();C.style.background=Q;F.style.left=((G.v*100)-8).toString()+"px";F.style.top=(((1-G.s)*100)-8).toString()+"px";A.style.top=((G.h*99)-5).toString()+"px"}function P(){G=rgbToHsv(N.r,N.g,N.b);J()}function D(){N=hsvToRgb(G.h,G.s,G.v);J()}var O=document.createElement("div");O.style.padding="6px";O.style.position="relative";O.style.height="102px";O.style.width="200px";var C=document.createElement("div");C.style.position="relative";C.style.width="100px";C.style.height="100px";C.style.border="1px solid #000";var I=fixPNG(satValImg);C.appendChild(I);var F=crossHairsImg.cloneNode(false);C.appendChild(F);function M(Q,R){G.s=1-(R/101);G.v=(Q/101);D()}trackDrag(C,M);O.appendChild(C);var H=document.createElement("div");H.style.position="absolute";H.style.left="112px";H.style.top="6px";H.style.width="20px";H.style.height="100px";H.style.border="1px solid #000";var A=fixPNG(huePositionImg);H.appendChild(hueSelectorImg.cloneNode(false));H.appendChild(A);function L(Q,R){G.h=R/101;D()}trackDrag(H,L);O.appendChild(H);var K=document.createElement("div");K.style.height="50px";K.style.width="50px";K.style.position="absolute";K.style.top="6px";K.style.left="138px";K.style.border="1px solid #000";O.appendChild(K);function B(){N=hexToRgb(E.value,{r:0,g:0,b:0});P()}myAddEventListener(E,"change",B);E.style.width="46px";E.style.padding="0px";E.style.position="absolute";E.style.left="138px";E.style.top="61px";E.style.fontSize="10px";O.appendChild(E);B();return O}function makeColorSelectors(G){var F=document.getElementsByTagName("input");var C;for(C=0;C<F.length;C++){var E=F[C];if(E.className!="colorselector"){continue}var D=E.parentNode;var B=E.previousSibling;var A=makeColorSelector(E);D.insertBefore(A,(B?B.nextSibling:null))}}myAddEventListener(window,"load",makeColorSelectors);
//]]>
