/*
Ice Javascript Framework
Version 1.1 Beta
http://my-webdesigner.com/ice/
THE GNU LGPL LICENSE APPLIES
DO NOT REMOVE THIS INFORMATION
*/
var $,$$,$body,$m,$do,_Ice,Ice;_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(Ice.isEmpty(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(this,a)},addAfter:function(a){a=$(a);if(!a.nextSibling&&a.parentNode){return this.addTo(a.parentNode)}if(!this.parentNode){this.addTo(document.body)}this.parentNode.insertBefore(this,a.nextSibling)},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},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},addHtml: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;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}if(!a.preventDefault){a.preventDefault=function(){h=true}}var b=_Ice.attachScopedFn(g,f,"ev_"+c);g[b](a,a.target);if(h===true){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](_Ice.ani.methods[b.method](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}}}},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}if(o.instantly===true){window.setTimeout(d+"."+e+"()",0)}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},modDirectory:"",getModDirectory:function(){if(_Ice.modDirectory!==""){return _Ice.modDirectory}else{$$("script").each(function(a){if(a.src.match(/(^|\/)ice\.js$/)){_Ice.modDirectory=a.src.replace(/^(.*?)\/?ice\.js$/,"$1")}});return _Ice.modDirectory?_Ice.modDirectory:"."}},incs:{},mods:{}};$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])){console.log("exists");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}}},plugin:{load:function(a){if(!a)return false;if(a.match(/^[A-Za-z0-9]+$/)){Ice.include(_Ice.getModDirectory()+"/plugin-"+a+".js")}else{Ice.include(a)}}},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=[]}},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){a.breakLoop=function(){a._breakIt=true};if(a.length){a._eachFn=b;for(var c=0;c<a.length;c++){if(a._breakIt===true){delete(a._breakIt);break}if(c==="breakLoop")continue;a._eachFn(a[c],c)}}else if(Ice.isObject(a)){a._eachFn=b;for(var c in a){if(c!=="each"&&c!=="_eachFn"){if(a._breakIt===true){delete(a._breakIt);break}if(c==="breakLoop")continue;a._eachFn(a[c],c)}}}else if(!Ice.isEmpty(a)){b(a)}},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})},preload:function(a){$({tag:"img",src:a})},include:function(a){if(!_Ice.incs[a]){var b=Ice.ajax.asyncRequest(a);eval(b);_Ice.incs[a]=true}}};$m=function(a){if(!_Ice.mods[a]){Ice.include(_Ice.getModDirectory()+"/mod-"+a+".js")}return _Ice.mods[a]};$m.add=function(a,b){_Ice.mods[a]=b};Ice.nothing=function(){};Ice.nothing.toString=Ice.nothing;Ice.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){}};$=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};$$=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.addEventListener){document.addEventListener("DOMContentLoaded",_Ice.ev.readyExec,false);window.addEventListener("load",_Ice.ev.readyBackup,false)}else{document.onreadystatechange=function(){if(document.readyState==="interactive"){_Ice.ev.readyExec()}};window.attachEvent("onload",_Ice.ev.readyBackup)}
