// JavaScript Document

// Clears Form Fields

function clearForms()
{
  var i;
  for (i = 0; (i < document.forms.length); i++) {
    document.forms[i].reset();
  }
}
// Newsletter Archive popup window

var newwindow;
function newsPop(url)
{
	newwindow=window.open(url,'name','height=640,width=605,resizable=no,scrollbars=yes,toolbar=no,status=no');
	if (window.focus) {newwindow.focus()}
}



// This popup window automatically resizes to fit the table

function getRefToDivMod( divID, oDoc ) {
	if( !oDoc ) { oDoc = document; }
	if( document.layers ) {
		if( oDoc.layers[divID] ) { return oDoc.layers[divID]; } else {
			for( var x = 0, y; !y && x < oDoc.layers.length; x++ ) {
				y = getRefToDivNest(divID,oDoc.layers[x].document); }
			return y; } }
	if( document.getElementById ) { return oDoc.getElementById(divID); }
	if( document.all ) { return oDoc.all[divID]; }
	return oDoc[divID];
}

function resizeWinTo( idOfDiv ) {
	var oH = getRefToDivMod( idOfDiv ); if( !oH ) { return false; }
	var x = window; x.resizeTo( screen.availWidth, screen.availWidth );
	var oW = oH.clip ? oH.clip.width : oH.offsetWidth;
	var oH = oH.clip ? oH.clip.height : oH.offsetHeight; if( !oH ) { return false; }
	x.resizeTo( oW + 200, oH + 200 );
	var myW = 0, myH = 0, d = x.document.documentElement, b = x.document.body;
	if( x.innerWidth ) { myW = x.innerWidth; myH = x.innerHeight; }
	else if( d && d.clientWidth ) { myW = d.clientWidth; myH = d.clientHeight; }
	else if( b && b.clientWidth ) { myW = b.clientWidth; myH = b.clientHeight; }
	if( window.opera && !document.childNodes ) { myW += 16; }
	//second sample, as the table may have resized
	var oH2 = getRefToDivMod( idOfDiv );
	var oW2 = oH2.clip ? oH2.clip.width : oH2.offsetWidth;
	var oH2 = oH2.clip ? oH2.clip.height : oH2.offsetHeight;
	x.resizeTo( oW2 + ( ( oW + 200 ) - myW ), oH2 + ( (oH + 200 ) - myH ) );
}

/****************************** Scrollable Divs ******************************/
/*LibCrossBrowser*/
/********************************************************************************************
* BlueShoes Framework; This file is part of the php application framework.
* NOTE: This code is stripped (obfuscated). To get the clean documented code goto 
*       www.blueshoes.org and register for the free open source *DEVELOPER* version or 
*       buy the commercial version.
*       
*       In case you've already got the developer version, then this is one of the few 
*       packages/classes that is only available to *PAYING* customers.
*       To get it go to www.blueshoes.org and buy a commercial version.
* 
* @copyright www.blueshoes.org
* @author    sam blum <sam-at-blueshoes-dot-org>
* @author    Andrej Arn <andrej-at-blueshoes-dot-org>
*/
LCB_version = 2.8;_mac=navigator.userAgent.indexOf('Mac')!=-1;_ie512=navigator.userAgent.indexOf('MSIE 5.12')!=-1;_dom = document.all?(document.getElementById?2:1)
:(document.getElementById?4:(document.layers?3:0));_createLayerNo = 0;function initCrossBrowserLib(){
_mac=navigator.userAgent.indexOf('Mac')!=-1;_ie512=navigator.userAgent.indexOf('MSIE 5.12')!=-1;_dom=document.all?(document.getElementById?2:1)
:(document.getElementById?4:(document.layers?3:0));_createLayerNo=0;}
initCrossBrowserLib();function getWindowWidth (){
if(_dom==4 || _dom==3) return window.innerWidth;if(_dom==2 || _dom==1) return document.body.clientWidth;return 0;}
function getWindowHeight(){
if(_dom==4 || _dom==3) return window.innerHeight;if(_dom==2 || _dom==1) return document.body.clientHeight;return 0;}
function getWinXOffset(){
if(_dom==4)            return window.scrollX;if(_dom==2 || _dom==1) return document.body.scrollLeft;if(_dom==3)            return window.pageXOffset;return 0;}
function getWinYOffset(){
if(_dom==4)            return window.scrollY;if(_dom==2 || _dom==1) return document.body.scrollTop;if(_dom==3)            return window.pageYOffset;return 0;}
function getDivFromName(nm){
if(_dom==4 || _dom==2) return document.getElementById(nm);if(_dom==1)            return document.all(nm);if(_dom==3){
var s='';for(var i=1; i<arguments.length; i++) s+='document.layers.'+arguments[i]+'.';return eval(s+'document.layers.'+nm);}
return null;}
function getDivName(div){
if(_dom==4 || _dom==2 || _dom==1) return div.id;if(_dom==3)                       return div.name;return '';}
function createLayer(left,top,width,height,parentDiv){
var s='';if(arguments.length>5){
for(var i=5; i<arguments.length; i++) s+=arguments[i];}
if(_dom==4){
var divName= '_js_layer_'+_createLayerNo; _createLayerNo++;var pDiv   =parentDiv?parentDiv:document.body;var div    =document.createElement('DIV');div.id=divName;div.setAttribute('style',
'position:absolute;left:'+left+';top:'+top
+(width >0?(';width:' +width ):'')
+(height>0?(';height:'+height):'')
+';visibility:hidden');var range=document.createRange();range.selectNodeContents(div);range.collapse(true);var cf=range.createContextualFragment(s);div.appendChild(cf);pDiv.appendChild(div);return div;}
if(_dom==2 || _dom==1){
var adj    =(_mac&&!_ie512)?' ':'';var divName= '_js_layer_'+_createLayerNo; _createLayerNo++;var ha     =(height>0)?(';height:'+height):'';var pDiv   =parentDiv?parentDiv:document.body;pDiv.insertAdjacentHTML('BeforeEnd',
'<div id="'+divName
+'" style="position:absolute;left:'+left+';top:'+top
+(width >0?(';width:' +width ):';width:1')
+(height>0?(';height:'+height):'')
+';visibility:hidden;">'+s+'<\/div>'+adj);return document.all(divName);}
if(_dom==3){
var div=parentDiv?(new Layer(width,parentDiv)):(new Layer(width));if(height>0) div.resizeTo(width,height);div.moveTo(left,top);if(s!=''){
div.document.open('text/html','replace');div.document.write(s);div.document.close();}
return div;}
return null;}
function createExLayer(url,left,top,width,height,parentDiv){
if(_dom==4){
var divName= '_js_layer_'+_createLayerNo; _createLayerNo++;var pDiv   =parentDiv?parentDiv:document.body;var div    =document.createElement('IFRAME');div.id=divName;div.name=divName;div.setAttribute('style',
'position:absolute;left:'+left+';top:'+top
+';width:'+width+(height>0?(';height:'+height):'')
+';visibility:hidden');div.setAttribute('src',url);div.setAttribute('frameborder',0);div.setAttribute('scrolling','no');pDiv.appendChild(div);return div;}
if(_dom==2 || _dom==1){
var adj=(_mac&&_ie512)?' ':'';var bd, divName='_js_layer_'+_createLayerNo;_createLayerNo++;var ha=(height>0)?(';height:'+height):'';if(arguments.length>5 && parentDiv)
bd=parentDiv;else bd=document.body;bd.insertAdjacentHTML('BeforeEnd',
'<div id="'+divName
+'" style="position:absolute;left:'+left+';top:'+top
+';width:'+width+ha+';visibility:hidden;">'
+'<iframe src="'+url+'" name="'+divName+'_if" '
+'width='+width+' height='+height
+'marginwidth=0 marginheight=0 '
+'scrolling="no" frameborder="no">'
+'<\/iframe>'
+'<\/div>'+adj);return document.all(divName);}
if(_dom==3){
var div=parentDiv?(new Layer(width,parentDiv)):(new Layer(width));if(height>0) div.resizeTo(width,height);div.moveTo(left,top);div.load(url,width);return div;}
return null;}
function getDivImage(div,imgName){
if(_dom==4)            return document.images[imgName];if(_dom==2 || _dom==1) return document.images(imgName);if(_dom==3)            return div.document.images[imgName];return null;}
function getDivForm(div,frmName){
if(_dom==4)            return document.forms[frmName];if(_dom==2 || _dom==1) return document.forms(frmName);if(_dom==3)            return div.document.forms[frmName];return null;}
function initDivPos(div){
if(_dom==4){
div.style.left=div.offsetLeft+'px';div.style.top =div.offsetTop +'px';}
else if(_dom==2 || _dom==1){
div.style.pixelLeft=div.offsetLeft;div.style.pixelTop =div.offsetTop;}
return div;}
function getDivLeft(div){
if(_dom==4 || _dom==2) return div.offsetLeft;if(_dom==1)            return div.style.pixelLeft;if(_dom==3)            return div.left;return 0;}
function getDivTop(div){
if(_dom==4 || _dom==2) return div.offsetTop;if(_dom==1)            return div.style.pixelTop;if(_dom==3)            return div.top;return 0;}
function moveDivTo(div,left,top){
if(_dom==4){
div.style.left=left+'px';div.style.top =top +'px';return;}
if(_dom==2 || _dom==1){
div.style.pixelLeft=left;div.style.pixelTop =top;return;}
if(_dom==3){
div.moveTo(left,top);return;}
}
function moveDivBy(div,left,top){
if(_dom==4){
div.style.left=div.offsetLeft+left;div.style.top =div.offsetTop +top;return;}
if(_dom==2){
div.style.pixelLeft=div.offsetLeft+left;div.style.pixelTop =div.offsetTop +top;return;}
if(_dom==1){
div.style.pixelLeft+=left;div.style.pixelTop +=top;return;}
if(_dom==3){
div.moveBy(left,top);return;}
}
function scrollExlHItTo(exdiv,x){
if(_dom==4){
frames[exdiv.id].scrollTo(x,frames[exdiv.id].scrollY);return;}
if(_dom==2 || _dom==1){
frames(exdiv.id+'_if').scrollTo(x,frames(exdiv.id+'_if').document.body.scrollTop);return;}
if(_dom==3){
var dx=x-exdiv.clip.left, ch=exdiv.clip.width;exdiv.left-=dx;exdiv.clip.left=x; exdiv.clip.width=ch;return;}
return;}
function scrollExlVItTo(exdiv,y){
if(_dom==4){
frames[exdiv.id].scrollTo(frames[exdiv.id].scrollX,y);return;}
if(_dom==2 || _dom==1){
frames(exdiv.id+'_if').scrollTo(frames(exdiv.id+'_if').document.body.scrollLeft,y);return;}
if(_dom==3){
var dy=y-exdiv.clip.top, ch=exdiv.clip.height;exdiv.top-=dy;exdiv.clip.top=y; exdiv.clip.height=ch;return;}
return;}
function initDivSize(div){
if(_dom==4){
div.style.width =div.offsetWidth +'px';div.style.height=div.offsetHeight+'px';}
else if(_dom==2 || _dom==1){
div.style.pixelWidth =div.offsetWidth;div.style.pixelHeight=div.offsetHeight;}
return div;}
function getDivWidth (div){
if(_dom==4 || _dom==2) return div.offsetWidth;if(_dom==1)            return div.style.pixelWidth;if(_dom==3)            return div.clip.width;return 0;}
function getDivHeight(div){
if(_dom==4 || _dom==2) return div.offsetHeight;if(_dom==1)            return div.style.pixelHeight;if(_dom==3)            return div.clip.height;return 0;}
function resizeDivTo(div,width,height){
if(_dom==4){
div.style.width =width +'px';div.style.height=height+'px';return;}
if(_dom==2 || _dom==1){
div.style.pixelWidth =width;div.style.pixelHeight=height;return;}
if(_dom==3){
div.resizeTo(width,height);return;}
}
function resizeDivBy(div,width,height){
if(_dom==4){
div.style.width =(div.offsetWidth +width )+'px';div.style.height=(div.offsetHeight+height)+'px';return;}
if(_dom==2){
div.style.pixelWidth =div.offsetWidth +width;div.style.pixelHeight=div.offsetHeight+height;return;}
if(_dom==1){
div.style.pixelWidth +=width;div.style.pixelHeight+=height;return;}
if(_dom==3){
div.resizeBy(width,height);return;}
}
function getExlWidth (exdiv){
if(_dom==4)
return exdiv.contentDocument.body.offsetWidth;if(_dom==2 || _dom==1)
return _mac?frames(exdiv.id+'_if').document.body.offsetWidth
:frames(exdiv.id+'_if').document.body.scrollWidth;if(_dom==3)
return exdiv.document.width;return 0;}
function getExlHeight(exdiv){
if(_dom==4)
return exdiv.contentDocument.body.offsetHeight;if(_dom==2 || _dom==1)
return _mac?frames(exdiv.id+'_if').document.body.offsetHeight
:frames(exdiv.id+'_if').document.body.scrollHeight;if(_dom==3)
return exdiv.document.height;return 0;}
function setDivVisibility(div,visible){
if(_dom==4 || _dom==2 || _dom==1){
div.style.visibility=(visible)?'inherit':'hidden';return;}
if(_dom==3){
div.visibility      =(visible)?'inherit':'hide';return;}
}
function setDivVisibilities(divs,visible){
if(_dom==4 || _dom==2 || _dom==1){
for(var i=0; i<divs.length; i++)
divs[i].style.visibility=(visible)?'inherit':'hidden';}
if(_dom==3){
for(var i=0; i<divs.length; i++)
divs[i].visibility      =(visible)?'inherit':'hide';}
return divs;}
function setDivClip(div,top,right,bottom,left){
if(_dom==4 || _dom==2 || _dom==1){
div.style.clip='rect('+top+'px '+right+'px '+bottom+'px '+left+'px)';return;}
if(_dom==3){
div.clip.top   =top;   div.clip.right=right;div.clip.bottom=bottom;div.clip.left =left;return;}
}
function writeDivHTML(div,op,cl){
var s='';for(var i=3; i<arguments.length; i++) s+=arguments[i];if(_dom==4){
if(op){ while(div.hasChildNodes()) div.removeChild(div.lastChild); }
var range=document.createRange();range.selectNodeContents(div);range.collapse(true);var cf=range.createContextualFragment(s);div.appendChild(cf);return;}
if(_dom==2 || _dom==1){
if(op)   div.innerHTML='';if(_mac&&!_ie512) div.innerHTML+=s;else     div.insertAdjacentHTML('BeforeEnd',s);return;}
if(_dom==3){
if(op) div.document.open('text/html','replace');div.document.write(s);if(cl) div.document.close();return;}
}
function setDivBackgroundColor(div,color){
if(color==null) color='transparent';if(_dom==3) div.bgColor=color;else        div.style.backgroundColor=color;}
function setDivBackgroundImage(div,url){
if(_dom==3) div.background.src=url?url:null;else        div.style.backgroundImage=url?('url('+url+')'):'none';}
function setDivZIndex(div,order){
if(_dom==4 || _dom==2 || _dom==1){
div.style.zIndex=order;return;}
if(_dom==3){
div.zIndex      =order;return;}
}
function setDivStyleAttribute(div,nm,value){
if(_dom!=0 && _dom!=3) eval('div.style.'+nm+'=value');return div;}
function changeExlURL(exdiv,url){
if(_dom==4){
exdiv.setAttribute('src',url);return;}
if(_dom==2 || _dom==1){
    frames(exdiv.id+'_if').location.replace(url);
return;}
if(_dom==3){
exdiv.load(url,exdiv.clip.width);return;}
return;}
function getLeftFromEvent(e){
if(_dom==4)          return e.clientX+window.scrollX;if(_dom==2||_dom==1) return document.body.scrollLeft+window.event.clientX;if(_dom==3)          return e.pageX;return 0;}
function getTopFromEvent(e){
if(_dom==4)          return e.clientY+window.scrollY;if(_dom==2||_dom==1) return document.body.scrollTop+window.event.clientY;if(_dom==3)          return e.pageY;return 0;}

/*EventHandler*/

/********************************************************************************************
* BlueShoes Framework; This file is part of the php application framework.
* NOTE: This code is stripped (obfuscated). To get the clean documented code goto 
*       www.blueshoes.org and register for the free open source *DEVELOPER* version or 
*       buy the commercial version.
*       
*       In case you've already got the developer version, then this is one of the few 
*       packages/classes that is only available to *PAYING* customers.
*       To get it go to www.blueshoes.org and buy a commercial version.
* 
* @copyright www.blueshoes.org
* @author    sam blum <sam-at-blueshoes-dot-org>
* @author    Andrej Arn <andrej-at-blueshoes-dot-org>
*/
_grabObj = null;function EventCtrl(div){
this.div   = div;this.type  = ''; this.mask  = 0;this.pageX = 0;  this.pageY = 0;}
EventCtrl.prototype.linkCtrl = function(obj){
if(obj && !obj.eventCtrl) obj.eventCtrl=this;return this;}
EventCtrl.prototype.setThreshold = function(threshold){
this.threshold = threshold;return this;}
function getCtrlFromElementIE(el,tagName){
for(;el;el=el.parentElement)
if((tagName==null || el.tagName==tagName) && el.eventCtrl)
return el.eventCtrl;return null;}
function getCtrlFromEventIE(e,tagName){
var ctrl=_grabObj;var event=window.event;var fromCtrl, toCtrl;if (ctrl==null){
var mask=0, type=event.type;switch(type){
case 'mouseover':
fromCtrl = getCtrlFromElementIE(event.fromElement,tagName);toCtrl   = getCtrlFromElementIE(event.toElement,  tagName);if(fromCtrl!=toCtrl) ctrl=toCtrl;if(!ctrl || (ctrl.mask&1)==0) ctrl=null;break;case 'mouseout':
fromCtrl = getCtrlFromElementIE(event.fromElement,tagName);toCtrl   = getCtrlFromElementIE(event.toElement,  tagName);if(fromCtrl!=toCtrl) ctrl=fromCtrl;if(!ctrl || (ctrl.mask&1)==0) ctrl=null;break;case 'mousedown':
case 'mousemove':
case 'mouseup':
ctrl = getCtrlFromElementIE(event.srcElement,tagName);if(ctrl && (ctrl.mask&2)!=0) break;default: ctrl=null; break;}
}
if(ctrl){
ctrl.pageX = document.body.scrollLeft+event.clientX;ctrl.pageY = document.body.scrollTop +event.clientY;ctrl.type  = event.type;}
return ctrl;}
function getCtrlFromEventNN4(e,tagName){
var ctrl=_grabObj;if(ctrl==null) ctrl=e.target.eventCtrl;if(ctrl){
var mask=0;switch(e.type){
case 'mouseover': case 'mouseout':
mask|=1; break;case 'mousedown': case 'mousemove': case 'mouseup':
mask|=2; break;}
if((ctrl.mask&mask)!=0){
ctrl.pageX = e.pageX; ctrl.pageY = e.pageY;ctrl.type  = e.type;} else ctrl=null;}
return ctrl;}
function getCtrlFromEventMz(e,tagName){
var ctrl=_grabObj;if(ctrl==null){
for(var t=e.target; t!=null; t=t.parentNode){
if((  tagName==null
||(t.nodeType==Node.ELEMENT_NODE && t.tagName==tagName))
&& ('undefined' != typeof(t.eventCtrl)) ){
ctrl=t.eventCtrl;break;}
}
}
if(ctrl){
ctrl.pageX = e.clientX+window.scrollX;ctrl.pageY = e.clientY+window.scrollY;ctrl.type  = e.type;}
return ctrl;}
function getCtrlFromEventNop(e,tagName){ return null; }
getCtrlFromEvent=(_dom==1||_dom==2)?getCtrlFromEventIE:
(_dom==3?getCtrlFromEventNN4:
(_dom==4?getCtrlFromEventMz:
getCtrlFromEventNop));function ech_mouseover(e){
var ctrl = getCtrlFromEvent(e,null);if(ctrl && ctrl.mouseover && !ctrl.mouseoverState){
ctrl.mouseoverState = true;if(ctrl.mouseover) ctrl.mouseover(ctrl,ctrl.mouseoverClient);}
}
function ech_mouseout(e){
var ctrl = getCtrlFromEvent(e,null);if(ctrl && ctrl.mouseover && ctrl.mouseoverState){
ctrl.mouseoverState = false;if(ctrl.mouseout) ctrl.mouseout(ctrl,ctrl.mouseoutClient);}
}
function ech_mousedown(e){
var ctrl = getCtrlFromEvent(e,null);if(ctrl && !ctrl.dragging){
_grabObj = ctrl; ctrl.dragging=true; ctrl.dragged = false;ctrl.startX = ctrl.curX = ctrl.pageX;ctrl.startY = ctrl.curY = ctrl.pageY;if(ctrl.mousedown) ctrl.mousedown(ctrl,ctrl.mousedownClient);return false;}
return true;}
function ech_mousemove(e){
var ctrl = getCtrlFromEvent(e,null);if(ctrl && ctrl.dragging){
if(ctrl.curX!=ctrl.pageX || ctrl.curY!=ctrl.pageY){
if(Math.abs(ctrl.pageX-ctrl.startX)>ctrl.threshold || Math.abs(ctrl.pageY-ctrl.startY)>ctrl.threshold)
ctrl.dragged = true;if(ctrl.mousemove) ctrl.mousemove(ctrl,ctrl.mousemoveClient);ctrl.curX = ctrl.pageX; ctrl.curY = ctrl.pageY;}
return false;}
return true;}
function ech_mouseup(e){
var ctrl = getCtrlFromEvent(e,null);if(ctrl && ctrl.dragging){
_grabObj = null; ctrl.dragging = false;if(ctrl.mouseup) ctrl.mouseup(ctrl,ctrl.mouseupClient);if(!ctrl.dragged && ctrl.mouseclick)
ctrl.mouseclick(ctrl,ctrl.mouseclickClient);ctrl.curX = ctrl.pageX; ctrl.curY = ctrl.pageY;return false;}
return true;}
function ech_attachMouseOverOut(div,ovrf,ovrc,outf,outc){
if(!div.eventCtrl) div.eventCtrl = new EventCtrl(div);var ctrl = div.eventCtrl;ctrl.mouseoverState = false;ctrl.mouseover  = ovrf; ctrl.mouseoverClient = ovrc;ctrl.mouseout   = outf; ctrl.mouseoutClient  = outc;div.onmouseover = ech_mouseover;div.onmouseout  = ech_mouseout;ctrl.mask|=1;return ctrl;}
function ech_detachMouseOverOut(div){
var ctrl = div.eventCtrl;if(ctrl){
ctrl.div.onmouseover = null;ctrl.div.onmouseout  = null;ctrl.mask=~1;}
}
function ech_attachMouseDrag(div,dwnf,dwnc,movf,movc,upf,upc,clkf,clkc){
var doc;if(_dom==1||_dom==2){
doc = div;doc.onmousedown      = ech_mousedown;document.onmousemove = ech_mousemove;document.onmouseup   = ech_mouseup;} else if(_dom==3){
doc = div.document;doc.onmousedown = ech_mousedown;doc.onmousemove = ech_mousemove;doc.onmouseup   = ech_mouseup;doc.captureEvents(Event.MOUSEDOWN|Event.MOUSEMOVE|Event.MOUSEUP);} else if(_dom==4){
doc = div;div.onmousedown           = ech_mousedown;document.body.onmousemove = ech_mousemove;document.body.onmouseup   = ech_mouseup;} else return null;if(!doc.eventCtrl) doc.eventCtrl = new EventCtrl(div);var ctrl=doc.eventCtrl;ctrl.dragging  = false; ctrl.dragged   = false;ctrl.startX    = 0;     ctrl.startY    = 0;ctrl.curX      = 0;     ctrl.curY      = 0;ctrl.mousedown = dwnf; ctrl.mousedownClient = dwnc;ctrl.mousemove = movf; ctrl.mousemoveClient = movc;ctrl.mouseup   = upf;  ctrl.mouseupClient   = upc;ctrl.mouseclick= clkf; ctrl.mouseclickClient= clkc;ctrl.threshold = 5;ctrl.mask|=2;return ctrl;}
function ech_detachMouseDrag(div){
var ctrl = null;if(_dom==1||_dom==2){
ctrl=div.eventCtrl;if(ctrl) ctrl.div.onmousedown=null;} else if(_dom==3){
ctrl = div.document.eventCtrl;if(ctrl){
var doc = ctrl.div.document;doc.releaseEvents(Event.MOUSEDOWN|Event.MOUSEMOVE|Event.MOUSEUP);doc.onmousedown = null;doc.onmousemove = null;doc.onmouseup   = null;}
} else if(_dom==4){
ctrl = div.eventCtrl;if(ctrl) ctrl.div.onmousedown=null;}
if(ctrl) ctrl.mask&=~2;}

/*Bs_FormUtil.lib.js*/

/********************************************************************************************
* BlueShoes Framework; This file is part of the php application framework.
* NOTE: This code is stripped (obfuscated). To get the clean documented code goto 
*       www.blueshoes.org and register for the free open source *DEVELOPER* version or 
*       buy the commercial version.
*       
*       In case you've already got the developer version, then this is one of the few 
*       packages/classes that is only available to *PAYING* customers.
*       To get it go to www.blueshoes.org and buy a commercial version.
* 
* @copyright www.blueshoes.org
* @author    sam blum <sam-at-blueshoes-dot-org>
* @author    Andrej Arn <andrej-at-blueshoes-dot-org>
*/
function bsFormGetFormForField(fieldElm) {
if (document.forms.length == 1) return document.forms[0];if (fieldElm.tagName == 'form') return fieldElm;if (fieldElm.parentNode) return bsFormGetFormForField(fieldElm.parentNode);return false;}
function bsFormGetNextField(fieldElm) {
var formElm = bsFormGetFormForField(fieldElm);if (!formElm) return false;var useNext = false;for (var i=0; i<formElm.elements.length; i++) {
if (useNext) return formElm.elements[i];if (formElm.elements[i] == fieldElm) useNext = true;}
return false;}
function bsFormToggleCheckbox(formName, fieldName) {
try {
if (document.forms[formName].elements[fieldName].checked) {
document.forms[formName].elements[fieldName].checked = false;} else {
document.forms[formName].elements[fieldName].checked = true;}
} catch (e) {
}
}
function bsFormToggleContainer(containerName) {
if (document.getElementById) {
var elm = document.getElementById(containerName);if (typeof(elm) != 'undefined') {
elm.style.display = (elm.style.display == 'none') ? 'block' : 'none';var img = document.getElementById('contToggleImg' + containerName.substr(9));if (typeof(img) != 'undefined') {
if (elm.style.display == 'none') {
img.src = img.src.substr(0, img.src.length -6) + 'down.gif';} else {
img.src = img.src.substr(0, img.src.length -8) + 'up.gif';}
}
var txtO = document.getElementById('contToggleTextO' + containerName.substr(9));var txtC = document.getElementById('contToggleTextC' + containerName.substr(9));if (typeof(txtO) != 'undefined') {
if (elm.style.display == 'none') {
txtO.style.display = 'inline';txtC.style.display = 'none';} else {
txtO.style.display = 'none';txtC.style.display = 'inline';}
}
return;}
}
if (document.all) {
if (document.all[containerName].style.display == "none") {
document.all[containerName].style.display = "block";} else {
document.all[containerName].style.display = "none";}
}
}
function bsFormCheckOnlyIf(formName, fieldName, fieldElement) {
if (typeof(bsFormVars) == 'undefined') return;if (typeof(bsFormVars[formName]) == 'undefined') return;for (var otherFieldName in bsFormVars[formName]) {
if (typeof(bsFormVars[formName][otherFieldName]['onlyIf']) == 'undefined') continue;var status = _bsForm_anyIfCase(bsFormVars[formName][otherFieldName]['onlyIf']);var elm = document.getElementById(otherFieldName);if ((typeof(elm) != 'undefined') && (elm != null)) {
if (!status) {
elm.disabled = true;} else {
elm.disabled = false;}
}
}
}
function bsFormGetFieldValue(elementID) {
var elm  = document.getElementById(elementID);if ((typeof(elm) == 'undefined') || (elm == null) || (elm.id != elementID)) {
var elm  = document.getElementById(elementID + '0');var elm2 = document[elm.form.name][elm.name];elm = elm2;} else {
var elm2 = document[elm.form.name][elm.name];}
for (var i=0; i<elm2.length; i++) {
if (elm2[i].checked) return elm2[i].value;}
return elm.value;}
function _bsForm_anyIfCase(myIf) {
if ((typeof(myIf) == 'object') && (myIf.length > 0)) {
var stack = new Array();for (i=0; i<myIf.length; i++) {
stack[i] = new Array();stack[i]['operator'] = (typeof(myIf[i]['operator']) != 'undefined') ? myIf[i]['operator'] : '|';stack[i]['compare']  = (typeof(myIf[i]['compare'])  != 'undefined') ? myIf[i]['compare']  : '=';stack[i]['boolean']  = false;do {
if (typeof(myIf[i]['value']) != 'undefined') {
var t = bsFormGetFieldValue(myIf[i]['field']);if (typeof(t) != null) {
switch (stack[i]['compare']) {
case '=':
stack[i]['boolean'] = (t == myIf[i]['value']);break;case '>':
stack[i]['boolean'] = (t > myIf[i]['value']);break;case '<':
stack[i]['boolean'] = (t < myIf[i]['value']);break;case '>=':
stack[i]['boolean'] = (t >= myIf[i]['value']);break;case '<=':
stack[i]['boolean'] = (t <= myIf[i]['value']);break;case '!=':
case '<>':
stack[i]['boolean'] = (t != myIf[i]['value']);break;default:
}
break;}
} else {
break;}
} while (false);}
if ((typeof(stack) == 'object') && (stack.length > 0)) {
var evalStr = '';for (var i=0; i<stack.length; i++) {
if (i > 0) evalStr += (stack[i]['operator'] == '&') ? '&& ' : '|| ';evalStr += (stack[i]['boolean']) ? 'true ' : 'false ';}
evalStr = ' (' + evalStr + ');';if (eval(evalStr)) {
return true;}
}
}
return false;}
function bsFormCheckMail(url, fieldObj, checkType) {
var fieldName = fieldObj.name;var fieldID   = fieldObj.id;var email     = fieldObj.value;var iFrameObj = document.getElementById('bsMailCheck' + fieldName);url += "?email=" + email + "&checkType=" + checkType;var zeit = new Date();url += "&random=" + zeit.getMilliseconds();iFrameObj.src = url;}
function bsFormJumpToFirstError(fieldName, formName, doSelect) {
try {
if (document.forms[formName].elements[fieldName]) {
if (doSelect && (document.forms[formName].elements[fieldName].value != '')) {
if (document.forms[formName].elements[fieldName].select) {
document.forms[formName].elements[fieldName].select();}
}
if (document.forms[formName].elements[fieldName].focus) {
document.forms[formName].elements[fieldName].focus();}
}
} catch (e) {
}
}
function bsFormEnterSubmit(ev, myForm) {
var ev = ('object' == typeof(window.event)) ? window.event : ev;if (ev && ev.keyCode == 13) {
myForm.submit();}
return true;}
function bsFormNoEnter(ev) {
var ev = ('object' == typeof(window.event)) ? window.event : ev;if (ev) return (ev.keyCode != 13);return true;}
function bsFormEnterToTab(ev) {
ev = ('object' == typeof(window.event)) ? window.event : ev;if ((ev && (ev.keyCode == 13)) || (ev.which && (ev.which == 13))) {
if ((typeof(ie) == 'undefined') || ie) {
ev.keyCode = 9;} else {
var nextField = bsFormGetNextField(ev.srcElement);if (nextField) {
try {
nextField.focus();} catch (e) {
}
}
return false;}
}
return true;}
function bsFormHandleEnter(ev, functionName) {
var ev = ('object' == typeof(window.event)) ? window.event : ev;if (ev && ev.keyCode == 13) {
return eval(functionName + '();');}
return true;}
function bsFormFieldSetFocusAndSelect(field, force) {
if (typeof(field) == 'string') {
field = document.getElementById(field);}
if (!field) return false;try {
if (force || !field.hasFocus) {
field.focus();field.select();}
} catch (e) {
return false;}
return true;}
function rc4encryptFormValues(formName, passPhraze) {
for(var i=0;i<document[formName].length;++i) {
var elm = document[formName].elements[i];if (typeof(elm.name) == 'undefined') continue;if (elm.name.substr(0, 8) == 'bs_form[') continue;if ((typeof(elm.value) != 'undefined') && (typeof(elm.value) != 'object') && (elm.value != '')) {
switch (elm.type) {
case 'text':
case 'password':
case 'hidden':
elm.value = '_crp_' + base64_encode(rc4crypt(passPhraze, elm.value));break;}
}
}
}
function flowerPower1(formName, passPhraze) {
rc4encryptFormValues(formName, passPhraze);}
function rc4decryptFormValues(formName, passPhraze) {
for(var i=0;i<document[formName].length;++i) {
var elm = document[formName].elements[i];if ((typeof(elm.value) != 'undefined') && (elm.value != '') && (elm.value.substr(0, 5) == '_crp_')) {
elm.value = rc4crypt(passPhraze, base64_decode(elm.value.substr(5)));}
}
}
function flowerPower2(formName, passPhraze) {
rc4decryptFormValues(formName, passPhraze);}
function bsFormDoHiddenSubmit(exitScreen, exitAction, nextScreen, nextAction, dataHash, submitToAction) {
var formOutArray =  new Array();var ii=0;formOutArray[ii++] = '<form name="smSubmitForm" action="' + submitToAction + '" method="post">';formOutArray[ii++] = '<input type="hidden" name="bs_todo[nextScreen]" value="' + nextScreen + '">';formOutArray[ii++] = '<input type="hidden" name="bs_todo[exitScreen]" value="' + exitScreen + '">';switch (typeof(nextAction)) {
case 'string':
formOutArray[ii++] = '<input type="hidden" name="bs_todo[nextAction]" value="' + nextAction + '">';break;case 'object':
for (var key in nextAction) {
formOutArray[ii++] = '<input type="hidden" name="bs_todo[nextAction][' + key + ']" value="' + nextAction[key] + '">';}
default:
}
switch (typeof(exitAction)) {
case 'string':
formOutArray[ii++] = '<input type="hidden" name="bs_todo[exitAction]" value="' + exitAction + '">';break;case 'object':
for (var key in exitAction) {
formOutArray[ii++] = '<input type="hidden" name="bs_todo[exitAction][' + key + ']" value="' + exitAction[key] + '">';}
default:
}
dataHash = _recursiveObj2Hash(dataHash);for (var matrixStr in dataHash) {
if (typeof(dataHash[matrixStr]) == 'function') continue;var valStr = bs_filterForHtml(dataHash[matrixStr] + '');formOutArray[ii++] = '<input type="hidden" name="' + "bs_todo[dataHash]" + matrixStr + '" value="' + valStr +  '">';}
formOutArray[ii++] = '</form>';var body = document.getElementsByTagName('body').item(0);body.innerHTML = formOutArray.join('');var form = document.smSubmitForm;form.submit();}
function _recursiveObj2Hash(aObject, matrixStr, flatObjHash) {
if (!flatObjHash) {
flatObjHash = new Object();matrixStr = '';}
if (typeof(aObject) != 'object') {
flatObjHash[matrixStr] = aObject;} else {
for (var key in aObject) {
var newMatrixStr = matrixStr + '['+key+']';_recursiveObj2Hash(aObject[key], newMatrixStr, flatObjHash);}
}
return flatObjHash;}

/* Bs_Slider.class.js */

/********************************************************************************************
* BlueShoes Framework; This file is part of the php application framework.
* NOTE: This code is stripped (obfuscated). To get the clean documented code goto 
*       www.blueshoes.org and register for the free open source *DEVELOPER* version or 
*       buy the commercial version.
*       
*       In case you've already got the developer version, then this is one of the few 
*       packages/classes that is only available to *PAYING* customers.
*       To get it go to www.blueshoes.org and buy a commercial version.
* 
* @copyright www.blueshoes.org
* @author    sam blum <sam-at-blueshoes-dot-org>
* @author    Andrej Arn <andrej-at-blueshoes-dot-org>
*/
if (!Bs_Objects) {var Bs_Objects = [];};function Bs_Slider(theFieldnamePrefix) {
this._objectId;this.fieldName;this.fieldName2;this._disabled = false;this.direction       = 0;this.width           = 100;this.height          = 20;this.minVal          = 0;this.maxVal          = 100;this.valueDefault      = 0;this.arrowAmount     = 1;this.arrowMouseOver = false;this.arrowKeepFiringTimeout = 10;this._stopFireArrowFlag = false;this.wheelAmount = 5;this.colorbar;this.colorbar2;this.baseZindex      = 1000;this.moveX = 0;this.moveY = 0;this.imgBasePath;this.imgDir  = '/_bsJavascript/components/slider/img/';this._bgImgSrc;this._bgImgRepeat;this._bgImgCssStyle;this._bgImgLeftSrc;this._bgImgLeftWidth;this._bgImgLeftHeight;this._bgImgRightSrc;this._bgImgRightWidth;this._bgImgRightHeight;this._sliderImgSrc;this._sliderImgWidth;this._sliderImgHeight;this.styleContainerClass;this.styleValueFieldClass  = 'smalltxt spanSliderField';this.styleValueFieldClass2 = 'smalltxt spanSliderField';this.styleValueTextClass  = 'smalltxt spanSliderText';this.styleValueTextClass2 = 'smalltxt spanSliderText';this.bgColor;this._arrowIconLeftSrc;this._arrowIconLeftWidth   = 0;this._arrowIconLeftHeight  = 0;this._arrowIconLeftCssStyle  = 0;this._arrowIconRightSrc;this._arrowIconRightWidth  = 0;this._arrowIconRightHeight = 0;this._arrowIconRightCssStyle  = 0;this.valueInterval   = 1;this.valueInterval2  = 1;this.useInputField  = 2;this.useInputField2 = 2;this.inputTextFieldEvent = 'over';this.useSecondKnob;this.preventValueCrossing;this.ctrl;this.ctrl2;this._valueInternal;this._valueInternal2;this._display         = 2;this._arrowLeftContainerId;this._arrowLeftContainerObj;this._arrowLeftIconId;this._arrowLeftIconObj;this._arrowRightContainerId;this._arrowRightContainerObj;this._arrowRightIconId;this._arrowRightIconObj;this._valueContainerId;this._valueContainerObj;this._handleId;this._handleObj;this._valueFieldId;this._valueFieldObj;this._valueFieldObj2;this._valueTextId;this._valueTextObj;this._valueTextObj2;this._slideBarId;this._slideBarObj;this._colorbarId;this._colorbarObj;this._colorbarObj2;this._posUpperLeftX;this._posUpperLeftY;this._posSlideStart;this._posSlideEnd;this._slideWidth;this._attachedEvents;this.eventOnChange;this.slideStartCB;this.slideMoveCB;this.slideEndCB;this._constructor = function(theFieldnamePrefix) {
this._id = Bs_Objects.length;Bs_Objects[this._id] = this;this._objectId = "Bs_Slider_"+this._id;this.objectName = this._objectId;if (typeof(theFieldnamePrefix) == 'string') {
this.fieldName  = theFieldnamePrefix + '_value';this.fieldName2 = theFieldnamePrefix + '2_value';this.objectName = theFieldnamePrefix;}
}
this._checkup = function() {
if (typeof(this.minVal)     == 'undefined') this.minVal     = 0;if (typeof(this.maxVal)     == 'undefined') this.maxVal     = 10;if (typeof(this.valueDefault) == 'undefined') this.valueDefault = this.minVal;this._valueInternal = this.valueDefault;if (this.useSecondKnob) {
if (typeof(this.minVal2)     == 'undefined') this.minVal2     = 0;if (typeof(this.maxVal2)     == 'undefined') this.maxVal2     = 10;if (typeof(this.valueDefault2) == 'undefined') this.valueDefault2 = this.maxVal2;this._valueInternal2 = this.valueDefault2;}
if (typeof(this.imgBasePath) == 'string')  this.imgDir = this.imgBasePath;}
this.loadSkin = function(skinName) {
switch (skinName) {
case 'winxp':
case 'winxp-scrollbar-horizontal':
this.useInputField = 0;this.height        = 16;this.imgDir        = '/_bsJavascript/components/slider/img/winxp/';this.setSliderIcon('horizontal_scrollbar_knob.gif', 17, 16);this.setArrowIconLeft('horizontal_scrollbar_arrowLeft.gif', 17, 16);this.setArrowIconRight('horizontal_scrollbar_arrowRight.gif', 17, 16);break;case 'winxp-scrollbar-vertical':
this.direction     = 1;this.useInputField = 0;this.width         = 16;this.imgDir        = '/_bsJavascript/components/slider/img/winxp/';this.setSliderIcon('vertical_scrollbar_knob.gif', 16, 17);this.setArrowIconLeft('vertical_scrollbar_arrowUp.gif', 16, 17);this.setArrowIconRight('vertical_scrollbar_arrowDown.gif', 16, 17);break;case 'osx':
case 'osx-horizontal':
this.useInputField = 0;this.height        = 21;this.imgDir        = '/_bsJavascript/components/slider/img/osx/';this.setSliderIcon('horizontal_knob.gif', 17, 16);this.setBackgroundImage('horizontal_background.gif', 'repeat');this.setBackgroundImageLeft('horizontal_backgroundLeft.gif', 6, 21);this.setBackgroundImageRight('horizontal_backgroundRight.gif', 6, 21);break;case 'osx-scrollbar-horizontal':
this.useInputField = 0;this.height        = 15;this.imgDir        = '/_bsJavascript/components/slider/img/osx/';this.setSliderIcon('horizontal_scrollbar_knobSmall.gif', 23, 15);this.setBackgroundImage('horizontal_scrollbar_background.gif', 'repeat');this.setArrowIconLeft('horizontal_scrollbar_arrowLeft.gif', 17, 15);this.setArrowIconRight('horizontal_scrollbar_arrowRight.gif', 17, 15);break;case 'osx-scrollbar-vertical':
this.direction     = 1;this.useInputField = 0;this.width         = 15;this.imgDir        = '/_bsJavascript/components/slider/img/osx/';this.setSliderIcon('vertical_scrollbar_knobSmall.gif', 15, 23);this.setBackgroundImage('vertical_scrollbar_background.gif', 'repeat');this.setArrowIconLeft('vertical_scrollbar_arrowUp.gif', 15, 17);this.setArrowIconRight('vertical_scrollbar_arrowDown.gif', 15, 17);break;case 'os9':
case 'os9-horizontal':
this.useInputField = 0;this.height        = 16;this.imgDir        = '/_bsJavascript/components/slider/img/os9/';this.setSliderIcon('horizontal_scrollbar_knob.gif', 17, 16);this.setBackgroundImage('horizontal_scrollbar_background.gif', 'repeat');this.setArrowIconLeft('horizontal_scrollbar_arrowLeft.gif', 16, 16);this.setArrowIconRight('horizontal_scrollbar_arrowRight.gif', 16, 16);break;case 'os9-vertical':
this.direction     = 1;this.useInputField = 0;this.width         = 16;this.imgDir        = '/_bsJavascript/components/slider/img/os9/';this.setSliderIcon('vertical_scrollbar_knob.gif', 16, 17);this.setBackgroundImage('vertical_scrollbar_background.gif', 'repeat');this.setArrowIconLeft('vertical_scrollbar_arrowUp.gif', 16, 16);this.setArrowIconRight('vertical_scrollbar_arrowDown.gif', 16, 16);break;case 'opera7':
case 'opera7-horizontal':
this.useInputField = 0;this.height        = 16;this.imgDir        = '/_bsJavascript/components/slider/img/opera7/';this.setSliderIcon('horizontal_knob.gif', 19, 16);this.setBackgroundImage('horizontal_background.gif', 'repeat');this.setArrowIconLeft('horizontal_arrowLeft.gif', 16, 16);this.setArrowIconRight('horizontal_arrowRight.gif', 16, 16);break;case 'opera7-vertical':
this.direction     = 1;this.useInputField = 0;this.width         = 16;this.imgDir        = '/_bsJavascript/components/slider/img/opera7/';this.setSliderIcon('vertical_knob.gif', 16, 19);this.setBackgroundImage('vertical_background.gif', 'repeat');this.setArrowIconLeft('vertical_arrowUp.gif', 16, 16);this.setArrowIconRight('vertical_arrowDown.gif', 16, 16);break;case 'bob':
case 'bob-horizontal':
this.height        = 18;this.imgDir        = '/_bsJavascript/components/slider/img/bob/';this.setBackgroundImage('background.gif', 'no-repeat');this.setSliderIcon('slider.gif', 13, 18);this.colorbar = new Object();this.colorbar['color']           = 'blue';this.colorbar['height']          = 5;this.colorbar['widthDifference'] = 0;this.colorbar['offsetLeft']      = 5;this.colorbar['offsetTop']       = 9;break;case 'burp':
case 'burp-horizontal':
this.useInputField = 0;this.height        = 11;this.imgDir        = '/_bsJavascript/components/slider/img/burp/';this.setSliderIcon('horizontal_knob.gif', 5, 11);this.setBackgroundImage('horizontal_background.gif', 'repeat');this.setArrowIconLeft('horizontal_arrowLeft.gif', 10, 11);this.setArrowIconRight('horizontal_arrowRight.gif', 10, 11);break;case 'burp-vertical':
this.direction     = 1;this.useInputField = 0;this.width         = 11;this.imgDir        = '/_bsJavascript/components/slider/img/burp/';this.setSliderIcon('vertical_knob.gif', 11, 5);this.setBackgroundImage('vertical_background.gif', 'repeat');this.setArrowIconLeft('vertical_arrowUp.gif', 11, 10);this.setArrowIconRight('vertical_arrowDown.gif', 11, 10);break;case 'ximian-industrial':
case 'ximian-industrial-horizontal':
this.useInputField = 0;this.height        = 15;this.imgDir        = '/_bsJavascript/components/slider/img/ximian_industrial/';this.setSliderIcon('horizontal_knob.gif', 31, 15);this.setBackgroundImage('horizontal_background.gif', 'repeat');this.setArrowIconLeft('horizontal_arrowLeft.gif', 15, 15);this.setArrowIconRight('horizontal_arrowRight.gif', 15, 15);break;case 'ximian-industrial-vertical':
this.direction     = 1;this.useInputField = 0;this.width         = 15;this.imgDir        = '/_bsJavascript/components/slider/img/ximian_industrial/';this.setSliderIcon('vertical_knob.gif', 15, 31);this.setBackgroundImage('vertical_background.gif', 'repeat');this.setArrowIconLeft('vertical_arrowUp.gif', 15, 15);this.setArrowIconRight('vertical_arrowDown.gif', 15, 15);break;case 'smoothstreak':
case 'smoothstreak-horizontal':
this.useInputField = 0;this.height        = 15;this.imgDir        = '/_bsJavascript/components/slider/img/smoothstreak/';this.setSliderIcon('horizontal_knob.gif', 31, 15);this.setBackgroundImage('horizontal_background.gif', 'repeat');this.setBackgroundImageLeft('horizontal_backgroundLeft.gif', 2, 15);this.setBackgroundImageRight('horizontal_backgroundRight.gif', 2, 15);this.colorbar = new Object();this.colorbar['color']           = '#736D6B';this.colorbar['height']          = 11;this.colorbar['widthDifference'] = 0;this.colorbar['offsetLeft']      = 0;this.colorbar['offsetTop']       = 2;break;case 'smoothstreak-vertical':
this.direction     = 1;this.useInputField = 0;this.width         = 15;this.imgDir        = '/_bsJavascript/components/slider/img/smoothstreak/';this.setSliderIcon('vertical_knob.gif', 15, 31);this.setBackgroundImage('vertical_background.gif', 'repeat');this.setBackgroundImageLeft('vertical_backgroundTop.gif', 15, 2);this.setBackgroundImageRight('vertical_backgroundBottom.gif', 15, 2);break;case 'aluminumalloyvolcanic':
case 'aluminumalloyvolcanic-horizontal':
this.useInputField = 0;this.height        = 15;this.imgDir        = '/_bsJavascript/components/slider/img/aluminumalloyvolcanic/';this.setSliderIcon('horizontal_knob.gif', 15, 19);this.setBackgroundImage('horizontal_background.gif', 'repeat');this.setBackgroundImageLeft('horizontal_backgroundLeft.gif', 2, 19);this.setBackgroundImageRight('horizontal_backgroundRight.gif', 2, 19);break;case 'yattacier3':
case 'yattacier3-horizontal':
this.useInputField = 0;this.height        = 16;this.imgDir        = '/_bsJavascript/components/slider/img/yattacier3/';this.setSliderIcon('horizontal_knob.gif', 30, 16);this.setBackgroundImage('horizontal_background.gif', 'repeat');this.setBackgroundImageLeft('horizontal_backgroundLeft.gif', 1, 16);this.setBackgroundImageRight('horizontal_backgroundRight.gif', 1, 16);break;case 'h2ogtk2':
case 'h2ogtk2-horizontal':
this.useInputField = 0;this.height        = 17;this.imgDir        = '/_bsJavascript/components/slider/img/h2ogtk2/';this.setSliderIcon('horizontal_knob.gif', 30, 17);this.setBackgroundImage('horizontal_background.gif', 'repeat');this.setBackgroundImageLeft('horizontal_backgroundLeft.gif', 7, 17);this.setBackgroundImageRight('horizontal_backgroundRight.gif', 7, 17);break;case 'h2ogtk2-scrollbar-horizontal':
this.useInputField = 0;this.height        = 17;this.imgDir        = '/_bsJavascript/components/slider/img/h2ogtk2/';this.setSliderIcon('horizontal_knob.gif', 30, 17);this.setBackgroundImage('horizontal_background.gif', 'repeat');this.setArrowIconLeft('horizontal_arrowLeft.gif', 15, 17);this.setArrowIconRight('horizontal_arrowRight.gif', 15, 17);break;default:
return false;}
return true;}
this.render = function(tagId) {
this._checkup();this._containerId           = 'co'   + tagId;this._handleId              = 'po'   + tagId;this._arrowLeftContainerId  = 'alc'  + tagId;this._arrowLeftIconId       = 'ali'  + tagId;this._arrowRightContainerId = 'arc'  + tagId;this._arrowRightIconId      = 'ari'  + tagId;this._valueContainerId      = 'vc'   + tagId;this._valueFieldId          = 'vf'   + tagId;if (typeof(this.fieldName)  == 'undefined') this.fieldName = tagId + '_value';if (typeof(this.fieldName2) == 'undefined') this.fieldName = tagId + '2_value';this._valueTextId           = 'vt'   + tagId;this._slideBarId            = 'bar'  + tagId;this._colorbarId            = 'cb'   + tagId;var divWidth      = this.width;var divHeight     = this.height;var out         = new Array();var outI        = 0;var localOffset = 0;out[outI++] = '<div id="' + this._containerId + '"';if (this.styleContainerClass) {
out[outI++] = ' class="' + this.styleContainerClass + '"';}
out[outI++] = ' style="position:relative;';if (this._display == 0) {
out[outI++] = ' display:none;';} else if (this._display == 1) {
out[outI++] = ' visibility:hidden;';}
out[outI++] = ' onmousewheel="Bs_Objects['+this._id+'].onMouseWheel(); return false;"';out[outI++] = '">';out[outI++] = '<div';out[outI++] = ' onmousewheel="Bs_Objects['+this._id+'].onMouseWheel(); return false;"';out[outI++] = ' style="position:absolute; left:' + this.moveX + '; top:' + this.moveY + ';">';if (this.useSecondKnob) {
out[outI++] = this._renderInputFieldAndText(localOffset, 1);localOffset += 35;}
out[outI++] = '<div style="position:absolute; display:none; z-index:' + (this.baseZindex + 10) + ';" id="' + this._handleId     + '">';out[outI++] = '<img name="poImg' + tagId + '" src="' + this.imgDir + this._sliderImgSrc + '" border=0 width=' + this._sliderImgWidth + ' height=' + this._sliderImgHeight + '>';out[outI++] = '</div>';if (this.useSecondKnob) {
out[outI++] = '<div style="position:absolute; display:none; z-index:' + (this.baseZindex + 9) + ';" id="' + this._handleId     + '2">';out[outI++] = '<img name="poImg' + tagId + '2" src="' + this.imgDir + this._sliderImgSrc + '" border=0 width=' + this._sliderImgWidth + ' height=' + this._sliderImgHeight + '>';out[outI++] = '</div>';}
if ((this.arrowAmount > 0) && this._arrowIconLeftSrc) {
out[outI++] = '<div id="' + this._arrowLeftContainerId + '" style="position:absolute; left:' + localOffset + '; top:0;">';out[outI++] = '<a href="javascript:void(false);"';if (this.arrowMouseOver) {
out[outI++] = ' onMouseOver="Bs_Objects['+this._id+'].onChangeByArrow(false, true); return false;"';out[outI++] = ' onMouseOut="Bs_Objects['+this._id+'].stopFireArrow(); return false;"';} else {
out[outI++] = ' onMouseDown="Bs_Objects['+this._id+'].onChangeByArrow(false, true); return false;"';out[outI++] = ' onMouseUp="Bs_Objects['+this._id+'].stopFireArrow(); return false;"';out[outI++] = ' onMouseOut="Bs_Objects['+this._id+'].stopFireArrow(); return false;"';}
out[outI++] = '>';out[outI++] = '<img id="' + this._arrowLeftIconId + '" src="' + this.imgDir + this._arrowIconLeftSrc + '" border="0" width="' + this._arrowIconLeftWidth + '" height="' + this._arrowIconLeftHeight + '"';if (typeof(this.arrowIconLeftCssStyle) != 'undefined') {
out[outI++] = ' style="' + this.arrowIconLeftCssStyle + '"';}
out[outI++] = '>';out[outI++] = '</a></div>';localOffset += this._arrowIconLeftWidth;}
if (typeof(this._bgImgLeftSrc) != 'undefined') {
var tmpLeft = (this.direction == 0) ? localOffset : 0;var tmpTop  = (this.direction == 0) ? 0           : localOffset;out[outI++] = '<div style="position:absolute; left:' + tmpLeft + '; top:' + tmpTop + ';">';out[outI++] = '<img src="' + this.imgDir + this._bgImgLeftSrc + '" width="' + this._bgImgLeftWidth + '" height="' + this._bgImgLeftHeight + '" border="0">';out[outI++] = '</div>';localOffset += (this.direction == 0) ? this._bgImgLeftWidth : this._bgImgLeftHeight;}
if (this.colorbar) {
out[outI++] = '<div id="' + this._colorbarId + '" onClick="Bs_Objects['+this._id+'].onChangeByClick(event);"';if (this.colorbar['cssClass']) {
out[outI++] = ' class="' + this.colorbar['cssClass'] + '"';}
out[outI++] = ' style="position:absolute; z-index:' + (this.baseZindex +5) + '; width:0;';if ('undefined' != typeof(this.colorbar['color'])) {
out[outI++] = ' background-color:' + this.colorbar['color'] + ';';} else if ('undefined' == typeof(this.colorbar['cssClass'])) {
out[outI++] = ' background-color:orange;';}
if ('undefined' != typeof(this.colorbar['offsetLeft'])) {
out[outI++] = ' left:' + (localOffset + this.colorbar['offsetLeft']) + ';';}
if ('undefined' != typeof(this.colorbar['offsetTop'])) {
out[outI++] = ' top:' + this.colorbar['offsetTop'] + ';';}
if ('undefined' != typeof(this.colorbar['height'])) {
out[outI++] = ' height:' + this.colorbar['height'] + ';';}
out[outI++] = '">';out[outI++] = '<img src="/_bsImages/spacer.gif" width="1" height="5"></div>';}
if (this.colorbar2) {
out[outI++] = '<div id="' + this._colorbarId + '2" onClick="Bs_Objects['+this._id+'].onChangeByClick(event);"';if (this.colorbar2['cssClass']) {
out[outI++] = ' class="' + this.colorbar2['cssClass'] + '"';}
out[outI++] = ' style="position:absolute; z-index:' + (this.baseZindex +5) + '; width:0;';if ('undefined' != typeof(this.colorbar2['color'])) {
out[outI++] = ' background-color:' + this.colorbar2['color'] + ';';} else if ('undefined' == typeof(this.colorbar2['cssClass'])) {
out[outI++] = ' background-color:orange;';}
if ('undefined' != typeof(this.colorbar2['offsetLeft'])) {
out[outI++] = ' left:' + (localOffset + this.colorbar2['offsetLeft']) + ';';}
if ('undefined' != typeof(this.colorbar2['offsetTop'])) {
out[outI++] = ' top:' + this.colorbar2['offsetTop'] + ';';}
if ('undefined' != typeof(this.colorbar2['height'])) {
out[outI++] = ' height:' + this.colorbar2['height'] + ';';}
out[outI++] = '">';out[outI++] = '<img src="/_bsImages/spacer.gif" width="1" height="5"></div>';}
out[outI++] = '<div id="' + this._slideBarId + '" onClick="Bs_Objects['+this._id+'].onChangeByClick(event);"';var tmpLeft = (this.direction == 0) ? localOffset : 0;var tmpTop  = (this.direction == 0) ? 0           : localOffset;out[outI++] = ' style="position:absolute; left:' + tmpLeft + '; top:' + tmpTop + '; width:' + divWidth + '; height: ' + divHeight + '; clip:rect(0 ' + divWidth + '  ' + divHeight + ' 0);';if (this.bgColor) {
out[outI++] = 'background-color:' + this.bgColor + '; layer-background-color:' + this.bgColor + ';';}
if (this._bgImgSrc) {
out[outI++] = ' background-image: url(' + this.imgDir + this._bgImgSrc + '); background-repeat:' + this._bgImgRepeat + ';';}
if (this._bgImgCssStyle) {
out[outI++] = this._bgImgCssStyle;}
out[outI++] = '"></div>';localOffset += (this.direction == 0) ? this.width : this.height;if (typeof(this._bgImgRightSrc) != 'undefined') {
var tmpLeft = (this.direction == 0) ? localOffset : 0;var tmpTop  = (this.direction == 0) ? 0           : localOffset;out[outI++] = '<div style="position:absolute; left:' + tmpLeft + '; top:' + tmpTop + ';">';out[outI++] = '<img src="' + this.imgDir + this._bgImgRightSrc + '" width="' + this._bgImgRightWidth + '" height="' + this._bgImgRightHeight + '" border="0">';out[outI++] = '</div>';localOffset += (this.direction == 0) ? this._bgImgRightWidth : this._bgImgRightHeight;}
if ((this.arrowAmount > 0) && this._arrowIconRightSrc) {
var tmpLeft = (this.direction == 0) ? localOffset : 0;var tmpTop  = (this.direction == 0) ? 0           : localOffset;out[outI++] = '<div id="' + this._arrowRightContainerId + '" style="position:absolute; left:' + tmpLeft + '; top:' + tmpTop + ';">';out[outI++] = '<a href="javascript:void(false);"';if (this.arrowMouseOver) {
out[outI++] = ' onMouseOver="Bs_Objects['+this._id+'].onChangeByArrow(true, true); return false;"';out[outI++] = ' onMouseOut="Bs_Objects['+this._id+'].stopFireArrow(); return false;"';} else {
out[outI++] = ' onMouseDown="Bs_Objects['+this._id+'].onChangeByArrow(true, true); return false;"';out[outI++] = ' onMouseUp="Bs_Objects['+this._id+'].stopFireArrow(); return false;"';out[outI++] = ' onMouseOut="Bs_Objects['+this._id+'].stopFireArrow(); return false;"';}
out[outI++] = '>';out[outI++] = '<img id="' + this._arrowRightIconId + '" src="' + this.imgDir + this._arrowIconRightSrc + '" border="0" width="' + this._arrowIconRightWidth + '" height="' + this._arrowIconRightHeight + '"';if (typeof(this.arrowIconRightCssStyle) != 'undefined') {
out[outI++] = ' style="' + this.arrowIconRightCssStyle + '"';}
out[outI++] = '>';out[outI++] = '</a></div>';localOffset += this._arrowIconRightWidth;}
if (this.useSecondKnob) {
out[outI++] = this._renderInputFieldAndText(localOffset, 2);} else {
out[outI++] = this._renderInputFieldAndText(localOffset, 1);}
out[outI++] = '</div>';out[outI++] = '</div>';document.getElementById(tagId).innerHTML = out.join('');this._containerObj           = document.getElementById(this._containerId);this._arrowLeftContainerObj  = document.getElementById(this._arrowLeftContainerId);this._arrowLeftIconObj       = document.getElementById(this._arrowLeftIconId);this._arrowRightContainerObj = document.getElementById(this._arrowRightContainerId);this._arrowRightIconObj      = document.getElementById(this._arrowRightIconId);this._slideBarObj            = document.getElementById(this._slideBarId);this._handleObj              = document.getElementById(this._handleId);this._valueContainerObj      = document.getElementById(this._valueContainerId);this._valueFieldObj          = document.getElementById(this._valueFieldId);this._valueTextObj           = document.getElementById(this._valueTextId);this._colorbarObj            = document.getElementById(this._colorbarId);this._posSlideStart = (this.direction == 0) ? getDivLeft(this._slideBarObj) : getDivTop(this._slideBarObj);this._slideWidth    = (this.direction == 0) ? this.width - this._sliderImgWidth : this.height - this._sliderImgHeight;this._posSlideEnd   = this._posSlideStart + this._slideWidth;this._currentRelSliderPosX = this._posSlideStart;if (this.valueDefault > this.minVal) {
var hundertPercent = this.maxVal - this.minVal;var myPercent      = (this.valueDefault-this.minVal) * 100 / hundertPercent;this._currentRelSliderPosX += (myPercent * this._slideWidth / 100);}
if (this.direction == 0) {
this._handleObj.style.left = this._currentRelSliderPosX;} else {
this._handleObj.style.top  = this._currentRelSliderPosX;}
this._handleObj.style.display = 'block';temp = ech_attachMouseDrag(this._handleObj,this.slideStart,null,this.slideMove,null,this.slideEnd,null,null,null);temp = temp.linkCtrl(getDivImage('', 'poImg' + tagId));this.ctrl           = temp;this.ctrl.sliderObj = this;this.ctrl.knobId    = 1;var x = getDivLeft(this._handleObj);var y = getDivTop(this._handleObj);y = 0;if (this.direction == 0) {
this.ctrl.minX = this._posSlideStart;this.ctrl.maxX = this._posSlideEnd;this.ctrl.minY = y;this.ctrl.maxY = y;} else {
this.ctrl.minX = x;this.ctrl.maxX = x;this.ctrl.minY = this._posSlideStart;this.ctrl.maxY = this._posSlideEnd;}
if (this.useSecondKnob) {
this._handleObj2              = document.getElementById(this._handleId + '2');this._valueContainerObj2      = document.getElementById(this._valueContainerId + '2');this._valueFieldObj2          = document.getElementById(this._valueFieldId + '2');this._valueTextObj2           = document.getElementById(this._valueTextId + '2');this._colorbarObj2            = document.getElementById(this._colorbarId + '2');this._slideWidth2    = (this.direction == 0) ? this.width - this._sliderImgWidth2 : this.height - this._sliderImgHeight2;this._posSlideEnd2   = this._posSlideStart + this._slideWidth2;this._currentRelSliderPosX2 = this._posSlideStart;if (this.valueDefault2 > this.minVal2) {
var hundertPercent = this.maxVal2 - this.minVal2;var myPercent      = (this.valueDefault2-this.minVal2) * 100 / hundertPercent;this._currentRelSliderPosX2 += (myPercent * this._slideWidth2 / 100);}
if (this.direction == 0) {
this._handleObj2.style.left = this._currentRelSliderPosX2;} else {
this._handleObj2.style.top  = this._currentRelSliderPosX2;}
this._handleObj2.style.display = 'block';temp2 = ech_attachMouseDrag(this._handleObj2,this.slideStart,null,this.slideMove,null,this.slideEnd,null,null,null);temp2 = temp2.linkCtrl(getDivImage('', 'poImg' + tagId + '2'));this.ctrl2           = temp2;this.ctrl2.sliderObj = this;this.ctrl2.knobId    = 2;var x = getDivLeft(this._handleObj2);var y = getDivTop(this._handleObj2);y = 0;if (this.direction == 0) {
this.ctrl2.minX = this._posSlideStart;this.ctrl2.maxX = this._posSlideEnd2;this.ctrl2.minY = y;this.ctrl2.maxY = y;} else {
this.ctrl2.minX = x;this.ctrl2.maxX = x;this.ctrl2.minY = this._posSlideStart;this.ctrl2.maxY = this._posSlideEnd2;}
}
this._updateColorbar(this._currentRelSliderPosX, 1);this._updateColorbar(this._currentRelSliderPosX2, 2);}
this._renderInputFieldAndText = function(localOffset, knobId) {
var k = ((typeof(knobId) == 'undefined') || (knobId == 1)) ? '' : '2';var out = new Array();var styleValueFieldClass = (this['styleValueFieldClass'+k]) ? ' class="' + this['styleValueFieldClass'+k] + '"' : '';var styleValueTextClass  = (this['styleValueTextClass'+k])  ? ' class="' + this['styleValueTextClass'+k]  + '"' : '';var cssAlign = (this.useSecondKnob && (knobId == 1)) ? 'align:right;' : '';out[out.length] = '<div id="' + this._valueContainerId + k + '" style="position:absolute; left:' + localOffset + '; top:0px;">';if (this['useInputField'+k] == 1) {
out[out.length] = '<span' + styleValueTextClass + ' id="' + this._valueTextId + k + '">' + this['valueDefault'+k]  + '</span>';out[out.length] = '<input type="hidden" name="' + this['fieldName'+k] + '" id="' + this._valueFieldId + k + '" value="' + this['valueDefault'+k] + '">';} else if (this['useInputField'+k] == 2) {
out[out.length] = '<input type="text"' + styleValueFieldClass + ' onMouseOver="bsFormFieldSetFocusAndSelect(this, false);" name="' + this['fieldName'+k] + '" id="' + this._valueFieldId + k + '" value="' + this['valueDefault'+k] + '" size="2"';if (styleValueFieldClass == '') {
out[out.length] = ' style="vertical-align:text-top; width:30; height:' + this.height + ';"';}
out[out.length] = ' onKeyUp="Bs_Objects['+this._id+'].onChangeByInput(this.value, false, '+knobId+');" onBlur="Bs_Objects['+this._id+'].onChangeByInput(this.value, true, '+knobId+');">';} else if (this['useInputField'+k] == 3) {
out[out.length] = '<input type="text"' + styleValueFieldClass + ' onMouseOver="bsFormFieldSetFocusAndSelect(this, false);" name="' + this['fieldName'+k] + '" id="' + this._valueFieldId + k + '" value="' + this['valueDefault'+k] + '" size="2"';if (styleValueFieldClass == '') {
out[out.length] = ' style="display:none; vertical-align:text-top; width:30; height:' + this.height + ';"';} else {
out[out.length] = ' style="display:none;"';}
out[out.length] = ' onKeyUp="Bs_Objects['+this._id+'].onChangeByInput(this.value, false, '+knobId+');" onBlur="var _bss = Bs_Objects['+this._id+']; _bss.onChangeByInput(this.value, true, '+knobId+'); _bss.textboxEdit(false, '+knobId+')">';out[out.length] = '<span' + styleValueTextClass + ' style="' + cssAlign + '" id="' + this._valueTextId + k + '" ';if (this.inputTextFieldEvent == 'click') {
out[out.length] = 'onClick="Bs_Objects['+this._id+'].textboxEdit(true, '+knobId+');"';} else {
out[out.length] = 'onMouseOver="Bs_Objects['+this._id+'].textboxEdit(true, '+knobId+');"';}
out[out.length] = '>' + this['valueDefault'+k]  + '</span>';} else {
out[out.length] = '<input type="hidden" name="' + this['fieldName'+k] + '" id="' + this._valueFieldId + k + '" value="' + this['valueDefault'+k] + '">';}
out[out.length] = '</div>';return out.join('');}
this.drawInto = function(tagId) {
this.render(tagId);if (this._disabled) this.setDisabled(true);}
this.draw = function(tagId) {
this.render(tagId);if (this._disabled) this.setDisabled(true);}
this.attachEvent = function(trigger, yourEvent) {
if (typeof(this._attachedEvents) == 'undefined') {
this._attachedEvents = new Array();}
if (typeof(this._attachedEvents[trigger]) == 'undefined') {
this._attachedEvents[trigger] = new Array(yourEvent);} else {
this._attachedEvents[trigger][this._attachedEvents[trigger].length] = yourEvent;}
}
this.hasEventAttached = function(trigger) {
return (this._attachedEvents && this._attachedEvents[trigger]);}
this.fireEvent = function(trigger) {
if (this._attachedEvents && this._attachedEvents[trigger]) {
var e = this._attachedEvents[trigger];if ((typeof(e) == 'string') || (typeof(e) == 'function')) {
e = new Array(e);}
for (var i=0; i<e.length; i++) {
if (typeof(e[i]) == 'function') {
e[i](this);} else if (typeof(e[i]) == 'string') {
eval(e[i]);}
}
}
}
this.attachOnChange = function(functionName) {
this.eventOnChange = functionName;}
this.attachOnSlideStart = function(functionName) {
this.slideStartCB = functionName;}
this.attachOnSlideMove = function(functionName) {
this.slideMoveCB = functionName;}
this.attachOnSlideEnd = function(functionName) {
this.slideEndCB = functionName;}
this.attachOnArrow = function(functionName) {
this.eventOnArrow = functionName;}
this.attachOnInputChange = function(functionName) {
this.eventOnInputChange = functionName;}
this.attachOnInputBlur = function(functionName) {
this.eventOnInputBlur = functionName;}
this.setSliderIcon = function(imgName, width, height) {
this._sliderImgSrc    = imgName;this._sliderImgWidth  = width;this._sliderImgHeight = height;}
this.setSliderIcon2 = function(imgName, width, height) {
this._sliderImgSrc2    = imgName;this._sliderImgWidth2  = width;this._sliderImgHeight2 = height;}
this.setArrowIconLeft = function(imgName, width, height) {
this._arrowIconLeftSrc    = imgName;this._arrowIconLeftWidth  = width;this._arrowIconLeftHeight = height;}
this.setArrowIconRight = function(imgName, width, height) {
this._arrowIconRightSrc    = imgName;this._arrowIconRightWidth  = width;this._arrowIconRightHeight = height;}
this.setBackgroundImage = function(src, repeat, cssStyle) {
this._bgImgSrc        = src;this._bgImgRepeat     = repeat;this._bgImgCssStyle   = cssStyle;}
this.setBackgroundImageLeft = function(imgName, width, height) {
this._bgImgLeftSrc    = imgName;this._bgImgLeftWidth  = width;this._bgImgLeftHeight = height;}
this.setBackgroundImageRight = function(imgName, width, height) {
this._bgImgRightSrc    = imgName;this._bgImgRightWidth  = width;this._bgImgRightHeight = height;}
this.setDisplay = function(display) {
this._display = display;if (this._containerObj) {
switch (display) {
case 0:
this._containerObj.style.display = 'none';break;case 1:
this._containerObj.style.visibility = 'hidden';break;case 2:
this._containerObj.style.visibility = 'visible';this._containerObj.style.display = 'block';break;default:
}
}
}
this.setDisabled = function(b) {
if (typeof(b) == 'undefined') b = !this._disabled;if (b) {
var filter = 'progid:DXImageTransform.Microsoft.BasicImage(grayScale=1); progid:DXImageTransform.Microsoft.BasicImage(opacity=.5)';var cursor = 'default';} else {
var filter = null;var cursor = 'hand';}
var t = new Array(
this._containerId, this._arrowLeftContainerId, this._arrowRightContainerId,
this._valueFieldId, this._valueTextId,
this._slideBarId, this._colorbarId, this._handleId,
this._valueFieldId + '2',
this._valueTextId + '2',
this._colorbarId + '2',
this._handleId + '2'
);for (var i=0; i<t.length; i++) {
var elm = document.getElementById(t[i]);if (elm != null) elm.style.filter = filter;}
var elm = document.getElementById(this._arrowLeftIconId);if (elm != null) elm.style.cursor = cursor;var elm = document.getElementById(this._arrowRightIconId);if (elm != null) elm.style.cursor = cursor;var elm = document.getElementById(this._valueFieldId);if (elm != null) elm.disabled = b;this._disabled = b;}
this.getValue = function(knobId) {
if ((typeof(knobId) == 'undefined') || (knobId == 1)) {
return this._valueInternal;} else {
return this._valueInternal2;}
}
this.getValueInPercent = function(knobId) {
if ((typeof(knobId) == 'undefined') || (knobId == 1)) {
var range   = Math.abs(this.maxVal - this.minVal);var percent = this._valueInternal / range * 100;return percent;} else {
var range   = Math.abs(this.maxVal2 - this.minVal2);var percent = this._valueInternal2 / range * 100;return percent;}
}
this.getSliderPos = function(knobId) {
if (typeof(knobId) == 'undefined') knobId = 1;if (knobId == 1) {
var absLeng = (this.direction==0) ? getDivLeft(this.ctrl.div) - this.ctrl.minX : getDivTop(this.ctrl.div) - this.ctrl.minY;var absRang = this.maxVal - this.minVal;return (absLeng * absRang/this._slideWidth) + this.minVal;} else {
var absLeng = (this.direction==0) ? getDivLeft(this.ctrl2.div) - this.ctrl2.minX : getDivTop(this.ctrl2.div) - this.ctrl2.minY;var absRang = this.maxVal2 - this.minVal2;return (absLeng * absRang/this._slideWidth) + this.minVal2;}
}
this.onChangeBySlide = function(ctrl) {
if (this._disabled) return;var newPos = this._getNewLocationFromCursor(ctrl);var val = this._getValueByPosition(newPos);val     = this._roundToGrid(val, ctrl.knobId);var valInternal = (ctrl.knobId == 1) ? this._valueInternal : this._valueInternal2;if (val != valInternal) {
if (ctrl.knobId == 1) {
this._valueInternal = val;} else {
this._valueInternal2 = val;}
this.updateHandle(newPos, ctrl.knobId);this.updateValueField(val, ctrl.knobId);this.updateValueText(val, ctrl.knobId);this._updateColorbar(newPos, ctrl.knobId);if ('undefined' != typeof(this.eventOnChange)) this.eventOnChange(this, val, newPos);this.fireEvent('onChange');}
}
this.onChangeByClick = function(event) {
if (this._disabled) return;var newPos = 0;if ('undefined' != typeof(event.offsetX)) {
newPos = (this.direction == 0) ? event.offsetX + this._posSlideStart : event.offsetY + this._posSlideStart;} else if ('undefined' != typeof(event.layerX)) {
newPos = (this.direction == 0) ? event.layerX + this._posSlideStart  : event.layerY  + this._posSlideStart;} else {
return;}
var val = this._getValueByPosition(newPos);if (this.useSecondKnob) {
if (val > this._valueInternal2) {
var knobId = 2;} else if (val < this._valueInternal) {
var knobId = 1;} else {
return;}
} else {
var knobId = 1;}
val     = this._roundToGrid(val);if (val != this._valueInternal) {
if (knobId == 1) {
this._valueInternal = val;} else {
this._valueInternal2 = val;}
this.updateHandle(newPos, knobId);this.updateValueField(val, knobId);this.updateValueText(val, knobId);this._updateColorbar(newPos, knobId);if ('undefined' != typeof(this.eventOnChange)) this.eventOnChange(this, val, newPos);this.fireEvent('onChange');}
}
this.onChangeByInput = function(val, isBlur, knobId) {
var k = ((typeof(knobId) == 'undefined') || (knobId == 1)) ? '' : '2';if (this._disabled) return;if (val == '') {
val = this['minVal'+k];}
val = this._roundToGrid(val, knobId);var newPos = this._getPositionByValue(val);if (val != this['_valueInternal'+k]) {
this['_valueInternal'+k] = val;this.updateHandle(newPos, knobId);this._updateColorbar(newPos, knobId);if ('undefined' != typeof(this.eventOnChange)) this.eventOnChange(this, val, newPos);this.fireEvent('onChange');if (isBlur) {
this.updateValueField(val, knobId);this.updateValueText(val, knobId);}
} else if (isBlur) {
this.updateValueField(val, knobId);this.updateValueText(val, knobId);}
}
this.onChangeByArrow = function(leftOrRight, keepFiring, loopCall) {
if (!loopCall) this._stopFireArrowFlag = false;if (this._stopFireArrowFlag) return;if (this._disabled) return;var val = parseFloat(this._valueInternal);if (leftOrRight) {
val += this.arrowAmount;} else {
val -= this.arrowAmount;}
val = this._roundToGrid(val);if (val != this._valueInternal) {
this._valueInternal = val;var newPos = this._getPositionByValue(val);this.updateHandle(newPos);this.updateValueField(val);this.updateValueText(val);this._updateColorbar(newPos);if ('undefined' != typeof(this.eventOnChange)) this.eventOnChange(this, val, newPos);this.fireEvent('onChange');}
if (keepFiring) {
if (!this._stopFireArrowFlag && (this.arrowKeepFiringTimeout > 0)) {
setTimeout('Bs_Objects[' + this._id + '].onChangeByArrow(' + leftOrRight + ', ' + keepFiring + ', true);', this.arrowKeepFiringTimeout);}
}
}
this.onMouseWheel = function() {
if (this._disabled) return;var val = parseFloat(this._valueInternal);if (event.wheelDelta > 0) {
val -= this.wheelAmount;} else {
val += this.wheelAmount;}
val = this._roundToGrid(val);if (val != this._valueInternal) {
this._valueInternal = val;var newPos = this._getPositionByValue(val);this.updateHandle(newPos);this.updateValueField(val);this.updateValueText(val);this._updateColorbar(newPos);if ('undefined' != typeof(this.eventOnChange)) this.eventOnChange(this, val, newPos);this.fireEvent('onChange');}
}
this.stopFireArrow = function() {
this._stopFireArrowFlag = true;}
this.setValue = function(val, knobId) {
if (typeof(knobId) == 'undefined') knobId = 1;val = this._roundToGrid(val, knobId);var newPos = this._getPositionByValue(val);var valInternal = (knobId == 1) ? this._valueInternal : this._valueInternal2;if (val != valInternal) {
if (knobId == 1) {
this._valueInternal = val;} else {
this._valueInternal2 = val;}
this.updateHandle(newPos, knobId);this._updateColorbar(newPos, knobId);if ('undefined' != typeof(this.eventOnChange)) this.eventOnChange(this, val, newPos);this.fireEvent('onChange');this.updateValueField(val, knobId);this.updateValueText(val, knobId);}
}
this.onChangeByApi = function(val, knobId) {
this.setValue(val, knobId);}
this._updateColorbar = function(newPos, knobId) {
var k = ((typeof(knobId) == 'undefined') || (knobId == 1) || ((typeof(this.colorbar) != 'undefined') && ((typeof(this.colorbar.type) != 'undefined') || (this.colorbar.type == 'between')))) ? '' : '2';if (this['_colorbarObj'+k]) {
if ((typeof(this.colorbar.type) != 'undefined') && (this.colorbar.type == 'between')) {
var left  = this._getPositionByValue(this._valueInternal,  1);var right = this._getPositionByValue(this._valueInternal2, 2);this['_colorbarObj'+k].style.left  = left + this.colorbar.offsetLeft;this['_colorbarObj'+k].style.width = right - left;} else {
var newWidth = newPos + this['colorbar'+k]['widthDifference'];if (newWidth < 0) newWidth = 0;if (k == '2') {
var invertedWidth = this.width - newWidth;if (invertedWidth < 0) invertedWidth = 0;this['_colorbarObj'+k].style.width = invertedWidth;if (typeof(this.colorbar2['offsetLeft']) != 'undefined') newWidth += this.colorbar2['offsetLeft'];this['_colorbarObj'+k].style.left  = newWidth;} else {
this['_colorbarObj'+k].style.width = newWidth;}
}
if (typeof(this['colorbar'+k]['color2']) != 'undefined') {
var percent  = this.getValueInPercent(knobId);var newColor = mixColor(this['colorbar'+k]['color'], this['colorbar'+k]['color2'], percent);document.getElementById(this._colorbarId+k).style.backgroundColor = newColor;}
}
}
this._getValueByPosition = function(pos) {
if (this.direction == 0) {
pos -= this.ctrl.minX;var hundertPercent = this.ctrl.maxX - this.ctrl.minX;} else {
pos -= this.ctrl.minY;var hundertPercent = this.ctrl.maxY - this.ctrl.minY;}
var myPercent      = pos / hundertPercent;var val            = this.minVal + ((this.maxVal - this.minVal) * myPercent);return val;}
this._getPositionByValue = function(val, knobId) {
var k = ((typeof(knobId) == 'undefined') || (knobId == 1)) ? '' : '2';val = val - this['minVal'+k];var hundertPercent = this['maxVal'+k] - this['minVal'+k];var myPercent      = val / hundertPercent;if (this.direction == 0) {
var pos = this['ctrl'+k].minX + ((this['ctrl'+k].maxX - this['ctrl'+k].minX) * myPercent);} else {
var pos = this['ctrl'+k].minY + ((this['ctrl'+k].maxY - this['ctrl'+k].minY) * myPercent);}
return pos;}
this._roundToGrid = function(val, knobId) {
val = parseFloat(val);if (isNaN(val)) return this.minVal;val = Math.round(val / this.valueInterval) * this.valueInterval;val = Math.round(val*10000)/10000;if (val < this.minVal) val = this.minVal;if (val > this.maxVal) val = this.maxVal;if (this.useSecondKnob && this.preventValueCrossing) {
if ((typeof(knobId) == 'undefined') || (knobId == 1)) {
if (val >= this._valueInternal2) {
val = this._valueInternal2 - this.valueInterval;if (val < this.minVal) val = this.minVal;}
} else {
if (val <= this._valueInternal) {
val = this._valueInternal + this.valueInterval2;if (val > this.maxVal2) val = this.maxVal2;}
}
}
return val;}
this._getNewLocationFromCursor = function(ctrl) {
if (ctrl.knobId == 1) {
var ox = this._posEventSlideStartX;var oy = this._posEventSlideStartY;var posObjSlideStartX = this._posObjSlideStartX;var posObjSlideStartY = this._posObjSlideStartY;} else {
var ox = this._posEventSlideStartX2;var oy = this._posEventSlideStartY2;var posObjSlideStartX = this._posObjSlideStartX2;var posObjSlideStartY = this._posObjSlideStartY2;}
switch (this.direction) {
case 0:
var t = ctrl.pageX - ox;var x = parseInt(posObjSlideStartX) + t;if (x > ctrl.maxX) x = ctrl.maxX;if (x < ctrl.minX) x = ctrl.minX;return x;case 1:
var t = ctrl.pageY - oy;var y = parseInt(posObjSlideStartY) + t;if (y > ctrl.maxY) y = ctrl.maxY;if (y < ctrl.minY) y = ctrl.minY;return y;}
}
this.updatePointer = function(newPos) {
this.updateHandle(newPos);}
this.updateHandle = function(newPos, knobId) {
if ((typeof(knobId) == 'undefined') || (knobId == 1)) {
if (this.direction == 0) {
this._currentRelSliderPosX = newPos;this.ctrl.div.style.left   = newPos;} else {
this._currentRelSliderPosX = newPos;this.ctrl.div.style.top    = newPos;}
} else {
if (this.direction == 0) {
this._currentRelSliderPosX2 = newPos;this.ctrl2.div.style.left   = newPos;} else {
this._currentRelSliderPosX2 = newPos;this.ctrl2.div.style.top    = newPos;}
}
return;}
this.updateValueField = function(val, knobId) {
var k = ((typeof(knobId) == 'undefined') || (knobId == 1)) ? '' : '2';if (this['_valueFieldObj'+k]) {
this['_valueFieldObj'+k].value = val;}
}
this.updateValueText = function(val, knobId) {
var k = ((typeof(knobId) == 'undefined') || (knobId == 1)) ? '' : '2';if (this['_valueTextObj'+k]) {
this['_valueTextObj'+k].innerHTML = val;}
}
this.arrowOnClick = function() {
}
this.onChange = function(val) {
if (this._disabled) return;this.setValue(val);}
this.updateInputBox = function(val) {
if (this._disabled) return;this.setValue(val);}
this.textboxEdit = function(editMode, knobId) {
var k = ((typeof(knobId) == 'undefined') || (knobId == 1)) ? '' : '2';if (this._disabled) return;if (editMode) {
if ('undefined' != typeof(this['_valueFieldObj'+k])) {
this['_valueTextObj'+k].style.display = 'none';this['_valueFieldObj'+k].style.display = 'block';bsFormFieldSetFocusAndSelect(this['_valueFieldObj'+k], false);}
} else {
if ('undefined' != typeof(this['_valueTextObj'+k])) {
this['_valueFieldObj'+k].style.display = 'none';this['_valueTextObj'+k].style.display  = 'block';}
}
}
this.slideMove = function(ctrl, client) {
ctrl.sliderObj.onChangeBySlide(ctrl);}
this.slideStart = function(ctrl, client) {
if (ctrl.knobId == 1) {
ctrl.sliderObj._handleObj.style.zIndex += 2;ctrl.sliderObj._posEventSlideStartX = ctrl.startX;ctrl.sliderObj._posEventSlideStartY = ctrl.startY;ctrl.sliderObj._posObjSlideStartX   = ctrl.sliderObj._handleObj.style.left;ctrl.sliderObj._posObjSlideStartY   = ctrl.sliderObj._handleObj.style.top;} else {
ctrl.sliderObj._handleObj2.style.zIndex += 2;ctrl.sliderObj._posEventSlideStartX2 = ctrl.startX;ctrl.sliderObj._posEventSlideStartY2 = ctrl.startY;ctrl.sliderObj._posObjSlideStartX2   = ctrl.sliderObj._handleObj2.style.left;ctrl.sliderObj._posObjSlideStartY2   = ctrl.sliderObj._handleObj2.style.top;}
var pos = ctrl.sliderObj.getSliderPos(ctrl.knobId);ctrl.sliderObj.setValue(pos, ctrl.knobId);if ('undefined' != typeof(ctrl.sliderObj.slideStartCB)) {
ctrl.sliderObj.slideStartCB(ctrl.sliderObj, ctrl.sliderObj.getValue(), pos);}
}
this.slideEnd = function(ctrl, client){
if (this._disabled) return;if (ctrl.knobId == 1) {
ctrl.sliderObj._handleObj.style.zIndex -= 2;} else {
ctrl.sliderObj._handleObj2.style.zIndex -= 2;}
var pos = ctrl.sliderObj.getSliderPos();if ('undefined' != typeof(ctrl.sliderObj.slideEndCB)) {
ctrl.sliderObj.slideEndCB(ctrl.sliderObj, ctrl.sliderObj.getValue(), pos);}
return;}
this._constructor(theFieldnamePrefix);}

/* Bs_ScrollableDiv.class.js */

/********************************************************************************************
* BlueShoes Framework; This file is part of the php application framework.
* NOTE: This code is stripped (obfuscated). To get the clean documented code goto 
*       www.blueshoes.org and register for the free open source *DEVELOPER* version or 
*       buy the commercial version.
*       
*       In case you've already got the developer version, then this is one of the few 
*       packages/classes that is only available to *PAYING* customers.
*       To get it go to www.blueshoes.org and buy a commercial version.
* 
* @copyright www.blueshoes.org
* @author    sam blum <sam-at-blueshoes-dot-org>
* @author    Andrej Arn <andrej-at-blueshoes-dot-org>
*/
function Bs_ScrollableDiv() {
this.sliderObj;this.bwCheckObj;this.lastScrollTo = 0;this.containerObj;this.contentObj;this.containerElm;this.contentElm;this.sliderDivId;this.isActive = false;this.init = function(containerDivId, contentDivId) {
this.bwCheckObj = lib_bwcheck();this.containerObj = new makeObj(this.bwCheckObj, containerDivId);this.contentObj   = new makeObj(this.bwCheckObj, contentDivId, containerDivId);this.contentObj.moveIt(0, 0);this.containerObj.css.visibility = "visible";this.containerElm = document.getElementById(containerDivId);this.contentElm   = document.getElementById(contentDivId);if (this.contentElm.attachEvent) {
this.contentElm.Bs_ScrollableDiv = this;this.contentElm.attachEvent('onmousewheel', Bs_ScrollableDiv_onMouseWheel);}
}
this.setSliderObject = function(sliderObj, sliderDivId) {
sliderObj.useInputField = 0;sliderObj.attachOnChange(Bs_ScrollableDiv_sliderChange);this.sliderObj = sliderObj;if (this.sliderObj.height == 'auto') {
this.sliderObj.height = this.containerElm.offsetHeight - (this.sliderObj._arrowIconLeftHeight + this.sliderObj._arrowIconRightHeight);}
if (this.sliderObj.width == 'auto') {
this.sliderObj.width = this.containerElm.offsetWidth - (this.sliderObj._arrowIconLeftWidth + this.sliderObj._arrowIconRightWidth);}
this.sliderObj.Bs_ScrollableDiv = this;this.sliderDivId = sliderDivId;this.updateScrollableSpace();}
this.setSlideSpeed = function(amount, unit) {
this.sliderObj.valueInterval  = 0.1;this.sliderObj.arrowAmount    = amount * this.sliderObj.arrowKeepFiringTimeout /1000;this.sliderObj.minVal         = 0;if (this.sliderObj.direction == 0) {
this.sliderObj.maxVal         = this.contentElm.scrollWidth - this.containerElm.offsetWidth;} else {
this.sliderObj.maxVal         = this.contentElm.scrollHeight - this.containerElm.offsetHeight;}
if (this.sliderObj.valueDefault > 0) {
this.sliderObj.valueDefault = this.sliderObj.maxVal / 100 * this.sliderObj.valueDefault;}
this.updateScrollableSpace();}
this.setWheelSpeed = function(amount, unit) {
this.sliderObj.wheelAmount    = amount;}
this.updateScrollableSpace = function() {
if (this.sliderObj.direction == 0) {
var scrollableSpace = this.contentElm.offsetWidth - this.containerElm.offsetWidth;} else {
var scrollableSpace = this.contentElm.offsetHeight - this.containerElm.offsetHeight;}
if (this.sliderObj.maxVal == 'auto') {
this.sliderObj.maxVal = scrollableSpace;}
if (scrollableSpace > 0) {
this.isActive = true;this.sliderObj.drawInto(this.sliderDivId);if (this.sliderObj.valueDefault != this.sliderObj.minVal) {
this.bsSliderChange(this.sliderObj.valueDefault);}
} else {
this.isActive = false;}
}
this.onMouseWheel = function() {
this.sliderObj.onMouseWheel();}
this.bsSliderChange = function(val, newPos) {
var percent = val * 100 / (this.sliderObj.maxVal - this.sliderObj.minVal);if (this.sliderObj.direction == 0) {
var scrollableSpace = this.contentElm.offsetWidth  - this.containerElm.offsetWidth;} else {
var scrollableSpace = this.contentElm.offsetHeight - this.containerElm.offsetHeight;}
var scrollTo = parseInt(scrollableSpace * percent  / 100);if (scrollTo != this.lastScrollTo) {
if (this.sliderObj.direction == 0) {
this.contentObj.moveIt(-scrollTo, 0);} else {
this.contentObj.moveIt(0, -scrollTo);}
this.lastScrollTo = scrollTo;}
}
}
function Bs_ScrollableDiv_onMouseWheel() {
var obj   = window.event.srcElement;var gotIt = false;while (true) {
if (typeof(obj.Bs_ScrollableDiv) != 'undefined') {
gotIt = true;break;}
if (typeof(obj.parentNode) == 'undefined') break;obj = obj.parentNode;}
if (gotIt && obj.Bs_ScrollableDiv.isActive) {
obj.Bs_ScrollableDiv.onMouseWheel();return false;} else {
return true;}
}
function lib_bwcheck() {
this.ver=navigator.appVersion;this.agent=navigator.userAgent;this.dom=(document.getElementById) ? 1 : 0;this.opera5=(navigator.userAgent.indexOf("Opera")>-1 && document.getElementById)?1:0;this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0;this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;this.ie4=(document.all && !this.dom && !this.opera5)?1:0;this.ie=this.ie4||this.ie5||this.ie6;this.mac=this.agent.indexOf("Mac")>-1;this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0;this.ns4=(document.layers && !this.dom)?1:0;this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5);bs_px_char = (this.ns4 || window.opera) ? "" : "px";return this;}
function Bs_ScrollableDiv_moveIt(x,y) {
this.x = x;this.y = y;this.css.left = this.x + bs_px_char;this.css.top  = this.y + bs_px_char;}
function Bs_ScrollableDiv_sliderChange(sliderObj, val, newPos){
sliderObj.Bs_ScrollableDiv.bsSliderChange(val, newPos);}
function makeObj(bwCheckObj, obj, nest){
nest=(!nest) ? "":'document.'+nest+'.';this.el=bwCheckObj.dom?document.getElementById(obj):bwCheckObj.ie4?document.all[obj]:bwCheckObj.ns4?eval(nest+'document.'+obj):0;this.css= (bwCheckObj.dom) ? document.getElementById(obj).style : (bwCheckObj.ie4) ? document.all[obj].style : (bwCheckObj.ns4) ? eval(nest+'document.'+obj) : 0;this.scrollHeight=bwCheckObj.ns4?this.css.document.height:this.el.offsetHeight;this.clipHeight=bwCheckObj.ns4?this.css.clip.height:this.el.offsetHeight;this.moveIt=Bs_ScrollableDiv_moveIt;this.x=0;this.y=0;this.obj = obj + "Object";eval(this.obj + "=this");return this;}



function init() {

		//scrollablediv 2
		var scroller2 = new Bs_ScrollableDiv();
		scroller2.init('divContainer_2', 'divContent_2');
		
	  var sliderObj2 = new Bs_Slider();
		sliderObj2.attachOnChange(Bs_ScrollableDiv_sliderChange);
		sliderObj2.width          = 11;
		sliderObj2.height         = 'auto';
		sliderObj2.arrowMouseOver = true;
		sliderObj2.valueDefault   = 5; //we don't start at position 0 by default. this is in percent.
		sliderObj2.direction      = 1;
		sliderObj2.imgDir         = '../images/';
		sliderObj2.setBackgroundImage('scroll_ln.gif', 'repeat');
		sliderObj2.setSliderIcon('scroll_knob.gif', 11, 5);
		sliderObj2.setArrowIconLeft('scroll_up.gif', 11, 10);
		sliderObj2.setArrowIconRight('scroll_dn.gif', 11, 10);
		sliderObj2.useInputField = 0;
		
		scroller2.setSliderObject(sliderObj2, 'sliderDiv2');
		scroller2.setSlideSpeed(75, 'pixel'); //50 pixel per second
		scroller2.setWheelSpeed(20, 'pixel'); //20 pixel per tick
	}
	
