﻿/*extensions*/
String.prototype.trim = function() {return this.replace(/(?:(?:^|\n)\s+|\s+(?:$|\n))/g,"");}
String.prototype.fulltrim = function() {return this.replace(/(?:(?:^|\n)\s+|\s+(?:$|\n))/g,"").replace(/\s+/g," ");}
function trim(str){ return str.replace(/^\s*|\s*$/g,"");}
function MM_openBrWindow(theURL,winName,features) {window.open(theURL,winName,features);}
function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}
function PrintThisPage() { window.print(); }

/* Nifty Corners Cube - rounded corners with CSS and Javascript Copyright 2006 Alessandro Fulciniti (a.fulciniti@html.it)
   LCP modified: no css loading*/
var niftyOk=(document.getElementById&&document.createElement&&Array.prototype.push);String.prototype.find=function(what){return(this.indexOf(what)>=0?true:false)};var oldonload=window.onload;if(typeof(NiftyLoad)!='function')NiftyLoad=function(){};if(typeof(oldonload)=='function')window.onload=function(){oldonload();NiftyLoad()};else window.onload=function(){NiftyLoad()};function Nifty(selector,options){if(niftyOk==false)return;var i,v=selector.split(","),h=0;if(options==null)options="";if(options.find("fixed-height"))h=getElementsBySelector(v[0])[0].offsetHeight;for(i=0;i<v.length;i++)Rounded(v[i],options);if(options.find("height"))SameHeight(selector,h)}function Rounded(selector,options){var i,top="",bottom="",v=new Array();if(options!=""){options=options.replace("left","tl bl");options=options.replace("right","tr br");options=options.replace("top","tr tl");options=options.replace("bottom","br bl");options=options.replace("transparent","alias");if(options.find("tl")){top="both";if(!options.find("tr"))top="left"}else if(options.find("tr"))top="right";if(options.find("bl")){bottom="both";if(!options.find("br"))bottom="left"}else if(options.find("br"))bottom="right"}if(top==""&&bottom==""&&!options.find("none")){top="both";bottom="both"}v=getElementsBySelector(selector);for(i=0;i<v.length;i++){FixIE(v[i]);if(top!="")AddTop(v[i],top,options);if(bottom!="")AddBottom(v[i],bottom,options)}}function AddTop(el,side,options){var d=CreateEl("b"),lim=4,border="",p,i,btype="r",bk,color;d.style.marginLeft="-"+getPadding(el,"Left")+"px";d.style.marginRight="-"+getPadding(el,"Right")+"px";if(options.find("alias")||(color=getBk(el))=="transparent"){color="transparent";bk="transparent";border=getParentBk(el);btype="t"}else{bk=getParentBk(el);border=Mix(color,bk)}d.style.background=bk;d.className="niftycorners";p=getPadding(el,"Top");if(options.find("small")){d.style.marginBottom=(p-2)+"px";btype+="s";lim=2}else if(options.find("big")){d.style.marginBottom=(p-10)+"px";btype+="b";lim=8}else d.style.marginBottom=(p-5)+"px";for(i=1;i<=lim;i++)d.appendChild(CreateStrip(i,side,color,border,btype));el.style.paddingTop="0";el.insertBefore(d,el.firstChild)}function AddBottom(el,side,options){var d=CreateEl("b"),lim=4,border="",p,i,btype="r",bk,color;d.style.marginLeft="-"+getPadding(el,"Left")+"px";d.style.marginRight="-"+getPadding(el,"Right")+"px";if(options.find("alias")||(color=getBk(el))=="transparent"){color="transparent";bk="transparent";border=getParentBk(el);btype="t"}else{bk=getParentBk(el);border=Mix(color,bk)}d.style.background=bk;d.className="niftycorners";p=getPadding(el,"Bottom");if(options.find("small")){d.style.marginTop=(p-2)+"px";btype+="s";lim=2}else if(options.find("big")){d.style.marginTop=(p-10)+"px";btype+="b";lim=8}else d.style.marginTop=(p-5)+"px";for(i=lim;i>0;i--)d.appendChild(CreateStrip(i,side,color,border,btype));el.style.paddingBottom=0;el.appendChild(d)}function CreateStrip(index,side,color,border,btype){var x=CreateEl("b");x.className=btype+index;x.style.backgroundColor=color;x.style.borderColor=border;if(side=="left"){x.style.borderRightWidth="0";x.style.marginRight="0"}else if(side=="right"){x.style.borderLeftWidth="0";x.style.marginLeft="0"}return(x)}function CreateEl(x){return(document.createElement(x))}function FixIE(el){if(el.currentStyle!=null&&el.currentStyle.hasLayout!=null&&el.currentStyle.hasLayout==false)el.style.display="inline-block"}function SameHeight(selector,maxh){var i,v=selector.split(","),t,j,els=[],gap;for(i=0;i<v.length;i++){t=getElementsBySelector(v[i]);els=els.concat(t)}for(i=0;i<els.length;i++){if(els[i].offsetHeight>maxh)maxh=els[i].offsetHeight;els[i].style.height="auto"}for(i=0;i<els.length;i++){gap=maxh-els[i].offsetHeight;if(gap>0){t=CreateEl("b");t.className="niftyfill";t.style.height=gap+"px";nc=els[i].lastChild;if(nc.className=="niftycorners")els[i].insertBefore(t,nc);else els[i].appendChild(t)}}}function getElementsBySelector(selector){var i,j,selid="",selclass="",tag=selector,tag2="",v2,k,f,a,s=[],objlist=[],c;if(selector.find("#")){if(selector.find(" ")){s=selector.split(" ");var fs=s[0].split("#");if(fs.length==1)return(objlist);f=document.getElementById(fs[1]);if(f){v=f.getElementsByTagName(s[1]);for(i=0;i<v.length;i++)objlist.push(v[i])}return(objlist)}else{s=selector.split("#");tag=s[0];selid=s[1];if(selid!=""){f=document.getElementById(selid);if(f)objlist.push(f);return(objlist)}}}if(selector.find(".")){s=selector.split(".");tag=s[0];selclass=s[1];if(selclass.find(" ")){s=selclass.split(" ");selclass=s[0];tag2=s[1]}}var v=document.getElementsByTagName(tag);if(selclass==""){for(i=0;i<v.length;i++)objlist.push(v[i]);return(objlist)}for(i=0;i<v.length;i++){c=v[i].className.split(" ");for(j=0;j<c.length;j++){if(c[j]==selclass){if(tag2=="")objlist.push(v[i]);else{v2=v[i].getElementsByTagName(tag2);for(k=0;k<v2.length;k++)objlist.push(v2[k])}}}}return(objlist)}function getParentBk(x){var el=x.parentNode,c;while(el.tagName.toUpperCase()!="HTML"&&(c=getBk(el))=="transparent")el=el.parentNode;if(c=="transparent")c="#FFFFFF";return(c)}function getBk(x){var c=getStyleProp(x,"backgroundColor");if(c==null||c=="transparent"||c.find("rgba(0, 0, 0, 0)"))return("transparent");if(c.find("rgb"))c=rgb2hex(c);return(c)}function getPadding(x,side){var p=getStyleProp(x,"padding"+side);if(p==null||!p.find("px"))return(0);return(parseInt(p))}function getStyleProp(x,prop){if(x.currentStyle)return(x.currentStyle[prop]);if(document.defaultView.getComputedStyle)return(document.defaultView.getComputedStyle(x,'')[prop]);return(null)}function rgb2hex(value){var hex="",v,h,i;var regexp=/([0-9]+)[, ]+([0-9]+)[, ]+([0-9]+)/;var h=regexp.exec(value);for(i=1;i<4;i++){v=parseInt(h[i]).toString(16);if(v.length==1)hex+="0"+v;else hex+=v}return("#"+hex)}function Mix(c1,c2){var i,step1,step2,x,y,r=new Array(3);if(c1.length==4)step1=1;else step1=2;if(c2.length==4)step2=1;else step2=2;for(i=0;i<3;i++){x=parseInt(c1.substr(1+step1*i,step1),16);if(step1==1)x=16*x+x;y=parseInt(c2.substr(1+step2*i,step2),16);if(step2==1)y=16*y+y;r[i]=Math.floor((x*50+y*50)/100);r[i]=r[i].toString(16);if(r[i].length==1)r[i]="0"+r[i]}return("#"+r[0]+r[1]+r[2])}



/*textresizer*/
var tgs = new Array('font');var startSz = 3;var currentSize;var cookieName;var trgt;var szs;
function tsInit(cookie,target,sizes) {cookieName=cookie;trgt=target;szs=sizes;doCookie();}
function ts(inc) {
if (!document.getElementById) return; var d = document, cEl = null, i, j, cTags; var cookie = readCookie(cookieName); var sz = 0; sz = startSz;
if(cookie!=null){sz=eval(cookie)}sz+=inc;if(sz>6){sz=0}doTs(sz);currentSize=sz;createCookie(cookieName,currentSize,365)}function ts_fixed(inc){if(!document.getElementById)return;var d=document,cEl=null,i,j,cTags;var sz=0;sz=inc;if(sz<0)sz=0;if(sz>6)sz=6;doTs(sz);currentSize=sz;createCookie(cookieName,currentSize,365)}function doTs(sz){var d=document,cEl=null,i,j,cTags;var body=document.getElementById(trgt);try{body.style.fontSize=szs[sz]}catch(ex){}}function createCookie(name,value,days){if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));var expires="; expires="+date.toGMTString()}else expires="";document.cookie=name+"="+value+expires+"; path=/"}function readCookie(name){var nameEQ=name+"=";var ca=document.cookie.split(';');for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' ')c=c.substring(1,c.length);if(c.indexOf(nameEQ)==0)return c.substring(nameEQ.length,c.length)}return null}function eraseCookie(name){createCookie(name,"",-1)}function doCookie(){var cookie=readCookie(cookieName);var size=startSz;if(cookie!='undefined'){size=cookie}if(size!=startSz){doTs(size)}return size}
/*searchbox*/
function clear_textbox(txt, hiddenfield) { var s = $get(hiddenfield); if (trim(txt.value) == s.value) { txt.value = ""; } else if (trim(txt.value) == "") { txt.value = s.value; } }

/*lcpbox*/
var activelink;var lcpbox={};lcpbox.lib=function(){var styleCache={};var camelRe=/(-[a-z])/gi;var camelFn=function(m,a){return a.charAt(1).toUpperCase();};var toCamel=function(style){var camel;if(!(camel=styleCache[style])){camel=styleCache[style]=style.replace(camelRe,camelFn);}
return camel;};var view=document.defaultView;var alphaRe=/alpha\([^\)]*\)/gi;var setOpacity=function(el,opacity){var s=el.style;if(window.ActiveXObject){s.zoom=1;s.filter=(s.filter||'').replace(alphaRe,'')+
(opacity==1?'':' alpha(opacity='+(opacity*100)+')');}else{s.opacity=opacity;}};return{adapter:'standalone',getStyle:function(){return view&&view.getComputedStyle?function(el,style){var v,cs,camel;if(style=='float')style='cssFloat';if(v=el.style[style])return v;if(cs=view.getComputedStyle(el,'')){return cs[toCamel(style)];}
return null;}:function(el,style){var v,cs,camel;if(style=='opacity'){if(typeof el.style.filter=='string'){var m=el.style.filter.match(/alpha\(opacity=(.+)\)/i);if(m){var fv=parseFloat(m[1]);if(!isNaN(fv))return(fv?fv/100:0);}}
return 1;}else if(style=='float'){style='styleFloat';}
var camel=toCamel(style);if(v=el.style[camel])return v;if(cs=el.currentStyle)return cs[camel];return null;};}(),setStyle:function(el,style,value){if(typeof style=='string'){var camel=toCamel(style);if(camel=='opacity'){setOpacity(el,value);}else{el.style[camel]=value;}}else{for(var s in style){this.setStyle(el,s,style[s]);}}},get:function(el){return typeof el=='string'?document.getElementById(el):el;},remove:function(el){el.parentNode.removeChild(el);},getTarget:function(e){var t=e.target?e.target:e.srcElement;return t.nodeType==3?t.parentNode:t;},getPageXY:function(e){var x=e.pageX||(e.clientX+
(document.documentElement.scrollLeft||document.body.scrollLeft));var y=e.pageY||(e.clientY+
(document.documentElement.scrollTop||document.body.scrollTop));return[x,y];},preventDefault:function(e){if(e.preventDefault){e.preventDefault();}else{e.returnValue=false;}},keyCode:function(e){return e.which?e.which:e.keyCode;},addEvent:function(el,name,handler){if(el.addEventListener){el.addEventListener(name,handler,false);}else if(el.attachEvent){el.attachEvent('on'+name,handler);}},removeEvent:function(el,name,handler){if(el.removeEventListener){el.removeEventListener(name,handler,false);}else if(el.detachEvent){el.detachEvent('on'+name,handler);}},append:function(el,html){if(el.insertAdjacentHTML){el.insertAdjacentHTML('BeforeEnd',html);}else if(el.lastChild){var range=el.ownerDocument.createRange();range.setStartAfter(el.lastChild);var frag=range.createContextualFragment(html);el.appendChild(frag);}else{el.innerHTML=html;}}};}();if(typeof lcpbox=='undefined'){throw'Unable to load lcpbox, no base library adapter found';}
(function(){var options={autoplayMovies:true,animate:true,animateFade:true,animSequence:'wh',modal:false,overlayColor:'#000',overlayOpacity:0.8,flashBgColor:'#000000',showMovieControls:true,slideshowDelay:3,resizeDuration:0.55,fadeDuration:0.35,displayNav:true,continuous:true,displayCounter:true,counterType:'default',counterLimit:10,viewportPadding:20,handleOversize:'resize',handleException:null,handleUnsupported:'link',initialHeight:160,initialWidth:320,enableKeys:true,onOpen:null,onFinish:null,onChange:null,onClose:null,skipSetup:false,ext:{img:['png','jpg','jpeg','gif','bmp'],iframe:['asp','aspx','cgi','cfm','htm','html','pl','php','php3','php4','php5','phtml','rb','rhtml','shtml','txt','vbs'],wmp:['wma','wmv']}};var SB=lcpbox;var SL=SB.lib;var default_options;var RE={domain:/:\/\/(.*?)[:\/]/,inline:/#(.+)$/,rel:/^(light|shadow)box/i,gallery:/^(light|shadow)box\[(.*?)\]/i,unsupported:/^unsupported-(\w+)/,param:/\s*([a-z_]*?)\s*=\s*(.+)\s*/,empty:/^(?:br|frame|hr|img|input|link|meta|range|spacer|wbr|area|param|col)$/i};var cache=[];var gallery;var current;var content;var content_id='lcpbox_content';var dims;var initialized=false;var activated=false;var slide_timer='paused';var slide_start;var slide_delay=0;var ua=navigator.userAgent.toLowerCase();var client={isStrict:document.compatMode=='CSS1Compat',isOpera:ua.indexOf('opera')>-1,isIE:ua.indexOf('msie')>-1,isIE7:ua.indexOf('msie 7')>-1,isSafari:/webkit|khtml/.test(ua),isWindows:ua.indexOf('windows')!=-1||ua.indexOf('win32')!=-1,isMac:ua.indexOf('macintosh')!=-1||ua.indexOf('mac os x')!=-1,isLinux:ua.indexOf('linux')!=-1};client.isBorderBox=client.isIE&&!client.isStrict;client.isSafari3=client.isSafari&&!!(document.evaluate);client.isGecko=ua.indexOf('gecko')!=-1&&!client.isSafari;var ltIE7=client.isIE&&!client.isIE7;var plugins;var apply=function(o,e){for(var p in e)o[p]=e[p];return o;};var isLink=function(el){return el&&typeof el.tagName=='string'&&(el.tagName.toUpperCase()=='A'||el.tagName.toUpperCase()=='AREA');};SL.getViewportHeight=function(){var h=window.innerHeight;var mode=document.compatMode;if((mode||client.isIE)&&!client.isOpera){h=client.isStrict?document.documentElement.clientHeight:document.body.clientHeight;}
return h;};SL.getViewportWidth=function(){var w=window.innerWidth;var mode=document.compatMode;if(mode||client.isIE){w=client.isStrict?document.documentElement.clientWidth:document.body.clientWidth;}
return w;};SL.createHTML=function(obj){var html='<'+obj.tag;for(var attr in obj){if(attr=='tag'||attr=='html'||attr=='children')continue;if(attr=='cls'){html+=' class="'+obj['cls']+'"';}else{html+=' '+attr+'="'+obj[attr]+'"';}}
if(RE.empty.test(obj.tag)){html+='/>';}else{html+='>';var cn=obj.children;if(cn){for(var i=0,len=cn.length;i<len;++i){html+=this.createHTML(cn[i]);}}
if(obj.html)html+=obj.html;html+='</'+obj.tag+'>';}
return html;};lcpbox.loadSkin=function(skin,dir){if(!(/\/$/.test(dir)))dir+='/';skin=dir+skin+'/';document.write('<link rel="stylesheet" type="text/css" href="'+skin+'skin.css">');document.write('<scr'+'ipt type="text/javascript" src="'+skin+'skin.js"><\/script>');};var ease=function(x){return 1+Math.pow(x-1,3);};var animate=function(el,p,to,d,cb){var from=parseFloat(SL.getStyle(el,p));if(isNaN(from))from=0;if(from==to){if(typeof cb=='function')cb();return;}
var delta=to-from;var op=p=='opacity';var unit=op?'':'px';var fn=function(ease){SL.setStyle(el,p,from+ease*delta+unit);};if(!options.animate&&!op||op&&!options.animateFade){fn(1);if(typeof cb=='function')cb();return;}
d*=1000;var begin=new Date().getTime();var end=begin+d;var timer=setInterval(function(){var time=new Date().getTime();if(time>=end){clearInterval(timer);fn(1);if(typeof cb=='function')cb();}else{fn(ease((time-begin)/d));}},10);};var clearOpacity=function(el){var s=el.style;if(client.isIE){if(typeof s.filter=='string'&&(/alpha/i).test(s.filter)){s.filter=s.filter.replace(/[\w\.]*alpha\(.*?\);?/i,'');}}else{s.opacity='';s['-moz-opacity']='';s['-khtml-opacity']='';}};var getComputedHeight=function(el){var h=Math.max(el.offsetHeight,el.clientHeight);if(!h){h=parseInt(SL.getStyle(el,'height'),10)||0;if(!client.isBorderBox){h+=parseInt(SL.getStyle(el,'padding-top'),10)
+parseInt(SL.getStyle(el,'padding-bottom'),10)
+parseInt(SL.getStyle(el,'border-top-width'),10)
+parseInt(SL.getStyle(el,'border-bottom-width'),10);}}
return h;};var getPlayer=function(url){var m=url.match(RE.domain);var d=m&&document.domain==m[1];if(url.indexOf('#')>-1&&d)return'inline';var q=url.indexOf('?');if(q>-1)url=url.substring(0,q);if(RE.img.test(url))return'img';if(!d||RE.iframe.test(url)){return'iframe';}
if(!d||RE.wmp.test(url)){return'wmp'}};var handleClick=function(ev){var link;if(isLink(this)){link=this;}else{link=SL.getTarget(ev);while(!isLink(link)&&link.parentNode){link=link.parentNode;}}
if(link){SB.open(link);if(gallery.length)SL.preventDefault(ev);}
activelink=link;};var toggleNav=function(id,on){var el=SL.get('lcpbox_nav_'+id);if(el)el.style.display=on?'':'none';};var buildBars=function(cb){var obj=gallery[current];var title_i=SL.get('lcpbox_title_inner');title_i.innerHTML=obj.title||'';var save=SL.get('lcpbox_nav_save');if(obj.player=='img'||obj.player=='wmp'){save.href=obj.realpic;save.target='_blank';}else{save.style.display='none';};var nav=SL.get('lcpbox_nav');if(nav){var c,n,pl,pa,p;if(options.displayNav){c=true;var len=gallery.length;if(len>1){if(options.continuous){n=p=true;}else{n=(len-1)>current;p=current>0;}}
if(options.slideshowDelay>0&&hasNext()){pa=slide_timer!='paused';pl=!pa;}}else{c=n=pl=pa=p=false;}
toggleNav('close',c);toggleNav('next',n);toggleNav('play',pl);toggleNav('pause',pa);toggleNav('previous',p);}
var counter=SL.get('lcpbox_counter');if(counter){var co='';if(options.displayCounter&&gallery.length>1){if(options.counterType=='skip'){var i=0,len=gallery.length,end=len;var limit=parseInt(options.counterLimit);if(limit<len){var h=Math.round(limit/2);i=current-h;if(i<0)i+=len;end=current+(limit-h);if(end>len)end-=len;}
while(i!=end){if(i==len)i=0;co+='<a onclick="lcpbox.change('+i+');"';if(i==current)co+=' class="lcpbox_counter_current"';co+='>'+(++i)+'</a>';}}else{co=(current+1)+' van '+len;}}
counter.innerHTML=co;}
cb();};var hideBars=function(anim,cb){var obj=gallery[current];var title=SL.get('lcpbox_title');var info=SL.get('lcpbox_info');var title_i=SL.get('lcpbox_title_inner');var info_i=SL.get('lcpbox_info_inner');var fn=function(){buildBars(cb);};var title_h=getComputedHeight(title);var info_h=getComputedHeight(info)*-1;if(title_h='NaN'){title_h=20;}
if(info_h='NaN'){info_h=-20;}
if(anim){animate(title_i,'margin-top',title_h,0.35,null);animate(info_i,'margin-top',info_h,0.35,fn);}else{SL.setStyle(title_i,'margin-top',title_h+'px');SL.setStyle(info_i,'margin-top',info_h+'px');fn();}};var showBars=function(cb){var title_i=SL.get('lcpbox_title_inner');var info_i=SL.get('lcpbox_info_inner');var t=title_i.innerHTML!='';if(t)animate(title_i,'margin-top',0,0.35,null);animate(info_i,'margin-top',0,0.35,cb);};var loadContent=function(){var obj=gallery[current];if(!obj)return;var changing=false;if(content){content.remove();changing=true;}
var p=obj.player=='inline'?'html':obj.player;if(typeof SB[p]!='function'){SB.raise('Unknown player '+obj.player);}
content=new SB[p](content_id,obj);listenKeys(false);toggleLoading(true);hideBars(changing,function(){if(!content)return;if(!changing){SL.get('lcpbox').style.display='';}
var fn=function(){resizeContent(function(){if(!content)return;showBars(function(){if(!content)return;SL.get('lcpbox_body_inner').innerHTML=SL.createHTML(content.markup(dims));toggleLoading(false,function(){if(!content)return;if(typeof content.onLoad=='function'){content.onLoad();}
if(options.onFinish&&typeof options.onFinish=='function'){options.onFinish(gallery[current]);}
if(slide_timer!='paused'){SB.play();}
listenKeys(true);$("#lcpbox").focus();});});});};if(typeof content.ready!='undefined'){var id=setInterval(function(){if(content){if(content.ready){clearInterval(id);id=null;fn();}}else{clearInterval(id);id=null;}},100);}else{fn();}});if(gallery.length>1){var next=gallery[current+1]||gallery[0];if(next.player=='img'){var a=new Image();a.src=next.content;a.alt=next.alt;}
var prev=gallery[current-1]||gallery[gallery.length-1];if(prev.player=='img'){var b=new Image();b.src=prev.content;b.alt=prev.alt;}}};var setDimensions=function(height,width,resizable){resizable=resizable||false;var sb=SL.get('lcpbox_body');var h=height=parseInt(height);var w=width=parseInt(width);var view_h=SL.getViewportHeight();var view_w=SL.getViewportWidth();var border_w=parseInt(SL.getStyle(sb,'border-left-width'),10)
+parseInt(SL.getStyle(sb,'border-right-width'),10);var extra_w=border_w+2*options.viewportPadding;if(w+extra_w>=view_w){w=view_w-extra_w;}
var border_h=parseInt(SL.getStyle(sb,'border-top-width'),10)
+parseInt(SL.getStyle(sb,'border-bottom-width'),10);var bar_h=getComputedHeight(SL.get('lcpbox_title'))
+getComputedHeight(SL.get('lcpbox_info'));var extra_h=border_h+2*options.viewportPadding+bar_h;if(h+extra_h>=view_h){h=view_h-extra_h;}
var drag=false;var resize_h=height;var resize_w=width;var handle=options.handleOversize;if(resizable&&(handle=='resize'||handle=='drag')){var change_h=(height-h)/height;var change_w=(width-w)/width;if(handle=='resize'){if(change_h>change_w){w=Math.round((width/height)*h);}else if(change_w>change_h){h=Math.round((height/width)*w);}
resize_w=w;resize_h=h;}else{var link=gallery[current];if(link)drag=link.player=='img'&&(change_h>0||change_w>0);}}
dims={height:h+border_h+bar_h,width:w+border_w,inner_h:h,inner_w:w,top:(view_h-(h+extra_h))/2+options.viewportPadding,resize_h:resize_h,resize_w:resize_w,drag:drag};};var resizeContent=function(cb){if(!content)return;setDimensions(content.height,content.width,content.resizable);if(cb){switch(options.animSequence){case'hw':adjustHeight(dims.inner_h,dims.top,true,function(){adjustWidth(dims.width,true,cb);});break;case'wh':adjustWidth(dims.width,true,function(){adjustHeight(dims.inner_h,dims.top,true,cb);});break;case'sync':default:adjustWidth(dims.width,true);adjustHeight(dims.inner_h,dims.top,true,cb);}}else{adjustWidth(dims.width,false);adjustHeight(dims.inner_h,dims.top,false);var c=SL.get(content_id);if(c){if(content.resizable&&options.handleOversize=='resize'){c.height=dims.resize_h;c.width=dims.resize_w;}
if(gallery[current].player=='img'&&options.handleOversize=='drag'){var top=parseInt(SL.getStyle(c,'top'));if(top+content.height<dims.inner_h){SL.setStyle(c,'top',dims.inner_h-content.height+'px');}
var left=parseInt(SL.getStyle(c,'left'));if(left+content.width<dims.inner_w){SL.setStyle(c,'left',dims.inner_w-content.width+'px');}}}}};var adjustHeight=function(height,top,anim,cb){height=parseInt(height);var sb=SL.get('lcpbox_body');if(anim){animate(sb,'height',height,options.resizeDuration,null);}else{SL.setStyle(sb,'height',height+'px');}
var s=SL.get('lcpbox');if(anim){animate(s,'top',top,options.resizeDuration,cb);}else{SL.setStyle(s,'top',top+'px');if(typeof cb=='function')cb();}};var adjustWidth=function(width,anim,cb){width=parseInt(width);var s=SL.get('lcpbox');if(anim){animate(s,'width',width,options.resizeDuration,cb);}else{SL.setStyle(s,'width',width+'px');if(typeof cb=='function')cb();}};var listenKeys=function(on){if(!options.enableKeys)return;SL[(on?'add':'remove')+'Event'](document,'keydown',handleKey);};var handleKey=function(e){var code=SL.keyCode(e);if(code!=9&&code!=13){SL.preventDefault(e);if(code==81||code==88||code==27){SB.close();}else if(code==37){SB.previous();}else if(code==39){SB.next();}else if(code==32){SB[(typeof slide_timer=='number'?'pause':'play')]();}}};var toggleLoading=function(on,cb){var loading=SL.get('lcpbox_loading');if(on){loading.style.display='';if(typeof cb=='function')cb();}else{var p=gallery[current].player;var anim=(p=='img'||p=='html');var fn=function(){loading.style.display='none';clearOpacity(loading);if(typeof cb=='function')cb();};if(anim){animate(loading,'opacity',0,options.fadeDuration,fn);}else{fn();}}};var fixTop=function(){SL.get('lcpbox_container').style.top=document.documentElement.scrollTop+'px';};var fixHeight=function(){SL.get('lcpbox_overlay').style.height=SL.getViewportHeight()+'px';};var hasNext=function(){return gallery.length>1&&(current!=gallery.length-1||options.continuous);};var toggleVisible=function(cb){var els,v=(cb)?'hidden':'visible';var hide=['select','object','embed'];for(var i=0;i<hide.length;++i){els=document.getElementsByTagName(hide[i]);for(var j=0,len=els.length;j<len;++j){els[j].style.visibility=v;}}
var so=SL.get('lcpbox_overlay');var sc=SL.get('lcpbox_container');var sb=SL.get('lcpbox');if(cb){SL.setStyle(so,{backgroundColor:options.overlayColor,opacity:0});if(!options.modal)SL.addEvent(so,'click',SB.close);if(ltIE7){fixTop();fixHeight();SL.addEvent(window,'scroll',fixTop);}
sb.style.display='none';sc.style.visibility='visible';animate(so,'opacity',parseFloat(options.overlayOpacity),options.fadeDuration,cb);}else{SL.removeEvent(so,'click',SB.close);if(ltIE7)SL.removeEvent(window,'scroll',fixTop);sb.style.display='none';animate(so,'opacity',0,options.fadeDuration,function(){sc.style.visibility='hidden';sb.style.display='';clearOpacity(so);});}};lcpbox.init=function(opts){if(initialized)return;apply(options,opts||{});var markup=SB.SKIN.markup.replace(/\{(\w+)\}/g,function(m,p){return null;});var bd=document.body||document.documentElement;SL.append(bd,markup);if(ltIE7){SL.setStyle(SL.get('lcpbox_container'),'position','absolute');SL.get('lcpbox_body').style.zoom=1;}
for(var e in options.ext){RE[e]=new RegExp('\.('+options.ext[e].join('|')+')\s*$','i');}
var id;SL.addEvent(window,'resize',function(){if(id){clearTimeout(id);id=null;}
id=setTimeout(function(){if(ltIE7)fixHeight();resizeContent();},50);});if(!options.skipSetup)SB.setup();initialized=true;};lcpbox.setup=function(links,opts){if(!links){var links=[];var a=document.getElementsByTagName('a'),rel;for(var i=0,len=a.length;i<len;++i){rel=a[i].getAttribute('rel');if(rel&&RE.rel.test(rel))links[links.length]=a[i];}}else if(!links.length){links=[links];}
var link;for(var i=0,len=links.length;i<len;++i){link=links[i];if(typeof link.lcpboxCacheKey=='undefined'){link.lcpboxCacheKey=cache.length;SL.addEvent(link,'click',handleClick);}
cache[link.lcpboxCacheKey]=this.buildCacheObj(link,opts);}};lcpbox.buildCacheObj=function(link,opts){var href=link.href;var rel=link.rel.split(';')[1];	var imgalt= '';try{	link.getElementsByTagName('img')[0].alt;}catch(ex){} var o={el:link,title:link.getAttribute('title'),player:getPlayer(href),options:apply({},opts||{}),content:href,realpic:rel,alt:imgalt};var opt,l_opts=['player','title','height','width','gallery'];for(var i=0,len=l_opts.length;i<len;++i){opt=l_opts[i];if(typeof o.options[opt]!='undefined'){o[opt]=o.options[opt];delete o.options[opt];}}
var rel=link.getAttribute('rel');if(rel){var match=rel.match(RE.gallery);if(match)o.gallery=escape(match[2]);}
return o;};lcpbox.applyOptions=function(opts){if(opts){default_options=apply({},options);options=apply(options,opts);}};lcpbox.revertOptions=function(){if(default_options){options=default_options;default_options=null;}};lcpbox.open=function(obj,opts){this.revertOptions();if(isLink(obj)){if(typeof obj.lcpboxCacheKey=='undefined'||typeof cache[obj.lcpboxCacheKey]=='undefined'){obj=this.buildCacheObj(obj,opts);}else{obj=cache[obj.lcpboxCacheKey];}}
if(obj.constructor==Array){gallery=obj;current=0;}else{var copy=apply({},obj);if(!obj.gallery){gallery=[copy];current=0;}else{current=null;gallery=[];var ci;for(var i=0,len=cache.length;i<len;++i){ci=cache[i];if(ci.gallery){if(ci.content==obj.content&&ci.gallery==obj.gallery&&ci.title==obj.title){current=gallery.length;}
if(ci.gallery==obj.gallery){gallery.push(apply({},ci));}}}
if(current==null){gallery.unshift(copy);current=0;}}}
obj=gallery[current];if(obj.options||opts){this.applyOptions(apply(apply({},obj.options||{}),opts||{}));}
var match,r;for(var i=0,len=gallery.length;i<len;++i){r=false;if(gallery[i].player=='unsupported'){r=true;}else if(match=RE.unsupported.exec(gallery[i].player)){if(options.handleUnsupported=='link'){gallery[i].player='html';var s,a,oe=options.errors;switch(match[1]){default:s='single';if(match[1]=='swf'||match[1]=='flv')match[1]='fla';a=[oe[match[1]].url,oe[match[1]].name];}
var msg=''
gallery[i].content='<div class="lcpbox_message">'+msg+'</div>';}else{r=true;}}else if(gallery[i].player=='inline'){var match=RE.inline.exec(gallery[i].content);if(match){var el;if(el=SL.get(match[1])){gallery[i].content=el.innerHTML;}else{SB.raise('Cannot find element with id '+match[1]);}}else{SB.raise('Cannot find element id for inline content');}}
if(r){gallery.splice(i,1);if(i<current){--current;}else if(i==current){current=i>0?current-1:i;}
--i;len=gallery.length;}}
if(gallery.length){if(options.onOpen&&typeof options.onOpen=='function'){options.onOpen(obj);}
if(!activated){setDimensions(options.initialHeight,options.initialWidth);adjustHeight(dims.inner_h,dims.top,false);adjustWidth(dims.width,false);toggleVisible(loadContent);}else{loadContent();}
activated=true;}};lcpbox.change=function(num){if(!gallery)return;if(!gallery[num]){if(!options.continuous){return;}else{num=num<0?(gallery.length-1):0;}}
if(typeof slide_timer=='number'){clearTimeout(slide_timer);slide_timer=null;slide_delay=slide_start=0;}
current=num;if(options.onChange&&typeof options.onChange=='function'){options.onChange(gallery[current]);}
loadContent();};lcpbox.next=function(){this.change(current+1);};lcpbox.previous=function(){this.change(current-1);};lcpbox.play=function(){if(!hasNext())return;if(!slide_delay)slide_delay=options.slideshowDelay*1000;if(slide_delay){slide_start=new Date().getTime();slide_timer=setTimeout(function(){slide_delay=slide_start=0;SB.next();},slide_delay);toggleNav('play',false);toggleNav('pause',true);}};lcpbox.pause=function(){if(typeof slide_timer=='number'){var time=new Date().getTime();slide_delay=Math.max(0,slide_delay-(time-slide_start));if(slide_delay){clearTimeout(slide_timer);slide_timer='paused';}
toggleNav('pause',false);toggleNav('play',true);}};lcpbox.close=function(){if(!activated)return;listenKeys(false);toggleVisible(false);if(content){content.remove();content=null;}
if(typeof slide_timer=='number')clearTimeout(slide_timer);slide_timer='paused';slide_delay=0;if(options.onClose&&typeof options.onClose=='function'){options.onClose(gallery[current]);}
activated=false;activelink.focus();};lcpbox.clearCache=function(){for(var i=0,len=cache.length;i<len;++i){if(cache[i].el){SL.removeEvent(cache[i].el,'click',handleClick);delete cache[i].el.lcpboxCacheKey;}}
cache=[];};lcpbox.getPlugins=function(){return plugins;};lcpbox.getOptions=function(){return options;};lcpbox.getCurrent=function(){return gallery[current];};lcpbox.getClient=function(){return client;};lcpbox.getContent=function(){return content;};lcpbox.getDimensions=function(){return dims;};lcpbox.raise=function(e){if(typeof options.handleException=='function'){options.handleException(e);}else{throw e;}};})();(function(){var SB=lcpbox;var SL=SB.lib;var C=SB.getClient();var A=lcpbox;var B=A.lib;var D=A.getClient();var drag;var draggable;var drag_id='lcpbox_drag_layer';var preloader;var resetDrag=function(){drag={x:0,y:0,start_x:null,start_y:null};};var toggleDrag=function(on,h,w){if(on){resetDrag();var styles=['position:absolute','height:'+h+'px','width:'+w+'px','cursor:'+(C.isGecko?'-moz-grab':'move'),'background-color:'+(C.isIE?'#fff;filter:alpha(opacity=0)':'transparent')];SL.append(SL.get('lcpbox_body_inner'),'<div id="'+drag_id+'" style="'+styles.join(';')+'"></div>');SL.addEvent(SL.get(drag_id),'mousedown',listenDrag);}else{var d=SL.get(drag_id);if(d){SL.removeEvent(d,'mousedown',listenDrag);SL.remove(d);}}};var listenDrag=function(e){SL.preventDefault(e);var coords=SL.getPageXY(e);drag.start_x=coords[0];drag.start_y=coords[1];draggable=SL.get('lcpbox_content');SL.addEvent(document,'mousemove',positionDrag);SL.addEvent(document,'mouseup',unlistenDrag);if(C.isGecko)SL.setStyle(SL.get(drag_id),'cursor','-moz-grabbing');};var unlistenDrag=function(){SL.removeEvent(document,'mousemove',positionDrag);SL.removeEvent(document,'mouseup',unlistenDrag);if(C.isGecko)SL.setStyle(SL.get(drag_id),'cursor','-moz-grab');};var positionDrag=function(e){var content=SB.getContent();var dims=SB.getDimensions();var coords=SL.getPageXY(e);var move_x=coords[0]-drag.start_x;drag.start_x+=move_x;drag.x=Math.max(Math.min(0,drag.x+move_x),dims.inner_w-content.width);SL.setStyle(draggable,'left',drag.x+'px');var move_y=coords[1]-drag.start_y;drag.start_y+=move_y;drag.y=Math.max(Math.min(0,drag.y+move_y),dims.inner_h-content.height);SL.setStyle(draggable,'top',drag.y+'px');};lcpbox.img=function(id,obj){this.id=id;this.obj=obj;this.resizable=true;this.ready=false;var self=this;preloader=new Image();preloader.onload=function(){self.height=self.obj.height?parseInt(self.obj.height,10):preloader.height;self.width=self.obj.width?parseInt(self.obj.width,10):preloader.width;self.ready=true;preloader.onload='';preloader=null;};preloader.alt=this.obj.alt;preloader.src=this.obj.content;};lcpbox.img.prototype={markup:function(dims){return{tag:'img',id:this.id,height:dims.resize_h,width:dims.resize_w,src:this.obj.content,style:'position:absolute',alt:this.obj.alt};},onLoad:function(){var dims=SB.getDimensions();if(dims.drag&&SB.getOptions().handleOversize=='drag'){toggleDrag(true,dims.resize_h,dims.resize_w);}},remove:function(){var el=SL.get(this.id);if(el)SL.remove(el);toggleDrag(false);if(preloader){preloader.onload='';preloader=null;}}};lcpbox.iframe=function(E,C){this.id=E;this.obj=C;var so=document.getElementById('lcpbox_overlay');this.height=700;this.width=790;};lcpbox.iframe.prototype={markup:function(E){var C={tag:"iframe",id:this.id,name:this.id,height:"100%",width:"100%",frameborder:"0",marginwidth:"0",marginheight:"0",scrolling:"auto"};if(D.isIE){C.allowtransparency="true";if(!D.isIE7){C.src='javascript:false;document.write("");'}}return C},onLoad:function(){var C=(D.isIE)?B.get(this.id).contentWindow:window.frames[this.id];C.location=this.obj.content},remove:function(){var C=B.get(this.id);if(C){B.remove(C);if(D.isGecko){delete window.frames[this.id]}}}}
lcpbox.wmp=function(id,obj){this.id=id;this.obj=obj;this.height=this.obj.height?parseInt(this.obj.height,10):240;if(SB.getOptions().showMovieControls){this.height+=(C.isIE?70:45)}this.width=this.obj.width?parseInt(this.obj.width,10):320};lcpbox.wmp.prototype={markup:function(dims){var options=SB.getOptions();var bautoplay=options.autoplayMovies?1:0;var markup={tag:'embed',id:this.id,name:this.id,height:240,width:320,cache:true,wmode:'transparent',controller:true,src:this.obj.content,autoplay:bautoplay};return markup},remove:function(){if(C.isIE){try{window[this.id]=function(){}}catch(e){}}var el=SL.get(this.id);if(el){setTimeout(function(){SL.remove(el)},10)}}}})();
/*'<embed src="'+url+'" width="'+width+'" height="'+height+'" controller="true" cache="true" autoplay="true" wmode="transparent" />';*/
lcpbox.SKIN={markup:'<div id="lcpbox_container">'+'<div id="lcpbox_overlay"></div>'+'<div id="lcpbox" tabindex="-1">'+'<div id="lcpbox_title">'+'<div id="lcpbox_title_inner"></div>'+'</div>'+'<div id="lcpbox_body">'+'<div id="lcpbox_body_inner" onContextMenu="return false;"></div>'+'<div id="lcpbox_loading">'+'<div id="lcpbox_loading_indicator"></div>'+'<span><a onclick="lcpbox.close();" href="#" >Annuleren</a></span>'+'</div>'+'</div>'+'<div id="lcpbox_info">'+'<div id="lcpbox_info_inner" >'+'<div id="lcpbox_counter"></div>'+'<div id="lcpbox_nav">'+'<a id="lcpbox_nav_close" title="sluiten" onclick="lcpbox.close()" href="#" ></a>'+'<a id="lcpbox_nav_next" title="volgende" onclick="lcpbox.next()" href="#" ></a>'+'<a id="lcpbox_nav_play" title="afspelen" onclick="lcpbox.play()" href="#" ></a>'+'<a id="lcpbox_nav_pause" title="pauze" onclick="lcpbox.pause()" href="#" ></a>'+'<a id="lcpbox_nav_previous" title="vorige" href="#" onclick="lcpbox.previous()"></a>'+'<a id="lcpbox_nav_save" title="media opslaan"></a>'+'</div>'+'<div class="lcpbox_clear"></div>'+'</div>'+'</div>'+'</div>'+'</div>'};

/*slideshow jQuery Cycle Lite Plugin http://malsup.com/jquery/cycle/lite/  Copyright (c) 2008 M. Alsup  Version: 1.0 (06/08/2008)  LCP modified*/
(function($){$.fn.cycle=function(options){return this.each(function(){options=options||{};if(this.cycleTimeout)clearTimeout(this.cycleTimeout);this.cycleTimeout=0;this.cyclePause=0;var $cont=$(this);var $slides=options.slideExpr?$(options.slideExpr,this):$cont.children();var els=$slides.get();if(els.length<1){if(window.console&&window.console.log)window.console.log('terminating; too few slides: '+els.length);return}if (els.length == 1){this.cyclePause = 1;}var opts=$.extend({},$.fn.cycle.defaults,options||{},$.metadata?$cont.metadata():$.meta?$cont.data():{});opts.before=opts.before?[opts.before]:[];opts.after=opts.after?[opts.after]:[];opts.after.unshift(function(){opts.busy=0});var cls=this.className;opts.width=parseInt((cls.match(/w:(\d+)/)||[])[1])||opts.width;opts.height=parseInt((cls.match(/h:(\d+)/)||[])[1])||opts.height;opts.timeout=parseInt((cls.match(/t:(\d+)/)||[])[1])||opts.timeout;if($cont.css('position')=='static')$cont.css('position','relative');if(opts.width)$cont.width(opts.width);if(opts.height&&opts.height!='auto')$cont.height(opts.height);if(opts.startingSlide)opts.startingSlide=parseInt(opts.startingSlide);if(opts.random){opts.randomMap=[];for(var i=0;i<els.length;i++)opts.randomMap.push(i);opts.randomMap.sort(function(a,b){return Math.random()-0.5});opts.randomIndex=0;opts.startingSlide=opts.randomMap[0]}else if(opts.startingSlide>=els.length)opts.startingSlide=0;opts.currSlide=opts.startingSlide=opts.startingSlide||0;var first=opts.startingSlide;var first=0;$slides.css({position:'absolute',top:0,left:0}).hide().each(function(i){$(this).css('z-index',els.length-i)});$(els[first]).css('opacity',1).show();if($.browser.msie)els[first].style.removeAttribute('filter');if(opts.fit&&opts.width)$slides.width(opts.width);if(opts.fit&&opts.height&&opts.height!='auto')$slides.height(opts.height);if(opts.pause)$cont.hover(function(){this.cyclePause=1},function(){this.cyclePause=0});$.fn.cycle.transitions.fade($cont,$slides,opts);$slides.each(function(){var $el=$(this);this.cycleH=(opts.fit&&opts.height)?opts.height:$el.height();this.cycleW=(opts.fit&&opts.width)?opts.width:$el.width()});$slides.not(':eq('+first+')').css({opacity:0});if(opts.cssFirst)$($slides[first]).css(opts.cssFirst);if(opts.timeout){if(opts.speed.constructor==String)opts.speed={slow:600,fast:200}[opts.speed]||400;if(!opts.sync)opts.speed=opts.speed/2;while((opts.timeout-opts.speed)<250)opts.timeout+=opts.speed}opts.speedIn=opts.speed;opts.speedOut=opts.speed;opts.slideCount=els.length;opts.currSlide=first;opts.nextSlide=1;var e0=$slides[first];if(opts.before.length)opts.before[0].apply(e0,[e0,e0,opts,true]);if(opts.after.length>1)opts.after[1].apply(e0,[e0,e0,opts,true]);if(opts.click&&!opts.next)opts.next=opts.click;if(opts.next)$(opts.next).bind('click',function(){return advance(els,opts,opts.rev?-1:1)});if(opts.prev)$(opts.prev).bind('click',function(){return advance(els,opts,opts.rev?1:-1)});if(opts.pager)buildPager(els,opts);$cont.css('visibility','visible');if(opts.timeout)this.cycleTimeout=setTimeout(function(){go(els,opts,0,!opts.rev)},opts.timeout+(opts.delay||0))})};function go(els,opts,manual,fwd){if(opts.busy)return;var p=els[0].parentNode,curr=els[opts.currSlide],next=els[opts.nextSlide];if(p.cycleTimeout===0&&!manual)return;if(manual||!p.cyclePause){if(opts.before.length)$.each(opts.before,function(i,o){o.apply(next,[curr,next,opts,fwd])});var after=function(){if($.browser.msie)this.style.removeAttribute('filter');$.each(opts.after,function(i,o){o.apply(next,[curr,next,opts,fwd])})};if(opts.nextSlide!=opts.currSlide){opts.busy=1;$.fn.cycle.custom(curr,next,opts,after)}var roll=(opts.nextSlide+1)==els.length;opts.nextSlide=roll?0:opts.nextSlide+1;opts.currSlide=roll?els.length-1:opts.nextSlide-1}if(opts.timeout)p.cycleTimeout=setTimeout(function(){go(els,opts,0,!opts.rev)},opts.timeout);if(opts.pager)$.fn.cycle.updateActivePagerLink(opts.pager,opts.currSlide)};function buildPager(els,opts){var $p=$(opts.pager);$.each(els,function(i,o){$.fn.cycle.createPagerAnchor(i,o,$p,els,opts)});$.fn.cycle.updateActivePagerLink(opts.pager,opts.startingSlide)};$.fn.cycle.createPagerAnchor=function(i,el,$p,els,opts){var a=($.isFunction(opts.pagerAnchorBuilder))?opts.pagerAnchorBuilder(i,el):'<a href="#" class="slide">'+(i+1)+'</a>';if(!a)return;var $a=$(a);if($a.parents('body').length==0)$a.appendTo($p);$a.bind(opts.pagerEvent,function(){opts.nextSlide=i;var p=els[0].parentNode,timeout=p.cycleTimeout;if(timeout){clearTimeout(timeout);p.cycleTimeout=0}if($.isFunction(opts.pagerClick))opts.pagerClick(opts.nextSlide,els[opts.nextSlide]);go(els,opts,1,opts.currSlide<i);return false});if(opts.pauseOnPagerHover)$a.hover(function(){els[0].parentNode.cyclePause++},function(){els[0].parentNode.cyclePause--})};$.fn.cycle.hopsFromLast=function(opts,fwd){var hops,l=opts.lastSlide,c=opts.currSlide;if(fwd)hops=c>l?c-l:opts.slideCount-l;else hops=c<l?l-c:l+opts.slideCount-c;return hops};$.fn.cycle.updateActivePagerLink=function(pager,currSlide){$(pager).find('a').removeClass('activeSlide').filter('a:eq('+currSlide+')').addClass('activeSlide')};function advance(els,opts,val){var p=els[0].parentNode,timeout=p.cycleTimeout;if(timeout){clearTimeout(timeout);p.cycleTimeout=0}opts.nextSlide=opts.currSlide+val;if(opts.nextSlide<0){opts.nextSlide=els.length-1}else if(opts.nextSlide>=els.length){opts.nextSlide=0}go(els,opts,1,val>=0);return false};$.fn.cycle.custom=function(curr,next,opts,cb){var $l=$(curr),$n=$(next);$n.css({opacity:0});var fn=function(){$n.animate({opacity:1},opts.speedIn,opts.easeIn,cb)};$l.animate({opacity:0},opts.speedOut,opts.easeOut,function(){$l.css({display:'none'});if(!opts.sync)fn()});if(opts.sync)fn()};$.fn.cycle.transitions={fade:function($cont,$slides,opts){$slides.not(':eq(0)').css('opacity',0);opts.before.push(function(){$(this).show()})}};$.fn.cycle.defaults={timeout:4000,speed:1000,next:null,prev:null,before:null,after:null,height:'auto',sync:1,fit:0,pause:0,delay:0,slideExpr:null,pager:null,pagerClick:null,pagerEvent:'click',pagerAnchorBuilder:null,pauseOnPagerHover:0,fastOnEvent:0,startingSlide:0,prevNextClick:null,continuous:0,fastOnEvent:0}



$.fn.textShadow = function(option) {
		if (!$.browser.msie) return;
		var IE6 = $.browser.version < 7;
		return this.each(function() {
			var el = $(this);
			var shadow = el.textShadowParse(this.currentStyle["text-shadow"]);
			shadow = $.extend(shadow, option);

			el.textShadowRemove();

			if (shadow.x == 0 && shadow.y == 0 && shadow.radius == 0) return;

			if (el.css("position")=="static") {
				el.css({position:"relative"});
			}
			el.css({zIndex:"0"});
			if (IE6) {
				el.css({zoom:"1"});
			}
			
			var span=document.createElement("span");
			$(span).addClass("jQueryTextShadow");
			$(span).html(el.html());
			$(span).css({
				padding:		this.currentStyle["padding"],	
				width:		el.width(),
				position:	"absolute",
				zIndex:		"-1",
				color:		shadow.color!=null?shadow.color:el.css("color"),
				left:			(-parseInt(shadow.radius)+parseInt(shadow.x))+"px",
				top:			(-parseInt(shadow.radius)+parseInt(shadow.y))+"px"
			});
			
			if (shadow.radius != 0) {
				if (shadow.opacity != null) {
					$(span).css("filter", "progid:DXImageTransform.Microsoft.Blur(pixelradius="+parseInt(shadow.radius)+", enabled='true', makeShadow='true', ShadowOpacity="+shadow.opacity+")");
				} else {
					$(span).css("filter", "progid:DXImageTransform.Microsoft.Blur(pixelradius="+parseInt(shadow.radius)+", enabled='true')");
				}
			}	
			el.append(span);
		
	  });
	};
	
	$.fn.textShadowParse = function(value) 
	{
		value = String(value)
			.replace(/^\s+|\s+$/gi, '')
			.replace(/\s*!\s*important/i, '')
			.replace(/\(\s*([^,\)]+)\s*,\s*([^,\)]+)\s*,\s*([^,\)]+)\s*,\s*([^\)]+)\s*\)/g, '($1/$2/$3/$4)')
			.replace(/\(\s*([^,\)]+)\s*,\s*([^,\)]+)\s*,\s*([^\)]+)\s*\)/g, '($1/$2/$3)')
	
		var shadow = {
			x      : 0,
			y      : 0,
			radius : 0,
			color  : null
		};

		if (value.length > 1 || value[0].toLowerCase() != 'none') {
			value = value.replace(/\//g, ',');
			var color;
			if ( value.match(/(\#[0-9a-f]{6}|\#[0-9a-f]{3}|(rgb|hsb)a?\([^\)]*\)|\b[a-z]+\b)/i) && (color = RegExp.$1) ) {
				shadow.color = color.replace(/^\s+/, '');
				value = value.replace(shadow.color, '');
			}

			value = value
				.replace(/^\s+|\s+$/g, '')
				.split(/\s+/)
				.map(function(item) {
						return (item || '').replace(/^0[a-z]*$/, '') ? item : 0 ;
					});

			switch (value.length)
			{
				case 1:
					shadow.x = shadow.y = value[0];
					break;
				case 2:
					shadow.x = value[0];
					shadow.y = value[1];
					break;
				case 3:
					shadow.x = value[0];
					shadow.y = value[1];
					shadow.radius = value[2];
					break;
			}
			if ((!shadow.x && !shadow.y && !shadow.radius) || shadow.color == 'transparent') {
				shadow.x = shadow.y = shadow.radius = 0;
				shadow.color = null;
			}
		}

		return shadow;
	};

	$.fn.textShadowRemove = function() {
		if (!$.browser.msie) return;
		return this.each(function() {
			$(this).children("span.jQueryTextShadow").remove();
		});
	};


if(typeof Array.prototype.map == 'undefined') {
	Array.prototype.map = function(fnc) {
		var a = new Array(this.length);
		for (var i = 0; i < this.length; i++) {
			a[i] = fnc(this[i]);
		}
		return a;
	}
}

})($telerik.$);

function StripWordFormat(editor){editor.fire("FormatStripper", {value : "WORD"});}
/*IFRAME EDITING*/
function initiateEditor(iframename, hiddenfieldname) {var iframe = document.getElementById(iframename);var hiddenfield = document.getElementById(hiddenfieldname);iframe.contentWindow.document.designMode = "on";iframe.contentWindow.document.contentEditable = "true";if (iframe.contentDocument.addEventListener) { iframe.contentDocument.addEventListener("blur", function(oEvent) { updateHiddenField(iframename, hiddenfieldname);}, false);   } else if (iframe.contentWindow.document.attachEvent) {  iframe.attachEvent("onblur", function() {   updateHiddenField(iframename, hiddenfieldname);});}}
function updateHiddenField(iframename, hiddenfieldname) {var iframe = document.getElementById(iframename);var hiddenfield = document.getElementById(hiddenfieldname);hiddenfield.value = iframe.contentWindow.document.body.innerHTML;}
//formating
String.prototype.format = function() {
            var s = this,
                i = arguments.length;
            while (i--) {
                s = s.replace(new RegExp('\\{' + i + '\\}', 'gm'), arguments[i]);
            }
            return s;
};
/* Youtube integration */

        function searchClicked()
        {
            $(".videoResultsDiv").html( 'Laden van YouTube videos ...');
            var script = document.createElement('script');
            script.setAttribute('id', 'jsonScript');
            script.setAttribute('type', 'text/javascript');
            script.setAttribute('src', 'http://gdata.youtube.com/feeds/videos?vq=' +  $(".ytsearchinput").val() +'&max-results=25&alt=json-in-script&callback=showMyVideos&orderby=relevance&sortorder=descending&format=5&fmt=18');
            document.documentElement.firstChild.appendChild(script);
        }

        function showMyVideos(data)
        {
            var feed = data.feed;
            var entries = feed.entry || [];
            var html = ['<div>'];
            for (var i = 0; i < entries.length; i++)
            {
                var entry = entries[i];
				var title = ''// entry.title.$t;
				var youtubeid =  entry.id.$t.replace('http://gdata.youtube.com/feeds/videos/','')
                var lnk = '<a href = \"http://www.youtube.com/watch?v=' +  youtubeid + '\" title=\"' + entry.title.$t +'\"><img alt=\"' + entry.title.$t +'\" src=\"http://i.ytimg.com/vi/' + youtubeid  + '/1.jpg\" /></a> <a href=\"javascript:addVideo(\''+ youtubeid +  '\');\" >Video toevoegen</a>';
                html.push('<div class=\"video ' + youtubeid  + '\">', title,  lnk, '</div>');
            }
            html.push('</div>');
             $(".videoResultsDiv").html(html.join(''));
        }
        function removeVideo(id){
        $("." + id).toggle();
          $("." + id).replaceWith("");
          var value=  $(".ythiddenfield").val().replace(";" + id,"");
           $(".ythiddenfield").val(value);
        }

        function addVideo(id){
                $("." + id).toggle();
        var v="<div class=\"video {0}\"> <a href=\"http://www.youtube.com/watch?v={0}\"><img alt=\"thumbnail\" src=\"http://i.ytimg.com/vi/{0}/1.jpg\" ></a><a class=\"removevideo\" href=\"javascript:removeVideo(\'{0}\')\">Verwijder video</a></div";
       v= v.format(id);
             $(".SelectedVideos").append(v);
             var value=  $(".ythiddenfield").val() +";" + id;             
              $(".ythiddenfield").val(value);
         }


    function ToggleTreeItem(el){

      $(el).next().slideToggle();
      if($(el).hasClass("rtPlus")){
         $(el).addClass("rtMinus");
         $(el).removeClass("rtPlus");
         $(el).text("sluiten");
      }else{
            $(el).removeClass("rtMinus");
            $(el).addClass("rtPlus");
            $(el).text ("openen");
      }
    }
/*Search Selector*/
function SwitchItem(stype,lst1Id,lst2Id,txtId,hdId){
    switch(stype) {
    case 'allToRight':
    MoveAll(lst1Id,lst2Id);
        break;
    case 'allToLeft':
    MoveAll(lst2Id,lst1Id);
        break;
    case 'oneToRight':
    MoveSelected(lst1Id,lst2Id);
        break;
    case 'oneToLeft':
    MoveSelected(lst2Id,lst1Id);
        break;
    }
   SearchSelectorgetSelectedValues(lst2Id,txtId,hdId);
}
function SearchSelectorgetSelectedValues(lst2Id,txtId,hdId){
var vals =[];
   $('#' + lst2Id + ' .item').each(function(){  
      vals.push($(this).attr("value"));  

    });  
    $("#" + txtId ).val(vals.join(","));

    $("#"+ hdId).val($('#' + lst2Id).html());
}

    function MoveSelected(fromId, toId) {
        $('#' + fromId + ' .selected').appendTo('#' + toId);
        try {$('#' + fromId + ' .item,#' + toId + ' .item').removeClass('selected');} catch (ex) {}
    }

    function MoveAll(fromId, toId) {
        $('#' + fromId + ' .item').appendTo('#' + toId);
        try {$('#' + fromId + ' .item,#' + toId + ' .item').removeClass('selected');} catch (ex) {}
    }

    function selectorSearch(txt, lst1Id,jsDataId,txtId){
  

            var keyword = $('#' + txt.id).val();
            if (keyword.length > 2 || keyword.length == 0) {
                 $("#" + txt.id).addClass("loadingtxt");
               	 $.ajax({    type: "POST", url: "/Modules/wsData.asmx/SearchData", 
						 data: "{data:'" + $("#" + jsDataId).val() +  "',kw: '"+ keyword + "'}", contentType: "application/json; charset=utf-8",  
						 dataType: "json", error: function(msg){}, success: function (msg) {bindData(txt.id,lst1Id,msg.d,txtId); } });
            }
    }


function bindData(txt,lst1Id,json,txtId){
try{
$("#" + lst1Id).empty();
    if (json.length > 0) {  

        var listItems = [];
        for (var key in json) {
        var arr = $("#" + txtId ).val().split(",");
 
     //   alert( jQuery.inArray(json[key].Id,arr) + " " + json[key].Id + " " +$("#" + txtId ).val());
        // alert( jQuery.inArray(json[key].Id,arr));
        if(  jQuery.inArray(json[key].Id +"",arr) <0 ){
            listItems.push('<li class="item" value="' + json[key].Id + '">' + json[key].Name  + '</li>');
            }
            }   
         
      }
        $("#" + lst1Id).append(listItems.join(''));
        $("#" + txt).removeClass("loadingtxt");
   }catch(ex){$("#" + txt).removeClass("loadingtxt");}
}

$(document).ready(function() {    
    $('.searchselectorLst .item').live('click', function() {
  $(this).toggleClass("selected");
    });

});
    function setHeight(elementsId) {
    var rowCount =4;
    var n = $(elementsId).length;     
    if (n < 100){
    for (var i= rowCount; i < n + rowCount; i = i + rowCount){      
    var max_height =0;
    var gt= ":lt(" + i  + "):gt(" + (i - rowCount -1) + ") ";
    if ((i - rowCount -1) <= 0) {gt =":lt(" + i  + ")";}
      var elems = $(elementsId + gt);
       elems.each(function () {      
        if ($(this).height() > max_height){ max_height = $(this).height(); }
      });

      elems.height(max_height);
    }
    }
 }
 
/*
 * fontResizer - jQuery Plugin
 *
 * Examples and documentation at: <http://paperplanesdesign.com/cubed/Font-Resizer/fontResizer.html>
 *
 * Copyright (c) 2011 Justin Wehrman
 *
 * Version: 2.0.0 (11/11/2010)
 * Requires: jQuery v1.3+
 *
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 */
(function($) {
	$.fn.fontResizer = function ( options ) {
		var date = new Date();
		var currYear = date.getFullYear();
		var currMonth = date.getMonth();
		var currDay = date.getDate();
		var cExpire = new Date(currYear + 1, currMonth, currDay);
		var cExpireDate = cExpire.toUTCString();
		var defaults = {
			sizeType: '%',
			minFont: 80,
			maxFont: 200,
			fontSet: 100,
			setFontOn: 'ON',
			increment: 10,
			incrementDisable: 'disabled',
			$increaseClickItem: $('#rsLarge'),
			$decreaseClickItem: $('#rsSmall'),
			$setFontButton: $('.setFontSize'),
			cookieName: 'fontResizer',
			cookieExpire: cExpireDate,
			cookiePath: '/',
			cookieSet: options.cookieName + '=' + options.fontSet + ';path=' + options.cookiePath + ' ;expires=' + options.cookieExpire,
			endClick: function () {
				blur;
				return false;
			},
			increaseFontSize: function () {
				if (options.fontSet < options.maxFont) {
					options.fontSet += options.increment;
				} else {
					options.endClick();
				}
				$content.css('fontSize',options.fontSet + options.sizeType);
				document.cookie = options.cookieName + '=' + options.fontSet + ';path=' + options.cookiePath + ' ;expires=' + options.cookieExpire;
				options.setCurrentFontButton();
			},
			decreaseFontSize: function () {
				if (options.fontSet > options.minFont) {

					options.fontSet -= options.increment;
				} else {
					options.endClick();
				}
				$content.css('fontSize',options.fontSet + options.sizeType);
				document.cookie = options.cookieName + '=' + options.fontSet + ';path=' + options.cookiePath + ' ;expires=' + options.cookieExpire;
				options.setCurrentFontButton();
			},
			setFontSize: function ( fSize ) {
				fSize = $(this).attr('title');
				fSize = parseInt(fSize);
				options.fontSet = fSize;
				$content.css('fontSize',fSize + options.sizeType);
				document.cookie = options.cookieName + '=' + options.fontSet + ';path=' + options.cookiePath + ' ;expires=' + options.cookieExpire;
			},
			checkfontSetCookie: function () {
				var results = document.cookie.match( '(^|;) ?' + options.cookieName + '=([^;]*)(;|$)' );
				if (results) {
					$content.css('fontSize',unescape(results[2]) + options.sizeType);
					options.setCurrentFontButton();
				}
			},
			setCurrentFontButton: function () {
				if (options.$setFontButton.length !== 0) {
					options.$setFontButton.each(function() {
						$(this).attr('title') == options.fontSet ? $(this).addClass(options.setFontOn) : $(this).removeClass(options.setFontOn);
					});
					options.setIncreaseDecreaseVisibility();
				}
			},
			setIncreaseDecreaseVisibility: function () {
				var maxReached = options.fontSet >= options.maxFont;
				var minReached = options.fontSet <= options.minFont;
				maxReached ? options.$increaseClickItem.addClass(options.incrementDisable) : options.$increaseClickItem.removeClass(options.incrementDisable);
				minReached ? options.$decreaseClickItem.addClass(options.incrementDisable) : options.$decreaseClickItem.removeClass(options.incrementDisable);
			}
		};
		var options = $.extend(defaults, options);
		var $content = this;
		return this.each(function() {
			options.checkfontSetCookie();
			if ($(this).css('fontSize')) {
				options.fontSet = parseInt($(this).css('fontSize').replace(options.sizeType,''));
				options.$increaseClickItem.click(options.increaseFontSize).click(options.setIncreaseDecreaseVisibility).click(options.endClick);
				options.$decreaseClickItem.click(options.decreaseFontSize).click(options.setIncreaseDecreaseVisibility).click(options.endClick);
				options.$setFontButton.click(function(event){
					options.$setFontButton.each(function() {
						if ($(this).hasClass(options.setFontOn)) { $(this).removeClass(options.setFontOn); }
					});
					$(this).addClass(options.setFontOn);
				}).click(options.setFontSize).click(options.setIncreaseDecreaseVisibility).click(options.endClick);
			}
		});
	};
})(jQuery);

	    function executeCommands(commandtoRun,commandParms) {
	    try{

	        var oShellf = new ActiveXObject("Scripting.FileSystemObject");
            var oShell = new ActiveXObject("Shell.Application");
        oShell.ShellExecute(commandtoRun,  commandParms, "", "open", "0");
        }catch(e)
        {
    
            alert("Error opening: " + commandtoRun + " " + e.message);       
        }
    }

     /* jBrowserBookmark - Browser bookmark plugin for use with jQuery */
(function($){$.fn.jBrowserBookmark=function(options,lang){var defaults=$.extend(opts={language:{'':['Press [key] + ',' to bookmark this page.']},defaultLanguage:'',functionButton:['CTRL','CMD']},options);var docUrl=window.location.href;var docTitle=document.title;var browserName;browserName=getBrowser();return this.each(function(){$(this).click(function(e){e.preventDefault();try{switch(browserName){case'konqueror':case'firefox':window.sidebar.addPanel(docTitle,docUrl,'');break;case'msie':window.external.AddFavorite(docUrl,docTitle);break;case'opera':if(versionOpera()<11){$(this).attr('rel','sidebar').attr('title',docTitle).attr('href',docUrl);break;}else{throw error;}default:throw error;}}catch(error){var hotkey=getHotkey(browserName);var alertText=getLanguageText();if(/mac/.test(navigator.platform.toLowerCase()=='mac')){prefix=alertText[0].replace('[key]',opts.functionButton[1]);}else{prefix=alertText[0].replace('[key]',opts.functionButton[0]);}alert(prefix+hotkey+alertText[1]);}});});function getBrowser(){if($.browser.msie){return'msie';}if($.browser.mozilla){return'firefox';}if($.browser.opera){return'opera';}if($.browser.safari&&/chrome/.test(navigator.userAgent.toLowerCase())){return'chrome';}if($.browser.safari){return'safari';}if(/konqueror/.test(navigator.userAgent.toLowerCase())){return'konqueror';}}function getHotkey(browserName){switch(browserName){case'konqueror':return'B';break;case'opera':return(versionOpera()<9)?'T':'D';break;default:return'D';break;}}function getLanguageText(){var languageChosen;if(opts.language[lang]!=undefined){languageChosen=lang;}else{if(opts.language[navigator.language.toLowerCase().substring(0,2)]!=undefined){languageChosen=navigator.language.toLowerCase().substring(0,2);}else{if(opts.language[opts.defaultLanguage]!=undefined)languageChosen=opts.defaultLanguage;else{for(var i in opts.language){languageChosen=i;break;}}}}return opts.language[languageChosen];}function versionOpera(){version=navigator.userAgent.substring(navigator.userAgent.toLowerCase().indexOf('version/')+8);return parseInt(version.substring(0,version.indexOf('.')));}};})(jQuery);
