
$(".testimonialthumb").live("mouseover",function(){
var src=$(this).children("img.thumb").attr("src").replace("_off","_on");
$(this).children("img").attr("src",src).load(function(){});});
$(".testimonialthumb").live("mouseout",function(){
var src=$(this).children("img.thumb").attr("src").replace("_on","_off");
$(this).children("img.thumb").attr("src",src).load(function(){});});
$(".testimonialthumb").live("click",function(){
var src=$(this).children("img").attr("src").replace("_on","_click");
$("#testimonialbannerimage").attr("src",src).load(function(){});});
$('div.FcpStandardTelephone input.FcpStandardTelephoneArea, div.FcpStandardTelephone input.FcpStandardTelephonePrefix').live('keyup',function(e){
if(this.value.length==3&&((e.which>47&&e.which<58)||(e.which>95&&e.which<106))){
var n=$("input:text").length;
var nextIndex=$('input:text').index(this)+ 1;
if(nextIndex<n){
$('input:text')[nextIndex].focus();}}});
$('div.FcpStandardTelephone input.FcpStandardTelephoneSuffix').live('keyup',function(e){
if(this.value.length==4&&((e.which>47&&e.which<58)||(e.which>95&&e.which<106))){
var n=$("input:text").length;
var nextIndex=$('input:text').index(this)+ 1;
if(nextIndex<n){
$('input:text')[nextIndex].focus();}}});
$("div.FcpStandardTelephone input").live('focus',function(){
this.select();});;(function($){
$.fn.supersubs=function(options){
var opts=$.extend({},$.fn.supersubs.defaults,options);
return this.each(function(){
var $$=$(this);
var o=$.meta?$.extend({},opts,$$.data()):opts;
var fontsize=$('<li id="menu-fontsize">&#8212;</li>').css({'padding':0,'position':'absolute','top':'-999em','width':'auto'}).appendTo($$).width();
$('#menu-fontsize').remove();
$ULs=$$.find('ul');
$ULs.each(function(i){
var $ul=$ULs.eq(i);
var $LIs=$ul.children();
var $As=$LIs.children('a');
var liFloat=$LIs.css('white-space','nowrap').css('float');
var emWidth=$ul.add($LIs).add($As).css({'float':'none','width':'auto'}).end().end()[0].clientWidth/fontsize;
emWidth +=o.extraWidth;
if(emWidth>o.maxWidth){emWidth=o.maxWidth;}
else if(emWidth<o.minWidth){emWidth=o.minWidth;}
emWidth +='em';
$ul.css('width',emWidth);
$LIs.css({'float':liFloat,'width':'100%','white-space':'normal'}).each(function(){
var $childUl=$('>ul',this);
var offsetDirection=$childUl.css('left')!==undefined?'left':'right';
$childUl.css(offsetDirection,emWidth);
$childUl.css('top','-10.5px');});});});};
$.fn.supersubs.defaults={
minWidth:9,
maxWidth:25,
extraWidth:0};})(jQuery);;(function($){
$.fn.superfish=function(op){
var sf=$.fn.superfish,
c=sf.c,
$arrow=$(['<span class="',c.arrowClass,'"> &#187;</span>'].join('')),
over=function(){
var $$=$(this),menu=getMenu($$);
clearTimeout(menu.sfTimer);
$$.showSuperfishUl().siblings().hideSuperfishUl();},
out=function(){
var $$=$(this),menu=getMenu($$),o=sf.op;
clearTimeout(menu.sfTimer);
menu.sfTimer=setTimeout(function(){
o.retainPath=($.inArray($$[0],o.$path)>-1);
$$.hideSuperfishUl();
if(o.$path.length&&$$.parents(['li.',o.hoverClass].join('')).length<1){over.call(o.$path);}},o.delay);},
getMenu=function($menu){
var menu=$menu.parents(['ul.',c.menuClass,':first'].join(''))[0];
sf.op=sf.o[menu.serial];
return menu;},
addArrow=function($a){$a.addClass(c.anchorClass).append($arrow.clone());};
return this.each(function(){
var s=this.serial=sf.o.length;
var o=$.extend({},sf.defaults,op);
o.$path=$('li.'+ o.pathClass,this).slice(0,o.pathLevels).each(function(){
$(this).addClass([o.hoverClass,c.bcClass].join(' ')).filter('li:has(ul)').removeClass(o.pathClass);});
sf.o[s]=sf.op=o;
$('li:has(ul)',this)[($.fn.hoverIntent&&!o.disableHI)?'hoverIntent':'hover'](over,out).each(function(){
if(o.autoArrows)addArrow($('>a:first-child',this));}).not('.'+ c.bcClass).hideSuperfishUl();
var $a=$('a',this);
$a.each(function(i){
var $li=$a.eq(i).parents('li');
$a.eq(i).focus(function(){over.call($li);}).blur(function(){out.call($li);});});
o.onInit.call(this);}).each(function(){
var menuClasses=[c.menuClass];
if(sf.op.dropShadows&&!($.browser.msie&&$.browser.version<7))menuClasses.push(c.shadowClass);
$(this).addClass(menuClasses.join(' '));});};
var sf=$.fn.superfish;
sf.o=[];
sf.op={};
sf.IE7fix=function(){
var o=sf.op;
if($.browser.msie&&$.browser.version>6&&o.dropShadows&&o.animation.opacity!=undefined)
this.toggleClass(sf.c.shadowClass +'-off');};
sf.c={
bcClass:'sf-breadcrumb',
menuClass:'sf-js-enabled',
anchorClass:'sf-with-ul',
arrowClass:'sf-sub-indicator',
shadowClass:'sf-shadow'};
sf.defaults={
hoverClass:'sfHover',
pathClass:'overideThisToUse',
pathLevels:1,
delay:0,
animation:{opacity:'show'},
speed:'normal',
autoArrows:true,
dropShadows:true,
disableHI:false,
onInit:function(){},
onBeforeShow:function(){},
onShow:function(){},
onHide:function(){}};
$.fn.extend({
hideSuperfishUl:function(){
var o=sf.op,
not=(o.retainPath===true)?o.$path:'';
o.retainPath=false;
var $ul=$(['li.',o.hoverClass].join(''),this).add(this).not(not).removeClass(o.hoverClass).find('>ul').hide().css('visibility','hidden');
o.onHide.call($ul);
return this;},
showSuperfishUl:function(){
var o=sf.op,
sh=sf.c.shadowClass +'-off',
$ul=this.addClass(o.hoverClass).find('>ul:hidden').css('visibility','visible');
sf.IE7fix.call($ul);
o.onBeforeShow.call($ul);
$ul.animate(o.animation,o.speed,function(){sf.IE7fix.call($ul);o.onShow.call($ul);});
return this;}});})(jQuery);
jQuery(function(){
jQuery('ul.sf-menu').supersubs({
minWidth:12,
maxWidth:27,
extraWidth:1}).superfish();
$("div.rootmenustackeddiv").live("mouseover",function(){
$("li.menuCap").each(function(){
var $liWidth=$(this).parent().width();
if($liWidth>0){
$(this).css({'width':$liWidth + 2});}});
$("div.menuCapCenterFill").each(function(){
var $divWidth=$(this).parent().parent().parent().parent().width();
if($divWidth>0){
$(this).css({'width':$divWidth - 13});}});});
$("div.rootmenudiv").live("mouseover",function(){
$("li.menuCap").each(function(){
var $liWidth=$(this).parent().width();
if($liWidth>0){
$(this).css({'width':$liWidth + 2});}});
$("div.menuCapCenterFill").each(function(){
var $divWidth=$(this).parent().parent().parent().parent().width();
if($divWidth>0){
$(this).css({'width':$divWidth - 13});}});});
$("a.children").hover(function(){
$("li.menuCap").each(function(){
var $liWidth=$(this).parent().width();
if($liWidth>0){
$(this).css({'width':$liWidth + 2});}});
$("div.menuCapCenterFill").each(function(){
var $divWidth=$(this).parent().parent().parent().parent().width();
if($divWidth>0){
$(this).css({'width':$divWidth - 13});}});
var position=$(this).position();
$(this).parent().children("ul").css({'top':position.top - 11});});});
(function($){
$.fn.jqm=function(o){
var p={
overlay:50,
overlayClass:'jqmOverlay',
closeClass:'jqmClose',
trigger:'.jqModal',
ajax:F,
ajaxText:'',
target:F,
modal:F,
toTop:F,
onShow:F,
onHide:F,
onLoad:F};
return this.each(function(){
if(this._jqm)return H[this._jqm].c=$.extend({},H[this._jqm].c,o);s++;this._jqm=s;
H[s]={c:$.extend(p,$.jqm.params,o),a:F,w:$(this).addClass('jqmID'+ s),s:s};
if(p.trigger)$(this).jqmAddTrigger(p.trigger);});};
$.fn.jqmAddClose=function(e){return hs(this,e,'jqmHide');};
$.fn.jqmAddTrigger=function(e){return hs(this,e,'jqmShow');};
$.fn.jqmShow=function(t){return this.each(function(){t=t||window.event;$.jqm.open(this._jqm,t);});};
$.fn.jqmHide=function(t){return this.each(function(){t=t||window.event;$.jqm.close(this._jqm,t)});};
$.jqm={
hash:{},
open:function(s,t){
var h=H[s],c=h.c,cc='.'+ c.closeClass,z=(parseInt(h.w.css('z-index'))),z=(z>0)?z:3001,o=$('<div></div>').css({height:'100%',width:'100%',position:'fixed',left:0,top:0,'z-index':z - 1,opacity:c.overlay/100});if(h.a)return F;h.t=t;h.a=true;h.w.css('z-index',z);
if(c.modal){if(!A[0])L('bind');A.push(s);}
else if(c.overlay>0)h.w.jqmAddClose(o);
else o=F;
h.o=(o)?o.addClass(c.overlayClass).prependTo('body'):F;
if(ie6){$('html,body').css({height:'100%',width:'100%'});if(o){o=o.css({position:'absolute'})[0];for(var y in{Top:1,Left:1})o.style.setExpression(y.toLowerCase(),"(_=(document.documentElement.scroll"+ y +" || document.body.scroll"+ y +"))+'px'");}}
if(c.ajax){
var r=c.target||h.w,u=c.ajax,r=(typeof r=='string')?$(r,h.w):$(r),u=(u.substr(0,1)=='@')?$(t).attr(u.substring(1)):u;
r.html(c.ajaxText).load(u,function(){if(c.onLoad)c.onLoad.call(this,h);if(cc)h.w.jqmAddClose($(cc,h.w));e(h);});}
else if(cc)h.w.jqmAddClose($(cc,h.w));
if(c.toTop&&h.o)h.w.before('<span id="jqmP'+ h.w[0]._jqm +'"></span>').insertAfter(h.o);
(c.onShow)?c.onShow(h):h.w.show();e(h);return F;},
close:function(s){
var h=H[s];if(!h.a)return F;h.a=F;
if(A[0]){A.pop();if(!A[0])L('unbind');}
if(h.c.toTop&&h.o)$('#jqmP'+ h.w[0]._jqm).after(h.w).remove();
if(h.c.onHide)h.c.onHide(h);else{h.w.hide();if(h.o)h.o.remove();}return F;},
params:{}};
var s=0,H=$.jqm.hash,A=[],ie6=$.browser.msie&&($.browser.version=="6.0"),F=false,
i=$('<iframe src="javascript:false;document.write(\'\');" class="jqm"></iframe>').css({opacity:0}),
e=function(h){if(ie6)if(h.o)h.o.html('<p style="width:100%;height:100%"/>').prepend(i);else if(!$('iframe.jqm',h.w)[0])h.w.prepend(i);f(h);},
f=function(h){try{}catch(_){}},
L=function(t){$()[t]("keypress",m)[t]("keydown",m)[t]("mousedown",m);},
m=function(e){var h=H[A[A.length - 1]],r=(!$(e.target).parents('.jqmID'+ h.s)[0]);if(r)f(h);return!r;},
hs=function(w,t,c){
return w.each(function(){
var s=this._jqm;$(t).each(function(){
if(!this[c]){this[c]=[];$(this).click(function(){for(var i in{jqmShow:1,jqmHide:1})for(var s in this[i])if(H[this[i][s]])H[this[i][s]].w[i](this);return F;});}this[c].push(s);});});};})(jQuery);
function ShowModalCentered(div){
div.css("position","absolute");
div.css("top",($(window).height()- div.height())/2 + $(window).scrollTop()+"px");
div.css("left",($(window).width()- div.width())/2 + $(window).scrollLeft()+"px");
div.jqmShow();}
$(document).ready(function(){
var closeModal=function(hash){
var $modalWindow=$(hash.w);
$modalWindow.fadeOut('100',function(){
hash.o.remove();
if(hash.refreshAfterClose==true){
window.location.href=document.location.href;}});};
var openInFrame=function(hash){
var $trigger=$(hash.t);
var $modalWindow=$(hash.w);
var $modalContainer=$('iframe',$modalWindow);
var myUrl=$trigger.attr('href');
var myTitle=$trigger.attr('title');
$modalContainer.html('').attr('src',myUrl);
$('#jqmTitleText').text(myTitle);
myUrl=(myUrl.lastIndexOf("#")>-1)?myUrl.slice(0,myUrl.lastIndexOf("#")):myUrl;
var queryString=(myUrl.indexOf("?")>-1)?myUrl.substr(myUrl.indexOf("?")+ 1):null;
if(queryString!=null&&typeof queryString!='undefined'){
var queryVarsArray=queryString.split("&");
for(var i=0;i<queryVarsArray.length;i++){
if(escape(unescape(queryVarsArray[i].split("=")[0]))=='jqmRefresh'){
hash.refreshAfterClose=queryVarsArray[i].split("=")[1]}else{
hash.refreshAfterClose=false;}}
var w=$('#jqmContent').width();
var sw=$(document,window.parent.document).width();
if(w<200)
w=567;
var top=$(document).scrollTop()+ 10;
var left=(sw/2)-(w/2);
$('.ArticleIframe').css({'visibility':'hidden'});
$modalWindow.jqmShow().animate({
height:'1px',
top:top,
left:left,
marginLeft:0},'fast');}
else{
$modalWindow.jqmShow();}}
$('#modalWindow').jqm({
overlay:50,
modal:true,
trigger:'a.thickbox',
target:'#jqmContent',
onHide:closeModal,
onShow:openInFrame});});
(function($){
var H=$.hint=function(txt,opts){return $(document).hint(txt,opts);},toOpts=function(t,o){
if(!o&&typeof t=="object"){o=t;t=null;}
o=o||{};if(t){o.text=''+ t;}
if(o.keepLabel)o.method='valueSwap';return o;};$.fn.hint=function(txt,opts){opts=toOpts(txt,opts);return this.each(function(){H.init.call(this,opts);});};$.extend(H,{version:"1.7",query:'input:password,input:text:not(._hintPw),textarea',on:'hint',toggleOnFocus:true,attr:false,inline:false,text:undefined,method:'labelOver',parentCss:{position:'relative'},inlineCss:{display:'inline',float:'none'},labelCss:{position:'absolute',top:'4px',left:'5px'},getElements:function(opts){var q=opts.query||H.query,inputs=this.is(q)?this:this.find(q);return(inputs.length==0?this:inputs);},init:function(opts){var $e=$(this),meta=$.metadata,Hm=meta?$e.metadata():null;H.getElements.call($e,opts).each(function(){var $i=$(this),hm=meta?$i.metadata():null,h=$.extend(true,{},H,Hm,hm,opts);$.extend(h,h[h.method]);h.create.call($i,h);});},hasValue:function(h){var v=this.val();return(v&&$.trim(v)!='');},start:function(){var i=$(this),h=i.data('hint'),method=h.hasValue.call(i,h)?'hide':'show';h[method].call(i,h);},end:function(){var i=$(this),h=i.data('hint');if(h&&h.hasHint.call(i,h)){h.hide.call(i,h);}},getText:function(h){return h.text||this.attr(h.attr||'title');},create:function(h){if(this.data('hint'))this.data('hint').destroy.call(this);this.data('hint',h);h.setup.call(this,h);h.start.call(this);},destroy:function(){var h=this.data('hint');h.teardown.call(this,h);this.data('hint',null);},valueSwap:{setup:function(h){
var self=this,text=h.getText.call(self,h);h.kill=function(){h.destroy.call(self);};if(self.is(':password')){h.password=$('<input type="text" value="'+ text +'" class="_hintPw">').focus(function(){self.show().focus();}).addClass(h.on).insertBefore(self);}else if($.browser.msie&&!self.attr('defaultValue')&&self.val()==text){self.val('');}
self.blur(h.start).focus(h.end);$(window).unload(h.kill);$(this[0].form).submit(h.kill);},hide:function(h){if(h.password){h.password.hide();this.show();}else{if(h.hasHint.call(this,h))this.val('');this.removeClass(h.on);}},show:function(h){if(h.password){this.hide();h.password.show();}else{this.addClass(h.on).val(h.getText.call(this,h));}},hasHint:function(h){if(h.password)return h.password.is(':visible');return this.hasClass(h.on)&&(this.val()==h.getText.call(this,h));},teardown:function(h){h.end.call(this);if(h.password)h.password.remove();$(window).unbind('unload',h.kill);$(this[0].form).unbind('submit',h.kill);}},labelOver:{setup:function(h){
var self=this,n=this.attr('name'),l=$('label[for='+ n +']'),p=self.parent();if(l.size()==0){h.newLabel=true;l=$('<label for="'+ n +'">'+ h.getText.call(this,h)+'</label>');self.before(l);}else if(h.text||h.attr){h.labelText=l.text();l.text(h.getText.call(this,h));}
p=self.wrap('<div></div>').before(l.remove()).parent().css(h.parentCss);if(h.inline)p.css(h.inlineCss);h.labelStyle=l.attr('style')||'';h.label=l.addClass(h.on).css(h.labelCss).click(function(){self.focus();});if(h.toggleOnFocus){self.blur(h.start).focus(h.end);}else{self.keyup(h.toggle=function(){(h.hasValue.call(self,h)?h.end:h.start).call(self);});}},hide:function(h){h.label.css('textIndent',-10000);},show:function(h){h.label.css('textIndent',0);},hasHint:function(h){return h.label.css('textIndent').charAt(0)=='0';},teardown:function(h){
if(h.toggleOnFocus){this.unbind('blur',h.start).unbind('focus',h.end);}else{this.unbind('keyup',h.toggle);}
h.label.removeClass(h.on).attr('style',h.labelStyle);if(h.newLabel){h.label.remove();h.label=null;}else if(h.labelText){h.label.text(h.labelText);}
var p=this.parent().after(this);if(h.label){p.before(h.label);}
p.remove();}}});})(jQuery);
function WireNumeric(CurrentElementID){
var CurrentElement=$('#'+ CurrentElementID);
CurrentElement.keyup(function(e){
if(isNaN(CurrentElement.val())||CurrentElement.val().substr(CurrentElement.val().length - 1,1)==" "){
CurrentElement.val(CurrentElement.val().substring(0,CurrentElement.val().length - 1));}});}
var DNN_COL_DELIMITER=String.fromCharCode(16);
var DNN_ROW_DELIMITER=String.fromCharCode(15);
var __dnn_m_bPageLoaded=false;
window.onload=__dnn_Page_OnLoad;
function __dnn_ClientAPIEnabled()
{
return typeof(dnn)!='undefined';}
function __dnn_Page_OnLoad()
{
if(__dnn_ClientAPIEnabled())
{
var sLoadHandlers=dnn.getVar('__dnn_pageload');
if(sLoadHandlers!=null)
eval(sLoadHandlers);
dnn.dom.attachEvent(window,'onscroll',__dnn_bodyscroll);}
__dnn_m_bPageLoaded=true;}
function __dnn_KeyDown(iKeyCode,sFunc,e)
{
if(e==null)
e=window.event;
if(e.keyCode==iKeyCode)
{
eval(unescape(sFunc));
return false;}}
function __dnn_bodyscroll()
{
if(__dnn_ClientAPIEnabled()&&__dnn_m_bPageLoaded){
var value=document.documentElement.scrollTop?document.documentElement.scrollTop:dnn.dom.getByTagName("body")[0].scrollTop;
jQuery('#ScrollTop').first().val(value);}}
function __dnn_setScrollTop(iTop)
{
if(__dnn_ClientAPIEnabled())
{
if(iTop==null){
iTop=jQuery('#ScrollTop').first().val();}
var sID=dnn.getVar('ScrollToControl');
if(sID!=null&&sID.length>0)
{
var oCtl=dnn.dom.getById(sID);
if(oCtl!=null)
{
iTop=dnn.dom.positioning.elementTop(oCtl);
dnn.setVar('ScrollToControl','');}}
window.scrollTo(0,iTop);}}
function __dnn_SetInitialFocus(sID)
{
var oCtl=dnn.dom.getById(sID);
if(oCtl!=null&&__dnn_CanReceiveFocus(oCtl))
oCtl.focus();}
function __dnn_CanReceiveFocus(e)
{
if(e.style.display!='none'&&e.tabIndex>-1&&e.disabled==false&&e.style.visible!='hidden')
{
var eParent=e.parentElement;
while(eParent!=null&&eParent.tagName!='BODY')
{
if(eParent.style.display=='none'||eParent.disabled||eParent.style.visible=='hidden')
return false;
eParent=eParent.parentElement;}
return true;}
else
return false;}
function __dnn_ContainerMaxMin_OnClick(oLnk,sContentID)
{
var oContent=dnn.dom.getById(sContentID);
if(oContent!=null)
{
var oBtn=oLnk.childNodes[0];
var sContainerID=dnn.getVar('containerid_'+ sContentID);
var sCookieID=dnn.getVar('cookieid_'+ sContentID);
var sCurrentFile=oBtn.src.toLowerCase().substr(oBtn.src.lastIndexOf('/'));
var sMaxFile;
var sMaxIcon;
var sMinIcon;
if(dnn.getVar('min_icon_'+ sContainerID))
sMinIcon=dnn.getVar('min_icon_'+ sContainerID);
else
sMinIcon=dnn.getVar('min_icon');
if(dnn.getVar('max_icon_'+ sContainerID))
sMaxIcon=dnn.getVar('max_icon_'+ sContainerID);
else
sMaxIcon=dnn.getVar('max_icon');
sMaxFile=sMaxIcon.toLowerCase().substr(sMaxIcon.lastIndexOf('/'));
var iNum=5;
var animf=dnn.getVar('animf_'+ sContentID);
if(animf!=null)
iNum=new Number(animf);
if(sCurrentFile==sMaxFile)
{
oBtn.src=sMinIcon;
dnn.dom.expandElement(oContent,iNum);
oBtn.title=dnn.getVar('min_text');
if(sCookieID!=null)
{
if(dnn.getVar('__dnn_'+ sContainerID +':defminimized')=='true')
dnn.dom.setCookie(sCookieID,'true',365);
else
dnn.dom.deleteCookie(sCookieID);}
else
dnn.setVar('__dnn_'+ sContainerID +'_Visible','true');}
else
{
oBtn.src=sMaxIcon;
dnn.dom.collapseElement(oContent,iNum);
oBtn.title=dnn.getVar('max_text');
if(sCookieID!=null)
{
if(dnn.getVar('__dnn_'+ sContainerID +':defminimized')=='true')
dnn.dom.deleteCookie(sCookieID);
else
dnn.dom.setCookie(sCookieID,'false',365);}
else
dnn.setVar('__dnn_'+ sContainerID +'_Visible','false');}
return true;}
return false;}
function __dnn_Help_OnClick(sHelpID)
{
var oHelp=dnn.dom.getById(sHelpID);
if(oHelp!=null)
{
if(oHelp.style.display=='none')
oHelp.style.display='';
else
oHelp.style.display='none';
return true;}
return false;}
function __dnn_SectionMaxMin(oBtn,sContentID)
{
var oContent=dnn.dom.getById(sContentID);
if(oContent!=null)
{
var sMaxIcon=oBtn.getAttribute('max_icon');
var sMinIcon=oBtn.getAttribute('min_icon');
var bCallback=oBtn.getAttribute('userctr')!=null;
var sVal;
if(oContent.style.display=='none')
{
oBtn.src=sMinIcon;
oContent.style.display='';
if(bCallback)
sVal='True';
else
dnn.setVar(oBtn.id +':exp',1);}
else
{
oBtn.src=sMaxIcon;
oContent.style.display='none';
if(bCallback)
sVal='False';
else
dnn.setVar(oBtn.id +':exp',0);}
if(bCallback)
dnncore.setUserProp(oBtn.getAttribute('userctr'),oBtn.getAttribute('userkey'),sVal,null);
return true;}
return false;}
function __dnn_enableDragDrop()
{
var aryConts=dnn.getVar('__dnn_dragDrop').split(";");
var aryTitles;
for(var i=0;i<aryConts.length;i++)
{
aryTitles=aryConts[i].split(" ");
if(aryTitles[0].length>0)
{
var oCtr=dnn.dom.getById(aryTitles[0]);
var oTitle=dnn.dom.getById(aryTitles[1]);
if(oCtr!=null&&oTitle!=null)
{
oCtr.setAttribute('moduleid',aryTitles[2]);
dnn.dom.positioning.enableDragAndDrop(oCtr,oTitle,'__dnn_dragComplete()','__dnn_dragOver()');}}}}
var __dnn_oPrevSelPane;
var __dnn_oPrevSelModule;
var __dnn_dragEventCount=0;
function __dnn_dragOver()
{
__dnn_dragEventCount++;
if(__dnn_dragEventCount%75!=0)
return;
var oCont=dnn.dom.getById(dnn.dom.positioning.dragCtr.contID);
var oPane=__dnn_getMostSelectedPane(dnn.dom.positioning.dragCtr);
if(__dnn_oPrevSelPane!=null)
__dnn_oPrevSelPane.pane.style.border=__dnn_oPrevSelPane.origBorder;
if(oPane!=null)
{
__dnn_oPrevSelPane=oPane;
oPane.pane.style.border='4px double '+ DNN_HIGHLIGHT_COLOR;
var iIndex=__dnn_getPaneControlIndex(oCont,oPane);
var oPrevCtl;
var oNextCtl;
for(var i=0;i<oPane.controls.length;i++)
{
if(iIndex>i&&oPane.controls[i].id!=oCont.id)
oPrevCtl=oPane.controls[i];
if(iIndex<=i&&oPane.controls[i].id!=oCont.id)
{
oNextCtl=oPane.controls[i];
break;}}
if(__dnn_oPrevSelModule!=null)
dnn.dom.getNonTextNode(__dnn_oPrevSelModule.control).style.border=__dnn_oPrevSelModule.origBorder;
if(oNextCtl!=null)
{
__dnn_oPrevSelModule=oNextCtl;
dnn.dom.getNonTextNode(oNextCtl.control).style.borderTop='5px groove '+ DNN_HIGHLIGHT_COLOR;}
else if(oPrevCtl!=null)
{
__dnn_oPrevSelModule=oPrevCtl;
dnn.dom.getNonTextNode(oPrevCtl.control).style.borderBottom='5px groove '+ DNN_HIGHLIGHT_COLOR;}}}
function __dnn_dragComplete()
{
var oCtl=dnn.dom.getById(dnn.dom.positioning.dragCtr.contID);
var sModuleID=oCtl.getAttribute('moduleid');
if(__dnn_oPrevSelPane!=null)
__dnn_oPrevSelPane.pane.style.border=__dnn_oPrevSelPane.origBorder;
if(__dnn_oPrevSelModule!=null)
dnn.dom.getNonTextNode(__dnn_oPrevSelModule.control).style.border=__dnn_oPrevSelModule.origBorder;
var oPane=__dnn_getMostSelectedPane(dnn.dom.positioning.dragCtr);
var iIndex;
if(oPane==null)
{
var oPanes=__dnn_Panes();
for(var i=0;i<oPanes.length;i++)
{
if(oPanes[i].id==oCtl.parentNode.id)
oPane=oPanes[i];}}
if(oPane!=null)
{
iIndex=__dnn_getPaneControlIndex(oCtl,oPane);
__dnn_MoveToPane(oPane,oCtl,iIndex);
dnn.callPostBack('MoveToPane','moduleid='+ sModuleID,'pane='+ oPane.paneName,'order='+ iIndex*2);}}
function __dnn_MoveToPane(oPane,oCtl,iIndex)
{
if(oPane!=null)
{
var aryCtls=new Array();
for(var i=iIndex;i<oPane.controls.length;i++)
{
if(oPane.controls[i].control.id!=oCtl.id)
aryCtls[aryCtls.length]=oPane.controls[i].control;
dnn.dom.removeChild(oPane.controls[i].control);}
dnn.dom.appendChild(oPane.pane,oCtl);
oCtl.style.top=0;
oCtl.style.left=0;
oCtl.style.position='relative';
for(var i=0;i<aryCtls.length;i++)
{
dnn.dom.appendChild(oPane.pane,aryCtls[i]);}
__dnn_RefreshPanes();}
else
{
oCtl.style.top=0;
oCtl.style.left=0;
oCtl.style.position='relative';}}
function __dnn_RefreshPanes()
{
var aryPanes=dnn.getVar('__dnn_Panes').split(';');
var aryPaneNames=dnn.getVar('__dnn_PaneNames').split(';');
__dnn_m_aryPanes=new Array();
for(var i=0;i<aryPanes.length;i++)
{
if(aryPanes[i].length>0)
__dnn_m_aryPanes[__dnn_m_aryPanes.length]=new __dnn_Pane(dnn.dom.getById(aryPanes[i]),aryPaneNames[i]);}}
var __dnn_m_aryPanes;
var __dnn_m_aryModules;
function __dnn_Panes()
{
if(__dnn_m_aryPanes==null)
{
__dnn_m_aryPanes=new Array();
__dnn_RefreshPanes();}
return __dnn_m_aryPanes;}
function __dnn_Modules(sModuleID)
{
if(__dnn_m_aryModules==null)
__dnn_RefreshPanes();
return __dnn_m_aryModules[sModuleID];}
function __dnn_getMostSelectedPane(oContent)
{
var oCDims=new dnn.dom.positioning.dims(oContent);
var iTopScore=0;
var iScore;
var oTopPane;
for(var i=0;i<__dnn_Panes().length;i++)
{
var oPane=__dnn_Panes()[i];
var oPDims=new dnn.dom.positioning.dims(oPane.pane);
iScore=dnn.dom.positioning.elementOverlapScore(oPDims,oCDims);
if(iScore>iTopScore)
{
iTopScore=iScore;
oTopPane=oPane;}}
return oTopPane;}
function __dnn_getPaneControlIndex(oContent,oPane)
{
if(oPane==null)
return;
var oCDims=new dnn.dom.positioning.dims(oContent);
var oCtl;
if(oPane.controls.length==0)
return 0;
for(var i=0;i<oPane.controls.length;i++)
{
oCtl=oPane.controls[i];
var oIDims=new dnn.dom.positioning.dims(oCtl.control);
if(oCDims.t<oIDims.t)
return oCtl.index;}
if(oCtl!=null)
return oCtl.index+1;
else
return 0;}
function __dnn_Pane(ctl,sPaneName)
{
this.pane=ctl;
this.id=ctl.id;
this.controls=new Array();
this.origBorder=ctl.style.border;
this.paneName=sPaneName;
var iIndex=0;
var strModuleOrder='';
for(var i=0;i<ctl.childNodes.length;i++)
{
var oNode=ctl.childNodes[i];
if(dnn.dom.isNonTextNode(oNode))
{
if(__dnn_m_aryModules==null)
__dnn_m_aryModules=new Array();
var sModuleID=oNode.getAttribute('moduleid');
if(sModuleID!=null&&sModuleID.length>0)
{
strModuleOrder +=sModuleID +'~';
this.controls[this.controls.length]=new __dnn_PaneControl(oNode,iIndex);
__dnn_m_aryModules[sModuleID]=oNode.id;
iIndex+=1;}}}
this.moduleOrder=strModuleOrder;}
function __dnn_PaneControl(ctl,iIndex)
{
this.control=ctl;
this.id=ctl.id;
this.index=iIndex;
this.origBorder=ctl.style.border;}
function __dnncore()
{
this.GetUserVal=0;
this.SetUserVal=1;}
__dnncore.prototype={
getUserProp:function(sNameCtr,sKey,pFunc){
this._doUserCallBack(dnncore.GetUserVal,sNameCtr,sKey,null,new dnncore.UserPropArgs(sNameCtr,sKey,pFunc));},
setUserProp:function(sNameCtr,sKey,sVal,pFunc){
this._doUserCallBack(dnncore.SetUserVal,sNameCtr,sKey,sVal,new dnncore.UserPropArgs(sNameCtr,sKey,pFunc));},
_doUserCallBack:function(iType,sNameCtr,sKey,sVal,pFunc){
if(dnn&&dnn.xmlhttp)
{
var sPack=iType + COL_DELIMITER + sNameCtr + COL_DELIMITER + sKey + COL_DELIMITER + sVal;
dnn.xmlhttp.doCallBack('__Page',sPack,dnncore._callBackSuccess,pFunc,dnncore._callBackFail,null,true,null,0);}
else
alert('Client Personalization not enabled');},
_callBackSuccess:function(result,ctx,req){
if(ctx.pFunc)
ctx.pFunc(ctx.namingCtr,ctx.key,result);},
_callBackFail:function(result,ctx){
window.status=result;}}
__dnncore.prototype.UserPropArgs=function(sNameCtr,sKey,pFunc)
{
this.namingCtr=sNameCtr;
this.key=sKey;
this.pFunc=pFunc;}
var dnncore=new __dnncore();         

