var JABB = JABB || {}; JABB.version = "0.3"; JABB.Ajax = { onStart: null, onStop: null, onError: null, XMLHttpFactories: [ function () {return new XMLHttpRequest()}, function () {return new ActiveXObject("Msxml2.XMLHTTP")}, function () {return new ActiveXObject("Msxml3.XMLHTTP")}, function () {return new ActiveXObject("Microsoft.XMLHTTP")} ], sendRequest: function (url, callback, postData) { var req = this.createXMLHTTPObject(); if (!req) { return; } var method = (postData) ? "POST" : "GET"; var calledOnce = false; req.open(method, url, true); //Refused to set unsafe header "User-Agent" //req.setRequestHeader('User-Agent', 'XMLHTTP/1.0'); req.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); if (postData) { req.setRequestHeader('Content-type','application/x-www-form-urlencoded'); } req.onreadystatechange = function () { switch (req.readyState) { case 1: if (!calledOnce) { JABB.Ajax.onAjaxStart(); calledOnce = true; } break; case 2: return; break; case 3: return; break; case 4: JABB.Ajax.onAjaxStop(); if (req.status == 200) { callback(req); } else { JABB.Ajax.onAjaxError(); } delete req; break; }/* if (req.readyState != 4) { return; } if (req.status != 200 && req.status != 304) { return; } callback(req);*/ }; if (req.readyState == 4) { return; } req.send(postData); }, onAjaxStart: function () { if (typeof this.onStart == 'function') { this.onStart(); } }, onAjaxStop: function () { if (typeof this.onStop == 'function') { this.onStop(); } }, onAjaxError: function () { if (typeof this.onError == 'function') { this.onError(); } }, createXMLHTTPObject: function () { var xmlhttp = false; for (var i = 0; i < this.XMLHttpFactories.length; i++) { try { xmlhttp = this.XMLHttpFactories[i](); } catch (e) { continue; } break; } return xmlhttp; }, getJSON: function (url, callback) { this.sendRequest(url, function (req) { callback(eval("(" + req.responseText + ")")); }); }, postJSON: function (url, callback, postData) { this.sendRequest(url, function (req) { callback(eval("(" + req.responseText + ")")); }, postData); }, get: function (url, container_id) { this.sendRequest(url, function (req) { document.getElementById(container_id).innerHTML = JABB.Utils.parseScript(req.responseText); }); }, post: function (url, container_id, postData) { this.sendRequest(url, function (req) { document.getElementById(container_id).innerHTML = JABB.Utils.parseScript(req.responseText); }, postData); } }; JABB.Utils = { addClass: function (ele, cls) { if (!this.hasClass(ele, cls)) { ele.className += " " + cls; } }, hasClass: function (ele, cls) { return ele && ele.className.match(new RegExp('(\\s|^)' + cls + '(\\s|$)')); }, removeClass: function (ele, cls) { if (this.hasClass(ele, cls)) { var reg = new RegExp('(\\s|^)' + cls + '(\\s|$)'); ele.className = ele.className.replace(reg, ' '); } }, importCss: function (cssFile) { if (document.createStyleSheet) { document.createStyleSheet(cssFile); } else { var styles = "@import url(" + cssFile + ");"; var newSS = document.createElement('link'); newSS.rel = 'stylesheet'; newSS.href = 'data:text/css,' + escape(styles); document.getElementsByTagName("head")[0].appendChild(newSS); } }, importJs: function (jsFile) { var d = window.document; if (d.createElement) { var js = d.createElement("script"); js.type = "text/javascript"; js.src = jsFile; if (js) { d.getElementsByTagName("head")[0].appendChild(js); } } }, getElementsByClass: function (searchClass, node, tag) { var classElements = new Array(); if (node == null) { node = document; } if (tag == null) { tag = '*'; } var els = node.getElementsByTagName(tag); var elsLen = els.length; var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)"); for (var i = 0, j = 0; i < elsLen; i++) { if (pattern.test(els[i].className)) { classElements[j] = els[i]; j++; } } return classElements; }, addEvent: function (obj, type, fn) { if (obj.addEventListener) { obj.addEventListener(type, fn, false); } else if (obj.attachEvent) { obj["e" + type + fn] = fn; obj[type + fn] = function() { obj["e" + type + fn](window.event); }; obj.attachEvent("on" + type, obj[type + fn]); } else { obj["on" + type] = obj["e" + type + fn]; } }, fireEvent: function (element, event) { if (!element) return false; if (document.createEventObject) { // dispatch for IE var evt = document.createEventObject(); return element.fireEvent('on' + event, evt); } else { // dispatch for firefox + others var evt = document.createEvent("HTMLEvents"); evt.initEvent(event, true, true); // event type,bubbling,cancelable return !element.dispatchEvent(evt); } }, serialize: function (form) { if (!form || form.nodeName !== "FORM") { return undefined; } var i, j, q = []; for (i = form.elements.length - 1; i >= 0; i = i - 1) { if (form.elements[i].name === "") { continue; } switch (form.elements[i].nodeName) { case 'INPUT': switch (form.elements[i].type) { case 'text': case 'hidden': case 'password': case 'button': case 'reset': case 'submit': q.push(form.elements[i].name + "=" + encodeURIComponent(form.elements[i].value)); break; case 'checkbox': case 'radio': if (form.elements[i].checked) { q.push(form.elements[i].name + "=" + encodeURIComponent(form.elements[i].value)); } break; case 'file': break; } break; case 'TEXTAREA': q.push(form.elements[i].name + "=" + encodeURIComponent(form.elements[i].value)); break; case 'SELECT': switch (form.elements[i].type) { case 'select-one': q.push(form.elements[i].name + "=" + encodeURIComponent(form.elements[i].options[form.elements[i].selectedIndex].value)); break; case 'select-multiple': for (j = form.elements[i].options.length - 1; j >= 0; j = j - 1) { if (form.elements[i].options[j].selected) { q.push(form.elements[i].name + "=" + encodeURIComponent(form.elements[i].options[j].value)); } } break; } break; case 'BUTTON': switch (form.elements[i].type) { case 'reset': case 'submit': case 'button': q.push(form.elements[i].name + "=" + encodeURIComponent(form.elements[i].value)); break; } break; } } return q.join("&"); }, extend: function (obj, args) { var i; for (i in args) { obj[i] = args[i]; } return obj; }, createElement: function (element) { if (typeof document.createElementNS != 'undefined') { return document.createElementNS('http://www.w3.org/1999/xhtml', element); } if (typeof document.createElement != 'undefined') { return document.createElement(element); } return false; }, getEventTarget: function (e) { var targ; if (!e) { e = window.event; } if (e.target) { targ = e.target; } else if (e.srcElement) { targ = e.srcElement; } if (targ.nodeType == 3) { targ = targ.parentNode; } return targ; }, parseScript: function (_source) { var source = _source, scripts = []; while (source.indexOf(" -1 || source.indexOf(" -1) { var s = source.indexOf("", s); var e = source.indexOf("", e); scripts.push(source.substring(s_e+1, e)); source = source.substring(0, s) + source.substring(e_e+1); } for (var i = 0; i < scripts.length; i++) { try { eval(scripts[i]); } catch(ex) { // do what you want here when a script fails } } return source; }, createCookie: function (name, value, days) { if (days) { var date = new Date(); date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); var expires = "; expires=" + date.toGMTString(); } else var expires = ""; document.cookie = name + "=" + value + expires + "; path=/"; }, readCookie: function (name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for (var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') c = c.substring(1, c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length); } return null; }, eraseCookie: function (name) { this.createCookie(name, "", -1); } }; /* * CalendarJS v1.3.1 * * Copyright 2011, Dimitar Ivanov (http://www.bulgaria-web-developers.com/projects/javascript/calendar/) * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL Version 3 * (http://www.opensource.org/licenses/gpl-3.0.html) license. * * Date: Wed May 16 10:52:16 2012 +0200 */ (function(window,undefined){var now=new Date(),today=[now.getFullYear(),now.getMonth(),now.getDate()].join("-"),midnight=new Date(now.getFullYear(),now.getMonth(),now.getDate()),d=window.document;function Calendar(options){this.isOpen=false;this.focus=false;this.opts={year:new Date().getFullYear(),month:new Date().getMonth(),dayNames:["Su","Mo","Tu","We","Th","Fr","Sa"],dayNamesFull:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],monthNamesFull:["January","February","March","April","May","June","July","August","September","October","November","December"],startDay:0,weekNumbers:false,months:1,inline:false,disablePast:false,dateFormat:"Y-m-d",position:"bottom",minDate:null,onBeforeOpen:function(){},onBeforeClose:function(){},onOpen:function(){},onClose:function(){},onSelect:function(){}};for(var key in options){if(options.hasOwnProperty(key)){this.opts[key]=options[key]}}this.init.call(this)}Calendar.Util={addClass:function(ele,cls){if(ele&&!this.hasClass(ele,cls)){ele.className+=ele.className.length>0?" "+cls:cls}},hasClass:function(ele,cls){if(ele&&typeof ele.className!="undefined"&&typeof ele.nodeType!="undefined"&&ele.nodeType===1){return ele.className.match(new RegExp("(\\s|^)"+cls+"(\\s|$)"))}return false},removeClass:function(ele,cls){if(this.hasClass(ele,cls)){var reg=new RegExp("(\\s|^)"+cls+"(\\s|$)");ele.className=ele.className.replace(reg," ")}},addEvent:function(obj,type,fn){if(obj.addEventListener){obj.addEventListener(type,fn,false)}else{if(obj.attachEvent){obj["e"+type+fn]=fn;obj[type+fn]=function(){obj["e"+type+fn](window.event)};obj.attachEvent("on"+type,obj[type+fn])}else{obj["on"+type]=obj["e"+type+fn]}}},getElementsByClass:function(searchClass,node,tag){var classElements=[];if(node===null){node=d}if(tag===null){tag="*"}var els=node.getElementsByTagName(tag);var elsLen=els.length;var pattern=new RegExp("(^|\\s)"+searchClass+"(\\s|$)");for(var i=0,j=0;i0&&i0&&i===months-1){return 2}else{if(i===0&&i===months-1){return 3}else{if(i===0&&i");Calendar.Util.addEvent(cell,"click",function(e){self.container.innerHTML="";for(i=0;i1){day-=7}while(day<=daysInMonth){jsdate=new Date(year,month,day+startDay);row=d.createElement("tr");if(self.opts.weekNumbers){cell=d.createElement("td");Calendar.Util.addClass(cell,"bcal-week");a=new Date(jsdate.getFullYear(),jsdate.getMonth(),jsdate.getDate()-(jsdate.getDay()||7)+3);b=new Date(a.getFullYear(),0,4);cell.appendChild(d.createTextNode(1+Math.round((a-b)/86400000/7)));row.appendChild(cell)}for(i=0;i<7;i++){cell=d.createElement("td");if(day>0&&day<=daysInMonth){current=new Date(year,month,day);cell.setAttribute("bcal-date",current.getTime());Calendar.Util.addClass(cell,"bcal-date");if(today===[current.getFullYear(),current.getMonth(),current.getDate()].join("-")){Calendar.Util.addClass(cell,"bcal-today")}text=d.createTextNode(day);cell.appendChild(text);if(self.opts.disablePast===true&¤t<=midnight){Calendar.Util.addClass(cell,"bcal-past")}else{if(minDate&¤t10){this.resizeSpeed=10}if(this.resizeSpeed<1){this.resizeSpeed=1}var ie8Duration=2;this.resizeDuration=(11-this.resizeSpeed)*(this.ie?(this.ieVersion>=9?6:(this.ieVersion==8?(this.doc.compatMode=="BackCompat"?ie8Duration:ie8Duration-1):3)):7);this.resizeDuration=this.ff?(11-this.resizeSpeed)*(this.ffVersion<6?3:12):this.resizeDuration;this.resizeDuration=this.chrome?(11-this.resizeSpeed)*5:this.resizeDuration;this.resizeDuration=this.safari?(11-this.resizeSpeed)*20:this.resizeDuration;if(window.name!="lbIframe"){this.initialize()}}else{this.http=new Array();if(typeof $=="undefined"){$=function(id){if($.cache[id]===undefined){$.cache[id]=document.getElementById(id)||false}return $.cache[id]};$.cache={}}}}Lytebox.prototype.setBrowserInfo=function(){var ua=navigator.userAgent.toLowerCase();this.chrome=ua.indexOf("chrome")>-1;this.ff=ua.indexOf("firefox")>-1;this.safari=!this.chrome&&ua.indexOf("safari")>-1;this.opera=ua.indexOf("opera")>-1;this.ie= /*@cc_on!@*/ false;if(this.chrome){var re=new RegExp("chrome/([0-9]{1,}[.0-9]{0,})");if(re.exec(ua)!=null){this.chromeVersion=parseInt(RegExp.$1)}}if(this.ff){var re=new RegExp("firefox/([0-9]{1,}[.0-9]{0,})");if(re.exec(ua)!=null){this.ffVersion=parseInt(RegExp.$1)}}if(this.ie){var re=new RegExp("msie ([0-9]{1,}[.0-9]{0,})");if(re.exec(ua)!=null){this.ieVersion=parseInt(RegExp.$1)}}if(this.opera){var re=new RegExp("opera/([0-9]{1,}[.0-9]{0,})");if(re.exec(ua)!=null){this.operaVersion=parseInt(RegExp.$1)}}if(this.safari){var re=new RegExp("version/([0-9]{1,}[.0-9]{0,})");if(re.exec(ua)!=null){this.safariVersion=parseInt(RegExp.$1)}}};Lytebox.prototype.initialize=function(){this.updateLyteboxItems();var oBody=this.doc.getElementsByTagName("body").item(0);if(this.doc.$("lbOverlay")){oBody.removeChild(this.doc.$("lbOverlay"))}if(this.doc.$("lbMain")){oBody.removeChild(this.doc.$("lbMain"))}if(this.doc.$("lbLauncher")){oBody.removeChild(this.doc.$("lbLauncher"))}var oLauncher=this.doc.createElement("a");oLauncher.setAttribute("id","lbLauncher");oLauncher.setAttribute(this.classAttribute,"lytebox");oLauncher.style.display="none";oBody.appendChild(oLauncher);var oOverlay=this.doc.createElement("div");oOverlay.setAttribute("id","lbOverlay");oOverlay.setAttribute(this.classAttribute,this.theme);if(this.ie&&(this.ieVersion<=6||(this.ieVersion<=9&&this.doc.compatMode=="BackCompat"))){oOverlay.style.position="absolute"}oOverlay.style.display="none";oBody.appendChild(oOverlay);var oLytebox=this.doc.createElement("div");oLytebox.setAttribute("id","lbMain");oLytebox.style.display="none";oBody.appendChild(oLytebox);var oOuterContainer=this.doc.createElement("div");oOuterContainer.setAttribute("id","lbOuterContainer");oOuterContainer.setAttribute(this.classAttribute,this.theme);if(this.roundedBorder){oOuterContainer.style.MozBorderRadius="8px";oOuterContainer.style.borderRadius="8px"}oLytebox.appendChild(oOuterContainer);var oTopContainer=this.doc.createElement("div");oTopContainer.setAttribute("id","lbTopContainer");oTopContainer.setAttribute(this.classAttribute,this.theme);if(this.roundedBorder){oTopContainer.style.MozBorderRadius="8px";oTopContainer.style.borderRadius="8px"}oOuterContainer.appendChild(oTopContainer);var oTopData=this.doc.createElement("div");oTopData.setAttribute("id","lbTopData");oTopData.setAttribute(this.classAttribute,this.theme);oTopContainer.appendChild(oTopData);var oTitleTop=this.doc.createElement("span");oTitleTop.setAttribute("id","lbTitleTop");oTopData.appendChild(oTitleTop);var oNumTop=this.doc.createElement("span");oNumTop.setAttribute("id","lbNumTop");oTopData.appendChild(oNumTop);var oTopNav=this.doc.createElement("div");oTopNav.setAttribute("id","lbTopNav");oTopContainer.appendChild(oTopNav);var oCloseTop=this.doc.createElement("a");oCloseTop.setAttribute("id","lbCloseTop");oCloseTop.setAttribute("title",this.label.close);oCloseTop.setAttribute(this.classAttribute,this.theme);oCloseTop.setAttribute("href","javascript:void(0)");oTopNav.appendChild(oCloseTop);var oPrintTop=this.doc.createElement("a");oPrintTop.setAttribute("id","lbPrintTop");oPrintTop.setAttribute("title",this.label.print);oPrintTop.setAttribute(this.classAttribute,this.theme);oPrintTop.setAttribute("href","javascript:void(0)");oTopNav.appendChild(oPrintTop);var oNextTop=this.doc.createElement("a");oNextTop.setAttribute("id","lbNextTop");oNextTop.setAttribute("title",this.label.next);oNextTop.setAttribute(this.classAttribute,this.theme);oNextTop.setAttribute("href","javascript:void(0)");oTopNav.appendChild(oNextTop);var oPauseTop=this.doc.createElement("a");oPauseTop.setAttribute("id","lbPauseTop");oPauseTop.setAttribute("title",this.label.pause);oPauseTop.setAttribute(this.classAttribute,this.theme);oPauseTop.setAttribute("href","javascript:void(0)");oPauseTop.style.display="none";oTopNav.appendChild(oPauseTop);var oPlayTop=this.doc.createElement("a");oPlayTop.setAttribute("id","lbPlayTop");oPlayTop.setAttribute("title",this.label.play);oPlayTop.setAttribute(this.classAttribute,this.theme);oPlayTop.setAttribute("href","javascript:void(0)");oPlayTop.style.display="none";oTopNav.appendChild(oPlayTop);var oPrevTop=this.doc.createElement("a");oPrevTop.setAttribute("id","lbPrevTop");oPrevTop.setAttribute("title",this.label.prev);oPrevTop.setAttribute(this.classAttribute,this.theme);oPrevTop.setAttribute("href","javascript:void(0)");oTopNav.appendChild(oPrevTop);var oIframeContainer=this.doc.createElement("div");oIframeContainer.setAttribute("id","lbIframeContainer");oIframeContainer.style.display="none";oOuterContainer.appendChild(oIframeContainer);var oIframe=this.doc.createElement("iframe");oIframe.setAttribute("id","lbIframe");oIframe.setAttribute("name","lbIframe");oIframe.setAttribute("frameBorder","0");if(this.innerBorder){oIframe.setAttribute(this.classAttribute,this.theme)}oIframe.style.display="none";oIframeContainer.appendChild(oIframe);var oImageContainer=this.doc.createElement("div");oImageContainer.setAttribute("id","lbImageContainer");oOuterContainer.appendChild(oImageContainer);var oLyteboxImage=this.doc.createElement("img");oLyteboxImage.setAttribute("id","lbImage");if(this.innerBorder){oLyteboxImage.setAttribute(this.classAttribute,this.theme)}oImageContainer.appendChild(oLyteboxImage);var oLoading=this.doc.createElement("div");oLoading.setAttribute("id","lbLoading");oLoading.setAttribute(this.classAttribute,this.theme);oOuterContainer.appendChild(oLoading);var oBottomContainer=this.doc.createElement("div");oBottomContainer.setAttribute("id","lbBottomContainer");oBottomContainer.setAttribute(this.classAttribute,this.theme);if(this.roundedBorder){oBottomContainer.style.MozBorderRadius="8px";oBottomContainer.style.borderRadius="8px"}oOuterContainer.appendChild(oBottomContainer);var oDetailsBottom=this.doc.createElement("div");oDetailsBottom.setAttribute("id","lbBottomData");oDetailsBottom.setAttribute(this.classAttribute,this.theme);oBottomContainer.appendChild(oDetailsBottom);var oTitleBottom=this.doc.createElement("span");oTitleBottom.setAttribute("id","lbTitleBottom");oDetailsBottom.appendChild(oTitleBottom);var oNumBottom=this.doc.createElement("span");oNumBottom.setAttribute("id","lbNumBottom");oDetailsBottom.appendChild(oNumBottom);var oDescBottom=this.doc.createElement("span");oDescBottom.setAttribute("id","lbDescBottom");oDetailsBottom.appendChild(oDescBottom);var oHoverNav=this.doc.createElement("div");oHoverNav.setAttribute("id","lbHoverNav");oImageContainer.appendChild(oHoverNav);var oBottomNav=this.doc.createElement("div");oBottomNav.setAttribute("id","lbBottomNav");oBottomContainer.appendChild(oBottomNav);var oPrevHov=this.doc.createElement("a");oPrevHov.setAttribute("id","lbPrevHov");oPrevHov.setAttribute("title",this.label.prev);oPrevHov.setAttribute(this.classAttribute,this.theme);oPrevHov.setAttribute("href","javascript:void(0)");oHoverNav.appendChild(oPrevHov);var oNextHov=this.doc.createElement("a");oNextHov.setAttribute("id","lbNextHov");oNextHov.setAttribute("title",this.label.next);oNextHov.setAttribute(this.classAttribute,this.theme);oNextHov.setAttribute("href","javascript:void(0)");oHoverNav.appendChild(oNextHov);var oClose=this.doc.createElement("a");oClose.setAttribute("id","lbClose");oClose.setAttribute("title",this.label.close);oClose.setAttribute(this.classAttribute,this.theme);oClose.setAttribute("href","javascript:void(0)");oBottomNav.appendChild(oClose);var oPrint=this.doc.createElement("a");oPrint.setAttribute("id","lbPrint");oPrint.setAttribute("title",this.label.print);oPrint.setAttribute(this.classAttribute,this.theme);oPrint.setAttribute("href","javascript:void(0)");oPrint.style.display="none";oBottomNav.appendChild(oPrint);var oNext=this.doc.createElement("a");oNext.setAttribute("id","lbNext");oNext.setAttribute("title",this.label.next);oNext.setAttribute(this.classAttribute,this.theme);oNext.setAttribute("href","javascript:void(0)");oBottomNav.appendChild(oNext);var oPause=this.doc.createElement("a");oPause.setAttribute("id","lbPause");oPause.setAttribute("title",this.label.pause);oPause.setAttribute(this.classAttribute,this.theme);oPause.setAttribute("href","javascript:void(0)");oPause.style.display="none";oBottomNav.appendChild(oPause);var oPlay=this.doc.createElement("a");oPlay.setAttribute("id","lbPlay");oPlay.setAttribute("title",this.label.play);oPlay.setAttribute(this.classAttribute,this.theme);oPlay.setAttribute("href","javascript:void(0)");oPlay.style.display="none";oBottomNav.appendChild(oPlay);var oPrev=this.doc.createElement("a");oPrev.setAttribute("id","lbPrev");oPrev.setAttribute("title",this.label.prev);oPrev.setAttribute(this.classAttribute,this.theme);oPrev.setAttribute("href","javascript:void(0)");oBottomNav.appendChild(oPrev)};Lytebox.prototype.updateLyteboxItems=function(){var anchors=(this.isFrame&&window.parent.frames[window.name].document)?window.parent.frames[window.name].document.getElementsByTagName("a"):document.getElementsByTagName("a");anchors=(this.isFrame)?anchors:document.getElementsByTagName("a");var areas=(this.isFrame)?window.parent.frames[window.name].document.getElementsByTagName("area"):document.getElementsByTagName("area");var lyteLinks=this.combine(anchors,areas);var myLink=relAttribute=revAttribute=classAttribute=dataOptions=dataTip=tipDecoration=tipStyle=tipImage=tipHtml=aSetting=sName=sValue=sExt=null;var bImage=bRelative=false;for(var i=0;i=1){if(bImage&&(dataOptions.match(/slide:true/i)||sType[0].toLowerCase()=="lyteshow")){myLink.onclick=function(){$lb.start(this,true,false);return false}}else{if(bImage){myLink.onclick=function(){$lb.start(this,false,false);return false}}else{myLink.onclick=function(){$lb.start(this,false,true);return false}}}}dataTip=String(myLink.getAttribute("data-tip"));dataTip=this.isEmpty(dataTip)?myLink.getAttribute("title"):dataTip;if(classAttribute.toLowerCase().match("lytetip")&&!this.isEmpty(dataTip)&&!this.tipsSet){if(this.__changeTipCursor){myLink.style.cursor="help"}tipDecoration=this.__tipDecoration;tipStyle=this.__tipStyle;bRelative=this.__tipRelative;if(!this.isEmpty(dataOptions)){aOptions=dataOptions.split(" ");for(var j=0;j1?this.trim(aSetting[0]).toLowerCase():"");sValue=(aSetting.length>1?this.trim(aSetting[1]):"");switch(sName){case"tipstyle":tipStyle=(/classic|info|help|warning|error/.test(sValue)?sValue:tipStyle);break;case"changetipcursor":myLink.style.cursor=(/true|false/.test(sValue)?(sValue=="true"?"help":""):myLink.style.cursor);break;case"tiprelative":bRelative=(/true|false/.test(sValue)?(sValue=="true"):bRelative);break;case"tipdecoration":tipDecoration=(/dotted|solid|none/.test(sValue)?sValue:tipDecoration);break}}}if(tipDecoration!="dotted"){myLink.style.borderBottom=(tipDecoration=="solid"?"1px solid":"none")}switch(tipStyle){case"info":tipStyle="lbCustom lbInfo";tipImage="lbTipImg lbInfoImg";break;case"help":tipStyle="lbCustom lbHelp";tipImage="lbTipImg lbHelpImg";break;case"warning":tipStyle="lbCustom lbWarning";tipImage="lbTipImg lbWarningImg";break;case"error":tipStyle="lbCustom lbError";tipImage="lbTipImg lbErrorImg";break;case"classic":tipStyle="lbClassic";tipImage="";break;default:tipStyle="lbClassic";tipImage=""}if((this.ie&&this.ieVersion<=7)||(this.ieVersion==8&&this.doc.compatMode=="BackCompat")){tipImage="";if(tipStyle!="lbClassic"&&!this.isEmpty(tipStyle)){tipStyle+=" lbIEFix"}}var aLinkPos=this.findPos(myLink);if((this.ie&&(this.ieVersion<=6||this.doc.compatMode=="BackCompat"))||bRelative){myLink.style.position="relative"}tipHtml=myLink.innerHTML;myLink.innerHTML="";if((this.ie&&this.ieVersion<=6&&this.doc.compatMode!="BackCompat")||bRelative){myLink.innerHTML=tipHtml+''+(tipImage?'
':"")+dataTip+"
"}else{myLink.innerHTML=tipHtml+''+(tipImage?'
':"")+dataTip+"
"}if(classAttribute.match(/lytebox|lyteshow|lyteframe/i)==null){myLink.setAttribute("title","")}}}}this.tipsSet=true};Lytebox.prototype.launch=function(args){var sUrl=this.isEmpty(args.url)?"":String(args.url);var sOptions=this.isEmpty(args.options)?"":String(args.options).toLowerCase();var sTitle=this.isEmpty(args.title)?"":args.title;var sDesc=this.isEmpty(args.description)?"":args.description;if(this.isEmpty(sUrl)){return false}var sExt=sUrl.split(".").pop().toLowerCase();var bImage=(sExt=="png"||sExt=="jpg"||sExt=="jpeg"||sExt=="gif"||sExt=="bmp");var oLauncher=this.doc.$("lbLauncher");oLauncher.setAttribute("href",sUrl);oLauncher.setAttribute("data-lyte-options",sOptions);oLauncher.setAttribute("data-title",sTitle);oLauncher.setAttribute("data-description",sDesc);this.updateLyteboxItems();this.start(oLauncher,false,(bImage?false:true))};Lytebox.prototype.start=function(oLink,bSlideshow,bFrame){var dataOptions=String(oLink.getAttribute("data-lyte-options"));dataOptions=this.isEmpty(dataOptions)?String(oLink.getAttribute("rev")):dataOptions;this.setOptions(dataOptions);this.isSlideshow=(bSlideshow?true:false);this.isLyteframe=(bFrame?true:false);if(!this.isEmpty(this.beforeStart)){var callback=window[this.beforeStart];if(typeof callback==="function"){if(!callback()){return }}}if(this.ie&&this.ieVersion<=6){this.toggleSelects("hide")}if(this.hideObjects){this.toggleObjects("hide")}if(this.isFrame&&window.parent.frames[window.name].document){window.parent.$lb.printId=(this.isLyteframe?"lbIframe":"lbImage")}else{this.printId=(this.isLyteframe?"lbIframe":"lbImage")}this.aPageSize=this.getPageSize();var objOverlay=this.doc.$("lbOverlay");var objBody=this.doc.getElementsByTagName("body").item(0);objOverlay.style.height=this.aPageSize[1]+"px";objOverlay.style.display="";this.fadeIn({id:"lbOverlay",opacity:(this.doAnimations&&this.animateOverlay&&(!this.ie||this.ieVersion>=9)?0:this.maxOpacity)});var anchors=(this.isFrame&&window.parent.frames[window.name].document)?window.parent.frames[window.name].document.getElementsByTagName("a"):document.getElementsByTagName("a");anchors=(this.isFrame)?anchors:document.getElementsByTagName("a");var areas=(this.isFrame)?window.parent.frames[window.name].document.getElementsByTagName("area"):document.getElementsByTagName("area");var lyteLinks=this.combine(anchors,areas);var sType=sExt=null;this.frameArray=[];this.frameNum=0;this.imageArray=[];this.imageNum=0;this.slideArray=[];this.slideNum=0;if(this.isEmpty(this.group)){dataOptions=String(oLink.getAttribute("data-lyte-options"));dataOptions=this.isEmpty(dataOptions)?String(oLink.getAttribute("rev")):dataOptions;if(this.isLyteframe){this.frameArray.push(new Array(oLink.getAttribute("href"),(!this.isEmpty(oLink.getAttribute("data-title"))?oLink.getAttribute("data-title"):oLink.getAttribute("title")),oLink.getAttribute("data-description"),dataOptions))}else{this.imageArray.push(new Array(oLink.getAttribute("href"),(!this.isEmpty(oLink.getAttribute("data-title"))?oLink.getAttribute("data-title"):oLink.getAttribute("title")),oLink.getAttribute("data-description"),dataOptions))}}else{for(var i=0;i=1){if(bImage&&(dataOptions.match(/slide:true/i)||sType[0].toLowerCase()=="lyteshow")){this.slideArray.push(new Array(myLink.getAttribute("href"),(!this.isEmpty(myLink.getAttribute("data-title"))?myLink.getAttribute("data-title"):myLink.getAttribute("title")),myLink.getAttribute("data-description"),dataOptions))}else{if(bImage){this.imageArray.push(new Array(myLink.getAttribute("href"),(!this.isEmpty(myLink.getAttribute("data-title"))?myLink.getAttribute("data-title"):myLink.getAttribute("title")),myLink.getAttribute("data-description"),dataOptions))}else{this.frameArray.push(new Array(myLink.getAttribute("href"),(!this.isEmpty(myLink.getAttribute("data-title"))?myLink.getAttribute("data-title"):myLink.getAttribute("title")),myLink.getAttribute("data-description"),dataOptions))}}}}}if(this.isLyteframe){this.frameArray=this.removeDuplicates(this.frameArray);while(this.frameArray[this.frameNum][0]!=oLink.getAttribute("href")){this.frameNum++}}else{if(bSlideshow){this.slideArray=this.removeDuplicates(this.slideArray);try{while(this.slideArray[this.slideNum][0]!=oLink.getAttribute("href")){this.slideNum++}}catch(e){}}else{this.imageArray=this.removeDuplicates(this.imageArray);while(this.imageArray[this.imageNum][0]!=oLink.getAttribute("href")){this.imageNum++}}}}this.changeContent(this.isLyteframe?this.frameNum:(this.isSlideshow?this.slideNum:this.imageNum))};Lytebox.prototype.changeContent=function(iContentNum){this.contentNum=iContentNum;if(!this.overlayLoaded){this.changeContentTimerArray[this.changeContentTimerCount++]=setTimeout("$lb.changeContent("+this.contentNum+")",250);return }else{for(var i=0;ix?x:w)+"px";h=(parseInt(h)>y?y:h)+"px"}iframe.height=this.height=h;iframe.width=this.width=w;iframe.scrolling=this.scrolling;var oDoc=iframe.contentWindow||iframe.contentDocument;try{if(oDoc.document){oDoc=oDoc.document}oDoc.body.style.margin=0;oDoc.body.style.padding=0;if(this.ie&&this.ieVersion<=8){oDoc.body.scroll=this.scrolling;oDoc.body.overflow=this.scrolling="no"?"hidden":"auto"}}catch(e){}this.resizeContainer(parseInt(this.width),parseInt(this.height))}else{imgPreloader=new Image();imgPreloader.onload=function(){var imageWidth=imgPreloader.width;var imageHeight=imgPreloader.height;if($lb.autoResize){var x=$lb.aPageSize[2]-50;var y=$lb.aPageSize[3]-150;if(imageWidth>x){imageHeight=Math.round(imageHeight*(x/imageWidth));imageWidth=x;if(imageHeight>y){imageWidth=Math.round(imageWidth*(y/imageHeight));imageHeight=y}}else{if(imageHeight>y){imageWidth=Math.round(imageWidth*(y/imageHeight));imageHeight=y;if(imageWidth>x){imageHeight=Math.round(imageHeight*(x/imageWidth));imageWidth=x}}}}var lbImage=$lb.doc.$("lbImage");lbImage.src=($lb.isSlideshow?$lb.slideArray[$lb.contentNum][0]:$lb.imageArray[$lb.contentNum][0]);lbImage.width=imageWidth;lbImage.height=imageHeight;$lb.resizeContainer(imageWidth,imageHeight);imgPreloader.onload=function(){}};imgPreloader.src=(this.isSlideshow?this.slideArray[this.contentNum][0]:this.imageArray[this.contentNum][0])}};Lytebox.prototype.resizeContainer=function(iWidth,iHeight){this.resizeWidth=iWidth;this.resizeHeight=iHeight;this.wCur=this.doc.$("lbOuterContainer").offsetWidth;this.hCur=this.doc.$("lbOuterContainer").offsetHeight;this.xScale=((this.resizeWidth+(this.borderSize*2))/this.wCur)*100;this.yScale=((this.resizeHeight+(this.borderSize*2))/this.hCur)*100;var wDiff=(this.wCur-this.borderSize*2)-this.resizeWidth;var hDiff=(this.hCur-this.borderSize*2)-this.resizeHeight;this.wDone=(wDiff==0);if(!(hDiff==0)){this.hDone=false;this.resizeH("lbOuterContainer",this.hCur,this.resizeHeight+this.borderSize*2,this.getPixelRate(this.hCur,this.resizeHeight))}else{this.hDone=true;if(!this.wDone){this.resizeW("lbOuterContainer",this.wCur,this.resizeWidth+this.borderSize*2,this.getPixelRate(this.wCur,this.resizeWidth))}}if((hDiff==0)&&(wDiff==0)){if(this.ie){this.pause(250)}else{this.pause(100)}}this.doc.$("lbPrevHov").style.height=this.resizeHeight+"px";this.doc.$("lbNextHov").style.height=this.resizeHeight+"px";if(this.hDone&&this.wDone){if(this.isLyteframe){this.loadContent()}else{this.showContent()}}};Lytebox.prototype.loadContent=function(){try{var iframe=this.doc.$("lbIframe");var uri=this.frameArray[this.contentNum][0];var ext=uri.split(".").pop().toLowerCase();if(!this.inline&&this.appendQS){uri+=((/\?/.test(uri))?"&":"?")+"request_from=lytebox"}if(!this.autoEmbed||(this.ff&&(ext=="pdf"||ext=="mov"))||ext=="wmv"){this.frameSource=uri;this.showContent();return }if(this.ie){iframe.onreadystatechange=function(){if($lb.doc.$("lbIframe").readyState=="complete"){$lb.showContent();$lb.doc.$("lbIframe").onreadystatechange=null}}}else{iframe.onload=function(){$lb.showContent();$lb.doc.$("lbIframe").onload=null}}if(this.inline||(ext=="mov"||ext=="avi"||ext=="wmv"||ext=="mpg"||ext=="mpeg"||ext=="swf")){iframe.src="/about:blank";this.frameSource="";var sHtml=(this.inline)?this.doc.$(uri.substr(uri.indexOf("#")+1,uri.length)).innerHTML:this.buildObject(parseInt(this.width),parseInt(this.height),uri,ext);var oDoc=iframe.contentWindow||iframe.contentDocument;if(oDoc.document){oDoc=oDoc.document}oDoc.open();oDoc.write(sHtml);oDoc.close();oDoc.body.style.margin=0;oDoc.body.style.padding=0;if(!this.inline){oDoc.body.style.backgroundColor="#fff";oDoc.body.style.fontFamily="Verdana, Helvetica, sans-serif";oDoc.body.style.fontSize="0.9em"}this.frameSource=""}else{this.frameSource=uri;iframe.src=/uri}}catch(e){}};Lytebox.prototype.showContent=function(){if(this.isSlideshow){if(this.contentNum==(this.slideArray.length-1)){if(this.loopSlideshow){this.slideshowIDArray[this.slideshowIDCount++]=setTimeout("$lb.changeContent(0)",this.slideInterval)}else{if(this.autoEnd){this.slideshowIDArray[this.slideshowIDCount++]=setTimeout("$lb.end('slideshow')",this.slideInterval)}}}else{if(!this.isPaused){this.slideshowIDArray[this.slideshowIDCount++]=setTimeout("$lb.changeContent("+(this.contentNum+1)+")",this.slideInterval)}}this.doc.$("lbHoverNav").style.display=(this.ieVersion!=6&&this.showNavigation&&this.navTypeHash["Hover_by_type_"+this.navType]?"":"none");this.doc.$("lbCloseTop").style.display=(this.showClose&&this.navTop?"":"none");this.doc.$("lbClose").style.display=(this.showClose&&!this.navTop?"":"none");this.doc.$("lbBottomData").style.display=(this.showDetails?"":"none");this.doc.$("lbPauseTop").style.display=(this.showPlayPause&&this.navTop?(!this.isPaused?"":"none"):"none");this.doc.$("lbPause").style.display=(this.showPlayPause&&!this.navTop?(!this.isPaused?"":"none"):"none");this.doc.$("lbPlayTop").style.display=(this.showPlayPause&&this.navTop?(!this.isPaused?"none":""):"none");this.doc.$("lbPlay").style.display=(this.showPlayPause&&!this.navTop?(!this.isPaused?"none":""):"none");this.doc.$("lbPrevTop").style.display=(this.navTop&&this.showNavigation&&this.navTypeHash["Display_by_type_"+this.navType]?"":"none");this.doc.$("lbPrev").style.display=(!this.navTop&&this.showNavigation&&this.navTypeHash["Display_by_type_"+this.navType]?"":"none");this.doc.$("lbNextTop").style.display=(this.navTop&&this.showNavigation&&this.navTypeHash["Display_by_type_"+this.navType]?"":"none");this.doc.$("lbNext").style.display=(!this.navTop&&this.showNavigation&&this.navTypeHash["Display_by_type_"+this.navType]?"":"none")}else{this.doc.$("lbHoverNav").style.display=(this.ieVersion!=6&&this.navTypeHash["Hover_by_type_"+this.navType]&&!this.isLyteframe?"":"none");if((this.navTypeHash["Display_by_type_"+this.navType]&&!this.isLyteframe&&this.imageArray.length>1)||(this.frameArray.length>1&&this.isLyteframe)){this.doc.$("lbPrevTop").style.display=(this.navTop?"":"none");this.doc.$("lbPrev").style.display=(!this.navTop?"":"none");this.doc.$("lbNextTop").style.display=(this.navTop?"":"none");this.doc.$("lbNext").style.display=(!this.navTop?"":"none")}else{this.doc.$("lbPrevTop").style.display="none";this.doc.$("lbPrev").style.display="none";this.doc.$("lbNextTop").style.display="none";this.doc.$("lbNext").style.display="none"}this.doc.$("lbCloseTop").style.display=(this.navTop?"":"none");this.doc.$("lbClose").style.display=(!this.navTop?"":"none");this.doc.$("lbBottomData").style.display="";this.doc.$("lbPauseTop").style.display="none";this.doc.$("lbPause").style.display="none";this.doc.$("lbPlayTop").style.display="none";this.doc.$("lbPlay").style.display="none"}this.doc.$("lbPrintTop").style.display=(this.showPrint&&this.navTop?"":"none");this.doc.$("lbPrint").style.display=(this.showPrint&&!this.navTop?"":"none");this.updateDetails();this.doc.$("lbLoading").style.display="none";this.doc.$("lbImageContainer").style.display=(this.isLyteframe?"none":"");this.doc.$("lbIframeContainer").style.display=(this.isLyteframe?"":"none");if(this.isLyteframe){if(!this.isEmpty(this.frameSource)){this.doc.$("lbIframe").src=/this.frameSource}this.doc.$("lbIframe").style.display="";this.fadeIn({id:"lbIframe",opacity:(this.doAnimations&&(!this.ie||this.ieVersion>=9)?0:100)})}else{this.doc.$("lbImage").style.display="";this.fadeIn({id:"lbImage",opacity:(this.doAnimations&&(!this.ie||this.ieVersion>=9)?0:100)});this.preloadNeighborImages()}if(!this.isEmpty(this.afterStart)){var callback=window[this.afterStart];if(typeof callback==="function"){callback()}}};Lytebox.prototype.updateDetails=function(){var sTitle=(this.isSlideshow?this.slideArray[this.contentNum][1]:(this.isLyteframe?this.frameArray[this.contentNum][1]:this.imageArray[this.contentNum][1]));var sDesc=(this.isSlideshow?this.slideArray[this.contentNum][2]:(this.isLyteframe?this.frameArray[this.contentNum][2]:this.imageArray[this.contentNum][2]));if(this.ie&&this.ieVersion<=7||(this.ieVersion>=8&&this.doc.compatMode=="BackCompat")){this.doc.$(this.titleTop?"lbTitleBottom":"lbTitleTop").style.display="none";this.doc.$(this.titleTop?"lbTitleTop":"lbTitleBottom").style.display=(this.isEmpty(sTitle)?"none":"block")}this.doc.$("lbDescBottom").style.display=(this.isEmpty(sDesc)?"none":"");this.doc.$(this.titleTop?"lbTitleTop":"lbTitleBottom").innerHTML=(this.isEmpty(sTitle)?"":sTitle);this.doc.$(this.titleTop?"lbTitleBottom":"lbTitleTop").innerHTML="";this.doc.$(this.titleTop?"lbNumBottom":"lbNumTop").innerHTML="";this.updateNav();if(this.titleTop||this.navTop){this.doc.$("lbTopContainer").style.display="block";this.doc.$("lbTopContainer").style.visibility="visible"}else{this.doc.$("lbTopContainer").style.display="none"}var object=(this.titleTop?this.doc.$("lbNumTop"):this.doc.$("lbNumBottom"));if(this.isSlideshow&&this.slideArray.length>1){object.innerHTML=this.label.image.replace("%1",this.contentNum+1).replace("%2",this.slideArray.length)}else{if(this.imageArray.length>1&&!this.isLyteframe){object.innerHTML=this.label.image.replace("%1",this.contentNum+1).replace("%2",this.imageArray.length)}else{if(this.frameArray.length>1&&this.isLyteframe){object.innerHTML=this.label.page.replace("%1",this.contentNum+1).replace("%2",this.frameArray.length)}else{object.innerHTML=""}}}var bAddSpacer=!(this.titleTop||(this.isEmpty(sTitle)&&this.isEmpty(object.innerHTML)));this.doc.$("lbDescBottom").innerHTML=(this.isEmpty(sDesc)?"":(bAddSpacer?'
':"")+sDesc);var iNavWidth=0;if(this.ie&&this.ieVersion<=7||(this.ieVersion>=8&&this.doc.compatMode=="BackCompat")){iNavWidth=39+(this.showPrint?39:0)+(this.isSlideshow&&this.showPlayPause?39:0);if((this.isSlideshow&&this.slideArray.length>1&&this.showNavigation&&this.navType!=1)||(this.frameArray.length>1&&this.isLyteframe)||(this.imageArray.length>1&&!this.isLyteframe&&this.navType!=1)){iNavWidth+=39*2}}this.doc.$("lbBottomContainer").style.display=(!(this.titleTop&&this.navTop)||!this.isEmpty(sDesc)?"block":"none");if(this.titleTop&&this.navTop){if(iNavWidth>0){this.doc.$("lbTopNav").style.width=iNavWidth+"px"}this.doc.$("lbTopData").style.width=(this.doc.$("lbTopContainer").offsetWidth-this.doc.$("lbTopNav").offsetWidth-15)+"px";if(!this.isEmpty(sDesc)){this.doc.$("lbDescBottom").style.width=(this.doc.$("lbBottomContainer").offsetWidth-15)+"px"}}else{if((!this.titleTop||!this.isEmpty(sDesc))&&!this.navTop){if(iNavWidth>0){this.doc.$("lbBottomNav").style.width=iNavWidth+"px"}this.doc.$("lbBottomData").style.width=(this.doc.$("lbBottomContainer").offsetWidth-this.doc.$("lbBottomNav").offsetWidth-15)+"px";this.doc.$("lbDescBottom").style.width=this.doc.$("lbBottomData").style.width}}this.fixBottomPadding();this.aPageSize=this.getPageSize();var iMainTop=parseInt(this.doc.$("lbMain").style.top);if((this.ie&&this.ieVersion<=7)||(this.ieVersion>=8&&this.doc.compatMode=="BackCompat")){iMainTop=(this.ie?parseInt(this.doc.$("lbMain").style.top)-this.getPageScroll():parseInt(this.doc.$("lbMain").style.top))}var iOverlap=(this.doc.$("lbOuterContainer").offsetHeight+iMainTop)-this.aPageSize[3];var iDivisor=40;if(iOverlap>0&&this.autoResize&&this.fixedPosition){if(this.ie&&(this.ieVersion<=7||this.doc.compatMode=="BackCompat")){document.body.onscroll=this.bodyOnscroll;if(window.removeEventListener){window.removeEventListener("scroll",this.scrollHandler)}else{if(window.detachEvent){window.detachEvent("onscroll",this.scrollHandler)}}}this.doc.$("lbMain").style.position="absolute";this.doc.$("lbMain").style.top=(this.getPageScroll()+(this.aPageSize[3]/iDivisor))+"px"}};Lytebox.prototype.updateNav=function(){if(this.isSlideshow){if(this.contentNum!=0){if(this.navTypeHash["Display_by_type_"+this.navType]&&this.showNavigation){this.doc.$(this.navTop?"lbPrevTop":"lbPrev").setAttribute(this.classAttribute,this.theme);this.doc.$(this.navTop?"lbPrevTop":"lbPrev").style.display="";this.doc.$(this.navTop?"lbPrevTop":"lbPrev").onclick=function(){if($lb.pauseOnPrevClick){$lb.togglePlayPause($lb.navTop?"lbPauseTop":"lbPause",$lb.navTop?"lbPlayTop":"lbPlay")}$lb.changeContent($lb.contentNum-1);return false}}if(this.navTypeHash["Hover_by_type_"+this.navType]){var object=this.doc.$("lbPrevHov");object.style.display="";object.onclick=function(){if($lb.pauseOnPrevClick){$lb.togglePlayPause($lb.navTop?"lbPauseTop":"lbPause",$lb.navTop?"lbPlayTop":"lbPlay")}$lb.changeContent($lb.contentNum-1);return false}}}else{if(this.navTypeHash["Display_by_type_"+this.navType]){this.doc.$(this.navTop?"lbPrevTop":"lbPrev").setAttribute(this.classAttribute,this.theme+"Off");this.doc.$(this.navTop?"lbPrevTop":"lbPrev").onclick=function(){return false}}}if(this.contentNum!=(this.slideArray.length-1)&&this.showNavigation){if(this.navTypeHash["Display_by_type_"+this.navType]){this.doc.$(this.navTop?"lbNextTop":"lbNext").setAttribute(this.classAttribute,this.theme);this.doc.$(this.navTop?"lbNextTop":"lbNext").style.display="";this.doc.$(this.navTop?"lbNextTop":"lbNext").onclick=function(){if($lb.pauseOnNextClick){$lb.togglePlayPause($lb.navTop?"lbPauseTop":"lbPause",$lb.navTop?"lbPlayTop":"lbPlay")}$lb.changeContent($lb.contentNum+1);return false}}if(this.navTypeHash["Hover_by_type_"+this.navType]){var object=this.doc.$("lbNextHov");object.style.display="";object.onclick=function(){if($lb.pauseOnNextClick){$lb.togglePlayPause($lb.navTop?"lbPauseTop":"lbPause",$lb.navTop?"lbPlayTop":"lbPlay")}$lb.changeContent($lb.contentNum+1);return false}}}else{if(this.navTypeHash["Display_by_type_"+this.navType]){this.doc.$(this.navTop?"lbNextTop":"lbNext").setAttribute(this.classAttribute,this.theme+"Off");this.doc.$(this.navTop?"lbNextTop":"lbNext").onclick=function(){return false}}}}else{if(this.isLyteframe){if(this.contentNum!=0){this.doc.$(this.navTop?"lbPrevTop":"lbPrev").setAttribute(this.classAttribute,this.theme);this.doc.$(this.navTop?"lbPrevTop":"lbPrev").style.display="";this.doc.$(this.navTop?"lbPrevTop":"lbPrev").onclick=function(){$lb.changeContent($lb.contentNum-1);return false}}else{this.doc.$(this.navTop?"lbPrevTop":"lbPrev").setAttribute(this.classAttribute,this.theme+"Off");this.doc.$(this.navTop?"lbPrevTop":"lbPrev").onclick=function(){return false}}if(this.contentNum!=(this.frameArray.length-1)){this.doc.$(this.navTop?"lbNextTop":"lbNext").setAttribute(this.classAttribute,this.theme);this.doc.$(this.navTop?"lbNextTop":"lbNext").style.display="";this.doc.$(this.navTop?"lbNextTop":"lbNext").onclick=function(){$lb.changeContent($lb.contentNum+1);return false}}else{this.doc.$(this.navTop?"lbNextTop":"lbNext").setAttribute(this.classAttribute,this.theme+"Off");this.doc.$(this.navTop?"lbNextTop":"lbNext").onclick=function(){return false}}}else{if(this.contentNum!=0){if(this.navTypeHash["Display_by_type_"+this.navType]){this.doc.$(this.navTop?"lbPrevTop":"lbPrev").setAttribute(this.classAttribute,this.theme);this.doc.$(this.navTop?"lbPrevTop":"lbPrev").style.display="";this.doc.$(this.navTop?"lbPrevTop":"lbPrev").onclick=function(){$lb.changeContent($lb.contentNum-1);return false}}if(this.navTypeHash["Hover_by_type_"+this.navType]){var object2=this.doc.$("lbPrevHov");object2.style.display="";object2.onclick=function(){$lb.changeContent($lb.contentNum-1);return false}}}else{if(this.navTypeHash["Display_by_type_"+this.navType]){this.doc.$(this.navTop?"lbPrevTop":"lbPrev").setAttribute(this.classAttribute,this.theme+"Off");this.doc.$(this.navTop?"lbPrevTop":"lbPrev").onclick=function(){return false}}}if(this.contentNum!=(this.imageArray.length-1)){if(this.navTypeHash["Display_by_type_"+this.navType]){this.doc.$(this.navTop?"lbNextTop":"lbNext").setAttribute(this.classAttribute,this.theme);this.doc.$(this.navTop?"lbNextTop":"lbNext").style.display="";this.doc.$(this.navTop?"lbNextTop":"lbNext").onclick=function(){$lb.changeContent($lb.contentNum+1);return false}}if(this.navTypeHash["Hover_by_type_"+this.navType]){var object2=this.doc.$("lbNextHov");object2.style.display="";object2.onclick=function(){$lb.changeContent($lb.contentNum+1);return false}}}else{if(this.navTypeHash["Display_by_type_"+this.navType]){this.doc.$(this.navTop?"lbNextTop":"lbNext").setAttribute(this.classAttribute,this.theme+"Off");this.doc.$(this.navTop?"lbNextTop":"lbNext").onclick=function(){return false}}}}}this.enableKeyboardNav()};Lytebox.prototype.fixBottomPadding=function(){if(!((this.ieVersion==7||this.ieVersion==8||this.ieVersion==9)&&this.doc.compatMode=="BackCompat")&&this.ieVersion!=6){var titleHeight=this.doc.$("lbTopContainer").offsetHeight+5;var offsetHeight=(titleHeight==5?0:titleHeight)+this.doc.$("lbBottomContainer").offsetHeight;this.doc.$("lbOuterContainer").style.paddingBottom=(offsetHeight+5)+"px"}};Lytebox.prototype.enableKeyboardNav=function(){document.onkeydown=this.keyboardAction};Lytebox.prototype.disableKeyboardNav=function(){document.onkeydown=""};Lytebox.prototype.keyboardAction=function(e){var keycode=key=escape=null;keycode=(e==null)?event.keyCode:e.which;key=String.fromCharCode(keycode).toLowerCase();escape=(e==null)?27:e.DOM_VK_ESCAPE;if((key=="x")||(key=="c")||(keycode==escape||keycode==27)){parent.$lb.end()}else{if(keycode==32&&$lb.isSlideshow&&$lb.showPlayPause){if($lb.isPaused){$lb.togglePlayPause($lb.navTop?"lbPlayTop":"lbPlay",$lb.navTop?"lbPauseTop":"lbPause")}else{$lb.togglePlayPause($lb.navTop?"lbPauseTop":"lbPause",$lb.navTop?"lbPlayTop":"lbPlay")}return false}else{if(key=="p"||keycode==37){if($lb.isSlideshow){if($lb.contentNum!=0){$lb.disableKeyboardNav();$lb.changeContent($lb.contentNum-1)}}else{if($lb.isLyteframe){if($lb.contentNum!=0){$lb.disableKeyboardNav();$lb.changeContent($lb.contentNum-1)}}else{if($lb.contentNum!=0){$lb.disableKeyboardNav();$lb.changeContent($lb.contentNum-1)}}}}else{if(key=="n"||keycode==39){if($lb.isSlideshow){if($lb.contentNum!=($lb.slideArray.length-1)){$lb.disableKeyboardNav();$lb.changeContent($lb.contentNum+1)}}else{if($lb.isLyteframe){if($lb.contentNum!=($lb.frameArray.length-1)){$lb.disableKeyboardNav();$lb.changeContent($lb.contentNum+1)}}else{if($lb.contentNum!=($lb.imageArray.length-1)){$lb.disableKeyboardNav();$lb.changeContent($lb.contentNum+1)}}}}}}}};Lytebox.prototype.preloadNeighborImages=function(){if(this.isSlideshow){if((this.slideArray.length-1)>this.contentNum){var preloadNextImage=new Image();preloadNextImage.src=/this.slideArray[this.contentNum+1][0]}if(this.contentNum>0){var preloadPrevImage=new Image();preloadPrevImage.src=/this.slideArray[this.contentNum-1][0]}}else{if((this.imageArray.length-1)>this.contentNum){var preloadNextImage=new Image();preloadNextImage.src=/this.imageArray[this.contentNum+1][0]}if(this.contentNum>0){var preloadPrevImage=new Image();preloadPrevImage.src=/this.imageArray[this.contentNum-1][0]}}};Lytebox.prototype.togglePlayPause=function(sHideId,sShowId){if(this.isSlideshow&&(sHideId=="lbPauseTop"||sHideId=="lbPause")){for(var i=0;i=9)?this.maxOpacity:0),speed:5,display:"none"});this.toggleSelects("visible");if(this.hideObjects){this.toggleObjects("visible")}this.doc.$("lbOuterContainer").style.width="200px";this.doc.$("lbOuterContainer").style.height="200px";if(this.inline&&this.safari){var iframe=this.doc.$("lbIframe");var oDoc=iframe.contentWindow||iframe.contentDocument;if(oDoc.document){oDoc=oDoc.document}oDoc.open();oDoc.write("");oDoc.close()}if(this.isSlideshow){for(var i=0;iiCurrent)?iDim-iCurrent:iCurrent-iDim;if(diff>=0&&diff<=100){return(100/this.resizeDuration)}if(diff>100&&diff<=200){return(150/this.resizeDuration)}if(diff>200&&diff<=300){return(200/this.resizeDuration)}if(diff>300&&diff<=400){return(250/this.resizeDuration)}if(diff>400&&diff<=500){return(300/this.resizeDuration)}if(diff>500&&diff<=600){return(350/this.resizeDuration)}if(diff>600&&diff<=700){return(400/this.resizeDuration)}if(diff>700){return(450/this.resizeDuration)}};Lytebox.prototype.fadeIn=function(args){var sId=this.isEmpty(args.id)?"":args.id;var iSpeed=(this.isEmpty(args.speed)?5:(parseInt(args.speed)>5?5:parseInt(args.speed)));iSpeed=isNaN(iSpeed)?5:iSpeed;var iOpacity=this.isEmpty(args.opacity)?0:parseInt(args.opacity);iOpacity=isNaN(iOpacity)?0:iOpacity;var sDisplay=this.isEmpty(args.display)?"":args.display;var sVisibility=this.isEmpty(args.visibility)?"":args.visibility;var oElement=this.doc.$(sId);var iIncrement=iSpeed;if(/lbImage|lbIframe|lbOverlay|lbBottomContainer|lbTopContainer/.test(sId)){iIncrement=this.ff?(this.ffVersion>=6?2:5):(this.safari?3:(this.ieVersion<=8?10:5));iIncrement=(sId=="lbOverlay"?iIncrement*2:iIncrement);iIncrement=(sId=="lbIframe"?100:iIncrement)}else{if(this.ieVersion==7||this.ieVersion==8){iIncrement=10}}oElement.style.opacity=(iOpacity/100);oElement.style.filter="alpha(opacity="+(iOpacity)+")";if(iOpacity>=100&&(sId=="lbImage"||sId=="lbIframe")){try{oElement.style.removeAttribute("filter")}catch(e){}this.fixBottomPadding()}else{if(iOpacity>=this.maxOpacity&&sId=="lbOverlay"){for(var i=0;i=100&&(sId=="lbBottomContainer"||sId=="lbTopContainer")){try{oElement.style.removeAttribute("filter")}catch(e){}for(var i=0;i=100){for(var i=0;i5?5:parseInt(args.speed)));iSpeed=isNaN(iSpeed)?5:iSpeed;var iOpacity=this.isEmpty(args.opacity)?100:parseInt(args.opacity);iOpacity=isNaN(iOpacity)?100:iOpacity;var sDisplay=this.isEmpty(args.display)?"":args.display;var sVisibility=this.isEmpty(args.visibility)?"":args.visibility;var oElement=this.doc.$(sId);if(this.ieVersion==7||this.ieVersion==8){iSpeed*=2}oElement.style.opacity=(iOpacity/100);oElement.style.filter="alpha(opacity="+iOpacity+")";if(iOpacity<=0){try{if(!this.isEmpty(sDisplay)){oElement.style.display=sDisplay}if(!this.isEmpty(sVisibility)){oElement.style.visibility=sVisibility}}catch(err){}if(sId=="lbOverlay"){this.overlayLoaded=false;if(this.isLyteframe){this.doc.$("lbIframe").src="/about:blank";this.initialize()}}else{for(var i=0;i=iMaxW)?(iMaxW-newW):iPixelRate}else{if(newW>iMaxW){newW-=(newW-iPixelRate<=iMaxW)?(newW-iMaxW):iPixelRate}}this.resizeWTimerArray[this.resizeWTimerCount++]=setTimeout("$lb.resizeW('"+sId+"', "+newW+", "+iMaxW+", "+iPixelRate+", "+(iSpeed)+")",iSpeed);if(parseInt(object.style.width)==iMaxW){this.wDone=true;for(var i=0;i=iMaxH)?(iMaxH-newH):iPixelRate}else{if(newH>iMaxH){newH-=(newH-iPixelRate<=iMaxH)?(newH-iMaxH):iPixelRate}}this.resizeHTimerArray[this.resizeHTimerCount++]=setTimeout("$lb.resizeH('"+sId+"', "+newH+", "+iMaxH+", "+iPixelRate+", "+(iSpeed+0.02)+")",iSpeed+0.02);if(parseInt(object.style.height)==iMaxH){this.hDone=true;for(var i=0;ithis.doc.body.offsetHeight){xScroll=this.doc.body.scrollWidth;yScroll=this.doc.body.scrollHeight}else{xScroll=this.doc.getElementsByTagName("html").item(0).offsetWidth;yScroll=this.doc.getElementsByTagName("html").item(0).offsetHeight;xScroll=(xScrollexitTime){return }}};Lytebox.prototype.combine=function(aAnchors,aAreas){var lyteLinks=[];for(var i=0;i1?this.trim(aSetting[0]).toLowerCase():"");sValue=(aSetting.length>1?this.trim(aSetting[1]):"");switch(sName){case"group":this.group=(sName=="group"?(!this.isEmpty(sValue)?sValue.toLowerCase():""):"");break;case"hideobjects":this.hideObjects=(/true|false/.test(sValue)?(sValue=="true"):this.__hideObjects);break;case"autoresize":this.autoResize=(/true|false/.test(sValue)?(sValue=="true"):this.__autoResize);break;case"doanimations":this.doAnimations=(/true|false/.test(sValue)?(sValue=="true"):this.__doAnimations);break;case"animateoverlay":this.animateOverlay=(/true|false/.test(sValue)?(sValue=="true"):this.__animateOverlay);break;case"forcecloseclick":this.forceCloseClick=(/true|false/.test(sValue)?(sValue=="true"):this.__forceCloseClick);break;case"refreshpage":this.refreshPage=(/true|false/.test(sValue)?(sValue=="true"):this.__refreshPage);break;case"showprint":this.showPrint=(/true|false/.test(sValue)?(sValue=="true"):this.__showPrint);break;case"navtype":this.navType=(/[1-3]{1}/.test(sValue)?parseInt(sValue):this.__navType);break;case"titletop":this.titleTop=(/true|false/.test(sValue)?(sValue=="true"):this.__titleTop);break;case"navtop":this.navTop=(/true|false/.test(sValue)?(sValue=="true"):this.__navTop);break;case"beforestart":this.beforeStart=(!this.isEmpty(sValue)?sValue:this.__beforeStart);break;case"afterstart":this.afterStart=(!this.isEmpty(sValue)?sValue:this.__afterStart);break;case"beforeend":this.beforeEnd=(!this.isEmpty(sValue)?sValue:this.__beforeEnd);break;case"afterend":this.afterEnd=(!this.isEmpty(sValue)?sValue:this.__afterEnd);break;case"scrollbars":this.scrolling=(/auto|yes|no/.test(sValue)?sValue:this.__scrolling);break;case"scrolling":this.scrolling=(/auto|yes|no/.test(sValue)?sValue:this.__scrolling);break;case"width":this.width=(/\d(%|px|)/.test(sValue)?sValue:this.__width);break;case"height":this.height=(/\d(%|px|)/.test(sValue)?sValue:this.__height);break;case"loopplayback":this.loopPlayback=(/true|false/.test(sValue)?(sValue=="true"):this.__loopPlayback);break;case"autoplay":this.autoPlay=(/true|false/.test(sValue)?(sValue=="true"):this.__autoPlay);break;case"autoembed":this.autoEmbed=(/true|false/.test(sValue)?(sValue=="true"):this.__autoEmbed);break;case"inline":this.inline=(/true|false/.test(sValue)?(sValue=="true"):false);case"slideinterval":this.slideInterval=(/\d/.test(sValue)?parseInt(sValue):this.__slideInterval);break;case"shownavigation":this.showNavigation=(/true|false/.test(sValue)?(sValue=="true"):this.__showNavigation);break;case"showclose":this.showClose=(/true|false/.test(sValue)?(sValue=="true"):this.__showClose);break;case"showdetails":this.showDetails=(/true|false/.test(sValue)?(sValue=="true"):this.__showDetails);break;case"showplaypause":this.showPlayPause=(/true|false/.test(sValue)?(sValue=="true"):this.__showPlayPause);break;case"autoend":this.autoEnd=(/true|false/.test(sValue)?(sValue=="true"):this.__autoEnd);break;case"pauseonnextclick":this.pauseOnNextClick=(/true|false/.test(sValue)?(sValue=="true"):this.__pauseOnNextClick);break;case"pauseonprevclick":this.pauseOnPrevClick=(/true|false/.test(sValue)?(sValue=="true"):this.__pauseOnPrevClick);break;case"loopslideshow":this.loopSlideshow=(/true|false/.test(sValue)?(sValue=="true"):this.__loopSlideshow);break}}};Lytebox.prototype.buildObject=function(w,h,url,ext){var object="";var classId="";var codebase="";var pluginsPage="";var auto=this.autoPlay?"true":"false";var loop=this.loopPlayback?"true":"false";switch(ext){case"mov":codebase="http://www.apple.com/qtactivex/qtplugin.cab";pluginsPage="http://www.apple.com/quicktime/";classId="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B";object='';if(this.getQuicktimeVersion()<=0){object='

QUICKTIME PLAYER

Content on this page requires a newer version of QuickTime. Please click the image link below to download and install the latest version.

'}break;case"avi":case"mpg":case"mpeg":case"wmv":classId="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B";object='';break;case"swf":classId="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000";object='

FLASH PLAYER

Content on this page requires a newer version of Adobe Flash Player. Please click the image link below to download and install the latest version.

';break}return object};Lytebox.prototype.getQuicktimeVersion=function(){var agent=navigator.userAgent.toLowerCase();var version=-1;if(navigator.plugins!=null&&navigator.plugins.length>0){for(i=0;i-1){version=parseFloat(plugin.name.substring(18))}}}else{if(this.autoEmbed&&agent.indexOf("msie")!=-1&&parseInt(navigator.appVersion)>=4&&agent.indexOf("win")!=-1&&agent.indexOf("16bit")==-1){var control=null;try{control=new ActiveXObject("QuickTime.QuickTime")}catch(e){}if(control){isInstalled=true}try{control=new ActiveXObject("QuickTimeCheckObject.QuickTimeCheck")}catch(e){return }if(control){isInstalled=true;version=control.QuickTimeVersion.toString(16);version=version.substring(0,1)+"."+version.substring(1,3);version=parseInt(version)}}}return version};Lytebox.prototype.findPos=function(el){if(this.ie&&this.doc.compatMode=="BackCompat"){return[0,16,12]}var left=0;var top=0;var height=0;height=el.offsetHeight+6;if(el.offsetParent){do{left+=el.offsetLeft;top+=el.offsetTop}while(el=el.offsetParent)}return[left,top,height]};Lytebox.prototype.isMobile=function(){var ua=navigator.userAgent;return(ua.match(/ipad/i)!=null)||(ua.match(/ipod/i)!=null)||(ua.match(/iphone/i)!=null)||(ua.match(/android/i)!=null)||(ua.match(/opera mini/i)!=null)||(ua.match(/blackberry/i)!=null)||(ua.match(/(pre\/|palm os|palm|hiptop|avantgo|plucker|xiino|blazer|elaine)/i)!=null)||(ua.match(/(iris|3g_t|windows ce|opera mobi|windows ce; smartphone;|windows ce; iemobile)/i)!=null)||(ua.match(/(mini 9.5|vx1000|lge |m800|e860|u940|ux840|compal|wireless| mobi|ahong|lg380|lgku|lgu900|lg210|lg47|lg920|lg840|lg370|sam-r|mg50|s55|g83|t66|vx400|mk99|d615|d763|el370|sl900|mp500|samu3|samu4|vx10|xda_|samu5|samu6|samu7|samu9|a615|b832|m881|s920|n210|s700|c-810|_h797|mob-x|sk16d|848b|mowser|s580|r800|471x|v120|rim8|c500foma:|160x|x160|480x|x640|t503|w839|i250|sprint|w398samr810|m5252|c7100|mt126|x225|s5330|s820|htil-g1|fly v71|s302|-x113|novarra|k610i|-three|8325rc|8352rc|sanyo|vx54|c888|nx250|n120|mtk |c5588|s710|t880|c5005|i;458x|p404i|s210|c5100|teleca|s940|c500|s590|foma|samsu|vx8|vx9|a1000|_mms|myx|a700|gu1100|bc831|e300|ems100|me701|me702m-three|sd588|s800|8325rc|ac831|mw200|brew |d88|htc\/|htc_touch|355x|m50|km100|d736|p-9521|telco|sl74|ktouch|m4u\/|me702|8325rc|kddi|phone|lg |sonyericsson|samsung|240x|x320|vx10|nokia|sony cmd|motorola|up.browser|up.link|mmp|symbian|smartphone|midp|wap|vodafone|o2|pocket|kindle|mobile|psp|treo)/i)!=null)};Lytebox.prototype.validate=function(args){var reTest=sName="";var bValid=false;var oElement=this.isEmpty(args.id)?(this.isEmpty(args.element)?null:args.element):document.getElementById(args.id);var sInput=this.isEmpty(args.value)?"":String(args.value);var sType=this.isEmpty(args.type)?"":String(args.type).toLowerCase();var sRegex=this.isEmpty(args.regex)?"":args.regex;var sCCType=(/visa|mc|amex|diners|discover|jcb/.test(args.ccType)?args.ccType:"");var iMin=(/^\d+$/.test(args.min)?parseInt(args.min):0);var iMax=(/^\d+$/.test(args.max)?parseInt(args.max):0);var bInclusive=args.inclusive?true:(/true|false/.test(args.inclusive)?(args.inclusive=="true"):true);var bAllowComma=args.allowComma?true:(/true|false/.test(args.allowComma)?(args.allowComma=="true"):true);var bAllowWhitespace=args.allowWhiteSpace?true:(/true|false/.test(args.allowWhiteSpace)?(args.allowWhiteSpace=="true"):true);if((this.isEmpty(sInput)&&this.isEmpty(oElement))||(this.isEmpty(sType)&&this.isEmpty(sRegex))){return false}var sInput=this.isEmpty(sInput)?oElement.value:sInput;if(!this.isEmpty(sRegex)){bValid=sRegex.test(sInput)}else{switch(sType){case"alnum":bValid=(bAllowWhitespace?/^[a-z0-9\s]+$/i.test(sInput):/^[a-z0-9]+$/i.test(sInput));break;case"alpha":bValid=(bAllowWhitespace?/^[a-z\s]+$/i.test(sInput):/^[a-z]+$/i.test(sInput));break;case"between":var iInput=bAllowComma?parseInt(sInput.replace(/\,/g,"")):parseInt(sInput);bValid=(bInclusive?(iInput>=iMin&&iInput<=iMax):(iInput>iMin&&iInput=iMin&&sInput.length<=iMax);break;case"phone":bValid=/^\(?(\d{3})\)?[- ]?(\d{3})[- ]?(\d{4})$/.test(sInput);break;case"notempty":bValid=!this.isEmpty(sInput);break;case"ssn":bValid=/^[0-9]{3}\-?[0-9]{2}\-?[0-9]{4}$/.test(sInput);break;case"url":bValid=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»""'']))/i.test(sInput);break;case"zip":bValid=/^\d{5}$|^\d{5}-\d{4}$/.test(sInput);break}}return bValid};Lytebox.prototype.ajax=function(args){var iIndex=this.http.length;var oRequest=this.getRequestObject();this.http[iIndex]=oRequest;var oHttpArgs=args;oHttpArgs.index=iIndex;oHttpArgs.method=!(/get|post/i.test(oHttpArgs.method))?"get":oHttpArgs.method;oHttpArgs.cache=!(/true|false/.test(oHttpArgs.cache))?true:(oHttpArgs.cache=="true"||oHttpArgs.cache);if(!this.isEmpty(oHttpArgs.timeout)&&(/^\d+$/.test(oHttpArgs.timeout))){oHttpArgs.timerId=setTimeout("$lb.http["+iIndex+"].abort()",oHttpArgs.timeout)}oRequest.onreadystatechange=function(){return function(){if(oRequest.readyState==4&&oRequest.status==200){var sResponse=oRequest.responseText;if(document.getElementById(oHttpArgs.updateId)){document.getElementById(oHttpArgs.updateId).innerHTML=sResponse}if(typeof oHttpArgs.success==="function"){oHttpArgs.success(sResponse)}window.clearTimeout(oHttpArgs.timerId);$lb.http[oHttpArgs.index]=null}else{if(oRequest.readyState==4&&oRequest.status!=200){if(typeof oHttpArgs.fail==="function"){oHttpArgs.fail(oRequest.responseText)}window.clearTimeout(oHttpArgs.timerId);$lb.http[oHttpArgs.index]=null}}}(oRequest,oHttpArgs)};if(oHttpArgs.method.toLowerCase()=="post"){var oForm=document.getElementById(oHttpArgs.form);var bStripTags=!(/true|false/.test(args.stripTags))?false:(args.stripTags=="true"||args.stripTags);var sParams=(oForm==null?this.serialize({name:oHttpArgs.form,stripTags:bStripTags}):this.serialize({element:oForm,stripTags:bStripTags}));var sTimestamp=(!oHttpArgs.cache?((/\&/.test(sParams))?"&":"")+new Date().getTime():"");oRequest.open("post",oHttpArgs.url,true);oRequest.setRequestHeader("Content-type","application/x-www-form-urlencoded");oRequest.send(sParams+sTimestamp)}else{var sTimestamp=(!oHttpArgs.cache?((/\?/.test(oHttpArgs.url))?"&":"?")+new Date().getTime():"");oRequest.open("get",oHttpArgs.url+sTimestamp,true);oRequest.send()}};Lytebox.prototype.serialize=function(args){var sParams=sValue="";var bStripTags=!(/true|false/.test(args.stripTags))?false:(args.stripTags=="true"||args.stripTags);var oElements=this.isEmpty(args.id)?(this.isEmpty(args.element)?null:args.element):document.getElementById(args.id);if(oElements==null){for(var i=0;i]+)>)/ig,"")}else{var sValue="";try{sValue=this.isEmpty(args.value)?args:args.value}catch(e){sValue=args}return String(sValue).replace(/(<([^>]+)>)/ig,"")}};Lytebox.prototype.trim=function(args){var sValue="";try{sValue=this.isEmpty(args.value)?args:args.value}catch(e){sValue=args}return String(sValue).replace(/^\s+|\s+$/g,"")};Lytebox.prototype.capitalize=function(args){return String(args.value?args.value:args).replace(/(^|\s)([a-z])/g,function(m,p1,p2){return p1+p2.toUpperCase()})};Lytebox.prototype.hasClass=function(args){var sClass=this.isEmpty(args.name)?"":args.name;var oElement=this.isEmpty(args.id)?(this.isEmpty(args.element)?null:args.element):document.getElementById(args.id);return new RegExp("(\\s|^)"+sClass+"(\\s|$)").test(oElement.className)};Lytebox.prototype.addClass=function(args){var sClass=this.isEmpty(args.name)?"":args.name;var oElement=this.isEmpty(args.id)?(this.isEmpty(args.element)?null:args.element):document.getElementById(args.id);var aClasses=sClass.split(" ");for(var i=0;idate)?1:(this=start.getTime()&&t<=end.getTime();};Date.prototype.addMilliseconds=function(value){this.setMilliseconds(this.getMilliseconds()+value);return this;};Date.prototype.addSeconds=function(value){return this.addMilliseconds(value*1000);};Date.prototype.addMinutes=function(value){return this.addMilliseconds(value*60000);};Date.prototype.addHours=function(value){return this.addMilliseconds(value*3600000);};Date.prototype.addDays=function(value){return this.addMilliseconds(value*86400000);};Date.prototype.addWeeks=function(value){return this.addMilliseconds(value*604800000);};Date.prototype.addMonths=function(value){var n=this.getDate();this.setDate(1);this.setMonth(this.getMonth()+value);this.setDate(Math.min(n,this.getDaysInMonth()));return this;};Date.prototype.addYears=function(value){return this.addMonths(value*12);};Date.prototype.add=function(config){if(typeof config=="number"){this._orient=config;return this;} var x=config;if(x.millisecond||x.milliseconds){this.addMilliseconds(x.millisecond||x.milliseconds);} if(x.second||x.seconds){this.addSeconds(x.second||x.seconds);} if(x.minute||x.minutes){this.addMinutes(x.minute||x.minutes);} if(x.hour||x.hours){this.addHours(x.hour||x.hours);} if(x.month||x.months){this.addMonths(x.month||x.months);} if(x.year||x.years){this.addYears(x.year||x.years);} if(x.day||x.days){this.addDays(x.day||x.days);} return this;};Date._validate=function(value,min,max,name){if(typeof value!="number"){throw new TypeError(value+" is not a Number.");}else if(valuemax){throw new RangeError(value+" is not a valid value for "+name+".");} return true;};Date.validateMillisecond=function(n){return Date._validate(n,0,999,"milliseconds");};Date.validateSecond=function(n){return Date._validate(n,0,59,"seconds");};Date.validateMinute=function(n){return Date._validate(n,0,59,"minutes");};Date.validateHour=function(n){return Date._validate(n,0,23,"hours");};Date.validateDay=function(n,year,month){return Date._validate(n,1,Date.getDaysInMonth(year,month),"days");};Date.validateMonth=function(n){return Date._validate(n,0,11,"months");};Date.validateYear=function(n){return Date._validate(n,1,9999,"seconds");};Date.prototype.set=function(config){var x=config;if(!x.millisecond&&x.millisecond!==0){x.millisecond=-1;} if(!x.second&&x.second!==0){x.second=-1;} if(!x.minute&&x.minute!==0){x.minute=-1;} if(!x.hour&&x.hour!==0){x.hour=-1;} if(!x.day&&x.day!==0){x.day=-1;} if(!x.month&&x.month!==0){x.month=-1;} if(!x.year&&x.year!==0){x.year=-1;} if(x.millisecond!=-1&&Date.validateMillisecond(x.millisecond)){this.addMilliseconds(x.millisecond-this.getMilliseconds());} if(x.second!=-1&&Date.validateSecond(x.second)){this.addSeconds(x.second-this.getSeconds());} if(x.minute!=-1&&Date.validateMinute(x.minute)){this.addMinutes(x.minute-this.getMinutes());} if(x.hour!=-1&&Date.validateHour(x.hour)){this.addHours(x.hour-this.getHours());} if(x.month!==-1&&Date.validateMonth(x.month)){this.addMonths(x.month-this.getMonth());} if(x.year!=-1&&Date.validateYear(x.year)){this.addYears(x.year-this.getFullYear());} if(x.day!=-1&&Date.validateDay(x.day,this.getFullYear(),this.getMonth())){this.addDays(x.day-this.getDate());} if(x.timezone){this.setTimezone(x.timezone);} if(x.timezoneOffset){this.setTimezoneOffset(x.timezoneOffset);} return this;};Date.prototype.clearTime=function(){this.setHours(0);this.setMinutes(0);this.setSeconds(0);this.setMilliseconds(0);return this;};Date.prototype.isLeapYear=function(){var y=this.getFullYear();return(((y%4===0)&&(y0!==0))||(y@0===0));};Date.prototype.isWeekday=function(){return!(this.is().sat()||this.is().sun());};Date.prototype.getDaysInMonth=function(){return Date.getDaysInMonth(this.getFullYear(),this.getMonth());};Date.prototype.moveToFirstDayOfMonth=function(){return this.set({day:1});};Date.prototype.moveToLastDayOfMonth=function(){return this.set({day:this.getDaysInMonth()});};Date.prototype.moveToDayOfWeek=function(day,orient){var diff=(day-this.getDay()+7*(orient||+1))%7;return this.addDays((diff===0)?diff+=7*(orient||+1):diff);};Date.prototype.moveToMonth=function(month,orient){var diff=(month-this.getMonth()+12*(orient||+1));return this.addMonths((diff===0)?diff+=12*(orient||+1):diff);};Date.prototype.getDayOfYear=function(){return Math.floor((this-new Date(this.getFullYear(),0,1))/86400000);};Date.prototype.getWeekOfYear=function(firstDayOfWeek){var y=this.getFullYear(),m=this.getMonth(),d=this.getDate();var dow=firstDayOfWeek||Date.CultureInfo.firstDayOfWeek;var offset=7+1-new Date(y,0,1).getDay();if(offset==8){offset=1;} var daynum=((Date.UTC(y,m,d,0,0,0)-Date.UTC(y,0,1,0,0,0))/86400000)+1;var w=Math.floor((daynum-offset+7)/7);if(w===dow){y--;var prevOffset=7+1-new Date(y,0,1).getDay();if(prevOffset==2||prevOffset==8){w=53;}else{w=52;}} return w;};Date.prototype.isDST=function(){console.log('isDST');return this.toString().match(/(E|C|M|P)(S|D)T/)[2]=="D";};Date.prototype.getTimezone=function(){return Date.getTimezoneAbbreviation(this.getUTCOffset,this.isDST());};Date.prototype.setTimezoneOffset=function(s){var here=this.getTimezoneOffset(),there=Number(s)*-6/10;this.addMinutes(there-here);return this;};Date.prototype.setTimezone=function(s){return this.setTimezoneOffset(Date.getTimezoneOffset(s));};Date.prototype.getUTCOffset=function(){var n=this.getTimezoneOffset()*-10/6,r;if(n<0){r=(n-10000).toString();return r[0]+r.substr(2);}else{r=(n+10000).toString();return"+"+r.substr(1);}};Date.prototype.getDayName=function(abbrev){return abbrev?Date.CultureInfo.abbreviatedDayNames[this.getDay()]:Date.CultureInfo.dayNames[this.getDay()];};Date.prototype.getMonthName=function(abbrev){return abbrev?Date.CultureInfo.abbreviatedMonthNames[this.getMonth()]:Date.CultureInfo.monthNames[this.getMonth()];};Date.prototype._toString=Date.prototype.toString;Date.prototype.toString=function(format){var self=this;var p=function p(s){return(s.toString().length==1)?"0"+s:s;};return format?format.replace(/dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|zz?z?/g,function(format){switch(format){case"hh":return p(self.getHours()<13?self.getHours():(self.getHours()-12));case"h":return self.getHours()<13?self.getHours():(self.getHours()-12);case"HH":return p(self.getHours());case"H":return self.getHours();case"mm":return p(self.getMinutes());case"m":return self.getMinutes();case"ss":return p(self.getSeconds());case"s":return self.getSeconds();case"yyyy":return self.getFullYear();case"yy":return self.getFullYear().toString().substring(2,4);case"dddd":return self.getDayName();case"ddd":return self.getDayName(true);case"dd":return p(self.getDate());case"d":return self.getDate().toString();case"MMMM":return self.getMonthName();case"MMM":return self.getMonthName(true);case"MM":return p((self.getMonth()+1));case"M":return self.getMonth()+1;case"t":return self.getHours()<12?Date.CultureInfo.amDesignator.substring(0,1):Date.CultureInfo.pmDesignator.substring(0,1);case"tt":return self.getHours()<12?Date.CultureInfo.amDesignator:Date.CultureInfo.pmDesignator;case"zzz":case"zz":case"z":return"";}}):this._toString();}; Date.now=function(){return new Date();};Date.today=function(){return Date.now().clearTime();};Date.prototype._orient=+1;Date.prototype.next=function(){this._orient=+1;return this;};Date.prototype.last=Date.prototype.prev=Date.prototype.previous=function(){this._orient=-1;return this;};Date.prototype._is=false;Date.prototype.is=function(){this._is=true;return this;};Number.prototype._dateElement="day";Number.prototype.fromNow=function(){var c={};c[this._dateElement]=this;return Date.now().add(c);};Number.prototype.ago=function(){var c={};c[this._dateElement]=this*-1;return Date.now().add(c);};(function(){var $D=Date.prototype,$N=Number.prototype;var dx=("sunday monday tuesday wednesday thursday friday saturday").split(/\s/),mx=("january february march april may june july august september october november december").split(/\s/),px=("Millisecond Second Minute Hour Day Week Month Year").split(/\s/),de;var df=function(n){return function(){if(this._is){this._is=false;return this.getDay()==n;} return this.moveToDayOfWeek(n,this._orient);};};for(var i=0;i0&&!last){try{q=d.call(this,r[1]);}catch(ex){last=true;}}else{last=true;} if(!last&&q[1].length===0){last=true;} if(!last){var qx=[];for(var j=0;j0){rx[0]=rx[0].concat(p[0]);rx[1]=p[1];}} if(rx[1].length1){args=Array.prototype.slice.call(arguments);}else if(arguments[0]instanceof Array){args=arguments[0];} if(args){for(var i=0,px=args.shift();i2)?n:(n+(((n+2000)Date.getDaysInMonth(this.year,this.month)){throw new RangeError(this.day+" is not a valid value for days.");} var r=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second);if(this.timezone){r.set({timezone:this.timezone});}else if(this.timezoneOffset){r.set({timezoneOffset:this.timezoneOffset});} return r;},finish:function(x){x=(x instanceof Array)?flattenAndCompact(x):[x];if(x.length===0){return null;} for(var i=0;i>> 0; if (len === 0) { return -1; } var n = 0; if (arguments.length > 0) { n = Number(arguments[1]); if (n != n) { // shortcut for verifying if it's NaN n = 0; } else if (n != 0 && n != Infinity && n != -Infinity) { n = (n > 0 || -1) * Math.floor(Math.abs(n)); } } if (n >= len) { return -1; } var k = n >= 0 ? n : Math.max(len - Math.abs(n), 0); for (; k < len; k++) { if (k in t && t[k] === searchElement) { return k; } } return -1; } } HB.prototype = { init: function () { var self = this; self.container = document.getElementById("hbContainer"); self.loadSearch(); self.overlayTerms = new OverlayJS({ selector: "hbDialogTerms", modal: true, width: 640, height: 480, onBeforeOpen: function () { var that = this; JABB.Ajax.sendRequest(self.opts.folder + "index.php?controller=Front&action=getTerms", function (req) { that.content.innerHTML = req.responseText; }); }, buttons: { "Close": function (button) { this.close(); } } }); self.overlayPrice = new OverlayJS({ selector: "hbDialogPrice", modal: true, width: 600, height: 400, onBeforeOpen: function () { var inst = this, that = self.opCallee, id = that.name.match(/\d+/)[0]; JABB.Ajax.sendRequest([self.opts.folder, "index.php?controller=Front&action=getPeople&room_id=", id, "&rooms=", that.options[that.selectedIndex].value, "&adults=1&children=0"].join(""), function(req) { inst.content.innerHTML = req.responseText; var sPeople = JABB.Utils.getElementsByClass("hbSelectPeople", inst.content, "select"), i, len; for (i = 0, len = sPeople.length; i < len; i++) { sPeople[i].onchange = function () { var people = JABB.Utils.getElementsByClass("hbSelectPeople", this.parentNode.parentNode, "select"), select = this, index = select.getAttribute("rel"), j, l, a = []; for (j = 0, l = people.length; j < l; j++) { a.push(people[j].name.match(/\w+/)[0] + "=" + encodeURIComponent(people[j].options[people[j].selectedIndex].value)); } a.push(["index=", index].join("")); a.push(["room_id=", id].join("")); JABB.Ajax.getJSON([self.opts.folder, "index.php?controller=Front&action=getPrice&", a.join("&")].join(""), function(data) { document.getElementById("hb2Total").innerHTML = data.format_total; document.getElementById("hb2Price_" + index).innerHTML = data.format_room; }); } } }); }, buttons: { "OK": function (button) { var frm = this.content.firstChild; if (frm) { JABB.Ajax.postJSON([self.opts.folder, "index.php?controller=Front&action=setPrice"].join(""), function(data) { var hbSelection = document.getElementById("hbSelection_" + data.id); if (hbSelection) { var arr = [], people = 0; for (var j in data.content) { if (data.content.hasOwnProperty(j)) { arr.push(data.content[j].adults + " adults, " + data.content[j].children + " children x " + data.content[j].price); people += parseInt(data.content[j].adults, 10) + parseInt(data.content[j].children, 10); } } hbSelection.innerHTML = arr.join("
"); self.reCycle.apply(self, [people, data.id]); } }, JABB.Utils.serialize(frm)); } this.close(); }, "Cancel": function (button) { this.close(); self.opCallee.recentIndex = self.opCallee.oldIndex; self.opCallee.selectedIndex = self.opCallee.oldIndex; } } }); }, reCycle: function () { var self = this; /* cnt = 0; selectRoom = JABB.Utils.getElementsByClass("hbSelectRoom"); for (var i = 0, len = selectRoom.length; i < len; i++) { cnt += parseInt(selectRoom[i].options[selectRoom[i].selectedIndex].value, 10); } var el = JABB.Utils.getElementsByClass("hbBoxSelected", self.container, "span"); if (el[0]) { el[0].innerHTML = cnt; }*/ if (arguments.length > 0) { if (arguments[0] > 0) { if (!self.ppl) { self.ppl = []; } self.ppl[arguments[1]] = arguments[0]; } else { if (self.ppl) { self.ppl[arguments[1]] = 0; } } } var cnt = 0; if (self.ppl) { for (var x in self.ppl) { if (self.ppl.hasOwnProperty(x)) { cnt += self.ppl[x]; } } } var el = JABB.Utils.getElementsByClass("hbBoxSelected", self.container, "span"); if (el[0]) { el[0].innerHTML = cnt; } }, bindSearch: function () { var self = this, dateFrom = new Calendar({ element: "hb_date_from", dateFormat: self.opts.dateFormat, disablePast: true, onSelect: function (element, selectedDate, date, cell) { dateTo.opts.minDate = new Date(date); dateTo.container.innerHTML = ""; dateTo.draw(dateTo.opts.minDate.getFullYear(), dateTo.opts.minDate.getMonth(), 3); if (Date.parseExact(dateTo.element.value, dateFormat(self.opts.dateFormat, 'datejs')) < dateTo.opts.minDate) { dateTo.element.value = selectedDate; } } }), dateTo = new Calendar({ element: "hb_date_to", dateFormat: self.opts.dateFormat, disablePast: true, onSelect: function (element, selectedDate, date, cell) { } }), lnkFrom = document.getElementById("hbDateFrom"), lnkTo = document.getElementById("hbDateTo"), btnCheck = document.getElementById("hbBtnCheck"); self.elFrom = document.getElementById("hb_date_from"); self.elTo = document.getElementById("hb_date_to"); if (lnkFrom) { lnkFrom.onclick = function (e) { if (e && e.preventDefault) { e.preventDefault(); } dateFrom.isOpen ? dateFrom.close() : dateFrom.open(); return false; }; } if (lnkTo) { lnkTo.onclick = function (e) { if (e && e.preventDefault) { e.preventDefault(); } dateTo.isOpen ? dateTo.close() : dateTo.open(); return false; }; } if (btnCheck) { btnCheck.onclick = function () { this.disabled = true; if (!self.validateSearch(this)) { this.disabled = false; return; } self.passed.first = true; self.loadRooms.apply(self, [JABB.Utils.serialize(document.getElementById("hbFormSearch"))]); }; } }, bindRooms: function () { var self = this, btnBook = document.getElementById("hbBtnBook"), loadSearch = JABB.Utils.getElementsByClass("hbLoadSearch"), selectRoom = JABB.Utils.getElementsByClass("hbSelectRoom"), i, len; if (btnBook) { btnBook.onclick = function () { this.disabled = true; if (!self.validateRooms()) { this.disabled = false; return; } self.passed.second = true; self.loadExtras(); }; } for (i = 0, len = loadSearch.length; i < len; i++) { loadSearch[i].onclick = function (e) { if (e && e.preventDefault) { e.preventDefault(); } self.loadSearch(); return false; }; } for (i = 0, len = selectRoom.length; i < len; i++) { selectRoom[i].recentIndex = selectRoom[i].selectedIndex; selectRoom[i].onchange = function (e) { this.oldIndex = this.recentIndex; this.recentIndex = this.selectedIndex; self.opCallee = this; self.overlayPrice.open(); }; } myLytebox = $lb = new Lytebox(true); }, bindExtras: function () { var self = this, btnCheckout = document.getElementById("hbBtnCheckout"), btnConditions = document.getElementById("hbBtnConditions"), btnWhen = document.getElementById("hbBtnWhen"), btnChoise = document.getElementById("hbBtnChoise"), add = JABB.Utils.getElementsByClass("hbBtnAdd", self.container, "button"), remove = JABB.Utils.getElementsByClass("hbBtnRemove", self.container, "button"), i, len; if (btnCheckout) { btnCheckout.onclick = function () { self.passed.third = true; self.loadCheckout(); }; } if (btnConditions) { btnConditions.onclick = function (e) { if (e && e.preventDefault) { e.preventDefault(); } self.overlayTerms.open(); return false; } } if (btnWhen) { btnWhen.onclick = function (e) { if (e && e.preventDefault) { e.preventDefault(); } self.loadSearch(); return false; }; } if (btnChoise) { btnChoise.onclick = function (e) { if (e && e.preventDefault) { e.preventDefault(); } self.loadRooms(); return false; }; } for (i = 0, len = add.length; i < len; i++) { add[i].onclick = function (e) { self.addExtra.apply(self, [this.value]); }; } for (i = 0, len = remove.length; i < len; i++) { remove[i].onclick = function (e) { self.removeExtra.apply(self, [this.value]); }; } }, bindCheckout: function () { var self = this, btnTerms = document.getElementById("hbBtnTerms"), btnConfirm = document.getElementById("hbBtnConfirm"), arrivalDate = document.getElementById("hbArrivalDate"), btnBack = document.getElementById("hbBtnBack"); if (arrivalDate) { var api = new Calendar({ element: "hbArrivalDate", dateFormat: "Y-m-d", disablePast: true }); } if (btnTerms) { btnTerms.onclick = function (e) { self.overlayTerms.open(); if (e && e.preventDefault) { e.preventDefault(); } return false; }; } if (btnBack) { btnBack.onclick = function () { self.loadExtras(); }; } if (btnConfirm) { var frm = btnConfirm.form; if (frm) { var pm = frm.payment_method; if (pm) { pm.onchange = function (e) { var data = document.getElementById("hbCCData"), banktransfer=document.getElementById("hbBankTransfer"), names = ["cc_type", "cc_num", "cc_exp_month", "cc_exp_year", "cc_code"], i, len = names.length; switch (this.options[this.selectedIndex].value) { case 'creditcard': //data.style.display = ""; for (i = 0; i < len; i++) { JABB.Utils.addClass(frm[names[i]], "hbRequired"); } banktransfer.style.display = "none"; break; case 'banktransfer': //data.style.display = "none"; for (i = 0; i < len; i++) { JABB.Utils.addClass(frm[names[i]], "hbRequired"); } banktransfer.style.display = ""; break; default: //data.style.display = "none"; for (i = 0; i < len; i++) { JABB.Utils.removeClass(frm[names[i]], "hbRequired"); } } }; } } btnConfirm.onclick = function () { var that = this; that.disabled = true; btnBack.disabled = true; if (!self.validateCheckoutForm(that)) { that.disabled = false; btnBack.disabled = false; return; } JABB.Ajax.postJSON(self.opts.folder + "index.php?controller=Front&action=bookingSave", function (data) { switch (data.code) { case 100: self.errorHandler('\n' + self.opts.message_4); that.disabled = false; btnBack.disabled = false; break; case 200: switch (data.payment) { case 'paypal': self.triggerLoading('message_1', self.container); self.loadPaymentForm(data); break; case 'authorize': self.triggerLoading('message_2', self.container); self.loadPaymentForm(data); break; case 'creditcard': self.triggerLoading('message_3', self.container); break; default: self.triggerLoading('message_3', self.container); } break; } }, JABB.Utils.serialize(that.form)); }; } }, loadSearch: function () { var self = this; JABB.Ajax.sendRequest(self.opts.folder + "index.php?controller=Front&action=loadSearch", function (req) { self.container.innerHTML = req.responseText; self.bindSearch(); }); }, loadRooms: function () { var self = this, post = typeof arguments[0] != "undefined" ? arguments[0] : null; JABB.Ajax.sendRequest(self.opts.folder + "index.php?controller=Front&action=loadRooms", function (req) { self.container.innerHTML = req.responseText; self.bindRooms(); self.reCycle(); }, post); }, loadExtras: function () { var self = this; JABB.Ajax.sendRequest([self.opts.folder, "index.php?controller=Front&action=loadExtras"].join(""), function (req) { self.container.innerHTML = req.responseText; self.bindExtras(); }, JABB.Utils.serialize(document.getElementById("hbFormRooms"))); }, loadCheckout: function () { var self = this; JABB.Ajax.sendRequest(self.opts.folder + "index.php?controller=Front&action=loadCheckout", function (req) { self.container.innerHTML = req.responseText; self.bindCheckout(); }); }, loadPaymentForm: function (obj) { var self = this, div; JABB.Ajax.sendRequest(self.opts.folder + "index.php?controller=Front&action=loadPayment", function (req) { div = document.createElement("div"); div.innerHTML = req.responseText; self.container.appendChild(div); if (typeof document.forms[obj.payment == 'paypal' ? 'hbPaypal' : 'hbAuthorize'] != 'undefined') { document.forms[obj.payment == 'paypal' ? 'hbPaypal' : 'hbAuthorize'].submit(); } }, "id=" + obj.booking_id); }, addExtra: function (extra_id) { var self = this; JABB.Ajax.getJSON([self.opts.folder, "index.php?controller=Front&action=addExtra&extra_id=", extra_id].join(""), function (data) { self.loadExtras(); }); return self; }, removeExtra: function (extra_id) { var self = this; JABB.Ajax.getJSON([self.opts.folder, "index.php?controller=Front&action=removeExtra&extra_id=", extra_id].join(""), function (data) { self.loadExtras(); }); return self; }, validateSearch: function (btn) { var frm = btn.form, df = frm.date_from, dt = frm.date_to; if (df && dt) { if (Date.parseExact(df.value, dateFormat(this.opts.dateFormat, 'datejs')).getTime() < Date.parseExact(dt.value, dateFormat(this.opts.dateFormat, 'datejs')).getTime()) { return true; } } this.errorHandler("\n - " + this.opts.validation.error_dates); return false; }, validateRooms: function () { var frm = document.getElementById("hbFormRooms"), room_id = JABB.Utils.getElementsByClass("hbSelect", frm, "select"), i, len; for (i = 0, len = room_id.length; i < len; i++) { if (parseInt(room_id[i].options[room_id[i].selectedIndex].value, 10) > 0) { return true; } } this.errorHandler("\n - " + this.opts.validation.error_rooms); return false; }, validateCheckoutForm: function (btn) { var re = /([0-9a-zA-Z\.\-\_]+)@([0-9a-zA-Z\.\-\_]+)\.([0-9a-zA-Z\.\-\_]+)/, message = ""; var frm = btn.form; for (var i = 0, len = frm.elements.length; i < len; i++) { var cls = frm.elements[i].className; if (cls.indexOf("hbRequired") !== -1 && frm.elements[i].disabled === false) { switch (frm.elements[i].nodeName) { case "INPUT": switch (frm.elements[i].type) { case "checkbox": case "radio": if (!frm.elements[i].checked && frm.elements[i].getAttribute("rev")) { message += "\n - " + frm.elements[i].getAttribute("rev"); } break; default: if (frm.elements[i].value.length === 0 && frm.elements[i].getAttribute("rev")) { message += "\n - " + frm.elements[i].getAttribute("rev"); } break; } break; case "TEXTAREA": if (frm.elements[i].value.length === 0 && frm.elements[i].getAttribute("rev")) { message += "\n - " + frm.elements[i].getAttribute("rev"); } break; case "SELECT": switch (frm.elements[i].type) { case 'select-one': if (frm.elements[i].value.length === 0 && frm.elements[i].getAttribute("rev")) { message += "\n - " + frm.elements[i].getAttribute("rev"); } break; case 'select-multiple': var has = false; for (j = frm.elements[i].options.length - 1; j >= 0; j = j - 1) { if (frm.elements[i].options[j].selected) { has = true; break; } } if (!has && frm.elements[i].getAttribute("rev")) { message += "\n - " + frm.elements[i].getAttribute("rev"); } break; } break; default: break; } } if (cls.indexOf("hbEmail") !== -1) { if (frm.elements[i].nodeName === "INPUT" && frm.elements[i].value.length > 0 && frm.elements[i].value.match(re) == null) { message += "\n - " + this.opts.validation.error_email; } } } if (message.length === 0) { return true; } else { this.errorHandler(message); return false; } }, errorHandler: function (message) { var err = JABB.Utils.getElementsByClass("hbError", self.container, "P"); if (err[0]) { err[0].innerHTML = '' + this.opts.validation.error_title + message.replace(/\n/g, "
"); err[0].style.display = ''; } else { alert(this.opts.validation.error_title + message); } }, triggerLoading: function (message, container) { if (container && container.nodeType) { container.innerHTML = this.opts[message]; } else if (typeof container != "undefined") { var c = document.getElementById(container); if (c && c.nodeType) { c.innerHTML = this.opts[message]; } } } }; return (window.HB = HB); })(window);