;jQuery.clrCore||(function($){$.clrCore={browser:{'ie6': (typeof(clrIE6)=='undefined')?false: true,'ie7': (typeof(clrIE7)=='undefined')?false: true,'ie8': (typeof(clrIE8)=='undefined')?false: true,'mac': false,'canvas': false,'3d': false},items:{},modules:{add: function(type, mod, key, order, data){if(typeof($.clrCore.modules[type])=='undefined'){$.clrCore.modules[type]={'items': [],'length': 0,'order':{},'keys':{},'sorted': false}}if(typeof($.clrCore.modules[type][mod])!='undefined'){return false;}$.clrCore.modules[type][mod]=data;$.clrCore.modules[type].keys[key]=mod;$.clrCore.modules[type].items[$.clrCore.modules[type].items.length]=mod;$.clrCore.modules[type].length++;$.clrCore.modules[type].sorted=false;while(typeof($.clrCore.modules[type].order[order])!='undefined'){order++;}$.clrCore.modules[type].order[order]=mod;return true;},sort: function(type){function sortNumber(a,b){return a - b;}if(typeof($.clrCore.modules[type])=='undefined')return false;if($.clrCore.modules[type].sorted||!$.clrCore.modules[type].length)return true;var list=[];for(var key in $.clrCore.modules[type].order){list[list.length]=key;}list=list.sort(sortNumber);$.clrCore.modules[type].items=[];for(var i=0;i<list.length;i++){$.clrCore.modules[type].items[$.clrCore.modules[type].items.length]=$.clrCore.modules[type].order[list[i]];}$.clrCore.modules[type].sorted=true;return true;}},hooks:{add: function(hook, code){if(typeof($.clrCore.hooks[hook])=='undefined'){$.clrCore.hooks[hook]='';}$.clrCore.hooks[hook]+=code;},get: function(hook){return (typeof($.clrCore.hooks[hook])=='undefined')?'': $.clrCore.hooks[hook];}},data:{},preload:{list: [],keys:{}},clone: function(obj, deep){if(obj&&obj.constructor==Array){var clone=[];for(var i=0;i<obj.length;i++){clone[i]=(deep!=true)?obj[i]: $.clrCore.clone(obj[i], deep);}return clone;}else if (obj&&obj.constructor==Object){var clone={};for (var p in obj){clone[p]=(deep!=true)?obj[p]: $.clrCore.clone(obj[p], deep);}return clone;}return obj;},validateInputHTML: function(color){if((color.length==7||color.length==4)&&color.slice(0, 1)=='#')color=color.slice(1);if(color.length==6||color.length==3){return (color.match(/^[a-fA-F0-9]+$/))?color: false;}return false;},checkEnter: function(e){var key=(window.event)?e.keyCode: ((e.which)?e.which: 0);return (key==13)?true: false;},nextCounter: function(type, baseId, className){if(typeof($.clrCore.items[type])=='undefined'){$.clrCore.items[type]={'id': baseId,'className': className,'counter': 0}}$.clrCore.items[type].counter++;return $.clrCore.items[type].counter;},getID: function(type, number){return $.clrCore.items[type].id+number;},getClass: function(type){return $.clrCore.items[type].className;},parent: function(item, type){return (typeof($.clrCore.items[type])=='undefined')?false: $(item).parents('.'+$.clrCore.items[type].className+':first');},getObject: function(type, number){return (typeof($.clrCore.items[type])=='undefined')?false: $('#'+$.clrCore.items[type].id+number);},getData: function(type, number){return (typeof($.clrCore.items[type])=='undefined')?false: $('#'+$.clrCore.items[type].id+number).data('clr');}};$.fn.clrNumber=function(){var id=$(this).attr('id'), pos=0;if(typeof(id)=='undefined')return 0;pos=id.indexOf('-');while(pos >=0){id=id.slice(pos+1);pos=id.indexOf('-');}return parseInt(id, 10);};var test=document.createElement('canvas');if(test.getContext){$.clrCore.browser.canvas=true;if(typeof(test.style.webkitTransform)=='string'){$.clrCore.browser['3d']=true;}}delete test;$.clrCore.browser.mac=(navigator.userAgent&&navigator.userAgent.indexOf('Mac OS X')>0)?true: false;})(jQuery);$.fn.clrButton=function(){var params={};for(var i=0;i<arguments.length;i++){if(typeof(arguments[i])=='string'){switch(arguments[i]){case 'left':case 'right':case 'center':params.align=arguments[i];break;case 'help':if(arguments.length>(i+1)&&typeof(arguments[i+1])=='string'){params.help=arguments[i+1];i++;}break;}}if(typeof(arguments[i])=='object'){$.extend(params, arguments[i]);}}this.each(function(){if($('span', this).length)return false;var item=$(this);if(typeof(params.icon)=='undefined'){item.addClass('clr-button').html('<span class="clr-button"></span><span class="clr-button-text">'+item.html()+'</span>');}else{item.addClass('clr-button-icon clr-button-icon-'+params.icon).removeClass('clr-button-select').html('<span class="clr-button-text">'+item.html()+'</span>');}if(typeof(params.align)=='string'){item.addClass('clr-button-'+params.align);}if(typeof(params.help)=='string'){if(!this.id&&!item.hasClass('clr-popup-button')){var number=$.clrCore.nextCounter('button', 'clr-button-', 'clr-button'),id='clr-button-'+number;item.attr('id', id);}eval("item.mouseover(function(){$(this).clrHelp('show', '"+params.help+"');}).mouseout(function(){$(this).clrHelp('hide');});");}});return this;};;jQuery.clrMath||(function($){$.clrMath={colorsText: [[240,248,255,'Alice Blue'],[250,235,215,'Antique White'],[0,255,255,'Aqua'],[127,255,212,'Aquamarine'],[240,255,255,'Azure'],[245,245,220,'Beige'],[255,228,196,'Bisque'],[0,0,0,'Black'],[255,235,205,'Blanched Almond'],[0,0,255,'Blue'],[138,43,226,'Blue Violet'],[165,42,42,'Brown'],[222,184,135,'Burly Wood'],[95,158,160,'Cadet Blue'],[127,255,0,'Chartreuse'],[210,105,30,'Chocolate'],[255,127,80,'Coral'],[100,149,237,'Cornflower Blue'],[255,248,220,'Cornsilk'],[220,20,60,'Crimson'],[0,255,255,'Cyan'],[0,0,139,'Dark Blue'],[0,139,139,'Dark Cyan'],[184,134,11,'Dark Goldenrod'],[169,169,169,'Dark Gray'],[0,100,0,'Dark Green'],[189,183,107,'Dark Khaki'],[139,0,139,'Dark Magenta'],[85,107,47,'Dark Olive Green'],[255,140,0,'Dark Orange'],[153,50,204,'Dark Orchid'],[139,0,0,'Dark Red'],[233,150,122,'Dark Salmon'],[143,188,143,'Dark Sea Green'],[72,61,139,'Dark Slate Blue'],[47,79,79,'Dark Slate Gray'],[0,206,209,'Dark Turquoise'],[148,0,211,'Dark Violet'],[255,20,147,'Deep Pink'],[0,191,255,'Deep Sky Blue'],[105,105,105,'Dim Gray'],[30,144,255,'Dodger Blue'],[178,34,34,'Fire Brick'],[255,250,240,'Floral White'],[34,139,34,'Forest Green'],[255,0,255,'Fuchsia'],[220,220,220,'Gainsboro'],[248,248,255,'Ghost White'],[255,215,0,'Gold'],[218,165,32,'Goldenrod'],[128,128,128,'Gray'],[0,128,0,'Green'],[173,255,47,'Green Yellow'],[240,255,240,'Honeydew'],[255,105,180,'Hot Pink'],[205,92,92,'Indian Red'],[75,0,130,'Indigo'],[255,255,240,'Ivory'],[240,230,140,'Khaki'],[230,230,250,'Lavender'],[255,240,245,'Lavender Blush'],[124,252,0,'Lawn Green'],[255,250,205,'Lemon Chiffon'],[173,216,230,'Light Blue'],[240,128,128,'Light Coral'],[224,255,255,'Light Cyan'],[250,250,210,'Light Goldenrod Yellow'],[144,238,144,'Light Green'],[211,211,211,'Light Gray'],[255,182,193,'Light Pink'],[255,160,122,'Light Salmon'],[32,178,170,'Light Sea Green'],[135,206,250,'Light Sky Blue'],[119,136,153,'Light Slate Gray'],[176,196,222,'Light Steel Blue'],[255,255,224,'Light Yellow'],[0,255,0,'Lime'],[50,205,50,'Lime Green'],[250,240,230,'Linen'],[255,0,255,'Magenta'],[128,0,0,'Maroon'],[102,205,170,'Medium Aquamarine'],[0,0,205,'Medium Blue'],[186,85,211,'Medium Orchid'],[147,112,219,'Medium Purple'],[60,179,113,'Medium Sea Green'],[123,104,238,'Medium Slate Blue'],[0,250,154,'Medium Spring Green'],[72,209,204,'Medium Turquoise'],[199,21,133,'Medium Violet Red'],[25,25,112,'Midnight Blue'],[245,255,250,'Mint Cream'],[255,228,225,'Misty Rose'],[255,228,181,'Moccasin'],[255,222,173,'Navajo White'],[0,0,128,'Navy'],[253,245,230,'Old Lace'],[128,128,0,'Olive'],[107,142,35,'Olive Drab'],[255,165,0,'Orange'],[255,69,0,'Orange Red'],[218,112,214,'Orchid'],[238,232,170,'Pale Goldenrod'],[152,251,152,'Pale Green'],[175,238,238,'Pale Turquoise'],[219,112,147,'Pale Violet Red'],[255,239,213,'Papaya Whip'],[255,218,185,'Peach Puff'],[205,133,63,'Peru'],[255,192,203,'Pink'],[221,160,221,'Plum'],[176,224,230,'Powder Blue'],[128,0,128,'Purple'],[255,0,0,'Red'],[188,143,143,'Rosy Brown'],[65,105,225,'Royal Blue'],[139,69,19,'Saddle Brown'],[250,128,114,'Salmon'],[244,164,96,'Sandy Brown'],[46,139,87,'Sea Green'],[255,245,238,'Seashell'],[160,82,45,'Sienna'],[192,192,192,'Silver'],[135,206,235,'Sky Blue'],[106,90,205,'Slate Blue'],[112,128,144,'Slate Gray'],[255,250,250,'Snow'],[0,255,127,'Spring Green'],[70,130,180,'Steel Blue'],[210,180,140,'Tan'],[0,128,128,'Teal'],[216,191,216,'Thistle'],[255,99,71,'Tomato'],[64,224,208,'Turquoise'],[238,130,238,'Violet'],[245,222,179,'Wheat'],[255,255,255,'White'],[245,245,245,'White Smoke'],[255,255,0,'Yellow'],[154,205,50,'Yellow Green']],hsl2rgb: function(){var h=arguments[0],s=arguments[1],l=arguments[2],round=(arguments.length>3)?arguments[3]: true;function valore(n1, n2, hue){while(hue>=360)hue -=360;while(hue<0)hue+=360;if(hue >=240)return n1;if(hue<60)return n1+(n2 - n1)* hue / 60;if(hue<180)return n2;return n1+(n2 - n1)* (240 - hue)/ 60;}while(h >=360)h -=360;while(h<0)h+=360;if(s>100)s=100;if(s<0)s=0;if(l>100)l=100;var lum=l / 100,sat=s / 100,m1, m2, c1, c2, c3;if(lum <=0.5)m2=lum * (1+sat);else m2=lum+sat * (1 - lum);m1=2 * lum - m2;c1=valore(m1, m2, h+120);c2=valore(m1, m2, h);c3=valore(m1, m2, h-120);if(s==0&&h==0){c1=lum;c2=lum;c3=lum;}return{'r': (round)?Math.round(c1 * 255): c1 * 255,'g': (round)?Math.round(c2 * 255): c2 * 255,'b': (round)?Math.round(c3 * 255): c3 * 255};},hsl2hex: function(h, s, l){var rgb=$.clrMath.hsl2rgb(h, s, l, false);return $.clrMath.rgb2hex(rgb.r, rgb.g, rgb.b);},rgb2hex: function(r, g, b){r=Math.round(r);if(r>255)r=255;if(r<0)r=0;g=Math.round(g);if(g>255)g=255;if(g<0)g=0;b=Math.round(b);if(b>255)b=255;if(b<0)b=0;return ((r<16)?'0': '')+r.toString(16)+((g<16)?'0': '')+g.toString(16)+((b<16)?'0': '')+b.toString(16);},hex2hsl: function(){var rgb=$.clrMath.hex2rgb(arguments[0]);return (typeof(rgb)=='boolean')?false: $.clrMath.rgb2hsl(rgb.r, rgb.g, rgb.b, (arguments.length>1)?arguments[1]: true);},hex2rgb: function(color){var rgb={'r': 0, 'g': 0, 'b': 0};if((color.length==7||color.length==4)&&color.slice(0, 1)=='#')color=color.slice(1);if(color.length==6){rgb.r=parseInt(color.slice(0, 2), 16);rgb.g=parseInt(color.slice(2, 4), 16);rgb.b=parseInt(color.slice(4, 6), 16);return (isNaN(rgb.r)||isNaN(rgb.g)||isNaN(rgb.b))?false: rgb;}if(color.length==3){rgb.r=parseInt(color.slice(0, 1)+color.slice(0, 1), 16);rgb.g=parseInt(color.slice(1, 2)+color.slice(1, 2), 16);rgb.b=parseInt(color.slice(2, 3)+color.slice(2, 3), 16);return (isNaN(rgb.r)||isNaN(rgb.g)||isNaN(rgb.b))?false: rgb;}return false;},rgb2hsl: function(){var c1=$.clrMath.minmax_rgb(arguments[0])/ 255,c2=$.clrMath.minmax_rgb(arguments[1])/ 255,c3=$.clrMath.minmax_rgb(arguments[2])/ 255,kmin=Math.min(c1, Math.min(c2, c3)),kmax=Math.max(c1, Math.max(c2, c3)),l=(kmax+kmin)/ 2,s, h;if(kmax==kmin){s=h=0;}else{if(l<0.5)s=(kmax - kmin)/ (kmax+kmin);else s=(kmax - kmin)/ (2 - kmax - kmin);var delta=kmax - kmin;if(kmax==c1)h=(c2 - c3)/ delta;if(kmax==c2)h=2+(c3 - c1)/ delta;if(kmax==c3)h=4+(c1 - c2)/ delta;h=h * 60;if(h<0)h+=360;}if(arguments.length>3&&arguments[3]==false){return{'h': h, 's': s * 100, 'l': l * 100};}return{'h': Math.round(h), 's': Math.round(s * 100), 'l': Math.round(l * 100)};},minmax_hsl: function(color){if(arguments.length>1&&arguments[1]=='true'){color.h=Math.round(color.h);color.s=Math.round(color.s);color.l=Math.round(color.l);}while(color.h<0)color.h+=360;while(color.h >=360)color.h -=360;if(color.s<0)color.s=0;if(color.s>100)color.s=100;if(color.l<0)color.l=0;if(color.l>100)color.l=100;return color;},minmax_rgb: function(color){if(typeof(color)=='string')color=parseInt(color, 10);if(typeof(color)=='number'){if(color>255)color=255;if(color<0)color=0;return color;}if(arguments.length>1&&arguments[1]=='true'){color.r=Math.round(color.r);color.g=Math.round(color.g);color.b=Math.round(color.b);}if(color.r>255)color.r=255;if(color.r<0)color.r=0;if(color.g>255)color.g=255;if(color.g<0)color.g=0;if(color.b>255)color.b=255;if(color.b<0)color.b=0;return color;},color: function(data){var color={'hex': '','rgb':{},'hsl':{},'gray': true},round=(arguments.length>1)?arguments[1]: false;if(typeof(data)=='string'){if((data.length==7||data.length==4)&&data.slice(0, 1)=='#')data=data.slice(1);if((data.length==6||data.length==3)&&data.match(/^[a-fA-F0-9]+$/)){color.hex='#'+data;color.rgb=$.clrMath.hex2rgb(color.hex);if(color.rgb===false)return false;color.hsl=$.clrMath.rgb2hsl(color.rgb.r, color.rgb.g, color.rgb.b, round);color.gray=(color.rgb.r==color.rgb.g&&color.rgb.g==color.rgb.b)?true: false;return color;}if(data.slice(0, 4)=='hue:'||data.slice(0, 2)=='h:'){data=parseInt(data.slice((data.slice(0, 2)=='h:')?2: 4), 10);if(!isNaN(data)&&data >=0&&data<360){color.hsl={'h': data,'s': 75,'l': 50};color.rgb=$.clrMath.hsl2rgb(color.hsl.h, color.hsl.s, color.hsl.l, round);color.hex='#'+$.clrMath.rgb2hex(color.rgb.r, color.rgb.g, color.rgb.b);color.gray=false;return color;}}return false;}if(typeof(data)=='object'){if(typeof(data.hsl)=='object'&&typeof(data.rgb)=='object'){return data;}if(typeof(data.h)=='number'&&typeof(data.s)=='number'&&typeof(data.l)=='number'){color.hsl={'h': data.h, 's': data.s, 'l': data.l};color.rgb=$.clrMath.hsl2rgb(color.hsl.h, color.hsl.s, color.hsl.l, round);color.hex='#'+$.clrMath.rgb2hex(color.rgb.r, color.rgb.g, color.rgb.b);color.gray=false;return color;}if(typeof(data.r)=='number'&&typeof(data.g)=='number'&&typeof(data.b)=='number'){color.rgb={'r': data.r, 'g': data.g, 'b': data.b};color.hex='#'+$.clrMath.rgb2hex(color.rgb.r, color.rgb.g, color.rgb.b);color.hsl=$.clrMath.rgb2hsl(color.rgb.r, color.rgb.g, color.rgb.b, round);color.gray=(color.rgb.r==color.rgb.g&&color.rgb.g==color.rgb.b)?true: false;return color;}}return false;},textColor: function(rgb){var diff=1000,a=0,text='',gray=(rgb.r==rgb.g&&rgb.g==rgb.b)?true: false;for(var i=0;i<$.clrMath.colorsText.length;i++){if(gray==(($.clrMath.colorsText[i][0]==$.clrMath.colorsText[i][1]&&$.clrMath.colorsText[i][1]==$.clrMath.colorsText[i][2])?true: false)){a=Math.abs(rgb.r - $.clrMath.colorsText[i][0]);if(a<diff){a+=Math.abs(rgb.g - $.clrMath.colorsText[i][1]);if(a<diff){a+=Math.abs(rgb.b - $.clrMath.colorsText[i][2]);if(a<diff){diff=a;text=$.clrMath.colorsText[i][3];}}}}}return text;}};})(jQuery);$.fn.clrMessage=function(){function _get(show){item=$('#clr-message');if(!item.length){$(document.body).append('<div id="clr-message" style="display: none;"><div class="clr-message-content"><p class="clr-message-text"></p><p class="clr-message-button"><a href="javascript:void(0);" onclick="$(this).clrMessage(\'hide\');return false;">Close</a></p></div></div>');item=$('#clr-message');if(item.length){$(window).resize(function(){var item=$('#clr-message');if(item.length&&item.is(':visible')){item.css({'width': Math.round($(window).width())+'px','height': Math.round($(window).height())+'px'});}});item.dblclick(function(){$(this).clrMessage('hide');});item.find('div.clr-message-content').draggable();item.find('a').clrButton();}}if(item.length){var content=item.find('div.clr-message-content').stop(true, true);visible=content.is(':visible');if(show){content.css({'top': 0, 'left': 0, 'opacity': 0.1});item.addClass('clr-message-bg').css({'display': 'block','position': 'fixed','z-index': 19,'top': 0,'left': 0,'width': Math.round($(window).width())+'px','height': Math.round($(window).height())+'px'});}}};function show(message, button){_get(true);item.removeClass('clr-message-error');var row=item.find('div.clr-message-content');item.find('p.clr-message-text').html(message);item.find('p.clr-message-close').css('display', (button===false)?'none': '');item.find('span.clr-button-text').html((typeof(button)=='boolean')?'Close': button);var callerOffset=caller.offset(),itemOffset=item.offset(),callerHeight=caller.height(),itemHeight=item.height(),rowHeight=row.height(),top=0,left=0;if(callerOffset.top<(itemOffset.top+itemHeight / 2)){top=callerOffset.top;}else{top=callerOffset.top+callerHeight - rowHeight;}top=Math.floor(Math.min(top, itemOffset.top+itemHeight - rowHeight)- itemOffset.top);top=Math.max(0, top);left=callerOffset.left+(caller.width()- row.width())/ 2;left=Math.min(left, item.width()- row.width())- itemOffset.left;left=Math.max(0, Math.floor(left));row.css({'top': top,'left': left,'opacity': 1});if(animate&&!visible){row.css('display', 'none').fadeIn(250);}else if(!animate){row.css('display', 'block');}return true;};function error(message, button){show(message, button);item.addClass('clr-message-error');return true;};function hide(){_get(false);if(!animate){item.css('display', 'none');}else if(visible){item.removeClass('clr-message-bg').find('div.clr-message-content').fadeOut(250, function(){$('#clr-message').css('display', 'none');});}};var caller=this,item=false,args=arguments,animate=false,action=(arguments.length&&typeof(arguments[0])=='string')?arguments[0]: 'hide',visible=false;switch(action){case 'show': return show(arguments[1], (arguments.length>2)?arguments[2]: true);case 'error': return error(arguments[1], (arguments.length>2)?arguments[2]: true);case 'hide': return hide();}return false;};$.clrCore.data.screenshots={};$.clrCore.data.screenshots.data={'dir': '','file': '','offset': false,'width': false,'height': false};$.fn.clrScreenshot=function(){function get(){var item=$('#clr-screenshot');if(!item.length){$(document.body).append('<div id="clr-screenshot" style="display: none;"><span class="loading">Loading screenshot...</span><span class="image"></span></div>');item=$('#clr-screenshot');item.mouseover(function(){$(this).hide();});}return item;};function show(dir, file){var data=item.data('screenshot');if(typeof(data)==='undefined'){data={'dir': dir,'file': file};item.data('screenshot', data);}var url='colorizeit_screenshot.php?dir='+dir+'&file='+file;if(typeof($.clrCore.data.screenshots[dir])=='undefined'){$.clrCore.data.screenshots[dir]={};}if(typeof($.clrCore.data.screenshots[dir][file])=='undefined'){$.clrCore.data.screenshots[dir][file]=new Image;eval("$.clrCore.data.screenshots[dir][file].onload=function(){$('body').clrScreenshot({'action': 'loaded', 'dir': '"+dir+"', 'file': '"+file+"'})}");$.clrCore.data.screenshots[dir][file].src=url;}var block=get();block.find('span.image').empty();block.find('span.loading').css('display', '');$.clrCore.data.screenshots.data.offset=item.offset();$.clrCore.data.screenshots.data.width=item.width();$.clrCore.data.screenshots.data.height=item.height();$.clrCore.data.screenshots.data.dir=dir;$.clrCore.data.screenshots.data.file=file;if($.clrCore.data.screenshots[dir][file].complete&&$.clrCore.data.screenshots[dir][file].width&&$.clrCore.data.screenshots[dir][file].height){loaded(dir, file, true);}else{align();}};function loaded(dir, file){var block=get();if((arguments.length==3||block.is(':visible'))&&dir==$.clrCore.data.screenshots.data.dir&&file==$.clrCore.data.screenshots.data.file){if($.clrCore.data.screenshots[dir][file].complete&&($.clrCore.data.screenshots[dir][file].width<2||$.clrCore.data.screenshots[dir][file].height<2)){block.find('span.loading').html('Failed to load image.');}else{block.find('span.loading').css('display', 'none');var url='colorizeit_screenshot.php?dir='+dir+'&file='+file;block.find('span.image').html('<img src="'+url+'" />');}align();}};function align(){var block=get(),left=$.clrCore.data.screenshots.data.offset.left+$.clrCore.data.screenshots.data.width,top=$.clrCore.data.screenshots.data.offset.top+$.clrCore.data.screenshots.data.height;var windowTop=0;if(typeof(window.pageYOffset)=='number'){windowTop=window.pageYOffset;}else if(document.body&&document.body.scrollTop){windowTop=document.body.scrollTop;}else if(document.documentElement&&document.documentElement.scrollTop){windowTop=document.documentElement.scrollTop;}if(left>$(window).width()/ 2){var temp=$.clrCore.data.screenshots.data.offset.left - block.width()- 12;if(temp>0){left=temp;}}if((top - windowTop)>($(window).height()- windowTop)/ 2){var temp=$.clrCore.data.screenshots.data.offset.top - block.height()- 12;top=Math.max(0, temp);}block.css({'display': 'block','left': Math.round(left)+'px','top': Math.round(top)+'px'});};var item=this;if(arguments.length==2){show(arguments[0], arguments[1]);}else if(arguments.length==1){if(typeof(arguments[0])=='object'){switch(arguments[0].action){case 'loaded':loaded(arguments[0].dir, arguments[0].file);break;}}}else if(arguments.length==0){get().hide();}};$.fn.clrSection=function(){function create(){var id=caller.attr('id');if(!id.length){var number=$.clrCore.nextCounter('section', 'clr-section-', 'clr-section');id='clr-section-'+number;}var params=(args.length>0&&typeof(args[0])=='object')?args[0]: ((args.length>1)?args[1]:{});var simple=(typeof(params.simple)=='boolean'&&params.simple)?true: ((typeof(params.type)=='number')?true: false);var content=(typeof(params.keepHTML)=='boolean'&&params.keepHTML)?caller.html(): ((typeof(params.content)!='undefined')?params.content: '');if(simple){item=caller;item.addClass('clr-section');item.html('<div class="clr-section-top"><span class="clr-section-left"></span><span class="clr-section-right"></span></div>'+'<div class="clr-section-content-left"><div class="clr-section-content-right"><div class="clr-section-content"></div></div></div>'+'<div class="clr-section-bottom"><span class="clr-section-left"></span><span class="clr-section-right"></span></div>');}else{var row='<tr><td class="clr-section-left" valign="top"></td><td class="clr-section-mid" valign="top"></td><td class="clr-section-right" valign="top"></td></tr>';caller.replaceWith('<table class="clr-section" cellspacing="0" id="'+id+'">'+'<thead class="clr-section">'+row+'</thead>'+'<tbody class="clr-section">'+row+'</tbody>'+'<tfoot class="clr-section">'+row+'</tfoot>'+'</table>');item=$('#'+id);data={'id': id,'params': params};item.data('clr-section', data);}if(typeof(params.type)!='undefined'){item.addClass('clr-section-'+params.type);}if(typeof(params['width'])!='undefined'){if(params['width'].indexOf('%')>0){item.attr('width', params['width']);}else{item.css('width', params['width']);}}if(typeof(params['height'])!='undefined'){item.css('height', params['height']);}if(typeof(params['css'])!='undefined'){item.css(params['css']);}if(!simple&&$.clrCore.browser.ie7){item.find('thead .clr-section-right, thead .clr-section-left, tfoot .clr-section-right, tfoot .clr-section-left').css('padding', '0').html('<img src="'+clrPathImages+'global/spacer.gif" width="7" height="7" alt="" />');}content=(simple)?item.find('div.clr-section-content').html(content): item.find('tbody .clr-section-mid').attr('id', id+'-content').html(content);if(typeof(params.parseHeaders)=='boolean'&&params.parseHeaders){var found=false;content.find('h1, h2, h3, h4, h5, h6').each(function(){var item=$(this);found=true;item.replaceWith('<div class="clr-section-header"><span class="clr-left"></span><span class="clr-right"></span><span class="clr-section-header-content">'+item.html()+'</span></div>');});if(found){item.addClass('clr-section-with-headers');}}if(typeof(params['content-width'])!='undefined'){content.css('width', params['content-width']);}if(typeof(params['content-height'])!='undefined'){content.css('height', params['content-height']);}if(typeof(params['content-css'])!='undefined'){content.css(params['content-css']);}if(!simple&&typeof(params.left)=='object'){leftNav(params.left);}return item;};function leftNav(left){if(arguments.length>1&&arguments[1]===true){item=caller;data=item.data('clr-section');}var row=item.find('tbody .clr-section-left'),code='',data, str,functions=new Array('click', 'mouseover', 'mouseout', 'focus', 'blur');code+='<div class="clr-section-nav clr-section-nav-left">';for(var section in left){data=left[section];code+='<table class="clr-section-nav-title" width="100%" cellspacing="0">'+'<thead><tr><td class="clr-section-nav-left"></td><td class="clr-section-nav-mid" width="100%"></td><td class="clr-section-nav-right"></td></thead>'+'<tbody><tr><td class="clr-section-nav-left"></td><td class="clr-section-nav-mid" width="100%">'+section+'</td><td class="clr-section-nav-right"></td></tbody>'+'</table>'+'<table class="clr-section-nav-content" width="100%" cellspacing="0">';for(var i=0;i<data.length;i++){var text='<a href="'+((typeof(data[i].link)=='undefined')?'javascript:void(0);': data[i].link)+'"';for(var j=0;j<functions.length;j++){if(typeof(data[i][functions[j]])=='string'){text+=' on'+functions[j]+'="'+data[i][functions[j]]+'"';}}var str=(typeof(data[i].selected)=='boolean'&&data[i].selected)?'clr-section-nav-selected': '';if(typeof(data[i].className)=='string'){text+=' class="'+data[i].className+((str.length)?' '+str: '')+'"';}else if(str.length){text+=' class="'+str+'"';}text+='>'+data[i].text+'</a>';code+='<tr><td class="clr-section-nav-left"></td><td class="clr-section-nav-mid" width="100%">'+text+'</td><td class="clr-section-nav-right"></td></tr>';}code+='</table>';code+='<table class="clr-section-nav-footer" width="100%" cellspacing="0">'+'<tr><td class="clr-section-nav-left"></td><td class="clr-section-nav-mid" width="100%"></td><td class="clr-section-nav-right"></td></tr>'+'</table>';}code+='</div>';row.html(code);if($.clrCore.browser.ie7){row.find('table.clr-section-nav-title thead td.clr-section-nav-left').css('padding', '0').html('<img src="'+clrPathImages+'global/spacer.gif" width="5" height="5" alt="" />');row.find('table.clr-section-nav-title thead td.clr-section-nav-right, table.clr-section-nav-content td.clr-section-nav-left, table.clr-section-nav-content td.clr-section-nav-right, table.clr-section-nav-footer td.clr-section-nav-right').css('padding', '0').html('<img src="'+clrPathImages+'global/spacer.gif" width="2" height="2" alt="" />');row.find('table.clr-section-nav-footer td.clr-section-nav-left').css('padding', '0').html('<img src="'+clrPathImages+'global/spacer.gif" width="5" height="2" alt="" />');}return true;};var caller=this,item=false,data=false,args=arguments,action=(arguments.length&&typeof(arguments[0])=='string')?arguments[0]: 'create';switch(action){case 'create': return create();case 'left': return leftNav(arguments[1], true);}return false;};
