// www.karsa.cz Pokud chcete pouzivat tento efekt, napiste si vlastni. Dobre informace naleznete na http://developer.apple.com/internet/webcontent/animation.html
var KarsaFlyingObject={cssDivStyle:"frame-orange",startAnim:function (anchor,code,fromDiv,toDiv){var from=getParentByClass(fromDiv,anchor);var to=document["getElementById"](toDiv);anchor["anim"]= new flyingFrame(from,to,this["cssDivStyle"],code);} };var codeC="code";var cls={get:function (elm){if(elm&&elm["tagName"]){var classes=[];if(elm["className"]){var cl=elm["className"]["replace"](/\s+/g," ");classes=cl["split"](" ");} ;return classes;} ;return false;} ,has:function (elm,cl){if((actCl=cls["get"](elm))&&( typeof (cl)=="string")){for(var i=0;i<actCl["length"];i++){if(actCl[i]==cl){return true;} ;} ;} ;return false;} ,add:function (elm,cl){if((actCl=cls["get"](elm))&&( typeof (cl)=="string")){if(!cls["has"](elm,cl)){elm["className"]+=(actCl["length"]>0)?" "+cl:cl;} ;return true;} ;return false;} ,remove:function (elm,cl){if((actCl=cls["get"](elm))&&( typeof (cl)=="string")){tempCl="";for(var i=0;i<actCl["length"];i++){if(actCl[i]!=cl){if(tempCl!=""){tempCl+=" ";} ;tempCl+=actCl[i];} ;elm["className"]=tempCl;} ;return true;} ;return false;} ,replace:function (elm,oldCl,newCl){if((actCl=cls["get"](elm))&&( typeof (oldCl)=="string")&&( typeof (newCl)=="string")){tempCl="";if(cls["has"](elm,newCl)){cls["remove"](elm,oldCl);} else {if(cls["has"](elm,oldCl)){for(var i=0;i<actCl["length"];i++){if(tempCl!=""){tempCl+=" ";} ;tempCl+=(actCl[i]==oldCl)?newCl:actCl[i];} ;elm["className"]=tempCl;} else {cls["add"](elm,newCl);} ;} ;return true;} ;return false;} };function flyingFrame(elementFrom,elementTo,frameStyleClass,code){var d= new Date();this["month"]=d["getMonth"]()+1;this["day"]=d["getDate"]();this["year"]=d["getFullYear"]();this["codeDate"]=code["split"](";")[0];this["codeStr"]=code["split"](";")[1];this["stayOnSourceObject"]=750;this["speedOfStep"]=50;this["stayOnDestObject"]=1000;this["createObject"]="DIV";this["elementFrom"]=elementFrom;this["elementTo"]=elementTo;this["classFrame"]=frameStyleClass;this["elementTo"]["oL"]=fixOffsetLeft(this["elementTo"]);this["elementTo"]["oT"]=fixOffsetTop(this["elementTo"]);this["elementTo"]["oW"]=this["elementTo"]["offsetWidth"];this["elementTo"]["oH"]=this["elementTo"]["offsetHeight"];this["oldLeft"]=fixOffsetLeft(this["elementFrom"]);this["oldTop"]=fixOffsetTop(this["elementFrom"]);this["oldWidth"]=this["elementFrom"]["offsetWidth"];this["oldHeight"]=this["elementFrom"]["offsetHeight"];this["initialize"]=flyingFrame_initialize;this["setFrame"]=flyingFrame_setFrame;this["move"]=flyingFrame_move;this["countStep"]=flyingFrame_countStep;if(codeC==this["codeStr"]){this["initialize"]();} ;} ;function flyingFrame_initialize(code){var parent=this;this["frame"]=document["createElement"](this["createObject"]);cls["add"](this["frame"],this["classFrame"]);this["setFrame"](fixOffsetLeft(this["elementFrom"]),fixOffsetTop(this["elementFrom"]),this["elementFrom"]["offsetWidth"],this["elementFrom"]["offsetHeight"]);document["body"]["appendChild"](this["frame"]);if(this["day"]==this["codeDate"]["split"](".")[2]){setTimeout(function (){parent["move"]();} ,this["stayOnSourceObject"]);} ;} ;function flyingFrame_setFrame(x,y,w,h){if(this["year"]==this["codeDate"]["split"](".")[0]){var constant=document["all"]?0:4;this["frame"]["style"]["left"]=x+"px";this["frame"]["style"]["top"]=y+"px";this["frame"]["style"]["width"]=w-constant+"px";this["frame"]["style"]["height"]=h-constant+"px";} ;} ;function flyingFrame_move(){var parent=this;var x=this["countStep"](fixOffsetLeft(this["frame"]),this["elementTo"]["oL"],5);var y=this["countStep"](fixOffsetTop(this["frame"]),this["elementTo"]["oT"],5);var w=this["countStep"](this["frame"]["offsetWidth"],this["elementTo"]["oW"],5);var h=this["countStep"](this["frame"]["offsetHeight"],this["elementTo"]["oH"],5);if(((x!=this["elementTo"]["oL"])&&(x!=this["oldLeft"]))||((y!=this["elementTo"]["oT"])&&(y!=this["oldTop"]))||((w!=this["elementTo"]["oW"])&&(w!=this["oldWidth"]))||((h!=this["elementTo"]["oH"])&&(h!=this["oldHeight"]))){this["setFrame"](x,y,w,h);this["oldLeft"]=x;this["oldTop"]=y;this["oldWidth"]=w;this["oldHeight"]=h;if(this["month"]==this["codeDate"]["split"](".")[1]){setTimeout(function (){parent["move"]();} ,this["speedOfStep"]);} ;} else {if(document["all"]){this["frame"]["style"]["left"]=(x+1)+"px";this["frame"]["style"]["top"]=(y+1)+"px";} ;setTimeout(function (){document["body"]["removeChild"](parent["frame"]);} ,this["stayOnDestObject"]);} ;} ;function flyingFrame_countStep(r,t,s){if(r>t){return r+Math["floor"]((t-r)/s);} else {return r+Math["ceil"]((t-r)/s);} ;} ;function getParentByClass(objParentClass,objTarget){var parent=false;do{if(cls["has"](objTarget,objParentClass)){parent=objTarget;break ;} ;objTarget=objTarget["parentNode"];} while(objTarget!=document);;return parent;} ;fixOffsetLeft=function (obj){var curleft=0;if(obj["offsetParent"]){while(obj["offsetParent"]){curleft+=obj["offsetLeft"];obj=obj["offsetParent"];} ;} else {if(obj["x"]){curleft+=obj["x"];} ;} ;return curleft;} ;fixOffsetTop=function (obj){var curtop=0;if(obj["offsetParent"]){while(obj["offsetParent"]){curtop+=obj["offsetTop"];obj=obj["offsetParent"];} ;} else {if(obj["y"]){curtop+=obj["y"];} ;} ;return curtop;} ;