/*
Ice Javascript Framework
Version 0.9 Alpha
http://my-webdesigner.com/ice/
THE GNU LGPL LICENSE APPLIES
DO NOT REMOVE THIS INFORMATION
*/
var $body;var Ice;var _Ice={model:{hasIceModel:true,isHidden:false,hide:function(){this.style.display="none";this.isHidden=true},show:function(){this.style.display="";this.isHidden=false},toggleShow:function(){if(this.isHidden){this.show();return true}else{this.hide();return false}},addEvent:function(e){if(!Ice.isObject(e)){throw("Object expected but "+(typeof e)+" found");}e.node=this;return _Ice.ev.addListener(e)},addEvents:function(){if(arguments.length<1){return false}for(var i=0;i<arguments.length;i++){if(this.addEvent(arguments[i])===false){return false}}return true},getParent:function(){return $(this.parentNode)},getChild:function(n){if(!n){return}return $(this.childNodes[n])},getChildren:function(){return this.childNodes.length},addTo:function(a){a=$(a);a.appendChild(this)},addNode:function(a){a=$(a);this.appendChild(a)},addBefore:function(a){a=$(a);if(!this.parentNode){this.addTo(document.body)}this.parentNode.insertBefore(a,this)},addAfter:function(a){a=$(a);if(!a.nextSibling){return this.addTo(a)}if(!this.parentNode){this.addTo(document.body)}this.parentNode.insertBefore(a.nextSibling,this)},getNext:function(){return $(this.nextSibling)},getPrev:function(){return $(this.previousSibling)},getFirst:function(){return $(this.firstChild)},getLast:function(){return $(this.lastChild)},remove:function(){if(!this.parentNode){return false}delete(_Ice.nodeCache[this.id]);this.parentNode.removeChild(this);return true},prependAddNode:function(a){if(this.firstChild){this.insertBefore(a,this.firstChild)}else{this.addNode(a)}},prependAddTo:function(a){a=$(a);if(a.firstChild){a.insertBefore(this,a.firstChild)}else{a.addNode(this)}},setId:function(a){if(!a){a=_Ice.getNewNodeId()}if(_Ice.nodeCache[this.id]){_Ice.nodeCache[a]=_Ice.nodeCache[this.id]}delete(_Ice.nodeCache[this.id]);this.id=a;return a},getId:function(){return this.id},setClass:function(c){this.className=c},getClass:function(){return this.className},addClass:function(c){this.className=Ice.trim(this.className+" "+c)},hasClass:function(c){return(" "+this.className+" ").indexOf(" "+c+" ")!==-1},removeClass:function(c){this.className=Ice.trim(this.className.replace(new RegExp("(^| )"+c+"( |$)","g")," "))},getClone:function(){var a=this.cloneNode(true);a.id="";return $(a)},getTag:function(){return this.tagName.toLowerCase()},containsNode:function(a){a=$(a);while(a){if(a.id===this.id){return true}a=a.parentNode}return false},isContainedIn:function(a){return $(a).containsNode(this)},setStyle:function(a,b){a=_Ice.getStyleId(a);this.style[a]=b;return true},getStyle:function(a){return _Ice.getNodeStyle(this,a)},getTop:function(){var o=this;var v=0;while(o){v+=o.offsetTop;o=o.offsetParent}return v},getLeft:function(){var o=this;var v=0;while(o){v+=o.offsetLeft;o=o.offsetParent}return v},getHeight:function(){return this.offsetHeight},getWidth:function(){return this.offsetWidth},getRight:function(){var o=this;var v=0;while(o){v+=o.offsetWidth+o.offsetLeft;o=o.offsetParent}return v},getBottom:function(){var o=this;var v=0;while(o){v+=o.offsetHeight+o.offsetTop;o=o.offsetParent}return v},stick:function(o){if(!Ice.isObject(o)){return false}if(!o.to){return false}var a=$(o.to);if(!a){return false}this.style.position="absolute";for(var b in o){var c=o[b];switch(b){case"to":break;case"top":this.style.top=(0-a.getHeight())+"px";break;case"right":this.style.left=a.getWidth()+"px";break;case"bottom":this.style.top=a.getHeight()+"px";break;case"left":this.style.left=(0-a.getWidth())+"px";break}}return true},setText:function(a){this.innerHTML="";this.addText(a)},addText:function(a){this.appendChild(document.createTextNode(a))},getText:function(){return _Ice.getText(this)},setHtml:function(a){this.innerHTML=a;return true},getHtml:function(){return this.innerHTML},getValue:function(){return this.value},setValue:function(a){this.value=a},animate:function(){return _Ice.ani.start(this,arguments)},stopAnimation:function(){return _Ice.ani.stop(this)}},nodeCache:{},lastNodeId:0,getNewNodeId:function(){return"ice_node_"+(++_Ice.lastNodeId)},lastScopeId:0,attachScopedFn:function(a,b,c){var d="_scopedFn_"+(c?c:++_Ice.lastScopeId);a[d]=b;return d},styleIdCache:{},getNodeStyle:function(c,d){var e=_Ice.getStyleId(d);if(c.style[e]){return c.style[e]}var f="";if(document.defaultView&&document.defaultView.getComputedStyle){f=document.defaultView.getComputedStyle(c,null).getPropertyValue(d)}else if(c.currentStyle){d=d.replace(/\-(\w)/g,function(a,b){return b.toUpperCase()});f=c.currentStyle[d]}if(!f||f==="auto"){switch(e){case"top":return c.getTop()+"px";case"left":return c.getLeft()+"px";case"right":return c.getRight()+"px";case"bottom":return c.getBottom()+"px";case"width":return c.getWidth()+"px";case"height":return c.getHeight()+"px"}}f=f+_Ice.getStyleUnit(e);return f},getStyleId:function(a){if(a.indexOf("-")!==-1){if(_Ice.styleIdCache[a]){return _Ice.styleIdCache[a]}var i="";for(var j=0;j<a.length;j++){var b=a.substr(j,1);if(b==="-"){i+=a.substr(j+1,1).toUpperCase();j++}else{i+=b}}a=i;_Ice.styleIdCache[a]=a}return a},getStyleUnit:function(a){var b="";switch(a){case"top":case"left":case"bottom":case"right":case"width":case"height":b="px";break;default:if(a.substr(0,7)==="padding"||a.substr(0,6)==="margin"){b="px"}}return b},parseColor:function(a){var r=0;var g=0;var b=0;a=a.replace(_Ice.regex.color,function(){if(arguments[4]){r=parseInt(arguments[4],10);g=parseInt(arguments[5],10);b=parseInt(arguments[6],10);if(arguments[8]==="0"){r=255;g=255;b=255}}else if(arguments[9]){r=parseInt(arguments[9].substr(0,2),16);g=parseInt(arguments[9].substr(2,2),16);b=parseInt(arguments[9].substr(4,2),16)}else if(arguments[10]){r=arguments[10].substr(0,1);r=parseInt(r+""+r,16);g=arguments[10].substr(1,1);g=parseInt(g+""+g,16);b=arguments[10].substr(2,1);b=parseInt(b+""+b,16)}});return{r:r,g:g,b:b}},getText:function(a){var b="";for(var i in a.childNodes){if(a.childNodes[i].nodeType===3){var c=a.childNodes[i].nodeValue;if(!Ice.isEmpty(c)){b+=c}}}return Ice.trim(b.replace(_Ice.regex.whitespace," "))},ev:{addListener:function(e){if(!Ice.isObject(e)||!Ice.isString(e.event)||Ice.isUndefined(e.node)||!Ice.isFunction(e.fn)){return false}var c=(e.event).toLowerCase();var d;if(c==="scroll"){d=window}else{d=Ice.isString(e.node)?$(e.node):e.node}var f=e.fn;var g=Ice.isString(e.scope)?$(e.scope):e.scope;var h=e.cancel!==false;var i=function(a){if(!a){a=event}if(!a.target){a.target=a.srcElement?a.srcElement:this}if(!g){g=a.target}var b=_Ice.attachScopedFn(g,f,"ev_"+c);g[b](a,a.target);if(h===true){if(a.preventDefault){a.preventDefault()}return false}};if(d.addEventListener){d.addEventListener(c,i,false)}else{d.attachEvent("on"+c,i)}return true},ready:function(a){if(_Ice.ev.domReady){a()}else{_Ice.ev.readyFns.push(a)}},readyExec:function(){if(document.body){document.body.id="ice_body";$body=$(document.body)}for(var i=0;i<_Ice.ev.readyFns.length;i++){_Ice.ev.readyFns[i]()}_Ice.ev.domReady=true},readyFns:[],domReady:false,readyBackup:function(){if(!_Ice.ev.domReady){_Ice.ev.readyExec()}}},ani:{defaults:{timeout:15,duration:1.3,method:"smooth"},methods:{linear:function(p){return p},smooth:function(p){return(Math.cos((Math.PI/2)*p*2)-1)/-2},fadein:function(p){return Math.cos(Math.PI/2*p+Math.PI)+1},fadeout:function(p){return Math.sin(Math.PI/2*p)}},lastId:0,start:function(a,c){if(!Ice.isNode(a)||!c.length){return false}var d;var e=0;var f={};if(c.length===1&&Ice.isArray(c[0])){c=c[0]}for(var b=0;b<c.length;b++){var g=d;_Ice.ani.lastId++;var h=_Ice.ani.lastId;d=h;var i=c[b].duration?c[b].duration:((c[b].duration===0||c[b].duration===0.0)?0.0000001:_Ice.ani.defaults.duration);if(c[b].morph){if(Ice.isFunction(c[b].morph)){c[b].morph={fn:c[b].morph}}for(var j in c[b].morph){if(j==="fn"){var k=_Ice.attachScopedFn(a,c[b].morph.fn);_Ice.ani.worker.jobs.push({aniId:h,waitFor:g,el:a,method:c[b].method?c[b].method:_Ice.ani.defaults.method,progress:0,duration:i,deadline:Ice.unixtime()+i+e,morphFn:k})}else{var l=c[b].morph[j];var m;if((l+"").substr(0,1)==="#"){m=f[j]?f[j]:_Ice.parseColor(a.getStyle(j));f[j]=l;l="'"+l+"'"}else{l=parseFloat(l);m=f[j]?f[j]:parseFloat(a.getStyle(j));f[j]=parseFloat(l)}_Ice.ani.worker.jobs.push({aniId:h,waitFor:g,el:a,method:c[b].method?c[b].method:_Ice.ani.defaults.method,progress:0,duration:i,deadline:Ice.unixtime()+i+e,style:j,"start":m,stop:l,unit:_Ice.getStyleUnit(j)})}_Ice.ani.worker.run()}}else{_Ice.ani.worker.jobs.push({aniId:h,waitFor:g,el:a,method:c[b].method?c[b].method:_Ice.ani.defaults.method,progress:0,duration:i,deadline:Ice.unixtime()+i+e,empty:true});_Ice.ani.worker.run()}e+=i}return true},stop:function(a){for(var i=0;i<_Ice.ani.worker.jobs.length;i++){if(!_Ice.ani.worker.jobs[i]){continue}if(_Ice.ani.worker.jobs[i].el.id===a.id){_Ice.ani.worker.kill();delete(_Ice.ani.worker.jobs[i]);_Ice.ani.worker.run()}}},worker:{running:false,killing:false,jobs:[],done:{},run:function(){if(_Ice.ani.worker.running){return}_Ice.ani.worker.running=true;_Ice.ani.worker.step()},kill:function(){if(!_Ice.ani.worker.running){return}_Ice.ani.worker.killing=true;window.clearInterval(_Ice.ani.worker.stepTimeout);_Ice.ani.worker.killing=false;_Ice.ani.worker.running=false},stepTimeout:null,step:function(){if(_Ice.ani.worker.killing){_Ice.ani.worker.killing=false;return}for(var a=0;a<_Ice.ani.worker.jobs.length;a++){var b=_Ice.ani.worker.jobs[a];if(!b||(b.waitFor&&!_Ice.ani.worker.done[b.waitFor])){continue}b.progress=((b.duration+Ice.unixtime()-b.deadline)/b.duration);if(b.progress<0){b.progress=0}else if(b.progress>1){b.progress=1}if(!b.empty){if(b.morphFn){b.el[b.morphFn](b.progress)}else{if(b.progress<1){b.el.setStyle(b.style,(b.start+_Ice.ani.methods[b.method](b.progress)*(b.stop-b.start))+b.unit)}else{b.el.setStyle(b.style,b.stop+b.unit)}}}if(b.progress==1){_Ice.ani.worker.jobs.splice(a,1);a--;_Ice.ani.worker.done[b.aniId]=true}}if(_Ice.ani.worker.jobs.length){_Ice.ani.worker.stepTimeout=window.setTimeout("_Ice.ani.worker.step()",_Ice.ani.defaults.timeout)}else{_Ice.ani.worker.running=false}}}},mouse:{x:0,y:0,out:true,updatePosition:function(e){if(!e){e=event}if(e.pageX){_Ice.mouse.x=e.pageX;_Ice.mouse.y=e.pageY}else{_Ice.mouse.x=e.clientX+Ice.scroll.getX();_Ice.mouse.y=e.clientY+Ice.scroll.getY()}if(_Ice.mouse.x<0){_Ice.mouse.x=0}if(_Ice.mouse.y<0){_Ice.mouse.y=0}_Ice.mouse.out=false;return true},setOut:function(){if(_Ice.mouse.out===false){_Ice.mouse.out=true;_Ice.mouse.x=0;_Ice.mouse.y=0;if(!Ice.isEmpty(_Ice.mouse.outFns)){for(var i=0;i<_Ice.mouse.outFns.length;i++){_Ice.mouse.outFns[i]()}}}},outFns:[]},browser:{detected:false,useragent:"",engine:"",browser:"",device:"",detect:function(){if(_Ice.browser.detected===true){return}if(navigator&&navigator.userAgent){_Ice.browser.useragent=navigator.userAgent;if(/WebKit/.test(_Ice.browser.useragent)){_Ice.browser.engine="webkit";if(/i(Phone|Pad|Pod)/.test(_Ice.browser.useragent)){_Ice.browser.useragent.replace(/i(Phone|Pad|Pod)/,function(w){_Ice.browser.browser="safari";_Ice.browser.device=w.toLowerCase();_Ice.browser.useragent.replace(/OS ([0-9]+)_([0-9]+)/,function(w,a,b){_Ice.browser.version=parseFloat(a+"."+b)})})}else if(/Chrome\/([0-9]+\.[0-9]+)/.test(_Ice.browser.useragent)){_Ice.browser.useragent.replace(/Chrome\/([0-9]+\.[0-9]+)/,function(w,a){_Ice.browser.browser="chrome";_Ice.browser.version=parseFloat(a)})}else if(/Android/.test(_Ice.browser.useragent)){_Ice.browser.browser="android";_Ice.browser.device="android"}else if(/Shiira/.test(_Ice.browser.useragent)){_Ice.browser.browser="shiira"}else if(/Safari/.test(_Ice.browser.useragent)){_Ice.browser.browser="safari"}if(!_Ice.browser.version){_Ice.browser.useragent.replace(/Version\/([0-9]+\.[0-9]+)/,function(w,a){_Ice.browser.version=parseFloat(a)})}}else if(/MSIE ([0-9]+\.[0-9]+)/.test(_Ice.browser.useragent)){_Ice.browser.engine="trident";if(/Avant Browser/.test(_Ice.browser.useragent)){_Ice.browser.browser="avant"}else{_Ice.browser.browser="internetexplorer"}_Ice.browser.useragent.replace(/MSIE ([0-9]+\.[0-9]+)/,function(w,a){_Ice.browser.version=parseFloat(a)});if(/Mac/.test(_Ice.browser.useragent)){_Ice.browser.device="mac"}else{_Ice.browser.device="win"}}else if(/Gecko/.test(_Ice.browser.useragent)){_Ice.browser.engine="gecko";if(/(Flock|Navigator|Firefox|Iceweasel|Iceape|Galeon|SeaMonkey|Konqueror|Shiretoko|Kazehakase|Minefield|Netscape)\/([0-9]+\.[0-9]+)/.test(_Ice.browser.useragent)){_Ice.browser.useragent.replace(/(Flock|Navigator)\/([0-9]+\.[0-9]+)/,function(w,a,b){_Ice.browser.browser=a.toLowerCase();_Ice.browser.version=parseFloat(b)})}else if(/K\-Meleon\/([0-9]+\.[0-9]+)/.test(_Ice.browser.useragent)){_Ice.browser.browser="kmeleon";_Ice.browser.useragent.replace(/K\-Meleon\/([0-9]+\.[0-9]+)/,function(w,a){_Ice.browser.version=parseFloat(a)})}}else if(/Presto/.test(_Ice.browser.useragent)){_Ice.browser.engine="presto";if(/Opera Mini\/([0-9]+\.[0-9]+)/.test(_Ice.browser.useragent)){_Ice.browser.browser="operamini";_Ice.browser.device="mobile";_Ice.browser.useragent.replace(/Opera Mini\/([0-9]+\.[0-9]+)/,function(w,a){_Ice.browser.version=parseFloat(a)})}else if(/Opera/.test(_Ice.browser.useragent)){_Ice.browser.browser="opera";_Ice.browser.useragent.replace(/(Opera|Version)\/([0-9]+\.[0-9]+)/,function(w,a,b){_Ice.browser.version=parseFloat(b)})}}else if(/Opera\/([0-9]+\.[0-9]+)/.test(_Ice.browser.useragent)){_Ice.browser.engine="presto";_Ice.browser.browser="opera";_Ice.browser.useragent.replace(/Opera\/([0-9]+\.[0-9]+)/,function(w,a){_Ice.browser.version=parseFloat(p2)})}else if(/Dillo\/([0-9]+\.[0-9]+)/.test(_Ice.browser.useragent)){_Ice.browser.engine="presto";_Ice.browser.browser="opera";_Ice.browser.useragent.replace(/Dillo\/([0-9]+\.[0-9]+)/,function(w,a){_Ice.browser.version=parseFloat(p2)})}else if(/(Bot|bot|BOT|Slurp|Yandex)/.test(_Ice.browser.useragent)){_Ice.browser.browser="bot"}if(!_Ice.browser.device){if(/Macintosh/.test(_Ice.browser.useragent)){_Ice.browser.device="mac"}else if(/Windows/.test(_Ice.browser.useragent)){_Ice.browser.device="win"}else if(/X11/.test(_Ice.browser.useragent)||/Linux/.test(_Ice.browser.useragent)){_Ice.browser.device="unix"}}}_Ice.browser.detected=true}},timer:{lastId:0,activeTimers:{},add:function(o,a){if(!Ice.isObject(o)||!Ice.isFunction(o.fn)){return false}var b=o.time?o.time*1000:0;if(o.scope){var c=$(o.scope);var d="$('"+c.getId()+"')"}else{var c=window;var d="window"}var e=_Ice.attachScopedFn(c,o.fn);var f=a.substr(0,1)+(o.id?o.id:_Ice.timer.lastId++);_Ice.timer.remove({id:f});switch(a){case"timeout":_Ice.timer.activeTimers[f]=window.setTimeout(d+"."+e+"()",b);break;case"interval":_Ice.timer.activeTimers[f]=window.setInterval(d+"."+e+"()",b);break}return{id:f,remove:function(){_Ice.timer.remove(this)}}},remove:function(a){if(!Ice.isObject(a)||!a.id||!_Ice.timer.activeTimers[a.id]){return false}switch(a.id.substr(0,1)){case"t":window.clearTimeout(_Ice.timer.activeTimers[a.id]);return true;case"i":window.clearInterval(_Ice.timer.activeTimers[a.id]);return true}return false}},regex:{color:/^(rgba?|#)(\((([0-9]+),\s*([0-9]+),\s*([0-9]+)(,\s*([0-9]+))?)\)|([A-Fa-f0-9]{6})|([A-Fa-f0-9]{3})).*$/i,ltrim:/^[ \r\n\t\0]+/g,rtrim:/[ \r\n\t\0]+$/g,whitespace:/[ \r\n\t\0]+/g}};$do=function(a){_Ice.ev.ready(a)};Ice={isObject:function(a){return(typeof a)==="object"&&!Ice.isArray(a)&&!Ice.isNode(a)},isNode:function(a){return a?(a.nodeType?true:false):false},isArray:function(a){return a instanceof Array},isString:function(a){return(typeof a)==="string"},isNumeric:function(a){return a+0==a&&(a+"").length>0},isBoolean:function(a){return(typeof a)==="boolean"},isFunction:function(a){return(typeof a)==="function"},isUndefined:function(a){return(typeof a)==="undefined"},isEmpty:function(a){if(Ice.isUndefined(a)||a===null||a===""||((a instanceof Array)&&a.length===0)||(Ice.isNode(a)&&a.innerHTML==="")){return true}if(Ice.isObject(a)){for(var i in a){break}return(typeof i)==="undefined"}return false},model:{inject:function(a,b){if(!Ice.isFunction(b)){throw("Second parameter is not a function");}if(Ice.isFunction(_Ice.model[a])){return false}_Ice.model[a]=b;return true},animate:{method:{inject:function(a){if(!Ice.isObject(a)||!a.method||!Ice.isFunction(a.fn)){throw("Object with parameters 'method' and 'fn' expected");}if(a.fn(1)==1){_Ice.ani.methods[a.method]=a.fn}else{return false}return true}},setDefaults:function(a){var b=true;for(var i in a){if(!Ice.isEmpty(_Ice.ani.defaults[i])){_Ice.ani.defaults[i]=a[i]}else{b=false}}return b}}},ltrim:function(a,b){if(b){return a.replace(new RegExp("^["+b+"]+","g"),"")}else{return a.replace(_Ice.regex.ltrim,"")}},rtrim:function(a,b){if(b){return a.replace(new RegExp("["+b+"]+$","g"),"")}else{return a.replace(_Ice.regex.rtrim,"")}},trim:function(a,b){return Ice.ltrim(Ice.rtrim(a,b),b)},unixtime:function(){return(new Date().getTime()/1000)},json:{decode:function(a){if(!Ice.isString(a)){return a}if(JSON&&JSON.parse){return JSON.parse(a)}try{return eval("("+a+")")}catch(e){throw("Trying to decode invalid JSON string");}},encode:function(d){if(JSON&&JSON.stringify){return JSON.stringify(d)}var e=[];function json_append_piece(b){if(typeof b==="string"){b=b.replace(/[\\"\x00-\x1F\u0080-\uFFFF]/g,function(a){switch(a){case"\b":return"\\b";case"\t":return"\\t";case"\n":return"\\n";case"\f":return"\\f";case"\r":return"\\r";case'"':return'\\"';case"\\":return"\\\\"}return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)});e.push('"'+b+'"')}else if(typeof b==="boolean"){e.push(b?"true":"false")}else if(typeof b==="number"&&isFinite(b)){e.push(b.toString())}else if(b===null){e.push("null")}else if(b instanceof Array||typeof b=="object"&&"length"in b&&(b.length===0||b[b.length-1]!==undefined)){e.push("[");for(var i=0;i<b.length;i++){arguments.callee(b[i]);e.push(",")}if(b.length>0){e.pop()}e.push("]")}else if(typeof b==="object"){e.push("{");for(var c in b){arguments.callee(c.toString());e.push(":");arguments.callee(b[c]);e.push(",")}if(e[e.length-1]===","){e.pop()}e.push("}")}else{throw("No JSON representation for this object");}}json_append_piece(d);return e.join("")}},ajax:{methodDetected:false,syncObjects:[],getXhr:function(){throw("AJAX implementation failed: XHR method not found");},getNewRequest:function(){if(!Ice.ajax.methodDetected){if(window.XMLHttpRequest){Ice.ajax.getXhr=function(){return new XMLHttpRequest()}}else if(window.ActiveXObject){try{void(new ActiveXObject("Microsoft.XMLHTTP"));Ice.ajax.getXhr=function(){return new ActiveXObject("Microsoft.XMLHTTP")}}catch(e){try{void(new ActiveXObject("Msxml2.XMLHTTP"));Ice.ajax.getXhr=function(){return new ActiveXObject("Msxml2.XMLHTTP")}}catch(e){}}}Ice.ajax.methodDetected=true}return Ice.ajax.getXhr()},parsePostData:function(a){var b="";switch(typeof a){case"string":return a;break;case"array":case"object":for(var i in a){b+=encodeURIComponent(i)+"="+encodeURIComponent(a[i])+"&"}b=b.substr(0,b.length-1);break;default:return""}return b},executeJavaScript:function(a){if(!Ice.isString(a)||!a.match(/<script/)){return false}var b=a.replace(/(\r\n|\n|\r)+/g," ");b=b.split(/(<script[^>]*>.*?<\/script>)/g);for(var c=0;c<b.length;c++){if(b[c].match(/^<script/)){var d=b[c].replace(/<script[^>]*>(.*?)<\/script>/,"$1");try{eval(d)}catch(e){}}}},asyncRequest:function(a,b){var c=this.getNewRequest();if(!c){return}c.open(b?"POST":"GET",a,false);try{c.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}catch(e){}c.send(b?this.parsePostData(b):null);return c.responseText},syncRequest:function(a,b,c){var d=this.getNewRequest();if(!d){return}Ice.ajax.syncObjects.push(d);d.onreadystatechange=function(){if(d.readyState!=4||d.status!=200){return}b(d.responseText);try{Ice.ajax.executeJavaScript(d.responseText)}catch(e){}};d.open(c?"POST":"GET",a,true);try{d.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}catch(e){}d.send(c?this.parsePostData(c):null)},abort:function(){for(var i=0;i<Ice.ajax.syncObjects.length;i++){try{Ice.ajax.syncObjects[i].abort()}catch(e){}}Ice.ajax.syncObjects=[]}},scroll:{setX:function(x){window.scrollTo(x,Ice.scroll.getY())},getX:function(){if(document.documentElement&&document.documentElement.scrollLeft){return document.documentElement.scrollLeft}else if(document.body&&document.body.scrollLeft){return document.body.scrollLeft}else{return 0}},setY:function(y){window.scrollTo(Ice.scroll.getX(),y)},getY:function(){if(document.documentElement&&document.documentElement.scrollTop){return document.documentElement.scrollTop}else if(document.body&&document.body.scrollTop){return document.body.scrollTop}else{return 0}}},mouse:{getX:function(){return _Ice.mouse.x},getY:function(){return _Ice.mouse.y},getFixedX:function(){return _Ice.mouse.x-Ice.scroll.getX()},getFixedY:function(){return _Ice.mouse.y-Ice.scroll.getY()},addOutFn:function(a){if(Ice.isFunction(a)){_Ice.mouse.outFns.push(a)}else{return false}return true}},array:function(){if(!arguments.length){var b=[]}else if(arguments.length>1){var b=arguments}else if(!Ice.isArray(arguments[0])&&!Ice.isObject(arguments[0])){var b=[arguments[0]]}else{var b=arguments[0]}b.each=function(a){Ice.each(b,a)};return b},each:function(a,b){if(a.length){a._eachFn=b;for(var c=0;c<a.length;c++){a._eachFn(a[c],c)}}else if(Ice.isObject(a)){a._eachFn=b;for(var c in a){if(c!=="each"&&c!=="_eachFn"){a._eachFn(a[c],c)}}}else{if(!Ice.isEmpty(a)){b(a)}}},browser:{getUserAgent:function(){_Ice.browser.detect();return _Ice.browser.useragent},getName:function(){_Ice.browser.detect();return _Ice.browser.browser},getVersion:function(){_Ice.browser.detect();return _Ice.browser.version},getEngine:function(){_Ice.browser.detect();return _Ice.browser.engine},getDevice:function(){_Ice.browser.detect();return _Ice.browser.device}},loc:{current:"",el:null,virgin:"",use:function(b){Ice.loc.el=b;$do(function(){Ice.loc.el=$(Ice.loc.el?Ice.loc.el:document.body);Ice.loc.virgin=Ice.loc.el.innerHTML;$$("a").each(function(a){if(!a.iceLocUsed){a.iceLocUsed=true;a.addEvent({event:"click",cancel:true,scope:a,fn:function(){Ice.loc.go(this)}})}});Ice.loc.grab();window.setInterval("Ice.loc.grab()",200)})},go:function(d){if(Ice.isNode(d)&&d.hasAttribute("rel")&&d.getAttribute("rel").match(/(^|\s)icebox($|\s)/i)){return}if(d.href){d=d.href}if(Ice.loc.onGo){Ice.loc.onGo()}Ice.loc.register(d);Ice.ajax.abort();Ice.ajax.syncRequest(d+((d.match(/\?/)?"&":"?")+"ajax=1"),function(c){Ice.loc.el.setHtml(c);$$("#"+Ice.loc.el.getId()+" a").each(function(a){var b=a.rel;if(!b&&a.hasAttribute&&a.hasAttribute("rel")){b=a.getAttribute("rel")}if(b&&b.match(/(^|\s)static($|\s)/i)){return}a.addEvent({event:"click",cancel:true,fn:function(){Ice.loc.go(this)}})});Ice.scroll.setX(0);Ice.scroll.setY(0);_Ice.nodeCache={};if(Ice.loc.onDisplay){Ice.loc.onDisplay()}});return false},register:function(a){var b=a.replace(/^[^:]+:\/\/[^\/]+/,"");Ice.loc.current=b;window.location.hash="!"+b},isBlank:false,blank:function(){Ice.loc.isBlank=true;Ice.loc.current="";Ice.loc.el.innerHTML=Ice.loc.virgin;if(Ice.loc.onBlank){Ice.loc.onBlank()}return},grab:function(){if(!window.location.hash){if(Ice.loc.current!==""){Ice.loc.isBlank=false}if(!Ice.loc.isBlank){Ice.loc.blank()}}if(window.location.hash.substr(0,2)!=="#!"){return}var a=window.location.hash.replace(/^#!/,"");if(a!==Ice.loc.current){if(Ice.loc.onGrab){Ice.loc.onGrab()}Ice.loc.go(a)}},onGrab:Nothing,onBlank:Nothing,onGo:Nothing,onDisplay:Nothing},icebox:{lastNode:null,currentImg:null,prev:null,next:null,deploy:function(){$$("a").each(function(a){if(!a.hasAttribute("rel")||!a.getAttribute("rel").match(/(^|\s)icebox($|\s)/i)||a.iceboxed){return}a.iceboxed=true;if(Ice.icebox.lastNode){a.prev=Ice.icebox.lastNode;Ice.icebox.lastNode.next=a}a.addEvent({event:"click",cancel:true,scope:a,fn:function(){Ice.icebox.view(this.href,this.prev,this.next)}});Ice.icebox.lastNode=a})},active:false,refresh:function(){var a=Ice.icebox.currentImg;var b=a.getWidth();if(b>40){Ice.removeInterval("Ice.icebox");var c=Ice.icebox.prev;var d=Ice.icebox.next;var e=a.getHeight();a.animate({duration:0.2,morph:{opacity:1.0,"margin-left":(-b/2)+"px","margin-top":(-e/2)+"px"}});left=$("icebox_left1");left.setStyle("margin-left",(-b/2-20)+"px");if(c&&c!="undefined"){left.href="javascript:Ice.icebox.view('"+(Ice.isNode(c)?c.href:c)+"',$('"+(c.prev?$(c.prev).getId():"")+"'),$('"+(c.next?$(c.next).getId():"")+"'))";if(left.getStyle("opacity")==0.0){left.animate({duration:0.2},{duration:0.2,morph:{opacity:1.0}})}}else{left.setStyle("opacity",0)}right=$("icebox_right1");right.setStyle("margin-left",(b/2-10)+"px");if(d&&d!="undefined"){right.href="javascript:Ice.icebox.view('"+(Ice.isNode(d)?d.href:d)+"',$('"+(d.prev?$(d.prev).getId():"")+"'),$('"+(d.next?$(d.next).getId():"")+"'))";if(right.getStyle("opacity")==0.0){right.animate({duration:0.2},{duration:0.2,morph:{opacity:1.0}})}}else{right.setStyle("opacity",0)}}},view:function(a,b,c){var d,left,right;if(!Ice.icebox.active){Ice.icebox.active=true;var e=$({tag:"div",id:"icebox_layer1",styles:{background:"#000",position:"fixed",left:0,top:0,width:"100%",height:"100%","z-index":19000000,opacity:0,cursor:"pointer"}});e.setClass("icebox");e.addTo($body);e.addEvent({event:"click",fn:function(){Ice.icebox.close()}});e.animate({duration:0.2,morph:{opacity:0.8}});d=$({tag:"img",id:"icebox_img1",styles:{"background-color":"#fff",position:"fixed",left:"50%",top:"50%","margin-left":"-500px","margin-top":"-500px","z-index":19000001,opacity:0,cursor:"pointer"}});d.setClass("icebox");d.addEvent({event:"click",fn:function(){Ice.icebox.close()}});d.addTo($body);Ice.icebox.currentImg=d;left=$({tag:"a",id:"icebox_left1",styles:{position:"fixed",display:"block",background:'url("data:image/gif;base64,R0lGODlhHgAeAKIAAIuTj8fLyebo5/Lz862zsJqhnZCYlP///yH5BAAAAAAALAAAAAAeAB4AAAOkeLrc/jDKSescQ+BhoQhEAQAFEQjdIhDGCBitS3CWIL5wnpMoJbS64M7Qi9hwQiGJBiEgk0qCEUrNFRuBZzAwSAICj4EICu5GmQsxWfGDXtlaQwHMpr4P7S0jHwTczUFzKlRoCgNOSXR8OzMPWWuAOl8ecTlcbhGIVX1SRgWbkgV3DT+VfUQVR6Ytoh2HMZIvBKMTHwU3JScpDhsahbvAwcLDCgkAOw%3D%3D") no-repeat',width:"30px",height:"30px","z-index":19000002,left:"50%",top:"50%","margin-top":"-15px",opacity:0}});left.addTo($body);right=$({tag:"a",id:"icebox_right1",styles:{position:"fixed",display:"block",background:'url("data:image/gif;base64,R0lGODlhHgAeAKIAAIuTj8fLyebo5/Lz862zsJqhnZCYlP///yH5BAAAAAAALAAAAAAeAB4AAAOieLrc/jDKSescQ+BhoQhEAQAFEQjdIhDGCBitS3CWIL5wnpMoJbS64M7Qi9hwQiGJBiEgk0qCEUrNFRuBpzVABQQeA1GSw00CZo4wtFdOXhUCrXURKLgdvzWjvXsfBlRFdWNpTncHfDtoDlmEiTtfD3Fujzp+C4ZVQWcSNpo6PBM/ckpEFUekMKEWAywjoC8El6J1NyUnKWkYGky5vr/AwQwJADs%3D") no-repeat',width:"30px",height:"30px","z-index":19000002,left:"50%",top:"50%","margin-top":"-15px",opacity:0}});right.addTo($body)}d=$("icebox_img1");d.src=a;Ice.icebox.prev=b;Ice.icebox.next=c;$({tag:"img",src:Ice.icebox.next});$({tag:"img",src:Ice.icebox.prev});$("icebox_left1").animate({duration:0.1,morph:{opacity:0}});$("icebox_right1").animate({duration:0.1,morph:{opacity:0}});Ice.interval({id:"Ice.icebox",time:0.2,fn:Ice.icebox.refresh})},close:function(){if(!Ice.icebox.active){return}$("icebox_layer1").animate({duration:0.3,morph:{opacity:0}},{duration:0,morph:{fn:function(){try{$("icebox_layer1").remove()}catch(e){}}}});$("icebox_left1").animate({duration:0.1,morph:{opacity:0}},{duration:0,morph:{fn:function(){try{$("icebox_left1").remove()}catch(e){}}}});$("icebox_right1").animate({duration:0.1,morph:{opacity:0.0}},{duration:0,morph:{fn:function(){try{$("icebox_right1").remove()}catch(e){}}}});$("icebox_img1").animate({duration:0.1},{duration:0.15,method:"fadein",morph:{opacity:0.0}},{duration:0,morph:{fn:function(){Ice.icebox.active=false;try{$("icebox_img1").remove()}catch(e){}}}})}},timeout:function(o){return _Ice.timer.add(o,"timeout")},interval:function(o){return _Ice.timer.add(o,"interval")},removeTimeout:function(a){_Ice.timer.remove({id:"t"+a})},removeInterval:function(a){_Ice.timer.remove({id:"i"+a})}};var Nothing=function(){};Nothing.toString=Nothing;Nothing.focus=function(){try{var a=document.createElement("input");a.type="text";a.style.position="absolute";a.style.top="-500px";a.style.left="-500px";a.style.opacity=0;document.body.appendChild(a);a.focus();document.body.removeChild(a)}catch(e){}};var $=function(n){if(!n){return}if(Ice.isString(n)){if(_Ice.nodeCache[n]){return _Ice.nodeCache[n]}var a=document.getElementById(n);if(!a){return}}else if(n.hasIceModel){return n}else if(n.nodeType){var a=n}else if(Ice.isObject(n)){var a=document.createElement(n.tag?n.tag:"div");for(var i in n){switch(i){case"tag":break;case"html":a.innerHTML=n[i];break;case"text":a.innerHTML=n[i];break;default:a[i]=n[i]}}}else return;if(!a.id){a.id=_Ice.getNewNodeId()}for(var i in _Ice.model){if(a[i]){var p=a[i];a[i]=_Ice.model[i];try{a[i](p)}catch(e){}}a[i]=_Ice.model[i]}if(Ice.isObject(n.styles)){for(var j in n.styles){a.setStyle(j,n.styles[j])}}_Ice.nodeCache[a.id]=a;return a};var $$=function(a){var c={};var d={};var e,rest,x,i,j,k,n,node,b,level,downlevel,iteration;if(Ice.isString(a)){a=a.replace(/[ \t]+/g," ");a=a.replace(/[,;]+ ?/g,",");var a=a.split(",")}else if(!Ice.isArray(a)){throw("Expected parameter to be string or array");}for(i=0;i<a.length;i++){e=[];rest=a[i];level=0;iteration=0;while(rest.length){if(++iteration>255){throw("Iteration overflow");}if(!e[level]){e[level]={tag:"",id:"",attr:[],cls:[],nodes:[]}}switch(rest.substr(0,1)){case"#":e[level].id=rest.replace(/^#([a-z0-9_]+).*/i,"$1");rest=rest.substr(e[level].id.length+1,rest.length-e[level].id.length-1);break;case".":x=rest.replace(/^.([-a-z0-9_]+).*/i,"$1");rest=rest.substr(x.length+1,rest.length-x.length-1);e[level].cls.push(x);break;case"[":x=rest.replace(/^\[([^\]]+)\]/i,"$1");rest=rest.substr(x.length+2,rest.length-x.length-2);e[level].attr.push(x);break;case" ":level++;rest=rest.substr(1,rest.length-1);break;default:x=rest.replace(/^(\*|[a-z0-9]+).*$/i,"$1");rest=rest.substr(x.length,rest.length-x.length);if(x===rest||x==="*"){x=""}e[level].tag=x}}for(level=0;level<e.length;level++){if(e[level].id){n=$(document.getElementById(e[level].id));if(!e[level].tag||n.getTag()===e[level].tag.toLowerCase()){n=[n]}else{n=undefined}}else{n=document.getElementsByTagName(e[level].tag?e[level].tag.toLowerCase():"*")}if(!n){continue}next_node:for(j=0;j<n.length;j++){node=$(n[j]);if(!Ice.isNode(node)){continue next_node}if(e[level].cls.length){for(k=0;k<e[level].cls.length;k++){if(!node.hasClass(e[level].cls[k])){continue next_node}}}if(e[level].attr.length){for(k=0;k<e[level].attr.length;k++){if(!node.getAttribute(e[level].attr[k])){continue next_node}}}e[level].nodes.push(node)}if(!e[level+1]){next_node:for(k=0;k<e[level].nodes.length;k++){if(Ice.isUndefined(d[e[level].nodes[k].id])){if(level>0){downlevel=level;while(downlevel>0){if(!e[downlevel-1].nodes.length){continue next_node}for(j=0;j<e[downlevel-1].nodes.length;j++){if(!e[downlevel-1].nodes[j].containsNode(e[downlevel].nodes[k])){continue next_node}}downlevel--}}d[e[level].nodes[k].id]=c[e[level].nodes[k].id]=e[level].nodes[k]}}}}}return Ice.array(c)};if(document.captureEvents){document.captureEvents(Event.MOUSEMOVE)}if(window.captureEvents){window.captureEvents(Event.MOUSEOUT)}if(document.addEventListener){document.addEventListener("mousemove",_Ice.mouse.updatePosition,false);window.addEventListener("mouseout",_Ice.mouse.setOut,false);document.addEventListener("DOMContentLoaded",_Ice.ev.readyExec,false);window.addEventListener("load",_Ice.ev.readyBackup,false)}else{document.attachEvent("onmousemove",_Ice.mouse.updatePosition);window.attachEvent("onmouseout",_Ice.mouse.setOut);document.onreadystatechange=function(){if(document.readyState==="interactive"){_Ice.ev.readyExec()}};window.attachEvent("onload",_Ice.ev.readyBackup)}
