//jquery.ui.js
jQuery.ui||(function(c){var i=c.fn.remove,d=c.browser.mozilla&&(parseFloat(c.browser.version)<1.9);c.ui={version:"1.7.1",plugin:{add:function(k,l,n){var m=c.ui[k].prototype;for(var j in n){m.plugins[j]=m.plugins[j]||[];m.plugins[j].push([l,n[j]])}},call:function(j,l,k){var n=j.plugins[l];if(!n||!j.element[0].parentNode){return}for(var m=0;m<n.length;m++){if(j.options[n[m][0]]){n[m][1].apply(j.element,k)}}}},contains:function(k,j){return document.compareDocumentPosition?k.compareDocumentPosition(j)&16:k!==j&&k.contains(j)},hasScroll:function(m,k){if(c(m).css("overflow")=="hidden"){return false}var j=(k&&k=="left")?"scrollLeft":"scrollTop",l=false;if(m[j]>0){return true}m[j]=1;l=(m[j]>0);m[j]=0;return l},isOverAxis:function(k,j,l){return(k>j)&&(k<(j+l))},isOver:function(o,k,n,m,j,l){return c.ui.isOverAxis(o,n,j)&&c.ui.isOverAxis(k,m,l)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(d){var f=c.attr,e=c.fn.removeAttr,h="http://www.w3.org/2005/07/aaa",a=/^aria-/,b=/^wairole:/;c.attr=function(k,j,l){var m=l!==undefined;return(j=="role"?(m?f.call(this,k,j,"wairole:"+l):(f.apply(this,arguments)||"").replace(b,"")):(a.test(j)?(m?k.setAttributeNS(h,j.replace(a,"aaa:"),l):f.call(this,k,j.replace(a,"aaa:"))):f.apply(this,arguments)))};c.fn.removeAttr=function(j){return(a.test(j)?this.each(function(){this.removeAttributeNS(h,j.replace(a,""))}):e.call(this,j))}}c.fn.extend({remove:function(){c("*",this).add(this).each(function(){c(this).triggerHandler("remove")});return i.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var j;if((c.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){j=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(c.curCSS(this,"position",1))&&(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}else{j=this.parents().filter(function(){return(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!j.length?c(document):j}});c.extend(c.expr[":"],{data:function(l,k,j){return !!c.data(l,j[3])},focusable:function(k){var l=k.nodeName.toLowerCase(),j=c.attr(k,"tabindex");return(/input|select|textarea|button|object/.test(l)?!k.disabled:"a"==l||"area"==l?k.href||!isNaN(j):!isNaN(j))&&!c(k)["area"==l?"parents":"closest"](":hidden").length},tabbable:function(k){var j=c.attr(k,"tabindex");return(isNaN(j)||j>=0)&&c(k).is(":focusable")}});function g(m,n,o,l){function k(q){var p=c[m][n][q]||[];return(typeof p=="string"?p.split(/,?\s+/):p)}var j=k("getter");if(l.length==1&&typeof l[0]=="string"){j=j.concat(k("getterSetter"))}return(c.inArray(o,j)!=-1)}c.widget=function(k,j){var l=k.split(".")[0];k=k.split(".")[1];c.fn[k]=function(p){var n=(typeof p=="string"),o=Array.prototype.slice.call(arguments,1);if(n&&p.substring(0,1)=="_"){return this}if(n&&g(l,k,p,o)){var m=c.data(this[0],k);return(m?m[p].apply(m,o):undefined)}return this.each(function(){var q=c.data(this,k);(!q&&!n&&c.data(this,k,new c[l][k](this,p))._init());(q&&n&&c.isFunction(q[p])&&q[p].apply(q,o))})};c[l]=c[l]||{};c[l][k]=function(o,n){var m=this;this.namespace=l;this.widgetName=k;this.widgetEventPrefix=c[l][k].eventPrefix||k;this.widgetBaseClass=l+"-"+k;this.options=c.extend({},c.widget.defaults,c[l][k].defaults,c.metadata&&c.metadata.get(o)[k],n);this.element=c(o).bind("setData."+k,function(q,p,r){if(q.target==o){return m._setData(p,r)}}).bind("getData."+k,function(q,p){if(q.target==o){return m._getData(p)}}).bind("remove",function(){return m.destroy()})};c[l][k].prototype=c.extend({},c.widget.prototype,j);c[l][k].getterSetter="option"};c.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled")},option:function(l,m){var k=l,j=this;if(typeof l=="string"){if(m===undefined){return this._getData(l)}k={};k[l]=m}c.each(k,function(n,o){j._setData(n,o)})},_getData:function(j){return this.options[j]},_setData:function(j,k){this.options[j]=k;if(j=="disabled"){this.element[k?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",k)}},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(l,m,n){var p=this.options[l],j=(l==this.widgetEventPrefix?l:this.widgetEventPrefix+l);m=c.Event(m);m.type=j;if(m.originalEvent){for(var k=c.event.props.length,o;k;){o=c.event.props[--k];m[o]=m.originalEvent[o]}}this.element.trigger(m,n);return !(c.isFunction(p)&&p.call(this.element[0],m,n)===false||m.isDefaultPrevented())}};c.widget.defaults={disabled:false};c.ui.mouse={_mouseInit:function(){var j=this;this.element.bind("mousedown."+this.widgetName,function(k){return j._mouseDown(k)}).bind("click."+this.widgetName,function(k){if(j._preventClickEvent){j._preventClickEvent=false;k.stopImmediatePropagation();return false}});if(c.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);(c.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},_mouseDown:function(l){l.originalEvent=l.originalEvent||{};if(l.originalEvent.mouseHandled){return}(this._mouseStarted&&this._mouseUp(l));this._mouseDownEvent=l;var k=this,m=(l.which==1),j=(typeof this.options.cancel=="string"?c(l.target).parents().add(l.target).filter(this.options.cancel).length:false);if(!m||j||!this._mouseCapture(l)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){k.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(l)&&this._mouseDelayMet(l)){this._mouseStarted=(this._mouseStart(l)!==false);if(!this._mouseStarted){l.preventDefault();return true}}this._mouseMoveDelegate=function(n){return k._mouseMove(n)};this._mouseUpDelegate=function(n){return k._mouseUp(n)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);(c.browser.safari||l.preventDefault());l.originalEvent.mouseHandled=true;return true},_mouseMove:function(j){if(c.browser.msie&&!j.button){return this._mouseUp(j)}if(this._mouseStarted){this._mouseDrag(j);return j.preventDefault()}if(this._mouseDistanceMet(j)&&this._mouseDelayMet(j)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,j)!==false);(this._mouseStarted?this._mouseDrag(j):this._mouseUp(j))}return !this._mouseStarted},_mouseUp:function(j){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(j.target==this._mouseDownEvent.target);this._mouseStop(j)}return false},_mouseDistanceMet:function(j){return(Math.max(Math.abs(this._mouseDownEvent.pageX-j.pageX),Math.abs(this._mouseDownEvent.pageY-j.pageY))>=this.options.distance)},_mouseDelayMet:function(j){return this.mouseDelayMet},_mouseStart:function(j){},_mouseDrag:function(j){},_mouseStop:function(j){},_mouseCapture:function(j){return true}};c.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);


//dimensions.js
(function($){$.dimensions={version:"@VERSION"};$.each(["Height","Width"],function(i,name){$.fn["inner"+name]=function(){if(!this[0]){return 0}var torl=name=="Height"?"Top":"Left",borr=name=="Height"?"Bottom":"Right";return num(this,name.toLowerCase())+num(this,"padding"+torl)+num(this,"padding"+borr)};$.fn["outer"+name]=function(options){if(!this[0]){return 0}var torl=name=="Height"?"Top":"Left",borr=name=="Height"?"Bottom":"Right";options=$.extend({margin:false},options||{});return num(this,name.toLowerCase())+num(this,"border"+torl+"Width")+num(this,"border"+borr+"Width")+num(this,"padding"+torl)+num(this,"padding"+borr)+(options.margin?(num(this,"margin"+torl)+num(this,"margin"+borr)):0)}});$.each(["Left","Top"],function(i,name){$.fn["scroll"+name]=function(val){if(!this[0]){return 0}return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(name=="Left"?val:$(window)["scrollLeft"](),name=="Top"?val:$(window)["scrollTop"]()):this["scroll"+name]=val}):this[0]==window||this[0]==document?self[(name=="Left"?"pageXOffset":"pageYOffset")]||$.boxModel&&document.documentElement["scroll"+name]||document.body["scroll"+name]:this[0]["scroll"+name]}});$.fn.extend({position:function(){var left=0,top=0,elem=this[0],offset,parentOffset,offsetParent,results;if(elem){offsetParent=this.offsetParent();offset=this.offset();parentOffset=offsetParent.offset();offset.top-=num(elem,"marginTop");offset.left-=num(elem,"marginLeft");parentOffset.top+=num(offsetParent,"borderTopWidth");parentOffset.left+=num(offsetParent,"borderLeftWidth");results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left}}return results},offsetParent:function(){var offsetParent=this[0].offsetParent;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&$.css(offsetParent,"position")=="static")){offsetParent=offsetParent.offsetParent}return $(offsetParent)}});function num(el,prop){return parseInt($.css(el.jquery?el[0]:el,prop))||0}})(jQuery);
//ifixpng.js
(function(b){b.ifixpng=function(c){b.ifixpng.pixel=c};b.ifixpng.getPixel=function(){return b.ifixpng.pixel||"pixel.gif"};var a={ltie7:b.browser.msie&&b.browser.version<7,filter:function(c){return"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=crop,src='"+c+"')"}};b.fn.ifixpng=a.ltie7?function(){return this.each(function(){var c=b(this);var e=b("base").attr("href");if(c.is("img")||c.is("input")){if(c.attr("src")){if(c.attr("src").match(/.*\.png([?].*)?$/i)){var d=(e&&c.attr("src").substring(0,1)!="/")?e+c.attr("src"):c.attr("src");c.css({filter:a.filter(d),width:c.width(),height:c.height()}).attr({src:b.ifixpng.getPixel()}).positionFix()}}}else{var f=c.css("backgroundImage");if(f.match(/^url\(["']?(.*\.png([?].*)?)["']?\)$/i)){f=RegExp.$1;c.css({backgroundImage:"none",filter:a.filter(f)}).children().children().positionFix()}}})}:function(){return this};b.fn.iunfixpng=a.ltie7?function(){return this.each(function(){var c=b(this);var d=c.css("filter");if(d.match(/src=["']?(.*\.png([?].*)?)["']?/i)){d=RegExp.$1;if(c.is("img")||c.is("input")){c.attr({src:d}).css({filter:""})}else{c.css({filter:"",background:"url("+d+")"})}}})}:function(){return this};b.fn.positionFix=function(){return this.each(function(){var d=b(this);var c=d.css("position");if(c!="absolute"&&c!="relative"){d.css({position:"relative"})}})}})(jQuery);
//head.js
var isOpera,isIE=false;if(typeof(window.opera)!="undefined"){isOpera=true}if(!isOpera&&navigator.userAgent.indexOf("Internet Explorer")){isIE=true}if(isOpera||isIE){document.nativeGetElementById=document.getElementById;document.getElementById=function(c){var b=document.nativeGetElementById(c);if(b){if(b.attributes.id&&b.attributes.id.value==c){return b}else{for(var a=1;a<document.all[c].length;a++){if(document.all[c][a].attributes.id&&document.all[c][a].attributes.id.value==c){return document.all[c][a]}}}}return null}}var key_count_global=0;function fly_init(){if(!document.getElementById("LoginForm")&&!document.getElementById("OrderStep1")){return}if(document.getElementById("EMail")){key_count_global=0;document.getElementById("EMail").onchange=function(){key_count_global++;setTimeout("lookup("+key_count_global+")",1000)}}}function makeHttpObject(){try{return new XMLHttpRequest()}catch(a){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(a){}try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(a){}throw new Error("Could not create HTTP request object.")}function simpleHttpRequest(b,d,a){var c=makeHttpObject();c.open("GET",b,true);c.send(null);c.onreadystatechange=function(){if(c.readyState==4){if(c.status==200){d(c.responseText)}else{if(a){a(c.status,c.statusText)}}}}}function printURL(a){if(a=="none"){var c=document.getElementById("EMail").value;var b=/^([\w]+)(.[\w]+)*@([\w]+)(.[\w]{2,3})/;if(b.test(c)==false){doErrorDialog("De gebruikersnaam is geen geldig E-mail adres.","EMail","/mediaServlet/")}else{doInfoDialog("De gebruikersnaam is beschikbaar.","EMail","/mediaServlet/")}}else{doInfoDialog('<div><a href="/inloggen.html">Gebruiker bestaat reeds, klik hier om aan te melden of kies een andere gebruikersnaam</a></div>',"EMail","/mediaServlet/")}}function printNothing(){restoreInput("EMail")}function lookup(a){if(a==key_count_global){simpleHttpRequest("/loginServlet?Mode=Verify&Value="+document.getElementById("EMail").value,printURL,printNothing);key_count_global=0}}function loadmore(a){var b=window.onload;if(typeof window.onload!="function"){window.onload=a}else{window.onload=function(){if(b){b()}a()}}}function getPath(c){var b=document.createElement("a");b.href=c;return b.pathname.substr(0,1)==="/"?b.pathname:"/"+b.pathname}var inFocus=false;function setFocus(){var a=document.getElementById("SearchString");if(!inFocus){a.focus()}}function redirectMe(b){var a="/"+b;if(a!=getPath(window.location)){window.location="/"+b}}function ToolTipHoverAdd(){if(navigator.appVersion.indexOf("MSIE")==-1){return}var c=document.getElementById("tooltip");if(c){var a=document.getElementsByTagName("A");if(a){for(var b=0;b<a.length;b++){a[b].onmouseover=function(){this.className+=" mshover"};a[b].onmouseout=function(){this.className=this.className.replace(new RegExp(" mshover\\b"),"")}}}}};

//jquery.cookie.js
jQuery.cookie=function(b,j,m){if(typeof j!="undefined"){m=m||{};if(j===null){j="";m.expires=-1}var e="";if(m.expires&&(typeof m.expires=="number"||m.expires.toUTCString)){var f;if(typeof m.expires=="number"){f=new Date();f.setTime(f.getTime()+(m.expires*24*60*60*1000))}else{f=m.expires}e="; expires="+f.toUTCString()}var l=m.path?"; path="+(m.path):"";var g=m.domain?"; domain="+(m.domain):"";var a=m.secure?"; secure":"";document.cookie=[b,"=",encodeURIComponent(j),e,l,g,a].join("")}else{var d=null;if(document.cookie&&document.cookie!=""){var k=document.cookie.split(";");for(var h=0;h<k.length;h++){var c=jQuery.trim(k[h]);if(c.substring(0,b.length+1)==(b+"=")){d=decodeURIComponent(c.substring(b.length+1));break}}}return d}return null};
//jquery.tabs.js4
(function(b){b.extend({tabs:{remoteCount:0}});b.fn.tabs=function(d,e){if(typeof d=="object"){e=d}e=b.extend({initial:(d&&typeof d=="number"&&d>0)?--d:0,disabled:null,bookmarkable:b.ajaxHistory?true:false,remote:false,spinner:"Loading&#8230;",hashPrefix:"remote-tab-",fxFade:null,fxSlide:null,fxShow:null,fxHide:null,fxSpeed:"normal",fxShowSpeed:null,fxHideSpeed:null,fxAutoHeight:false,onClick:null,onHide:null,onShow:null,navClass:"tabs-nav",selectedClass:"tabs-selected",disabledClass:"tabs-disabled",containerClass:"tabs-container",hideClass:"tabs-hide",loadingClass:"tabs-loading",tabStruct:"div"},e||{});b.browser.msie6=b.browser.msie&&(b.browser.version&&b.browser.version<7||/MSIE 6.0/.test(navigator.userAgent));function f(){scrollTo(0,0)}return this.each(function(){var r=this;var p=b("ul."+e.navClass,r);p=p.size()&&p||b(">ul:eq(0)",r);var A=b("a",p);if(e.remote){A.each(function(){var B=e.hashPrefix+(++b.tabs.remoteCount),k="#"+B,i=this.href;this.href=k;b('<div id="'+B+'" class="'+e.containerClass+'"></div>').appendTo(r);b(this).bind("loadRemoteTab",function(F,G){var C=b(this).addClass(e.loadingClass),D=b("span",this)[0],E=D.innerHTML;if(e.spinner){D.innerHTML="<em>"+e.spinner+"</em>"}setTimeout(function(){b(k).load(i,function(){if(e.spinner){D.innerHTML=E}C.removeClass(e.loadingClass);G&&G()})},0)})})}var t=b("div."+e.containerClass,r);t=t.size()&&t||b(">"+e.tabStruct,r);p.is("."+e.navClass)||p.addClass(e.navClass);t.each(function(){var i=b(this);i.is("."+e.containerClass)||i.addClass(e.containerClass)});var n=b("li",p).index(b("li."+e.selectedClass,p)[0]);if(n>=0){e.initial=n}if(location.hash){A.each(function(B){if(this.hash==location.hash){e.initial=B;if((b.browser.msie||b.browser.opera)&&!e.remote){var k=b(location.hash);var C=k.attr("id");k.attr("id","");setTimeout(function(){k.attr("id",C)},500)}f();return false}})}if(b.browser.msie){f()}t.filter(":eq("+e.initial+")").show().end().not(":eq("+e.initial+")").addClass(e.hideClass);b("li",p).removeClass(e.selectedClass).eq(e.initial).addClass(e.selectedClass);A.eq(e.initial).trigger("loadRemoteTab").end();if(e.fxAutoHeight){var z=function(i){var k=b.map(t.get(),function(C){var B,D=b(C);if(i){if(b.browser.msie6){C.style.removeExpression("behaviour");C.style.height="";C.minHeight=null}B=D.css({"min-height":""}).height()}else{B=D.height()}return B}).sort(function(C,B){return B-C});if(b.browser.msie6){t.each(function(){this.minHeight=k[0]+"px";this.style.setExpression("behaviour",'this.style.height = this.minHeight ? this.minHeight : "1px"')})}else{t.css({"min-height":k[0]+"px"})}};z();var q=r.offsetWidth;var y=r.offsetHeight;var j=b("#tabs-watch-font-size").get(0)||b('<span id="tabs-watch-font-size">M</span>').css({display:"block",position:"absolute",visibility:"hidden"}).appendTo(document.body).get(0);var s=j.offsetHeight;setInterval(function(){var k=r.offsetWidth;var B=r.offsetHeight;var i=j.offsetHeight;if(B>y||k!=q||i!=s){z((k>q||i<s));q=k;y=B;s=i}},50)}var l={},u={},h=e.fxShowSpeed||e.fxSpeed,o=e.fxHideSpeed||e.fxSpeed;if(e.fxSlide||e.fxFade){if(e.fxSlide){l.height="show";u.height="hide"}if(e.fxFade){l.opacity="show";u.opacity="hide"}}else{if(e.fxShow){l=e.fxShow}else{l["min-width"]=0;h=1}if(e.fxHide){u=e.fxHide}else{u["min-width"]=0;o=1}}var m=e.onClick,g=e.onHide,v=e.onShow;A.bind("triggerTab",function(){var i=b(this).parents("li:eq(0)");if(r.locked||i.is("."+e.selectedClass)||i.is("."+e.disabledClass)){return false}var B=this.hash;if(b.browser.msie){b(this).trigger("click");if(e.bookmarkable){b.ajaxHistory.update(B);location.hash=B.replace("#","")}}else{if(b.browser.safari){var k=b('<form action="'+B+'"><div><input type="submit" value="h" /></div></form>').get(0);k.submit();b(this).trigger("click");if(e.bookmarkable){b.ajaxHistory.update(B)}}else{if(e.bookmarkable){location.hash=B.replace("#","")}else{b(this).trigger("click")}}}});A.bind("disableTab",function(){var i=b(this).parents("li:eq(0)");if(b.browser.safari){i.animate({opacity:0},1,function(){i.css({opacity:""})})}i.addClass(e.disabledClass)});if(e.disabled&&e.disabled.length){for(var x=0,w=e.disabled.length;x<w;x++){A.eq(--e.disabled[x]).trigger("disableTab").end()}}A.bind("enableTab",function(){var i=b(this).parents("li:eq(0)");i.removeClass(e.disabledClass);if(b.browser.safari){i.animate({opacity:1},1,function(){i.css({opacity:""})})}});A.bind("click",function(D){var I=D.clientX;var E=this,J=b(this).parents("li:eq(0)"),k=b(this.hash),F=t.filter(":visible");if(r.locked||J.is("."+e.selectedClass)||J.is("."+e.disabledClass)||typeof m=="function"&&m(this,k[0],F[0])===false){this.blur();return false}r.locked=true;if(k.size()){if(b.browser.msie&&e.bookmarkable){var i=this.hash.replace("#","");k.attr("id","");setTimeout(function(){k.attr("id",i)},0)}var C={display:"",overflow:"",height:""};if(!b.browser.msie){C.opacity=""}function B(){if(e.bookmarkable&&I){b.ajaxHistory.update(E.hash)}F.animate(u,o,function(){b(E).parents("li:eq(0)").addClass(e.selectedClass).siblings().removeClass(e.selectedClass);F.addClass(e.hideClass).css(C);if(typeof g=="function"){g(E,k[0],F[0])}if(!(e.fxSlide||e.fxFade||e.fxShow)){k.css("display","block")}k.animate(l,h,function(){k.removeClass(e.hideClass).css(C);if(b.browser.msie){F[0].style.filter="";k[0].style.filter=""}if(typeof v=="function"){v(E,k[0],F[0])}r.locked=null})})}if(!e.remote){B()}else{b(E).trigger("loadRemoteTab",[B])}}else{alert("There is no such container.")}var H=window.pageXOffset||document.documentElement&&document.documentElement.scrollLeft||document.body.scrollLeft||0;var G=window.pageYOffset||document.documentElement&&document.documentElement.scrollTop||document.body.scrollTop||0;setTimeout(function(){window.scrollTo(H,G)},0);this.blur();return e.bookmarkable&&!!I});if(e.bookmarkable){b.ajaxHistory.initialize(function(){A.eq(e.initial).trigger("click").end()})}})};var c=["triggerTab","disableTab","enableTab"];for(var a=0;a<c.length;a++){b.fn[c[a]]=(function(d){return function(e){return this.each(function(){var g=b("ul.tabs-nav",this);g=g.size()&&g||b(">ul:eq(0)",this);var f;if(!e||typeof e=="number"){f=b("li a",g).eq((e&&e>0&&e-1||0))}else{if(typeof e=="string"){f=b('li a[@href$="#'+e+'"]',g)}}f.trigger(d)})}})(c[a])}b.fn.activeTab=function(){var d=[];this.each(function(){var f=b("ul.tabs-nav",this);f=f.size()&&f||b(">ul:eq(0)",this);var e=b("li",f);d.push(e.index(e.filter(".tabs-selected")[0])+1)});return d[0]}})(jQuery);

//dynamicselect.js
function dynamicSelect(id1,id2){var agt=navigator.userAgent.toLowerCase();var is_ie=((agt.indexOf("msie")!=-1)&&(agt.indexOf("opera")==-1));var is_mac=(agt.indexOf("mac")!=-1);if(!(is_ie&&is_mac)&&document.getElementById&&document.getElementsByTagName){var sel1=document.getElementById(id1);var sel2=document.getElementById(id2);if(!sel2) return; var clone=sel2.cloneNode(true);var clonedOptions=clone.getElementsByTagName("option");if(!sel2) return; refreshDynamicSelectOptions(sel1,sel2,clonedOptions);sel1.onchange=function(){refreshDynamicSelectOptions(sel1,sel2,clonedOptions)}}}function refreshDynamicSelectOptions(sel1,sel2,clonedOptions){while(sel2.options.length){sel2.remove(0)}var pattern1=/( |^)(select)( |$)/;var pattern2=new RegExp("( |^)("+sel1.options[sel1.selectedIndex].value+")( |$)");for(var i=0;i<clonedOptions.length;i++){if(clonedOptions[i].className.match(pattern1)||clonedOptions[i].className.match(pattern2)){sel2.appendChild(clonedOptions[i].cloneNode(true))}}};
//functions.js

var		 __user_name	=	"";
function reloadCaptcha()
{
	if(document.getElementById("CaptchaImg"))
	{
		document.getElementById("CaptchaImg").src =
			"/CaptchaServlet";
	}
}

function	setLoginName(url)
{
	var formObj =	document.forms["LoginForm"];
	if( formObj != null ) {
		__user_name = url + "?user=" + formObj["WebLogin"].value;
	}
}

function	clearInput( )
{
//	document.chatform.submit();
	document.chatform.message.value='';
}

function	getLoginName()
{
	var u = document.location.href;
	var i = u.indexOf('user') + 5;
	if(i == undefined )
		return "";
	return u.substr( i, u.length );
}

HashTable.prototype.items = null;
HashTable.prototype.keys  = null;
HashTable.prototype.ptr   = null;

function HashTable() {
	this.items = new Array();
	this.keys  = new Array();
	this.ptr   = 0;
}

HashTable.prototype.put = function( key, val )
{
	if( val == null )
		return;

	if( this.items[key] == null )
		this.keys[this.keys.length] = key;
	this.items[key] = val;
}

HashTable.prototype.toString = function()
{
	try {
		var s = "&";  
		for( var i = 0; i < this.keys.length; i ++ ) {
			s =  s + this.keys[i];
			s =  s + "=";
			if( this.items[this.keys[i]] ) {
				s = s + this.items[ this.keys[i] ];
			}
			if( (i+1) < this.keys.length ) {
				s = s + "&";
			}
		}
		return s;
	} catch(e) {
		return "";
	}

}

function doRequest(servletName, servletArguments){
	var r   = servletName + servletArguments;
	var request;
    try {
		request = new XMLHttpRequest();
	} catch(e) {
		try {
			request = new ActiveXObject("Microsoft.XMLHTTP");
		} catch(e) {
			return false;
		}
	}

	request.open( "GET", r, true );
	request.send( null );

    request.onreadystatechange = function(){  
    }
	return true;
}

function	saveEMail()
{
	var e = document.getElementById("WebLogin");
	if( e ) {
//		doRequest( "/sessionServlet", "?container=Pool&ebs_email=" + e.value );
	}
}

function	continueShopping()
{
		var e = document.getElementById("OneTimeOrderLink");
		var f = document.getElementById("WebLogin");
//		if( f ) {
//			doRequest( "/sessionServlet" , "?container=ClientCache&WebLogin=" + f.value );
//		}
		window.location = e.value;
		return true;
}

function 	submitLoginForm (formObj, mandatory, requiredFields, fieldNames, pad)
{
	var alertMsg = "";
	var i;
	var result = true;

	
	lastError = -1;

	var elem1 =  document.getElementById( "NewUser" );
	if( elem1 ) {
	if( eval( elem1.checked ) == true )
	{
		var e = document.getElementById("RegisterLink");
		var f = document.getElementById("WebLogin");

	/*	if(f.value != undefined) {
		if(! fieldIsValidEmail( formObj[requiredFields[0]] ) ) {
			alert( ErrorMessages[lastError] );
	//		doErrorDialog( ErrorMessages[lastError], formObj[requiredFields[0] ], pad );
			return false;
		}
		else
		{
			restoreInput( formObj[ requiredFields[0]] );
		}
		}*/

		if( f ) {
			doRequest( "/sessionServlet" , "?container=ClientCache&WebLogin=" + f.value );
		}
		window.location = e.value;
		return false;
	}}

	var elem2 = document.getElementById( "OneTimeOrder" );
	if( elem2 ) {
	if( eval( elem2.checked ) == true ) 
	{
		var e = document.getElementById("OneTimeOrderLink");
		var f = document.getElementById("WebLogin");
		restoreInput( formObj[ requiredFields[0]] );
		if( f ) {
			doRequest( "/sessionServlet" , "?container=ClientCache&WebLogin=" + f.value );
		}
		window.location = e.value;
		return false;
	}}

	var elem3 = document.getElementById( "Existing" );
	if( elem3 ) {
	if( eval( elem3.checked) == true )
	{
		for (i=0; i<requiredFields.length; i++)
		{
			if( requiredFields[i] == "WebLogin" ) {
				if(! fieldIsValidUserName( formObj[requiredFields[i]] ) ) {
					doErrorDialog( ErrorMessages[lastError], requiredFields[i], pad );
					result = false;
				} else {
					restoreInput( requiredFields[i] );
				}
			}
	
			if( requiredFields[i] == "Password" || requiredFields[i] == "PasswordNew" ||
				requiredFields[i] == "ID_Password" || requiredFields[i] == "ID_PasswordNew") {
				if(!fieldIsValidPassword( formObj[requiredFields[i] ]) ) {
					doErrorDialog( ErrorMessages[lastError], requiredFields[i], pad );
					result = false;
				} else {
					restoreInput( requiredFields[i] );
				}
			}
		}
	}
	}
	
	if( document.getElementById('processingDiv') ) {
		document.getElementById('processingDiv').style.display='inline';
	}


	return result;
}


function	drawBorderGreen( element )
{
	element.style.border = "2px solid #00ff00";
	element.style.padding = "6px 9px 12px 9px";
	element.style.margin = "6px 0 18px 0";
	element.style.background = "#fff";
}

function	drawBorder( element )
{
	element.style.border = "2px solid #f00";
	element.style.padding = "6px 9px 12px 9px";
	element.style.margin = "6px 0 18px 0";
	element.style.background = "#fff";
}

function	drawTextGreen( element, path, message )
{
	element.style.display = "block";
	element.style.color = "#bccfe1";
	element.style.fontWeight = "bold";
	element.style.fontSize = "0.9em";
	element.style.padding = "3px 0px 6px 26px";
	element.style.background = "url(" + path + "information.png) no-repeat 0 0px;";
	element.innerHTML = message;
}



function	drawText( element, path, message )
{
	element.style.display = "block";
	element.style.color = "#f00";
	element.style.fontWeight = "bold";
	element.style.fontSize = "1.3em";
	element.style.padding = "3px 0px 6px 26px";
	element.style.background = "url(" + path + "/icon-set.gif" + ") no-repeat 0 0px;";
	element.innerHTML = message;
}


var lastError = -1;

function	doInfoDialog( msg, field, path )
{
 	var p = document.getElementById( "field" + field );
	if( p ) {
		drawBorderGreen(p);
		var b = document.getElementById( "big" + field );
		if( b  ) {
			drawTextGreen( b, path,msg );
		}
	}
}
function	doErrorDialog( msg, field, path )
{
 	var p = document.getElementById( "field" + field );
	if( p ) {
		drawBorder(p);
		var b = document.getElementById( "big" + field );
		if( b  ) {
			drawText( b, path,msg );
		}
	}
}
function getCookie(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);
		var n = c.split('=');
	    var x = n[0];

		if( x == nameEQ ) {
			return  unescape(c.substring(nameEQ.length+1,c.length));
		} 
	//	while (c.charAt(0)==' ') c = c.substring(1,c.length);
	//	if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}
/*
function	getCookie(name) {
	var dc = document.cookie;
	var prefix = name + "=";
	var begin = dc.indexOf( ";" + prefix );
	if( begin == -1 ) {
		begin = dc.indexOf(prefix);
	}
	if( begin != 0 ) {
		return null;
	} else {
		begin += 2;
	}
	var end = document.cookie.indexOf(";",begin);
	if( end == -1 ) {
		end = dc.length;
	}
	return unescape( dc.substring(begin + prefix.length, end ));
}*/

function	saveForm( form )
{
	var now = new Date();
	var exp = new Date( now.getTime() + ( 60 * 60 * 1000) / 4);
//	var str = "formname=" + form.id + "\|";
	var str = "";
	var index=0;
	var i=0;
	var saveas = "Login";
	for( i = 0; i < form.length; i ++ )
	{	
		var elem = form[i].name;
		var val  = form[i].value;
		var type = form[i].type;

		if( elem == undefined || elem == null || form.elements[elem] == null )
			continue;

		if( type == "hidden" ) 
		{
			continue;
			/*str = str + 
				  elem + "=" +
				  form.elements[elem].value + "\|\n";*/
		}
		if( type == "radio" ) {
			for( x = 0; x < form.elements[elem].length; x ++ ) {
				if( form.elements[elem][x].checked ) {
					index = x;
					break;
				}
			}
			if( index > 0 && elem != undefined ) {
			str  = str + 
				   elem + "=" +
				   index + "\|";
				 }
		}
		if( type == "text" || type == "textarea" || type == "select-one")
		{
			str = str + 
				  elem + "=" +
				  form.elements[elem].value + "\|";
		}
		if( type == "checkbox" )
		{
			var v2;
			if( form.elements[elem].checked == true )
				v2 = "1";
			else
				v2 = "0";
			str = str + 
				  elem + "=" +
			      v2 + "\|";
		}
	}
	setCookie( saveas, str, exp,false,false,false );
}

function	loadForm( form )
{
	var id = form.id;
	var values = getCookie( id );
	if( values == null ) {
		return;
	}

	var arr    = values.split("\|");
	var j;
	var i,k;

	for( i = 0; i < arr.length; i ++ )
	{
		var fv = arr[i].split("=");
		for( k = 0; k < form.length; k ++ ) {
			var elem = form[k].name;
			if( fv[0] == elem ) {
				if( form[k].type == "radio" || form[k].type == "checkbox" ) {
					form.elements[elem].checked = (	fv[1] == "1" ? true: false );
				}
				else{
					if( fv.length > 1 )
						form.elements[elem].value = fv[1];
				}
			}
		}

	}

}

function	saveRedirCookie( name,attr,value )
{
	var now = new Date();
	var exp = new Date( now.getTime() + ( 60 * 60 * 1000) / 2);
	var str = value;
	var index=0;
	var i=0;
	setCookie( name, str, exp,false,false,false );
}




function	restoreInput( field )
{
	var p = document.getElementById( "field" + field );
	if ( p ) {
		p.style.border= "";
		p.style.padding = "";
		p.style.margin = "";
		p.style.background = "";
	}
	var b = document.getElementById( "big" + field );
	if( b ) {
		b.style.display = "none";
	}
}

function	setErrorMessage( msg )
{
	if( document.getElementById('processingDiv') ) {
		document.getElementById('processingDiv').style.display='inline';
		document.getElementById('processingDiv').innerHTML = 
			"<strong>" + msg + "</strong>";
		}

	if (document.getElementById('submitDiv'))
	{
		document.getElementById('submitDiv').style.display='none';
	}
}


/*
// Tabbladen
function tabblad (activeTab, name){
	var tab_prefix = name ? 'tab_' + name + '_' : 'tab_';
	var i=1;
	var element = null;
	for( i = 1; i < 7; i ++ ) {
		var tab = document.getElementById( tab_prefix + i );
		element = document.getElementById('content' + tab_prefix + i );
		if( element == null || tab == null)
			continue;
		if( i == activeTab ) {
			element.className = 'showit';
			tab.className = 'current';
		} else {
			element.className = 'hide';
			tab.className = '';
		}
	}
}
*/

// Toon een element
function showID(id) {
	document.getElementById(id).style.display = "block";
	}

// Verberg een element
function hideID(id) {
	document.getElementById(id).style.display = "none";
	}


function	toggleID(id) {

	if( document.getElementById(id).style.display == "none" )
		document.getElementById(id).style.display = "block";
	else
		document.getElementById(id).style.display = "none";
}


function	fieldIsEmpty( field )
{
	if(!field) {
		return true;
	}

	if( ( field.type == "text" ) || ( field.type == "textarea" ))
	{
		if( field.value == ""  || field.value.length <= 1 ) {
			lastError = 0;
			return true;
		}
	}

	return false;
}

function	fieldIsValidEmail( field )
{
	if( fieldIsEmpty(field) ) {
		lastError = 0;
		return false;
	}
	if( field.value.indexOf("@") == -1 ||
		field.value.indexOf(".")==-1 ||
		field.value.length<6 ) {
			lastError = 2;
			return false;
		}

/*	var re = /^([\w]+)(.[\w]+)*@([\w]+)(.[\w]{2,3})/;
	if( re.test(field.value) != true ) {
		lastError = 2;
		return false;
	}*/
	return true;
}

function	fieldIsValidPhoneNumber( field ) {
    var error = "";
	 if ((field.value.length <= 0 ) || fieldIsEmpty(field) ) {
   		lastError = 0;
		return false;
	}

	var stripped = field.value.replace(/[\(\)\.\-\ ]/g, '');    


	if( stripped.length < 10 ) {
		lastError = 17;
		return false;
	}

    if (isNaN(parseInt(stripped))) {
		lastError = 3;
		return false;
    } 

	return true;
}


function	fieldIsValidName( field ) {
   if (field.value == "" || fieldIsEmpty(field)) {
   		lastError = 0;
		return false;
    } else if ((field.value.length < 3) || (field.value.length > 60)) {
		lastError = 7;
		return false;
	}
	return true;
}

function	fieldIsValidUserName(field) {
/*	var error = "";
    var illegalChars = /\W/; 
	if (illegalChars.test(field.value)) {
		lastError = 1;
		return false;
	}*/
	
	if( fieldIsEmpty(field)|| (field.value.length <= 0) )
		lastError = 0;
	else {
		if ( field.value == "" || ( field.value.length < 3 ) || ( field.value.length > 60) )  {
			lastError = 1;
			return false;
		}
	}
	return true;
}

function	fieldIsValidDescription(field) {
	if( field.value.length > 200 ) {
		lastError = 18;
		return false;
	}
	return true;
}

function	fieldIsValidPassword(field) {

	if( field.value == "" ) {
		lastError = 0;
		return false;
	} 

	return true;
}

function	fieldIsValidPostal(field) {
	if( field.value == "" ) {
		lastError = 0;
		return false;
	}

	if( field.value.length < 6 )
	{
		lastError = 16;
		return false;
	}

	/*var re = /([0-9]){4}\s+([A-Za-z]){2}/;
	if(!re.test( field.value ) ) {
		lastError = 16;
		return false;
	}*/

	return true;
}

function	fieldIsValidHouse(field) {
	if( field.value == "") {
		lastError = 0;
		return false;
	}
	return true;
}


function	fieldIsValidAddress(field) {
	if( field.value == "") {
		lastError = 0;
		return false;
	}
	if( field.value.length < 3 ) {
		lastError = 9;
		return false;
	}
	return true;
}

function	fieldIsValidCity( field ) {
	if( field.value == "" ) {
		lastError = 0;
		return false;
	}
	return true;
}

function	fieldIsValidCountry( field ) {
	if( field.value == "" ) {
		lastError = 0;
		return false;
	}
	return true;
}

function	fieldIsValidGreeting( field ) {
	if( field.value == "" ) {
		lastError = 0;
		return false;
	}
	return true;
}

function	mailinglistSubmit( id )
{
	if (document.getElementById('submitDiv'))
	{
		document.getElementById('submitDiv').style.display='none';
	}
	if (document.getElementById('processingDiv'))
	{
		document.getElementById('processingDiv').style.display='inline';
	}
	document.forms[id].submit();

	return true;
}

function	validateAndSubmit( formObj, mandatory, requiredFields, fieldNames, pad,doSave )
{
	var i=0;
	var iss=0;
	var isf=0;
	var isa=0;
	var error = 1;

	if (document.getElementById('submitDiv'))
	{
		document.getElementById('submitDiv').style.display='none';
	}
	if (document.getElementById('processingDiv'))
	{
		document.getElementById('processingDiv').style.display='inline';
	}

	var result = true;

	lastError = -1;

	for( i = 0; i < requiredFields.length; i ++ ) {
		if( requiredFields[i] == "WebLogin" ) {
			if(! fieldIsValidUserName( formObj[requiredFields[i]] ) ||
			   ! fieldIsValidEmail( formObj[requiredFields[i]])) {
				doErrorDialog( ErrorMessages[lastError], requiredFields[i], pad );
				result = false;
			} else {
				restoreInput( requiredFields[i] );
			}
		}

		 if( requiredFields[i] == "Naam" || requiredFields[i] == "Name" || requiredFields[i] == "naam" || requiredFields[i] == "FriendName" ) {
			if(! fieldIsValidName( formObj[requiredFields[i]] ) ) {
				doErrorDialog( ErrorMessages[lastError], requiredFields[i], pad );
				result = false;
			} else {
				restoreInput( requiredFields[i] );
			}
		 }

		if( requiredFields[i] == "EMail" || requiredFields[i] == "ID_EMail" || requiredFields[i] == "FriendEMail") {
			if(! fieldIsValidEmail( formObj[requiredFields[i] ] )) {
				doErrorDialog( ErrorMessages[lastError], requiredFields[i], pad );
				result = false;
			}else {
				restoreInput( requiredFields[i] );
			}
		}

		if( requiredFields[i] == "Phone" ) {
			if(! fieldIsValidPhoneNumber( formObj[requiredFields[i]] )) {
				doErrorDialog( ErrorMessages[lastError], requiredFields[i], pad );
				result = false;
			} else {
				restoreInput( requiredFields[i] );
			}
		}

		if( requiredFields[i] == "Password" || requiredFields[i] == "PasswordNew" ||
			requiredFields[i] == "ID_Password" || requiredFields[i] == "ID_PasswordNew") {
			if(!fieldIsValidPassword( formObj[requiredFields[i] ]) ) {
				doErrorDialog( ErrorMessages[lastError], requiredFields[i], pad );
				result = false;
			} else {
				restoreInput( requiredFields[i] );
			}
		}

		if( requiredFields[i] == 'DiscountCode') {
			if( fieldIsEmpty( formObj[requiredFields[i]] ) ) {
				doErrorDialog( ErrorMessages[lastError],requiredFields[i],pad);
				result = false;
			} else {
				restoreInput( requiredFields[i] );
			}
		}

		if( requiredFields[i] == "UserHouseNumber" ) {
			if( !fieldIsValidHouse( formObj[requiredFields[i]] ) ) {
				doErrorDialog( ErrorMessages[lastError], requiredFields[i],pad);
				result = false;
			} else {
				restoreInput( requiredFields[i] );
			}
		}

		if( requiredFields[i] == "UserAddress" ) {
			if( !fieldIsValidAddress( formObj[ requiredFields[i] ]) ) {
				doErrorDialog( ErrorMessages[lastError], requiredFields[i], pad );
				result = false;
			} else {
				restoreInput( requiredFields[i] );
			}
		}

		if( requiredFields[i] == "Postal" || requiredFields[i] == "ID_Postal" ) {
			if( !fieldIsValidPostal( formObj[ requiredFields[i]] )) {
				doErrorDialog( ErrorMessages[lastError], requiredFields[i], pad );
				result = false;
			} else {
				restoreInput( requiredFields[i] );
			}
		}

		if( requiredFields[i] == "ID_City" || requiredFields[i] == "City" ) {
			if( !fieldIsValidCity( formObj[ requiredFields[i] ] )) {
				doErrorDialog( ErrorMessages[lastError], requiredFields[i], pad );
				result = false;
			}else {
				restoreInput( requiredFields[i] );
			}
		}
		if( requiredFields[i] == "C_Country_ID" || requiredFields[i] == "ID_C_Country_ID") {
			if( !fieldIsValidCountry( formObj[ requiredFields[i] ] )) {
				doErrorDialog( ErrorMessages[lastError], requiredFields[i], pad );
				result = false;
			} else {
				restoreInput( requiredFields[i] );
			}
		}

		if ( requiredFields[i] == "C_Greeting_ID" ) {
			if( !fieldIsValidGreeting( formObj[ requiredFields[i] ] )) {
				doErrorDialog( ErrorMessages[lastError], requiredFields[i], pad );
				result = false;
			} else {
				restoreInput( requiredFields[i] );
			}
		}

		if( requiredFields[i] == "Review" || requiredFields[i] == "Comment") {
			if( fieldIsEmpty( formObj[requiredFields[i]] ) ) {
				doErrorDialog( ErrorMessages[lastError], requiredFields[i], pad );
				result = false;
			} else {
				restoreInput( requiredFields[i] );
			}
		}

		if( requiredFields[i] == "IsShipTo"  ) {
			isa = 1;
			if( fieldIsChecked( formObj[requiredFields[i]] ) )
				iss = 1;
		}

		if( requiredFields[i] == "IsBillTo" ) {
			isa = 1;
			if( fieldIsChecked( formObj[requiredFields[i]] ) )
				isf = 1;
		}	

		if( requiredFields[i] == "Captcha" ) {
			if( fieldIsEmpty( formObj[requiredFields[i]] ) ) {
				result = false;
			} 
		}

	}

	if( isa == 1  ) {
		if( iss == 0 && isf == 0 ) {
			setErrorMessage( ErrorMessages[5] );
			result = false;
			return false;
		}
	}
	
	if( doSave == true ) {
		saveForm( formObj );
	}

	if( result == true ) {
		createAddress( formObj );
		formObj.submit();
	}

	if( doSave == true ) {
		saveForm( formObj );
	}
	/*for (i = 0; i < formObj.length; i++) {
		var tempobj = formObj.elements[i];
		if (tempobj.type.toLowerCase() == "submit" || tempobj.type.toLowerCase() == "reset")
			tempobj.disabled = true;
	}*/

	return result;
}

function	GenericSubmitII( formname, value, msg ) 
{
	formObj = document.getElementById(formname);

	if( !fieldIsChecked(formObj.GeneralTerms )) {
		alert( msg );
		return false;
	}

	formObj.submit();
	
/*	for (i = 0; i < formObj.length; i++) {
		var tempobj = formObj.elements[i];
		if (tempobj.type.toLowerCase() == "submit" || tempobj.type.toLowerCase() == "reset")
			tempobj.disabled = true;
	}*/

	return true;
}

function	GenericSubmit(formname,value) {
	formObj = document.getElementById(formname);
//    if(!formObj) alert( "No such element: " + value );
//formObj.action.value = value;
	formObj.submit();
	
/*	for (i = 0; i < formObj.length; i++) {
		var tempobj = formObj.elements[i];
		if (tempobj.type.toLowerCase() == "submit" || tempobj.type.toLowerCase() == "reset")
			tempobj.disabled = true;
	}*/

	//document.forms[formname].action.value = value;
	//document.forms[formname].submit();
	return true;
}




function	validateAndSubmitq( formObj, mandatory, requiredFields, fieldNames, retURL,pad )
{
	if(retURL) {
		formObj[ "ReturnTo" ].value = retURL;
		formObj[ "From" ].value = retURL;
	}

	var success = validateAndSubmit( formObj, mandatory, requiredFields, fieldNames,pad,false )
	if(success != true ) {
/*		for (i = 0; i < formObj.length; i++) {
			var tempobj = formObj.elements[i];
			if (tempobj.type.toLowerCase() == "submit" || tempobj.type.toLowerCase() == "reset")
				tempobj.disabled = false;
		}
*/
		return false;
	}

/*(	for (i = 0; i < formObj.length; i++) {
		var tempobj = formObj.elements[i];
		if (tempobj.type.toLowerCase() == "submit" || tempobj.type.toLowerCase() == "reset")
			tempobj.disabled = true;
	}
*/
	return true;
}

function 	createAddress( formObj )
{
	var street = formObj[ "UserAddress" ];
	var house  = formObj[ "UserHouseNumber" ];

	if( null == street || undefined == street || null == house || undefined == house ) {
		return false;
	}

	var elem   = formObj["Address" ];
	if( null == elem || undefined == elem )
	{
		var address = document.createElement( "input" );
		address.setAttribute( "type", "hidden" );
		address.setAttribute( "name", "Address" );
		address.setAttribute( "id", "Address" );
		address.setAttribute( "value", street.value + " " + house.value );
		elem = address;
		formObj.appendChild( address );
	} 
	else {
		elem.setAttribute( "value", street.value + " " + house.value );
	}
	return true;
}

function 	submitForm (formObj, mandatory, requiredFields, fieldNames, pad)
{
	var alertMsg = "";
	var i;
	var result = true;

	
	lastError = -1;

	//	check required fields
	for (i=0; i<requiredFields.length; i++)
	{
		if( requiredFields[i] == "WebLogin" ) {
			if(! fieldIsValidUserName( formObj[requiredFields[i]] ) ) {
				doErrorDialog( ErrorMessages[lastError], requiredFields[i], pad );
				result = false;
			} else {
				restoreInput( requiredFields[i] );
			}
		}

		if( requiredFields[i] == "Password" || requiredFields[i] == "PasswordNew" ||
			requiredFields[i] == "ID_Password" || requiredFields[i] == "ID_PasswordNew") {
			if(!fieldIsValidPassword( formObj[requiredFields[i] ]) ) {
				doErrorDialog( ErrorMessages[lastError], requiredFields[i], pad );
				result = false;
			} else {
				restoreInput( requiredFields[i] );
			}
		}

	/*	if( fieldIsEmpty( formObj[requiredFields[i] ] ) ) {
			doErrorDialog( ErrorMessages[0], requiredFields[i], pad );
			result = false;
		} else {
			restoreInput( requiredFields[i] );
		}*/
	}
		
	return result;
}

function changeQuantity( aform, field ) {
	var qty = aform[ field ];
	if( isNaN( qty.value ) || (qty.value <= 0 ) ) {
		qty.value = "1";
	}
	if( qty.value >= 1000 )
		qty.value = "999";
	if( qty.value <= 0 )
		qty.value = "1";
	aform.submit();
}

function	submitAttribute( aform ) {
	document.forms[aform].submit();
}

function	submitQuantity( aform, loc ) {
	document.forms[aform].submit();
	window.location=loc;
}

function	submitNow( aform ) {
	document.forms[aform].submit();
}

function	doForm( aform ) {
	aform.submit();
}

function	rateNow( formObj,val ) {
	var input = formObj[ "Rating" ];
	input.value = val;
	formObj.submit();
}

function	choose( msg, amt )
{
	if( amt <= 0 )
		return true;
	var d = confirm( msg );
	if( d )
		return true;
	return false;
}

function	fieldIsChecked( field )
{
	if( null == field )
		return false;
	if( field == undefined )
		return true;
	if(field.checked == true )
		return true;
	return false;
}

function	checkGeneralTerms( obj, msg )
{
	if( !fieldIsChecked(obj.GeneralTerms )) {
		alert( msg );
		return false;
	}
	if( !fieldIsValidDescription( obj.orderDescription )) {
		alert( ErrorMessages[lastError] );
		return false;
	}
	return true;
}

function 	AreThereCookies() { 
	 var expiredate = new Date(); 
	 var ret = false;
	 expiredate.setTime(expiredate.getTime() + 1800000); 
	 setCookie("EBS_DoYouHaveCookies", "EBS_DoYouHaveCookies", expiredate, false, false, false); 
	 if (document.cookie.indexOf('EBS_DoYouHaveCookies') != -1) { 
	   ret= true;
	 } 
	
		 
	 // now delete the test cookie 
	  expiredate = new Date(); 
	  expiredate.setTime(expiredate.getTime() - 1800000); 
	  setCookie("EBS_DoYouHaveCookies", "EBS_DoYouHaveCookies", expiredate, false, false, false);
	  return ret;
}
	
function setCookie(name, value, expires, path, domain, secure) { 
	 var curCookie = name + "=" + escape(value) + 
		((expires) ? "; expires=" + expires.toGMTString() : "") + 
		((path) ? "; path=" + path : "") + 
		((domain) ? "; domain=" + domain : "") + 
		((secure) ? "; secure" : "");

	 document.cookie = curCookie; 
}

function  delCookie( name ) {
	var ed = new Date();
	ed.setTime( ed.getTime() - 1 );
	setCookie( name,name,ed,false,false,false );
}
function initCorners() {
	var settings = {
		tl: { radius:16 },
		tr: { radius:16 },
		bl: { radius:16 },
		br: { radius:16 },
		antiAlias: true
	}
	curvyCorners( settings, "includeproductb" );
	curvyCorners( settings, "div.column-oxxio" );


}
function imgOnError(){
    var imageList = document.getElementsByTagName('IMG');
    var i;
    for(i=0;i<imageList.length;i++){
        if(imageList[i].height <= 1){
            imageList[i].setAttribute('src','/mediaServlet/brokenImage.png');
        }
    }
}

// Offering a Custom Alias suport - More info: http://docs.jquery.com/Plugins/Authoring#Custom_Alias
(function($) {
	/**
	 * $ is an alias to jQuery object
	 *
	 */
	$.fn.lightBox = function(settings) {
		// Settings to configure the jQuery lightBox plugin how you like
		settings = jQuery.extend({
			// Configuration related to overlay
			overlayBgColor: 		'#3474c5',		// (string) Background color to overlay; inform a hexadecimal value like: #RRGGBB. Where RR, GG, and BB are the hexadecimal values for the red, green, and blue values of the color.
			overlayOpacity:			0.8,		// (integer) Opacity value to overlay; inform: 0.X. Where X are number from 0 to 9
			// Configuration related to navigation
			fixedNavigation:		false,		// (boolean) Boolean that informs if the navigation (next and prev button) will be fixed or not in the interface.
			// Configuration related to images
			imageLoading:			'/mediaServlet/lightbox-ico-loading.gif',		// (string) Path and the name of the loading icon
			imageBtnPrev:			'/mediaServlet/lightbox-btn-prev.gif',			// (string) Path and the name of the prev button image
			imageBtnNext:			'/mediaServlet/lightbox-btn-next.gif',			// (string) Path and the name of the next button image
			imageBtnClose:			'/mediaServlet/lightbox-btn-close.gif',		// (string) Path and the name of the close btn
			imageBlank:				'/mediaServlet/lightbox-blank.gif',			// (string) Path and the name of a blank image (one pixel)
			// Configuration related to container image box
			containerBorderSize:	10,			// (integer) If you adjust the padding in the CSS for the container, #lightbox-container-image-box, you will need to update this value
			containerResizeSpeed:	400,		// (integer) Specify the resize duration of container image. These number are miliseconds. 400 is default.
			// Configuration related to texts in caption. For example: Image 2 of 8. You can alter either "Image" and "of" texts.
			txtImage:				'Afbeelding',	// (string) Specify text "Image"
			txtOf:					'van',		// (string) Specify text "of"
			// Configuration related to keyboard navigation
			keyToClose:				'c',		// (string) (c = close) Letter to close the jQuery lightBox interface. Beyond this letter, the letter X and the SCAPE key is used to.
			keyToPrev:				'p',		// (string) (p = previous) Letter to show the previous image
			keyToNext:				'n',		// (string) (n = next) Letter to show the next image.
			// Don´t alter these variables in any way
			imageArray:				[],
			activeImage:			0
		},settings);
		// Caching the jQuery object with all elements matched
		var jQueryMatchedObj = this; // This, in this context, refer to jQuery object
		/**
		 * Initializing the plugin calling the start function
		 *
		 * @return boolean false
		 */
		function _initialize() {
			_start(this,jQueryMatchedObj); // This, in this context, refer to object (link) which the user have clicked
			return false; // Avoid the browser following the link
		}
		/**
		 * Start the jQuery lightBox plugin
		 *
		 * @param object objClicked The object (link) whick the user have clicked
		 * @param object jQueryMatchedObj The jQuery object with all elements matched
		 */
		function _start(objClicked,jQueryMatchedObj) {
			// Hime some elements to avoid conflict with overlay in IE. These elements appear above the overlay.
			$('embed, object, select').css({ 'visibility' : 'hidden' });
			// Call the function to create the markup structure; style some elements; assign events in some elements.
			_set_interface();
			// Unset total images in imageArray
			settings.imageArray.length = 0;
			// Unset image active information
			settings.activeImage = 0;
			// We have an image set? Or just an image? Let´s see it.
			if ( jQueryMatchedObj.length == 1 ) {
				settings.imageArray.push(new Array(objClicked.getAttribute('href'),objClicked.getAttribute('title')));
			} else {
				// Add an Array (as many as we have), with href and title atributes, inside the Array that storage the images references		
				for ( var i = 0; i < jQueryMatchedObj.length; i++ ) {
					settings.imageArray.push(new Array(jQueryMatchedObj[i].getAttribute('href'),jQueryMatchedObj[i].getAttribute('title')));
				}
			}
			while ( settings.imageArray[settings.activeImage][0] != objClicked.getAttribute('href') ) {
				settings.activeImage++;
			}
			// Call the function that prepares image exibition
			_set_image_to_view();
		}
		/**
		 * Create the jQuery lightBox plugin interface
		 *
		 * The HTML markup will be like that:
			<div id="jquery-overlay"></div>
			<div id="jquery-lightbox">
				<div id="lightbox-container-image-box">
					<div id="lightbox-container-image">
						<img src="../fotos/XX.jpg" id="lightbox-image">
						<div id="lightbox-nav">
							<a href="#" id="lightbox-nav-btnPrev"></a>
							<a href="#" id="lightbox-nav-btnNext"></a>
						</div>
						<div id="lightbox-loading">
							<a href="#" id="lightbox-loading-link">
								<img src="../images/lightbox-ico-loading.gif">
							</a>
						</div>
					</div>
				</div>
				<div id="lightbox-container-image-data-box">
					<div id="lightbox-container-image-data">
						<div id="lightbox-image-details">
							<span id="lightbox-image-details-caption"></span>
							<span id="lightbox-image-details-currentNumber"></span>
						</div>
						<div id="lightbox-secNav">
							<a href="#" id="lightbox-secNav-btnClose">
								<img src="../images/lightbox-btn-close.gif">
							</a>
						</div>
					</div>
				</div>
			</div>
		 *
		 */
		function _set_interface() {
			// Apply the HTML markup into body tag
			$('body').append('<div id="jquery-overlay"></div><div id="jquery-lightbox"><div id="lightbox-container-image-box"><div id="lightbox-container-image"><img id="lightbox-image"><div style="" id="lightbox-nav"><a href="#" id="lightbox-nav-btnPrev"></a><a href="#" id="lightbox-nav-btnNext"></a></div><div id="lightbox-loading"><a href="#" id="lightbox-loading-link"><img src="' + settings.imageLoading + '"></a></div></div></div><div id="lightbox-container-image-data-box"><div id="lightbox-container-image-data"><div id="lightbox-image-details"><span id="lightbox-image-details-caption"></span><span id="lightbox-image-details-currentNumber"></span></div><div id="lightbox-secNav"><a href="#" id="lightbox-secNav-btnClose"><img src="' + settings.imageBtnClose + '"></a></div></div></div></div>');	
			// Get page sizes
			var arrPageSizes = ___getPageSize();
			// Style overlay and show it
			$('#jquery-overlay').css({
				backgroundColor:	settings.overlayBgColor,
				opacity:			settings.overlayOpacity,
				width:				arrPageSizes[0],
				height:				arrPageSizes[1]
			}).fadeIn();
			// Get page scroll
			var arrPageScroll = ___getPageScroll();
			// Calculate top and left offset for the jquery-lightbox div object and show it
			$('#jquery-lightbox').css({
				top:	arrPageScroll[1] + (arrPageSizes[3] / 10),
				left:	arrPageScroll[0]
			}).show();
			// Assigning click events in elements to close overlay
			$('#jquery-overlay,#jquery-lightbox').click(function() {
				_finish();									
			});
			// Assign the _finish function to lightbox-loading-link and lightbox-secNav-btnClose objects
			$('#lightbox-loading-link,#lightbox-secNav-btnClose').click(function() {
				_finish();
				return false;
			});
			// If window was resized, calculate the new overlay dimensions
			$(window).resize(function() {
				// Get page sizes
				var arrPageSizes = ___getPageSize();
				// Style overlay and show it
				$('#jquery-overlay').css({
					width:		arrPageSizes[0],
					height:		arrPageSizes[1]
				});
				// Get page scroll
				var arrPageScroll = ___getPageScroll();
				// Calculate top and left offset for the jquery-lightbox div object and show it
				$('#jquery-lightbox').css({
					top:	arrPageScroll[1] + (arrPageSizes[3] / 10),
					left:	arrPageScroll[0]
				});
			});
		}
		/**
		 * Prepares image exibition; doing a image´s preloader to calculate it´s size
		 *
		 */
		function _set_image_to_view() { // show the loading
			// Show the loading
			$('#lightbox-loading').show();
			if ( settings.fixedNavigation ) {
				$('#lightbox-image,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();
			} else {
				// Hide some elements
				$('#lightbox-image,#lightbox-nav,#lightbox-nav-btnPrev,#lightbox-nav-btnNext,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();
			}
			// Image preload process
			var objImagePreloader = new Image();
			objImagePreloader.onload = function() {
				$('#lightbox-image').attr('src',settings.imageArray[settings.activeImage][0]);
				// Perfomance an effect in the image container resizing it
				_resize_container_image_box(objImagePreloader.width,objImagePreloader.height);
				//	clear onLoad, IE behaves irratically with animated gifs otherwise
				objImagePreloader.onload=function(){};
			};
			objImagePreloader.src = settings.imageArray[settings.activeImage][0];
		};
		/**
		 * Perfomance an effect in the image container resizing it
		 *
		 * @param integer intImageWidth The image´s width that will be showed
		 * @param integer intImageHeight The image´s height that will be showed
		 */
		function _resize_container_image_box(intImageWidth,intImageHeight) {
			// Get current width and height
			var intCurrentWidth = $('#lightbox-container-image-box').width();
			var intCurrentHeight = $('#lightbox-container-image-box').height();
			// Get the width and height of the selected image plus the padding
			var intWidth = (intImageWidth + (settings.containerBorderSize * 2)); // Plus the image´s width and the left and right padding value
			var intHeight = (intImageHeight + (settings.containerBorderSize * 2)); // Plus the image´s height and the left and right padding value
			// Diferences
			var intDiffW = intCurrentWidth - intWidth;
			var intDiffH = intCurrentHeight - intHeight;
			// Perfomance the effect
			$('#lightbox-container-image-box').animate({ width: intWidth, height: intHeight },settings.containerResizeSpeed,function() { _show_image(); });
			if ( ( intDiffW == 0 ) && ( intDiffH == 0 ) ) {
				if ( $.browser.msie ) {
					___pause(250);
				} else {
					___pause(100);	
				}
			} 
			$('#lightbox-container-image-data-box').css({ width: intImageWidth });
			$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({ height: intImageHeight + (settings.containerBorderSize * 2) });
		};
		/**
		 * Show the prepared image
		 *
		 */
		function _show_image() {
			$('#lightbox-loading').hide();
			$('#lightbox-image').fadeIn(function() {
				_show_image_data();
				_set_navigation();
			});
			_preload_neighbor_images();
		};
		/**
		 * Show the image information
		 *
		 */
		function _show_image_data() {
			$('#lightbox-container-image-data-box').slideDown('fast');
			$('#lightbox-image-details-caption').hide();
			if ( settings.imageArray[settings.activeImage][1] ) {
				$('#lightbox-image-details-caption').html(settings.imageArray[settings.activeImage][1]).show();
			}
			// If we have a image set, display 'Image X of X'
			if ( settings.imageArray.length > 1 ) {
				$('#lightbox-image-details-currentNumber').html(settings.txtImage + ' ' + ( settings.activeImage + 1 ) + ' ' + settings.txtOf + ' ' + settings.imageArray.length).show();
			}		
		}
		/**
		 * Display the button navigations
		 *
		 */
		function _set_navigation() {
			$('#lightbox-nav').show();

			// Instead to define this configuration in CSS file, we define here. And it´s need to IE. Just.
			$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' });
			
			// Show the prev button, if not the first image in set
			if ( settings.activeImage != 0 ) {
				if ( settings.fixedNavigation ) {
					$('#lightbox-nav-btnPrev').css({ 'background' : 'url(' + settings.imageBtnPrev + ') left 15% no-repeat' })
						.unbind()
						.bind('click',function() {
							settings.activeImage = settings.activeImage - 1;
							_set_image_to_view();
							return false;
						});
				} else {
					// Show the images button for Next buttons
					$('#lightbox-nav-btnPrev').unbind().hover(function() {
						$(this).css({ 'background' : 'url(' + settings.imageBtnPrev + ') left 15% no-repeat' });
					},function() {
						$(this).css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' });
					}).show().bind('click',function() {
						settings.activeImage = settings.activeImage - 1;
						_set_image_to_view();
						return false;
					});
				}
			}
			
			// Show the next button, if not the last image in set
			if ( settings.activeImage != ( settings.imageArray.length -1 ) ) {
				if ( settings.fixedNavigation ) {
					$('#lightbox-nav-btnNext').css({ 'background' : 'url(' + settings.imageBtnNext + ') right 15% no-repeat' })
						.unbind()
						.bind('click',function() {
							settings.activeImage = settings.activeImage + 1;
							_set_image_to_view();
							return false;
						});
				} else {
					// Show the images button for Next buttons
					$('#lightbox-nav-btnNext').unbind().hover(function() {
						$(this).css({ 'background' : 'url(' + settings.imageBtnNext + ') right 15% no-repeat' });
					},function() {
						$(this).css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' });
					}).show().bind('click',function() {
						settings.activeImage = settings.activeImage + 1;
						_set_image_to_view();
						return false;
					});
				}
			}
			// Enable keyboard navigation
			_enable_keyboard_navigation();
		}
		/**
		 * Enable a support to keyboard navigation
		 *
		 */
		function _enable_keyboard_navigation() {
			$(document).keydown(function(objEvent) {
				_keyboard_action(objEvent);
			});
		}
		/**
		 * Disable the support to keyboard navigation
		 *
		 */
		function _disable_keyboard_navigation() {
			$(document).unbind();
		}
		/**
		 * Perform the keyboard actions
		 *
		 */
		function _keyboard_action(objEvent) {
			// To ie
			if ( objEvent == null ) {
				keycode = event.keyCode;
				escapeKey = 27;
			// To Mozilla
			} else {
				keycode = objEvent.keyCode;
				escapeKey = objEvent.DOM_VK_ESCAPE;
			}
			// Get the key in lower case form
			key = String.fromCharCode(keycode).toLowerCase();
			// Verify the keys to close the ligthBox
			if ( ( key == settings.keyToClose ) || ( key == 'x' ) || ( keycode == escapeKey ) ) {
				_finish();
			}
			// Verify the key to show the previous image
			if ( ( key == settings.keyToPrev ) || ( keycode == 37 ) ) {
				// If we´re not showing the first image, call the previous
				if ( settings.activeImage != 0 ) {
					settings.activeImage = settings.activeImage - 1;
					_set_image_to_view();
					_disable_keyboard_navigation();
				}
			}
			// Verify the key to show the next image
			if ( ( key == settings.keyToNext ) || ( keycode == 39 ) ) {
				// If we´re not showing the last image, call the next
				if ( settings.activeImage != ( settings.imageArray.length - 1 ) ) {
					settings.activeImage = settings.activeImage + 1;
					_set_image_to_view();
					_disable_keyboard_navigation();
				}
			}
		}
		/**
		 * Preload prev and next images being showed
		 *
		 */
		function _preload_neighbor_images() {
			if ( (settings.imageArray.length -1) > settings.activeImage ) {
				objNext = new Image();
				objNext.src = settings.imageArray[settings.activeImage + 1][0];
			}
			if ( settings.activeImage > 0 ) {
				objPrev = new Image();
				objPrev.src = settings.imageArray[settings.activeImage -1][0];
			}
		}
		/**
		 * Remove jQuery lightBox plugin HTML markup
		 *
		 */
		function _finish() {
			$('#jquery-lightbox').remove();
			$('#jquery-overlay').fadeOut(function() { $('#jquery-overlay').remove(); });
			// Show some elements to avoid conflict with overlay in IE. These elements appear above the overlay.
			$('embed, object, select').css({ 'visibility' : 'visible' });
		}
		/**
		 / THIRD FUNCTION
		 * getPageSize() by quirksmode.com
		 *
		 * @return Array Return an array with page width, height and window width, height
		 */
		function ___getPageSize() {
			var xScroll, yScroll;
			if (window.innerHeight && window.scrollMaxY) {	
				xScroll = window.innerWidth + window.scrollMaxX;
				yScroll = window.innerHeight + window.scrollMaxY;
			} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
				xScroll = document.body.scrollWidth;
				yScroll = document.body.scrollHeight;
			} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
				xScroll = document.body.offsetWidth;
				yScroll = document.body.offsetHeight;
			}
			var windowWidth, windowHeight;
			if (self.innerHeight) {	// all except Explorer
				if(document.documentElement.clientWidth){
					windowWidth = document.documentElement.clientWidth; 
				} else {
					windowWidth = self.innerWidth;
				}
				windowHeight = self.innerHeight;
			} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
				windowWidth = document.documentElement.clientWidth;
				windowHeight = document.documentElement.clientHeight;
			} else if (document.body) { // other Explorers
				windowWidth = document.body.clientWidth;
				windowHeight = document.body.clientHeight;
			}	
			// for small pages with total height less then height of the viewport
			if(yScroll < windowHeight){
				pageHeight = windowHeight;
			} else { 
				pageHeight = yScroll;
			}
			// for small pages with total width less then width of the viewport
			if(xScroll < windowWidth){	
				pageWidth = xScroll;		
			} else {
				pageWidth = windowWidth;
			}
			arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight);
			return arrayPageSize;
		};
		/**
		 / THIRD FUNCTION
		 * getPageScroll() by quirksmode.com
		 *
		 * @return Array Return an array with x,y page scroll values.
		 */
		function ___getPageScroll() {
			var xScroll, yScroll;
			if (self.pageYOffset) {
				yScroll = self.pageYOffset;
				xScroll = self.pageXOffset;
			} else if (document.documentElement && document.documentElement.scrollTop) {	 // Explorer 6 Strict
				yScroll = document.documentElement.scrollTop;
				xScroll = document.documentElement.scrollLeft;
			} else if (document.body) {// all other Explorers
				yScroll = document.body.scrollTop;
				xScroll = document.body.scrollLeft;	
			}
			arrayPageScroll = new Array(xScroll,yScroll);
			return arrayPageScroll;
		};
		 /**
		  * Stop the code execution from a escified time in milisecond
		  *
		  */
		 function ___pause(ms) {
			var date = new Date(); 
			curDate = null;
			do { var curDate = new Date(); }
			while ( curDate - date < ms);
		 };
		// Return the jQuery object for chaining. The unbind method is used to avoid click conflict when the plugin is called more than once
		return this.unbind('click').click(_initialize);
	};
})(jQuery); // Call and execute the function immediately passing the jQuery object

(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev]);}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev]);};var handleHover=function(e){var p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode;}catch(e){p=this;}}if(p==this){return false;}var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);}if(e.type=="mouseover"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob);},cfg.timeout);}}};return this.mouseover(handleHover).mouseout(handleHover);};})(jQuery);



