By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,825 Members | 1,255 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,825 IT Pros & Developers. It's quick & easy.

Javascript not working on my PC but ok on others

P: 9
Hello,

Please help with the following problem it is causing me some headaches.

The following javascript code is designed to fill in text boxes with numbers on an online game (tribalwars). It works fine for everyone else and even the link to the script that I am personally using has been used on other people computers successfully. I have tried this on both IE7 and the latest Firefox. My options show javascript is enabled and even other more basic scripts have worked in the same browser and on the same computer.

Any ideas or suggestions would be greatly appreciated. Thanks in advance.


Expand|Select|Wrap|Line Numbers
  1. javascript:var%20configuration=[8000,0,0,302,0,2000,20,0,0,0];var%20archers=false;var%20units;var%20unitsNET;var%20costs;function%20arrayMin(array){var%20value=array[0];for%20(var%20t=1;t<array.length;t++){if%20(array[t]<value){value=array[t];}}return%20value;}function%20linearDivideArray(array1,%20array2){var%20value=[];if%20(array1.length==array2.length){for%20(var%20t=0;t<array1.length;t++){if%20(array2[t]!=0){value[t]=array1[t]*1.0/array2[t];}else{value[t]=0;}}}return%20value;}function%20linearAddArray(array1,array2){var%20value=[];if%20(array1.length==array2.length){for%20(var%20t=0;t<array1.length;t++){value[t]=array1[t]+array2[t];}}%20return%20value;}function%20getUnitId(unit){for%20(var%20t=0;t<units.length;t++){if%20(unit%20==%20unitsNET[t]){return%20t;}}return%20-1;}function%20getTagsSubset(tagname,classname){var%20subset_t=document.getElementsByTagName(tagname);var%20subset_c=[];var%20u=0;for%20(var%20t=0;t<subset_t.length;t++){if%20(subset_t[t].className==classname){subset_c[u++]=subset_t[t];}}return%20subset_c;}function%20getTable(){var%20candidates=getTagsSubset('table',%20'vis');%20var%20t;%20for%20(t=0;t<candidates.length;t++){try%20{if%20(candidates[t].rows[0].cells[0].innerHTML=='Village'){break;}}catch%20(e){}}return%20candidates[t];}function%20getQueue(record){var%20value=[0,0,0,0,0,0,0,0,0,0];for%20(var%20u=3;u<record.cells.length;u++){try{value[u%20-%203]=parseInt(record.cells.childNodes[1].childNodes[1].firstChild.title,10);}catch%20(e){}if%20(isNaN(value[u%20-%203])){value[u%20-%203]=0;}}return%20value;}function%20getResources(record){var%20value=[0,0,0,0];var%20res=record.cells[1].textContent.split("\n");var%20farm=record.cells[2].innerHTML.split('/');value[0]=parseInt(res[1].replace(".",""),10);value[1]=parseInt(res[2].replace(".",""),10);value[2]=parseInt(res[3].replace(".",""),10);value[3]=farm[1]-farm[0];return%20value;}function%20getProduced(record){var%20value=[0,0,0,0,0,0,0,0,0,0];for%20(var%20u=3;u<record.cells.length;u++){try{value[u%20-%203]=parseInt(record.cells.childNodes[1].textContent.split("\n")[2],10);}catch%20(e){}if%20(isNaN(value[u%20-%203])){value[u%20-%203]=0;}}return%20value;}function%20submitForm(){var%20candidates=document.getElementsByTagName("input");var%20t;for%20(t=0;t<candidates.length;t++){if%20(candidates[t].type=="submit"){break;}}candidates[t].click();}if%20(document.URL.match('screen=train')&&document.URL.match('mode=mass')){var%20records=getTable().rows;if%20(archers){units=['spear','sword','axe','archer','spy','light','marcher','heavy','ram','catapult'];unitsNET=['Spear%20Fighter','Swordsman','Axeman','Archer','Scout','Light%20Cavalry','Mounted%20Archer',%20'Heavy%20Cavalry','Ram','Catapult'];costs=[[50,30,10,1],[30,30,70,1],[60,30,40,1],[100,30,60,1],[50,50,20,2],[125,100,250,4],[250,100,150,5],[200,150,600,6],%20[300,200,200,5],[320,400,100,8]];}else{units=['spear','sword','axe','spy','light','heavy','ram','catapult'];unitsNET=['Spear%20Fighter','Swordsman','Axeman','Scout','Light%20Cavalry','Heavy%20Cavalry','Ram','Catapult'];%20costs=[[50,30,10,1],[30,30,70,1],[60,30,40,1],[50,50,20,2],[125,100,250,4],[200,150,600,6],[300,200,200,5],[320,400,100,8]];}for%20(r=1;r<records.length;r++){var%20subconf=[];var%20total_costs=[0,0,0,0];var%20i;var%20resources=getResources(records[r]);var%20queue=getQueue(records[r]);var%20produced=getProduced(records[r]);for%20(i=0;i<units.length;i++){subconf=configuration-(queue+produced);if%20(subconf<0){subconf=0;}for%20(var%20j=0;j<4;j++){total_costs[j]+=costs[j]*subconf;}};var%20factor=arrayMin(linearDivideArray(resources,total_costs));if%20(factor>1.0){factor=1.0;}for%20(i=0;i<units.length;i++){var%20number=subconf*factor;if%20(number<0){number=0;}if%20(records[r].cells[3%20+%20i].childNodes[3]){var%20ibox=records[r].cells[3%20+%20i].childNodes[3];try{ibox.defaultValue=parseInt(number,10);}catch%20(e){}}}}stop();}else{alert('Script%20only%20works%20on%20the%20mass%20recruitment%20page');}
Aug 16 '08 #1
Share this Question
Share on Google+
16 Replies


acoder
Expert Mod 15k+
P: 16,027
How are you using this script?
Aug 17 '08 #2

P: 9
How are you using this script?

It is embedded as a custom link with in the game. (This is the same way that every one else is successfully using it). When in a certain screen on the game the link is clicked and the JavaScript is meant to fill in the many text boxes on screen with the predefined custom numbers. These numbers are in the square brackets near the beginning of the script, starting with [8000,0, etc].

Thanks for any help you can give.
Aug 17 '08 #3

acoder
Expert Mod 15k+
P: 16,027
Do you get any errors when you run this script?

btw, is this a cheat script?
Aug 18 '08 #4

P: 9
No, no errors just nothing happens.

It is not a cheat script. It is an admin approved script that greatly speeds up a mundane task of entering text in 100's of boxes (depending on your size in the game).
Aug 18 '08 #5

acoder
Expert Mod 15k+
P: 16,027
I just asked out of interest.

Can you give me a link to test on?
Aug 18 '08 #6

P: 9
The only place I would imagine the link can be tested is in game. www.tribalwars.net and going to the mass recruit section. This is where the link is supposed to work. However you would need a game account and I dont even know if you would have the mass recruit option with out paying for premium (which i don't expect you to do, lol)

Even then the text layout within the script must be correct as my own link in game has been proven to work as another player in game "sat" my account from another computer and the link worked fine. The hick up seems to be this script not working on my PC only. It is not possible for you to "sit" my account as the game world I play in (world 2) is now shut to new members.

Why would my PC be it browser, firewall or any other possible thing inhibit this link/script from working. When the exact same link works on other peoples computers?

Thanks for you continued help. :)
Aug 18 '08 #7

acoder
Expert Mod 15k+
P: 16,027
Does the link look something like
Expand|Select|Wrap|Line Numbers
  1. <a href="javascript:..." ...>...</a>
?
Aug 19 '08 #8

P: 9
No it is exactly as written in the first post. I know this as it appears in the status bar of Firefox when I hover over the link and when I click to edit the link, the same code is in there also.
Aug 19 '08 #9

acoder
Expert Mod 15k+
P: 16,027
By the "..." I meant the rest of the script above. Since it appears in the status bar, then it is the href which is set. I was thinking of something you could try and then realised that you're creating this custom link and don't really have control over how the link is created, so we'll have to scrap that.

Have you tried a simpler version (if you have another script) and does that work?

Here's a quick test you could try:
Expand|Select|Wrap|Line Numbers
  1. javascript:alert(document.getElementsByTagName("input").length);
Just alerts the number of input elements on the page.
Aug 20 '08 #10

P: 9
Strangely this one works which is still reasonably complex. But the code in the first one is definitely correct. Yes the script for input elements you gave me works fine.


Expand|Select|Wrap|Line Numbers
  1. javascript:doc=document;if(window.frames.length>0)doc=document.main;if(doc.location.search.indexOf('screen=market')==-1||doc.location.search.indexOf('mode=own_offer')==-1){doc.location.search='screen=market&mode=own_offer';alert('You%20were%20not%20on%20the%20correct%20page%20to%20run%20this%20script,\nbut%20you%20are%20now.');}else{var%20wood=new%20Number(doc.getElementById('wood').innerHTML);var%20clay=new%20Number(doc.getElementById('stone').innerHTML);var%20iron=new%20Number(doc.getElementById('iron').innerHTML);var%20forms=doc.getElementsByTagName('form');var%20table="";for(i=0;i<forms.length&&table=="";i++){if(forms[i].action.indexOf('action=modify_offers')!=-1)table=forms[i].childNodes[0];}for(i=1;table!=""&&i<table.rows.length-1;i++){res=table.rows[i].cells[1].childNodes[0].title;num="";for(j=0;j<table.rows[i].cells[1].childNodes.length;j++){value%20=%20table.rows[i].cells[1].childNodes[j].nodeValue;if(value%20!=%20null)num+=value;}num=num.substring(0,num.length-1);num*=new%20Number(table.rows[i].cells[2].innerHTML);if(res=='Wood')wood+=num;if(res=='Clay')clay+=num;if(res=='Iron')iron+=num;}wood=Math.round(wood/1000);clay=Math.round(clay/1000);iron=Math.round(iron/1000);doc.getElementById('res_sell_wood').checked=wood>clay&&wood>iron;doc.getElementById('res_sell_stone').checked=clay>wood&&clay>iron;doc.getElementById('res_sell_iron').checked=iron>clay&&iron>wood;doc.getElementById('res_buy_wood').checked=wood<clay&&wood<iron;doc.getElementById('res_buy_stone').checked=clay<wood&&clay<iron;doc.getElementById('res_buy_iron').checked=iron<clay&&iron<wood;offers=Math.max(Math.max(wood,clay),iron)-Math.min(Math.min(wood,clay),iron);offers=Math.round(offers/2);doc.getElementsByName('multi')[0].value=offers;doc.getElementsByName('max_time')[0].value=10;doc.getElementsByName('sell')[0].value=1000;doc.getElementsByName('buy')[0].value=1000;}end();
Aug 20 '08 #11

acoder
Expert Mod 15k+
P: 16,027
It's not easy solving this kind of problem unless there's something simple I'm missing that's waiting to jump out at me.

If you can view the source code of the page and get the relevant parts that I could perhaps test. Please post code using code tags. Thanks!

Failing that, since this is an admin-approved script, and you're playing a premium version that you've paid for, you should ask the game support staff for help ;)
Aug 21 '08 #12

P: 9
Yes it must be something simple. I cant think for the life of me what it is though, I have asked other people in game who are fairly good with computers and they have no idea.

I could try asking the admin team but they only approved the script not created it so I don't think they will help me with this one.

I tried posting all the source code but I guess it is too long for this web site to handle as I am receiving fatal errors. I have posted the first part, not sure if that is any use though.


Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><script src="http://1.2.3.4/bmi-int-js/bmi.js" language="javascript"></script><head><title>Aten 134 (868|176) - Tribal Wars</title> <style type="text/css">.inv_empty{position:absolute; z-index:3;width:600px; height:430px;}
  2.  
  3. .inv_map{position:absolute; z-index:2;}
  4.  
  5. .inv_archer{top:157px;left:193px;}
  6. .inv_axe{top:257px;left:128px;}
  7. .inv_catapult{top:0px;left:38px;}
  8. .inv_heavy{top:24px;left:76px;}
  9. .inv_light{top:56px;left:245px;}
  10. .inv_marcher{top:217px;left:483px;}
  11. .inv_ram{top:157px;left:361px;}
  12. .inv_spear{top:43px;left:99px;}
  13. .inv_snob{top:276px;left:398px;}
  14. .inv_spy{top:264px;left:340px;}
  15. .inv_sword{top:208px;left:336px;}
  16. </style>
  17. <style type="text/css">ul.quickbar{border:1px solid black;background-color:#F1EBDD;border-spacing:1px;list-style-type:none;padding:0;margin:0 auto}ul.quickbar li{padding:0px;padding-left:4px;padding-right:4px;white-space:nowrap;background-color:#F8F4E8;background-image:url(http://en2.tribalwars.net/graphic/background/grey.jpg);display:inline}
  18. </style>
  19. <style type="text/css">a:link{font-weight:bold;color:#804000;text-decoration:none}a:visited{font-weight:bold;color:#804000;text-decoration:none}a:active{font-weight:bold;color:#0082BE;text-decoration:none}a:hover{font-weight:bold;color:#0082BE;text-decoration:none}td{font-size:9pt}.hidden{color:#DED3B9}table.main{border-width:2px;border-style:solid;border-color:#804000;background-color:#F1EBDD;background-image:url(http://en2.tribalwars.net/graphic/background/main.jpg)}table.news{background-color:#F1EBDD}.in_border{background-color:#F1EBDD;text-align:left}span.timer_replace span{display:none}form{margin:0px}p:first-child,h1:first-child,h2:first-child,h3:first-child,h4:first-child,h5:first-child,h6:first-child,h1+p,h2+p,h3+p,h4+p,h5+p,h6+p{margin-top:0px}table.blind{border-spacing:0px}table.blind td{padding:0px}table.vis td{background-color:#F8F4E8;background-image:url(http://en2.tribalwars.net/graphic/background/table.jpg)}table.vis td.selected{background-color:#DED3B9;background-image:none}table.vis tr.nowrap td{white-space:nowrap;background-color:#F8F4E8;background-image:none}table.vis tr.units_own_home td{background-color:#F8F4E8;background-image:none}table.vis tr.units_there td{background-color:#EDE1B7;background-image:none}table.vis tr.units_away td{background-color:#F3EBCF;background-image:none}table.vis tr.units_moving td{background-color:#F3EBCF;background-image:none}table.vis tr.row_a td{background-color:#F8F4E8;background-image:none}table.vis tr.row_b td{background-color:#F3EBCF;background-image:none}table.vis tr.edit_player_colors td{background-image:none}tr.nowrap td{white-space:nowrap}table.intro td{background-color:#F8F4E8;line-height:1.5em;padding:6px;font-size:8pt}/**/.tool-tip{width:250px;background-color:#F8F4E8;z-index:9999}.tool-title{background-color:#DED3B9;font-weight:bold;padding:2px}.tool-text{padding:5px}/*üleiste */
  20. table.menu, ul.quickbar {
  21.     border: 1px solid black;
  22.     background-color: #F1EBDD;
  23. }
  24.  
  25. ul.quickbar{
  26.     border-spacing:1px;
  27.     list-style-type:none;
  28.     padding:0;
  29.     margin:0 auto;
  30. }
  31.  
  32. /* Top-Menu-Item mit Hover */
  33. table.menu tr td, ul.quickbar li {
  34.     padding: 2px; padding-left: 4px; padding-right: 4px;
  35.     white-space: nowrap;
  36.     background-color: #F8F4E8;
  37.     background-image:url(http://en2.tribalwars.net/graphic/background/grey.jpg);
  38. }
  39.  
  40. /* Quickbar MenuItem */
  41. ul.quickbar li{
  42.     padding-top: 0px; padding-bottom: 0px;
  43.     display:inline;
  44. }
  45.  
  46. /* Das gesamte Untermenu */
  47. table.menu tr td table {
  48.     z-index:100;
  49.     position:absolute;
  50.     border-top: 1px solid black;
  51.     border-top: 1px solid black;
  52.     margin-left: -5px; margin-top:1px;
  53.     visibility: hidden;
  54. }
  55.  
  56. /* Das gesamte Untermenu in sichtbar */
  57. table.menu tr td:hover table, table.menu tr td.hover table {
  58.     visibility: visible;
  59.     z-index:9999;
  60. }
  61.  
  62. /* Ein Untermenupunkt */
  63. table.menu tr td table tr td {
  64.     border: 1px solid black;
  65.     border-top: none;
  66. }
  67. /* Ein Link in einem Untermenupunkt */
  68. table.menu tr td table tr td a{
  69.     display: block;
  70.     width: 100%;
  71. }
  72.  
  73. /* Forum */
  74. .forum { display:inline-block; background-color:#F1EBDD; margin-bottom:4px; padding:1px; border:1px solid #000; white-space:nowrap; line-height:150%; }
  75. .selected { background-color:#FADC9B;}
  76.  
  77. table.map_container { background-color: #DED3B9; border: 1px solid rgb(0, 0, 0); }
  78. table.map td { font-size:8pt; text-align:center; vertical-align:middle;}
  79.  
  80. td.space-left { border-left:1px solid #175E36; } /* zwischen normalen Feldern */
  81. td.space-bottom { border-bottom:1px solid #175E36; }
  82. td.border-left { border-left:1px solid #103530; } /* "Sektorgrenzen" S1/S2/S6 */
  83. td.border-bottom { border-bottom:1px solid #103530; }
  84. td.sector-left { border-left:1px solid #DED3B9; } /* Sektorgrenzen */
  85. td.sector-bottom { border-bottom:1px solid #DED3B9; }
  86.  
  87. td.space-left-new {}
  88. td.space-bottom-new {}
  89. td.border-left-new { border-left:1px solid #214B18; }
  90. td.border-bottom-new { border-bottom:1px solid #214B18; }
  91. td.sector-left-new { border-left:1px solid #DED3B9; }
  92. td.sector-bottom-new { border-bottom:1px solid #DED3B9; }
  93. td.con-left-new { border-left:1px solid #000000; }
  94. td.con-bottom-new { border-bottom:1px solid #000000; }
  95.  
  96. tr.center td { text-align:center; }
  97. tr.lit td { font-weight:bold; background-color:#FADC9B; background-image:none;}
  98. tr.lit2 td { font-weight:bold; background-color:#F0E6C8; background-image:none;}
  99. tr.admin td { background-color:#F0E6C8; }
  100. tr.mini td { font-style: italic; font-size: x-small }
  101. th        { font-size:9pt; text-align: left; font-weight:bold; background-color:#DED3B9; background-image:url(http://en2.tribalwars.net/graphic/background/body.jpg); }
  102. body    { background-color: #DED3B9; background-image:url(http://en2.tribalwars.net/graphic/background/body.jpg); font-size:9pt; font-family: Verdana, Arial }
  103. /* !!! ACHTUNG !!! 'Wenn css nicht als UTF-8 gespeichert, dann wird dies hier kaputt gehen !!! */
  104. h1        { font-size:16pt;}
  105. h2        { font-size:14pt;}
  106. h3      { font-size:12pt; font-weight:bold; }
  107. h4      { font-size:10pt; font-weight:bold; font-style:italic; margin-bottom:4pt}
  108. h5      { font-size:10pt; font-weight:bold; margin-bottom:2pt}
  109. img   { border: none; }
  110. img.middle { vertical-align:middle; }
  111.  
  112. .grey  { color: gray; }
  113. .warn  { color: rgb(255, 0, 0); }
  114. .error { color: rgb(180, 0, 0); font-weight:bold; }
  115. .inactive { color: rgb(160, 160, 160); }
  116. .nowrap { white-space: nowrap; }
  117. .small { font-size: xx-small; }
  118.  
  119. hr        { color: #804000; }
  120. table.box { border-width:1px; border-style: solid; border-color:#000000; background-color:#F1EBDD; background-image:url(http://en2.tribalwars.net/graphic/background/main.jpg); vertical-align: middle; }
  121. table.box tr td { white-space:nowrap; }
  122.  
  123. input, select { font-size: 8pt; /*background-color:#FDFBF3;*/ }
  124.  
  125. input.attack { background-color: rgb(250, 210, 210) }
  126. input.support { background-color: rgb(210, 250, 210) }
  127.  
  128. input.check { margin:0px; margin-right:5px; }
  129.  
  130. table.quote td.quote_author { font-weight: bold; font-size: 8pt; }
  131. table.quote td.quote_message { background-color:#FFFFFF; font-size: 8pt; }
  132.  
  133. .post { border: 2px solid #804000; background-color: #f8f4e8; padding:0px; margin-bottom:5px;}
  134. .igmline { background-color:#efe6c9; padding-left:4px; border-bottom:1px solid #804000; position:relative;}
  135. .text { padding:6px; }
  136. .date { font-size:x-small; right:5px; position:absolute;}
  137. .right { right:5px; position:absolute; }
  138.  
  139. .landing { font-size:x-small; }
  140.  
  141. #igm_groups { position:absolute;z-index:100; border: 2px solid #804000; background-color:#efe6c9;}
  142. #igm_groups td { padding:2px; }
  143.  
  144. #igm_to { position:absolute; z-index:1; border: 2px solid #804000; background-color:#DED3B9;}
  145. #igm_to_content { background-color:#efe6c9; height: 250px; width:200px; overflow:auto}
  146. #igm_to td { padding:2px; }
  147.  
  148. #box{
  149. color:black;
  150. background-color : #F8F4E8;
  151. width:100%;
  152. height:200px;
  153. text-align:left;
  154. padding : 0px;
  155. overflow:auto;
  156. position:relative;
  157. }
  158.  
  159. ul.help{padding-left:1px; margin-left:0px}
  160. li.help{list-style-type:none; background-color:#DED3B9; margin:2px; padding-left:8px; padding-top:4px; padding-bottom:4px;}
  161.  
  162. ul.help li.help ul.help li.help{ background-color:#F1EBDD; }
  163. ul.help li.help ul.help li.help ul.help li.help { background-color:#F8F4E8; }
  164. /*ul.help ul.help ul.help{background-color:#F8F4E8;}*/
  165.  
  166. ul.submenu{padding-left:1px; margin-left:0px}
  167. li.submenu{list-style-type:none; margin:2px; padding-left:8px; padding-top:4px; padding-bottom:4px;}
  168.  
  169. a.sel { color:#0082BE; text-decoration:underline;}
  170.  
  171. .bonus_icon{background-image:url(http://en2.tribalwars.net/graphic/overview/bonus_icons.png);width:14px;height:14px;display:inline-block;margin-left:2px;}
  172. .bonus_icon_1{background-position:0 0}
  173. .bonus_icon_2{background-position:0 98px}
  174. .bonus_icon_3{background-position:0 84px}
  175. .bonus_icon_4{background-position:0 14px}
  176. .bonus_icon_5{background-position:0 56px}
  177. .bonus_icon_6{background-position:0 42px}
  178. .bonus_icon_7{background-position:0 28px}
  179. .bonus_icon_8{background-position:0 70px}
  180.  
  181. </style>
  182. <style type="text/css">.empty{ position:absolute; z-index:3; left:0px; top:0px; width:600px; height:418px;}
  183.  
  184. .p_main{ position:absolute; z-index:2; left:194px; top:106px; }
  185. .p_place{ position:absolute; z-index:2; left:334px; top:198px; }
  186. .p_wood{ position:absolute; z-index:2; left:505px; top:332px; }
  187. .p_stone{ position:absolute; z-index:2; left:0px; top:333px; }
  188. .p_iron{ position:absolute; z-index:2; left:2px; top:0px; }
  189. .p_statue{ position:absolute; z-index:2; left:182px; top:203px; }
  190. .p_wall{ position:absolute; z-index:1; left:0px; top:0px; }
  191. .p_farm{ position:absolute; z-index:2; left:237px; top:36px; }
  192. .p_hide{ position:absolute; z-index:2; left:180px; top:293px; }
  193.  
  194. .p_storage{ position:absolute; z-index:2; left:96px; top:221px; }
  195. .p_market{ position:absolute; z-index:2; left:407px; top:204px; }
  196.  
  197. .p_barracks{ position:absolute; z-index:2; left:356px; top:113px; }
  198. .p_stable{ position:absolute; z-index:2; left:219px; top:222px; }
  199. .p_garage{ position:absolute; z-index:2; left:46px; top:102px; }
  200. .p_church{ position:absolute; z-index:2; left:179px; top:180px; }
  201. .p_snob{ position:absolute; z-index:2; left:279px; top:294px; }
  202. .p_smith{ position:absolute; z-index:2; left:146px; top:44px; }
  203.  
  204. /* Label(Stufenanzeigen) für fest positionierte Gebaeude */
  205.  
  206. .l_main{  position:absolute; display:none; z-index:3; left:228px; top:135px; }
  207. .l_place{ position:absolute; display:none; z-index:3; left:371px; top:224px; }
  208. .l_wood{  position:absolute; display:none; z-index:3; left:510px; top:333px; }
  209. .l_stone{ position:absolute; display:none; z-index:3; left:16px; top:318px; }
  210. .l_iron{  position:absolute; display:none; z-index:3; left:29px; top:0px; }
  211. .l_statue{position:absolute; display:none; z-index:3; left:187px; top:190px; }
  212. .l_wall{  position:absolute; display:none; z-index:3; left:482px; top:22px; }
  213. .l_farm{  position:absolute; display:none; z-index:3; left:299px; top:39px; }
  214. .l_hide{  position:absolute; display:none; z-index:3; left:184px; top:298px; }
  215.  
  216. .l_storage{ position:absolute; display:none; z-index:3; left:147px; top:223px; }
  217. .l_market{ position:absolute; display:none; z-index:3; left:500px; top:231px; }
  218.  
  219. .l_barracks{ position:absolute; display:none; z-index:3; left:478px; top:112px; }
  220. .l_stable{ position:absolute; display:none; z-index:3; left:277px; top:232px; }
  221. .l_garage{ position:absolute; display:none; z-index:3; left:123px; top:99px; }
  222. .l_snob{ position:absolute; display:none; z-index:3; left:285px; top:340px; }
  223. .l_smith{ position:absolute; display:none; z-index:3; left:146px; top:63px; }
  224.  
  225. div.label { background-color: #598146; padding: 1px; border: 1px black solid; min-width:20px; color: white}
  226. div.label_night { background-color: #202060; padding: 1px; border: 1px black solid; min-width:20px; color:white}
  227. div.label a:link    { color:#DDDDDD }
  228. div.label a:visited    {  color:#DDDDDD }
  229. div.label a:active    {  color:#DDDDDD }
  230. div.label a:hover    { color:white }
  231.  
  232. div.label_night a:link { color:#CCCCCC}
  233. div.label_night a:visited { color:#CCCCCC}
  234. div.label_night a:active { color:#CCCCCC}
  235. div.label_night a:hover { color:white}
  236. div.label img { display:none; }
  237. div.label_night img { display:none; }
  238. </style>
  239. <script  type="text/javascript">
  240. <!--
  241. var MooTools={version:"1.11"};function $defined(A){return(A!=undefined);}function $type(B){if(!$defined(B)){return false;}if(B.htmlElement){return"element";}var A=typeof B;if(A=="object"&&B.nodeName){switch(B.nodeType){case 1:return"element";case 3:return(/\S/).test(B.nodeValue)?"textnode":"whitespace";}}if(A=="object"||A=="function"){switch(B.constructor){case Array:return"array";case RegExp:return"regexp";case Class:return"class";}if(typeof B.length=="number"){if(B.item){return"collection";}if(B.callee){return"arguments";}}}return A;}function $merge(){var C={};for(var B=0;B<arguments.length;B++){for(var E in arguments[b]){var A=arguments[b][E];var D=C[E];if(D&&$type(A)=="object"&&$type(D)=="object"){C[E]=$merge(D,A);}else{C[E]=A;}}}return C;}var $extend=function(){var A=arguments;if(!A[1]){A=[this,A[0]];}for(var B in A[1]){A[0][b]=A[1][b];}return A[0];};var $native=function(){for(var B=0,A=arguments.length;B<A;B++){arguments[b].extend=function(C){for(var D in C){if(!this.prototype[D]){this.prototype[D]=C[D];}if(!this[D]){this[D]=$native.generic(D);}}};}};$native.generic=function(A){return function(B){return this.prototype[A].apply(B,Array.prototype.slice.call(arguments,1));};};$native(Function,Array,String,Number);function $chk(A){return!!(A||A===0);}function $pick(B,A){return $defined(B)?B:A;}function $random(B,A){return Math.floor(Math.random()*(A-B+1)+B);}function $time(){return new Date().getTime();}function $clear(A){clearTimeout(A);clearInterval(A);return null;}var Abstract=function(A){A=A||{};A.extend=$extend;return A;};var Window=new Abstract(window);var Document=new Abstract(document);document.head=document.getElementsByTagName("head")[0];window.xpath=!!(document.evaluate);if(window.ActiveXObject){window.ie=window[window.XMLHttpRequest?"ie7":"ie6"]=true;}else{if(document.childNodes&&!document.all&&!navigator.taintEnabled){window.webkit=window[window.xpath?"webkit420":"webkit419"]=true;}else{if(document.getBoxObjectFor!=null){window.gecko=true;}}}window.khtml=window.webkit;Object.extend=$extend;if(typeof HTMLElement=="undefined"){var HTMLElement=function(){};if(window.webkit){document.createElement("iframe");}HTMLElement.prototype=(window.webkit)?window["[[DOMElement.prototype]]"]:{};}HTMLElement.prototype.htmlElement=function(){};if(window.ie6){try{document.execCommand("BackgroundImageCache",false,true);}catch(e){}}var Class=function(B){var A=function(){return(arguments[0]!==null&&this.initialize&&$type(this.initialize)=="function")?this.initialize.apply(this,arguments):this;};$extend(A,this);A.prototype=B;A.constructor=Class;return A;};Class.empty=function(){};Class.prototype={extend:function(B){var C=new this(null);for(var D in B){var A=C[D];C[D]=Class.Merge(A,B[D]);}return new Class(C);},implement:function(){for(var B=0,A=arguments.length;B<A;B++){$extend(this.prototype,arguments[b]);}}};Class.Merge=function(C,D){if(C&&C!=D){var B=$type(D);if(B!=$type(C)){return D;}switch(B){case"function":var A=function(){this.parent=arguments.callee.parent;return D.apply(this,arguments);};A.parent=C;return A;case"object":return $merge(C,D);}}return D;};var Chain=new Class({chain:function(A){this.chains=this.chains||[];this.chains.push(A);return this;},callChain:function(){if(this.chains&&this.chains.length){this.chains.shift().delay(10,this);}},clearChain:function(){this.chains=[];}});var Events=new Class({addEvent:function(B,A){if(A!=Class.empty){this.$events=this.$events||{};this.$events[b]=this.$events[b]||[];this.$events[b].include(A);}return this;},fireEvent:function(C,B,A){if(this.$events&&this.$events[C]){this.$events[C].each(function(D){D.create({bind:this,delay:A,"arguments":B})();},this);}return this;},removeEvent:function(B,A){if(this.$events&&this.$events[b]){this.$events[b].remove(A);}return this;}});var Options=new Class({setOptions:function(){this.options=$merge.apply(null,[this.options].extend(arguments));if(this.addEvent){for(var A in this.options){if($type(this.options[A]=="function")&&(/^on[A-Z]/).test(A)){this.addEvent(A,this.options[A]);}}}return this;}});Array.extend({forEach:function(C,D){for(var B=0,A=this.length;B<A;B++){C.call(D,this[b],B,this);}},filter:function(D,E){var C=[];for(var B=0,A=this.length;B<A;B++){if(D.call(E,this[b],B,this)){C.push(this[b]);}}return C;},map:function(D,E){var C=[];for(var B=0,A=this.length;B<A;B++){C[b]=D.call(E,this[b],B,this);}return C;},every:function(C,D){for(var B=0,A=this.length;B<A;B++){if(!C.call(D,this[b],B,this)){return false;}}return true;},some:function(C,D){for(var B=0,A=this.length;B<A;B++){if(C.call(D,this[b],B,this)){return true;}}return false;},indexOf:function(C,D){var A=this.length;for(var B=(D<0)?Math.max(0,A+D):D||0;B<A;B++){if(this[b]===C){return B;}}return-1;},copy:function(D,C){D=D||0;if(D<0){D=this.length+D;}C=C||(this.length-D);var A=[];for(var B=0;B<C;B++){A[b]=this[D++];}return A;},remove:function(C){var B=0;var A=this.length;while(B<A){if(this[b]===C){this.splice(B,1);A--;}else{B++;}}return this;},contains:function(A,B){return this.indexOf(A,B)!=-1;},associate:function(C){var D={},B=Math.min(this.length,C.length);for(var A=0;A<B;A++){D[C[A]]=this[A];}return D;},extend:function(C){for(var B=0,A=C.length;B<A;B++){this.push(C[b]);}return this;},merge:function(C){for(var B=0,A=C.length;B<A;B++){this.include(C[b]);}return this;},include:function(A){if(!this.contains(A)){this.push(A);}return this;},getRandom:function(){return this[$random(0,this.length-1)]||null;},getLast:function(){return this[this.length-1]||null;}});Array.prototype.each=Array.prototype.forEach;Array.each=Array.forEach;function $A(A){return Array.copy(A);}function $each(C,B,D){if(C&&typeof C.length=="number"&&$type(C)!="object"){Array.forEach(C,B,D);}else{for(var A in C){B.call(D||C,C[A],A);}}}Array.prototype.test=Array.prototype.contains;String.extend({test:function(A,B){return(($type(A)=="string")?new RegExp(A,B):A).test(this);},toInt:function(){return parseInt(this,10);},toFloat:function(){return parseFloat(this);},camelCase:function(){return this.replace(/-\D/g,function(A){return A.charAt(1).toUpperCase();});},hyphenate:function(){return this.replace(/\w[A-Z]/g,function(A){return(A.charAt(0)+"-"+A.charAt(1).toLowerCase());});},capitalize:function(){return this.replace(/\b[a-z]/g,function(A){return A.toUpperCase();});},trim:function(){return this.replace(/^\s+|\s+$/g,"");},clean:function(){return this.replace(/\s{2,}/g," ").trim();},rgbToHex:function(B){var A=this.match(/\d{1,3}/g);return(A)?A.rgbToHex(B):false;},hexToRgb:function(B){var A=this.match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/);return(A)?A.slice(1).hexToRgb(B):false;},contains:function(A,B){return(B)?(B+this+B).indexOf(B+A+B)>-1:this.indexOf(A)>-1;},escapeRegExp:function(){return this.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1");}});Array.extend({rgbToHex:function(D){if(this.length<3){return false;}if(this.length==4&&this[3]==0&&!D){return"transparent";}var B=[];for(var A=0;A<3;A++){var C=(this[A]-0).toString(16);B.push((C.length==1)?"0"+C:C);}return D?B:"#"+B.join("");},hexToRgb:function(C){if(this.length!=3){return false;}var A=[];for(var B=0;B<3;B++){A.push(parseInt((this[b].length==1)?this[b]+this[b]:this[b],16));}return C?A:"rgb("+A.join(",")+")";}});Function.extend({create:function(A){var B=this;A=$merge({bind:B,event:false,"arguments":null,delay:false,periodical:false,attempt:false},A);if($chk(A.arguments)&&$type(A.arguments)!="array"){A.arguments=[A.arguments];}return function(E){var C;if(A.event){E=E||window.event;C=[(A.event===true)?E:new A.event(E)];if(A.arguments){C.extend(A.arguments);}}else{C=A.arguments||arguments;}var F=function(){return B.apply($pick(A.bind,B),C);};if(A.delay){return setTimeout(F,A.delay);}if(A.periodical){return setInterval(F,A.periodical);}if(A.attempt){try{return F();}catch(D){return false;}}return F();};},pass:function(A,B){return this.create({"arguments":A,bind:B});},attempt:function(A,B){return this.create({"arguments":A,bind:B,attempt:true})();},bind:function(B,A){return this.create({bind:B,"arguments":A});},bindAsEventListener:function(B,A){return this.create({bind:B,event:true,"arguments":A});},delay:function(B,C,A){return this.create({delay:B,bind:C,"arguments":A})();},periodical:function(A,C,B){return this.create({periodical:A,bind:C,"arguments":B})();}});Number.extend({toInt:function(){return parseInt(this);},toFloat:function(){return parseFloat(this);},limit:function(B,A){return Math.min(A,Math.max(B,this));},round:function(A){A=Math.pow(10,A||0);return Math.round(this*A)/A;},times:function(B){for(var A=0;A<this;A++){B(A);}}});var Element=new Class({initialize:function(D,C){if($type(D)=="string"){if(window.ie&&C&&(C.name||C.type)){var A=(C.name)?' name="'+C.name+'"':"";var B=(C.type)?' type="'+C.type+'"':"";delete C.name;delete C.type;D="<"+D+A+B+">";}D=document.createElement(D);}D=$(D);return(!C||!D)?D:D.set(C);}});var Elements=new Class({initialize:function(A){return(A)?$extend(A,this):this;}});Elements.extend=function(A){for(var B in A){this.prototype[b]=A[b];this[b]=$native.generic(B);}};function $(B){if(!B){return null;}if(B.htmlElement){return Garbage.collect(B);}if([window,document].contains(B)){return B;}var A=$type(B);if(A=="string"){B=document.getElementById(B);A=(B)?"element":false;}if(A!="element"){return null;}if(B.htmlElement){return Garbage.collect(B);}if(["object","embed"].contains(B.tagName.toLowerCase())){return B;}$extend(B,Element.prototype);B.htmlElement=function(){};return Garbage.collect(B);}document.getElementsBySelector=document.getElementsByTagName;function $$(){var D=[];for(var C=0,B=arguments.length;C<B;C++){var A=arguments[C];switch($type(A)){case"element":D.push(A);case"boolean":break;case false:break;case"string":A=document.getElementsBySelector(A,true);default:D.extend(A);}}return $$.unique(D);}$$.unique=function(G){var D=[];for(var C=0,A=G.length;C<A;C++){if(G[C].$included){continue;}var B=$(G[C]);if(B&&!B.$included){B.$included=true;D.push(B);}}for(var F=0,E=D.length;F<E;F++){D[F].$included=null;}return new Elements(D);};Elements.Multi=function(A){return function(){var D=arguments;var B=[];var G=true;for(var E=0,C=this.length,F;E<C;E++){F=this[E][A].apply(this[E],D);if($type(F)!="element"){G=false;}B.push(F);}return(G)?$$.unique(B):B;};};Element.extend=function(A){for(var B in A){HTMLElement.prototype[b]=A[b];Element.prototype[b]=A[b];Element[b]=$native.generic(B);var C=(Array.prototype[b])?B+"Elements":B;Elements.prototype[C]=Elements.Multi(B);}};Element.extend({set:function(A){for(var C in A){var B=A[C];switch(C){case"styles":this.setStyles(B);break;case"events":if(this.addEvents){this.addEvents(B);}break;case"properties":this.setProperties(B);break;default:this.setProperty(C,B);}}return this;},inject:function(C,A){C=$(C);switch(A){case"before":C.parentNode.insertBefore(this,C);break;case"after":var B=C.getNext();if(!B){C.parentNode.appendChild(this);}else{C.parentNode.insertBefore(this,B);}break;case"top":var D=C.firstChild;if(D){C.insertBefore(this,D);break;}default:C.appendChild(this);}return this;},injectBefore:function(A){return this.inject(A,"before");},injectAfter:function(A){return this.inject(A,"after");},injectInside:function(A){return this.inject(A,"bottom");},injectTop:function(A){return this.inject(A,"top");},adopt:function(){var A=[];$each(arguments,function(B){A=A.concat(B);});$$(A).inject(this);return this;},remove:function(){return this.parentNode.removeChild(this);},clone:function(C){var B=$(this.cloneNode(C!==false));if(!B.$events){return B;}B.$events={};for(var A in this.$events){B.$events[A]={keys:$A(this.$events[A].keys),values:$A(this.$events[A].values)};}return B.removeEvents();},replaceWith:function(A){A=$(A);this.parentNode.replaceChild(A,this);return A;},appendText:function(A){this.appendChild(document.createTextNode(A));return this;},hasClass:function(A){return this.className.contains(A," ");},addClass:function(A){if(!this.hasClass(A)){this.className=(this.className+" "+A).clean();}return this;},removeClass:function(A){this.className=this.className.replace(new RegExp("(^|\\s)"+A+"(?:\\s|$)"),"$1").clean();return this;},toggleClass:function(A){return this.hasClass(A)?this.removeClass(A):this.addClass(A);},setStyle:function(B,A){switch(B){case"opacity":return this.setOpacity(parseFloat(A));case"float":B=(window.ie)?"styleFloat":"cssFloat";}B=B.camelCase();switch($type(A)){case"number":if(!["zIndex","zoom"].contains(B)){A+="px";}break;case"array":A="rgb("+A.join(",")+")";}this.style[b]=A;return this;},setStyles:function(A){switch($type(A)){case"object":Element.setMany(this,"setStyle",A);break;case"string":this.style.cssText=A;}return this;},setOpacity:function(A){if(A==0){if(this.style.visibility!="hidden"){this.style.visibility="hidden";}}else{if(this.style.visibility!="visible"){this.style.visibility="visible";}}if(!this.currentStyle||!this.currentStyle.hasLayout){this.style.zoom=1;}if(window.ie){this.style.filter=(A==1)?"":"alpha(opacity="+A*100+")";}this.style.opacity=this.$tmp.opacity=A;return this;},getStyle:function(C){C=C.camelCase();var A=this.style[C];if(!$chk(A)){if(C=="opacity"){return this.$tmp.opacity;}A=[];for(var B in Element.Styles){if(C==B){Element.Styles[b].each(function(F){var E=this.getStyle(F);A.push(parseInt(E)?E:"0px");},this);if(C=="border"){var D=A.every(function(E){return(E==A[0]);});return(D)?A[0]:false;}return A.join(" ");}}if(C.contains("border")){if(Element.Styles.border.contains(C)){return["Width","Style","Color"].map(function(E){return this.getStyle(C+E);},this).join(" ");}else{if(Element.borderShort.contains(C)){return["Top","Right","Bottom","Left"].map(function(E){return this.getStyle("border"+E+C.replace("border",""));},this).join(" ");}}}if(document.defaultView){A=document.defaultView.getComputedStyle(this,null).getPropertyValue(C.hyphenate());}else{if(this.currentStyle){A=this.currentStyle[C];}}}if(window.ie){A=Element.fixStyle(C,A,this);}if(A&&C.test(/color/i)&&A.contains("rgb")){return A.split("rgb").splice(1,4).map(function(E){return E.rgbToHex();}).join(" ");}return A;},getStyles:function(){return Element.getMany(this,"getStyle",arguments);},walk:function(A,C){A+="Sibling";var B=(C)?this[C]:this[A];while(B&&$type(B)!="element"){B=B[A];}return $(B);},getPrevious:function(){return this.walk("previous");},getNext:function(){return this.walk("next");},getFirst:function(){return this.walk("next","firstChild");},getLast:function(){return this.walk("previous","lastChild");},getParent:function(){return $(this.parentNode);},getChildren:function(){return $$(this.childNodes);},hasChild:function(A){return!!$A(this.getElementsByTagName("*")).contains(A);},getProperty:function(D){var B=Element.Properties[D];if(B){return this[b];}var A=Element.PropertiesIFlag[D]||0;if(!window.ie||A){return this.getAttribute(D,A);}var C=this.attributes[D];return(C)?C.nodeValue:null;},removeProperty:function(B){var A=Element.Properties[b];if(A){this[A]="";}else{this.removeAttribute(B);}return this;},getProperties:function(){return Element.getMany(this,"getProperty",arguments);},setProperty:function(C,B){var A=Element.Properties[C];if(A){this[A]=B;}else{this.setAttribute(C,B);}return this;},setProperties:function(A){return Element.setMany(this,"setProperty",A);},setHTML:function(){this.innerHTML=$A(arguments).join("");return this;},setText:function(B){var A=this.getTag();if(["style","script"].contains(A)){if(window.ie){if(A=="style"){this.styleSheet.cssText=B;}else{if(A=="script"){this.setProperty("text",B);}}return this;}else{this.removeChild(this.firstChild);return this.appendText(B);}}this[$defined(this.innerText)?"innerText":"textContent"]=B;return this;},getText:function(){var A=this.getTag();if(["style","script"].contains(A)){if(window.ie){if(A=="style"){return this.styleSheet.cssText;}else{if(A=="script"){return this.getProperty("text");}}}else{return this.innerHTML;}}return($pick(this.innerText,this.textContent));},getTag:function(){return this.tagName.toLowerCase();},empty:function(){Garbage.trash(this.getElementsByTagName("*"));return this.setHTML("");}});Element.fixStyle=function(E,A,D){if($chk(parseInt(A))){return A;}if(["height","width"].contains(E)){var B=(E=="width")?["left","right"]:["top","bottom"];var C=0;B.each(function(F){C+=D.getStyle("border-"+F+"-width").toInt()+D.getStyle("padding-"+F).toInt();});return D["offset"+E.capitalize()]-C+"px";}else{if(E.test(/border(.+)Width|margin|padding/)){return"0px";}}return A;};Element.Styles={border:[],padding:[],margin:[]};["Top","Right","Bottom","Left"].each(function(B){for(var A in Element.Styles){Element.Styles[A].push(A+B);}});Element.borderShort=["borderWidth","borderStyle","borderColor"];Element.getMany=function(B,D,C){var A={};$each(C,function(E){A[E]=B[D](E);});return A;};Element.setMany=function(B,D,C){for(var A in C){B[D](A,C[A]);}return B;};Element.Properties=new Abstract({"class":"className","for":"htmlFor",colspan:"colSpan",rowspan:"rowSpan",accesskey:"accessKey",tabindex:"tabIndex",maxlength:"maxLength",readonly:"readOnly",frameborder:"frameBorder",value:"value",disabled:"disabled",checked:"checked",multiple:"multiple",selected:"selected"});Element.PropertiesIFlag={href:2,src:2};Element.Methods={Listeners:{addListener:function(B,A){if(this.addEventListener){this.addEventListener(B,A,false);}else{this.attachEvent("on"+B,A);}return this;},removeListener:function(B,A){if(this.removeEventListener){this.removeEventListener(B,A,false);}else{this.detachEvent("on"+B,A);}return this;}}};window.extend(Element.Methods.Listeners);document.extend(Element.Methods.Listeners);Element.extend(Element.Methods.Listeners);var Garbage={elements:[],collect:function(A){if(!A.$tmp){Garbage.elements.push(A);A.$tmp={opacity:1};}return A;},trash:function(D){for(var B=0,A=D.length,C;B<A;B++){if(!(C=D[b])||!C.$tmp){continue;}if(C.$events){C.fireEvent("trash").removeEvents();}for(var E in C.$tmp){C.$tmp[E]=null;}for(var F in Element.prototype){C[F]=null;}Garbage.elements[Garbage.elements.indexOf(C)]=null;C.htmlElement=C.$tmp=C=null;}Garbage.elements.remove(null);},empty:function(){Garbage.collect(window);Garbage.collect(document);Garbage.trash(Garbage.elements);}};window.addListener("beforeunload",function(){window.addListener("unload",Garbage.empty);if(window.ie){window.addListener("unload",CollectGarbage);}});var Event=new Class({initialize:function(C){if(C&&C.$extended){return C;}this.$extended=true;C=C||window.event;this.event=C;this.type=C.type;this.target=C.target||C.srcElement;if(this.target.nodeType==3){this.target=this.target.parentNode;}this.shift=C.shiftKey;this.control=C.ctrlKey;this.alt=C.altKey;this.meta=C.metaKey;if(["DOMMouseScroll","mousewheel"].contains(this.type)){this.wheel=(C.wheelDelta)?C.wheelDelta/120:-(C.detail||0)/3;}else{if(this.type.contains("key")){this.code=C.which||C.keyCode;for(var B in Event.keys){if(Event.keys[b]==this.code){this.key=B;break;}}if(this.type=="keydown"){var A=this.code-111;if(A>0&&A<13){this.key="f"+A;}}this.key=this.key||String.fromCharCode(this.code).toLowerCase();}else{if(this.type.test(/(click|mouse|menu)/)){this.page={x:C.pageX||C.clientX+document.documentElement.scrollLeft,y:C.pageY||C.clientY+document.documentElement.scrollTop};this.client={x:C.pageX?C.pageX-window.pageXOffset:C.clientX,y:C.pageY?C.pageY-window.pageYOffset:C.clientY};this.rightClick=(C.which==3)||(C.button==2);switch(this.type){case"mouseover":this.relatedTarget=C.relatedTarget||C.fromElement;break;case"mouseout":this.relatedTarget=C.relatedTarget||C.toElement;}this.fixRelatedTarget();}}}return this;},stop:function(){return this.stopPropagation().preventDefault();},stopPropagation:function(){if(this.event.stopPropagation){this.event.stopPropagation();}else{this.event.cancelBubble=true;}return this;},preventDefault:function(){if(this.event.preventDefault){this.event.preventDefault();}else{this.event.returnValue=false;}return this;}});Event.fix={relatedTarget:function(){if(this.relatedTarget&&this.relatedTarget.nodeType==3){this.relatedTarget=this.relatedTarget.parentNode;}},relatedTargetGecko:function(){try{Event.fix.relatedTarget.call(this);}catch(A){this.relatedTarget=this.target;}}};Event.prototype.fixRelatedTarget=(window.gecko)?Event.fix.relatedTargetGecko:Event.fix.relatedTarget;Event.keys=new Abstract({enter:13,up:38,down:40,left:37,right:39,esc:27,space:32,backspace:8,tab:9,"delete":46});Element.Methods.Events={addEvent:function(C,B){this.$events=this.$events||{};this.$events[C]=this.$events[C]||{keys:[],values:[]};if(this.$events[C].keys.contains(B)){return this;}this.$events[C].keys.push(B);var A=C;var D=Element.Events[C];if(D){if(D.add){D.add.call(this,B);}if(D.map){B=D.map;}if(D.type){A=D.type;}}if(!this.addEventListener){B=B.create({bind:this,event:true});}this.$events[C].values.push(B);return(Element.NativeEvents.contains(A))?this.addListener(A,B):this;},removeEvent:function(C,B){if(!this.$events||!this.$events[C]){return this;}var F=this.$events[C].keys.indexOf(B);if(F==-1){return this;}var A=this.$events[C].keys.splice(F,1)[0];var E=this.$events[C].values.splice(F,1)[0];var D=Element.Events[C];if(D){if(D.remove){D.remove.call(this,B);}if(D.type){C=D.type;}}return(Element.NativeEvents.contains(C))?this.removeListener(C,E):this;},addEvents:function(A){return Element.setMany(this,"addEvent",A);},removeEvents:function(A){if(!this.$events){return this;}if(!A){for(var B in this.$events){this.removeEvents(B);}this.$events=null;}else{if(this.$events[A]){this.$events[A].keys.each(function(C){this.removeEvent(A,C);},this);this.$events[A]=null;}}return this;},fireEvent:function(C,B,A){if(this.$events&&this.$events[C]){this.$events[C].keys.each(function(D){D.create({bind:this,delay:A,"arguments":B})();},this);}return this;},cloneEvents:function(C,A){if(!C.$events){return this;}if(!A){for(var B in C.$events){this.cloneEvents(C,B);}}else{if(C.$events[A]){C.$events[A].keys.each(function(D){this.addEvent(A,D);},this);}}return this;}};window.extend(Element.Methods.Events);document.extend(Element.Methods.Events);Element.extend(Element.Methods.Events);Element.Events=new Abstract({mouseenter:{type:"mouseover",map:function(A){A=new Event(A);if(A.relatedTarget!=this&&!this.hasChild(A.relatedTarget)){this.fireEvent("mouseenter",A);}}},mouseleave:{type:"mouseout",map:function(A){A=new Event(A);if(A.relatedTarget!=this&&!this.hasChild(A.relatedTarget)){this.fireEvent("mouseleave",A);}}},mousewheel:{type:(window.gecko)?"DOMMouseScroll":"mousewheel"}});Element.NativeEvents=["click","dblclick","mouseup","mousedown","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","keydown","keypress","keyup","load","unload","beforeunload","resize","move","focus","blur","change","submit","reset","select","error","abort","contextmenu","scroll"];Function.extend({bindWithEvent:function(B,A){return this.create({bind:B,"arguments":A,event:Event});}});Elements.extend({filterByTag:function(A){return new Elements(this.filter(function(B){return(Element.getTag(B)==A);}));},filterByClass:function(A,C){var B=this.filter(function(D){return(D.className&&D.className.contains(A," "));});return(C)?B:new Elements(B);},filterById:function(C,B){var A=this.filter(function(D){return(D.id==C);});return(B)?A:new Elements(A);},filterByAttribute:function(B,A,D,E){var C=this.filter(function(F){var G=Element.getProperty(F,B);if(!G){return false;}if(!A){return true;}switch(A){case"=":return(G==D);case"*=":return(G.contains(D));case"^=":return(G.substr(0,D.length)==D);case"$=":return(G.substr(G.length-D.length)==D);case"!=":return(G!=D);case"~=":return G.contains(D," ");}return false;});return(E)?C:new Elements(C);}});function $E(A,B){return($(B)||document).getElement(A);}function $ES(A,B){return($(B)||document).getElementsBySelector(A);}$$.shared={regexp:/^(\w*|\*)(?:#([\w-]+)|\.([\w-]+))?(?:\[(\w+)(?:([!*^$]?=)["']?([^"'\]]*)["']?)?])?$/,xpath:{getParam:function(B,D,E,C){var A=[D.namespaceURI?"xhtml:":"",E[1]];if(E[2]){A.push('[@id="',E[2],'"]');}if(E[3]){A.push('[contains(concat(" ", @class, " "), " ',E[3],' ")]');}if(E[4]){if(E[5]&&E[6]){switch(E[5]){case"*=":A.push("[contains(@",E[4],', "',E[6],'")]');break;case"^=":A.push("[starts-with(@",E[4],', "',E[6],'")]');break;case"$=":A.push("[substring(@",E[4],", string-length(@",E[4],") - ",E[6].length,' + 1) = "',E[6],'"]');break;case"=":A.push("[@",E[4],'="',E[6],'"]');break;case"!=":A.push("[@",E[4],'!="',E[6],'"]');}}else{A.push("[@",E[4],"]");}}B.push(A.join(""));return B;},getItems:function(B,E,G){var F=[];var A=document.evaluate(".//"+B.join("//"),E,$$.shared.resolver,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);for(var D=0,C=A.snapshotLength;D<C;D++){F.push(A.snapshotItem(D));}return(G)?F:new Elements(F.map($));}},normal:{getParam:function(A,C,E,B){if(B==0){if(E[2]){var D=C.getElementById(E[2]);if(!D||((E[1]!="*")&&(Element.getTag(D)!=E[1]))){return false;}A=[D];}else{A=$A(C.getElementsByTagName(E[1]));}}else{A=$$.shared.getElementsByTagName(A,E[1]);if(E[2]){A=Elements.filterById(A,E[2],true);}}if(E[3]){A=Elements.filterByClass(A,E[3],true);}if(E[4]){A=Elements.filterByAttribute(A,E[4],E[5],E[6],true);}return A;},getItems:function(A,B,C){return(C)?A:$$.unique(A);}},resolver:function(A){return(A=="xhtml")?"http://www.w3.org/1999/xhtml":false;},getElementsByTagName:function(D,C){var E=[];for(var B=0,A=D.length;B<A;B++){E.extend(D[b].getElementsByTagName(C));}return E;}};$$.shared.method=(window.xpath)?"xpath":"normal";Element.Methods.Dom={getElements:function(A,H){var C=[];A=A.trim().split(" ");for(var E=0,D=A.length;E<D;E++){var F=A[E];var G=F.match($$.shared.regexp);if(!G){break;}G[1]=G[1]||"*";var B=$$.shared[$$.shared.method].getParam(C,this,G,E);if(!B){break;}C=B;}return $$.shared[$$.shared.method].getItems(C,this,H);},getElement:function(A){return $(this.getElements(A,true)[0]||false);},getElementsBySelector:function(A,E){var D=[];A=A.split(",");for(var C=0,B=A.length;C<B;C++){D=D.concat(this.getElements(A[C],true));}return(E)?D:$$.unique(D);}};Element.extend({getElementById:function(C){var B=document.getElementById(C);if(!B){return false;}for(var A=B.parentNode;A!=this;A=A.parentNode){if(!A){return false;}}return B;},getElementsByClassName:function(A){return this.getElements("."+A);}});document.extend(Element.Methods.Dom);Element.extend(Element.Methods.Dom);Element.extend({getValue:function(){switch(this.getTag()){case"select":var A=[];$each(this.options,function(B){if(B.selected){A.push($pick(B.value,B.text));}});return(this.multiple)?A:A[0];case"input":if(!(this.checked&&["checkbox","radio"].contains(this.type))&&!["hidden","text","password"].contains(this.type)){break;}case"textarea":return this.value;}return false;},getFormElements:function(){return $$(this.getElementsByTagName("input"),this.getElementsByTagName("select"),this.getElementsByTagName("textarea"));},toQueryString:function(){var A=[];this.getFormElements().each(function(D){var C=D.name;var E=D.getValue();if(E===false||!C||D.disabled){return;}var B=function(F){A.push(C+"="+encodeURIComponent(F));};if($type(E)=="array"){E.each(B);}else{B(E);}});return A.join("&");}});Element.extend({scrollTo:function(A,B){this.scrollLeft=A;this.scrollTop=B;},getSize:function(){return{scroll:{x:this.scrollLeft,y:this.scrollTop},size:{x:this.offsetWidth,y:this.offsetHeight},scrollSize:{x:this.scrollWidth,y:this.scrollHeight}};},getPosition:function(A){A=A||[];var B=this,D=0,C=0;do{D+=B.offsetLeft||0;C+=B.offsetTop||0;B=B.offsetParent;}while(B);A.each(function(E){D-=E.scrollLeft||0;C-=E.scrollTop||0;});return{x:D,y:C};},getTop:function(A){return this.getPosition(A).y;},getLeft:function(A){return this.getPosition(A).x;},getCoordinates:function(B){var A=this.getPosition(B);var C={width:this.offsetWidth,height:this.offsetHeight,left:A.x,top:A.y};C.right=C.left+C.width;C.bottom=C.top+C.height;return C;}});Element.Events.domready={add:function(B){if(window.loaded){B.call(this);return;}var A=function(){if(window.loaded){return;}window.loaded=true;window.timer=$clear(window.timer);this.fireEvent("domready");}.bind(this);if(document.readyState&&window.webkit){window.timer=function(){if(["loaded","complete"].contains(document.readyState)){A();}}.periodical(50);}else{if(document.readyState&&window.ie){if(!$("ie_ready")){var C=(window.location.protocol=="https:")?"://0":"javascript:void(0)";document.write('<script id="ie_ready" defer src="'+C+'"><\/script>');$("ie_ready").onreadystatechange=function(){if(this.readyState=="complete"){A();}};}}else{window.addListener("load",A);document.addListener("DOMContentLoaded",A);}}}};window.onDomReady=function(A){return this.addEvent("domready",A);};window.extend({getWidth:function(){if(this.webkit419){return this.innerWidth;}if(this.opera){return document.body.clientWidth;}return document.documentElement.clientWidth;},getHeight:function(){if(this.webkit419){return this.innerHeight;}if(this.opera){return document.body.clientHeight;}return document.documentElement.clientHeight;},getScrollWidth:function(){if(this.ie){return Math.max(document.documentElement.offsetWidth,document.documentElement.scrollWidth);}if(this.webkit){return document.body.scrollWidth;}return document.documentElement.scrollWidth;},getScrollHeight:function(){if(this.ie){return Math.max(document.documentElement.offsetHeight,document.documentElement.scrollHeight);}if(this.webkit){return document.body.scrollHeight;}return document.documentElement.scrollHeight;},getScrollLeft:function(){return this.pageXOffset||document.documentElement.scrollLeft;},getScrollTop:function(){return this.pageYOffset||document.documentElement.scrollTop;},getSize:function(){return{size:{x:this.getWidth(),y:this.getHeight()},scrollSize:{x:this.getScrollWidth(),y:this.getScrollHeight()},scroll:{x:this.getScrollLeft(),y:this.getScrollTop()}};},getPosition:function(){return{x:0,y:0};}});var Fx={};Fx.Base=new Class({options:{onStart:Class.empty,onComplete:Class.empty,onCancel:Class.empty,transition:function(A){return-(Math.cos(Math.PI*A)-1)/2;},duration:500,unit:"px",wait:true,fps:50},initialize:function(A){this.element=this.element||null;this.setOptions(A);if(this.options.initialize){this.options.initialize.call(this);}},step:function(){var A=$time();if(A<this.time+this.options.duration){this.delta=this.options.transition((A-this.time)/this.options.duration);this.setNow();this.increase();}else{this.stop(true);this.set(this.to);this.fireEvent("onComplete",this.element,10);this.callChain();}},set:function(A){this.now=A;this.increase();return this;},setNow:function(){this.now=this.compute(this.from,this.to);},compute:function(B,A){return(A-B)*this.delta+B;},start:function(B,A){if(!this.options.wait){this.stop();}else{if(this.timer){return this;}}this.from=B;this.to=A;this.change=this.to-this.from;this.time=$time();this.timer=this.step.periodical(Math.round(1000/this.options.fps),this);this.fireEvent("onStart",this.element);return this;},stop:function(A){if(!this.timer){return this;}this.timer=$clear(this.timer);if(!A){this.fireEvent("onCancel",this.element);}return this;},custom:function(B,A){return this.start(B,A);},clearTimer:function(A){return this.stop(A);}});Fx.Base.implement(new Chain,new Events,new Options);Fx.CSS={select:function(B,C){if(B.test(/color/i)){return this.Color;}var A=$type(C);if((A=="array")||(A=="string"&&C.contains(" "))){return this.Multi;}return this.Single;},parse:function(C,D,A){if(!A.push){A=[A];}var F=A[0],E=A[1];if(!$chk(E)){E=F;F=C.getStyle(D);}var B=this.select(D,E);return{from:B.parse(F),to:B.parse(E),css:B};}};Fx.CSS.Single={parse:function(A){return parseFloat(A);},getNow:function(C,B,A){return A.compute(C,B);},getValue:function(C,A,B){if(A=="px"&&B!="opacity"){C=Math.round(C);}return C+A;}};Fx.CSS.Multi={parse:function(A){return A.push?A:A.split(" ").map(function(B){return parseFloat(B);});},getNow:function(E,D,C){var A=[];for(var B=0;B<E.length;B++){A[b]=C.compute(E[b],D[b]);}return A;},getValue:function(C,A,B){if(A=="px"&&B!="opacity"){C=C.map(Math.round);}return C.join(A+" ")+A;}};Fx.CSS.Color={parse:function(A){return A.push?A:A.hexToRgb(true);},getNow:function(E,D,C){var A=[];for(var B=0;B<E.length;B++){A[b]=Math.round(C.compute(E[b],D[b]));}return A;},getValue:function(A){return"rgb("+A.join(",")+")";}};Fx.Style=Fx.Base.extend({initialize:function(B,C,A){this.element=$(B);this.property=C;this.parent(A);},hide:function(){return this.set(0);},setNow:function(){this.now=this.css.getNow(this.from,this.to,this);},set:function(A){this.css=Fx.CSS.select(this.property,A);return this.parent(this.css.parse(A));},start:function(C,B){if(this.timer&&this.options.wait){return this;}var A=Fx.CSS.parse(this.element,this.property,[C,B]);this.css=A.css;return this.parent(A.from,A.to);},increase:function(){this.element.setStyle(this.property,this.css.getValue(this.now,this.options.unit,this.property));}});Element.extend({effect:function(B,A){return new Fx.Style(this,B,A);}});Fx.Styles=Fx.Base.extend({initialize:function(B,A){this.element=$(B);this.parent(A);},setNow:function(){for(var A in this.from){this.now[A]=this.css[A].getNow(this.from[A],this.to[A],this);}},set:function(C){var A={};this.css={};for(var B in C){this.css[b]=Fx.CSS.select(B,C[b]);A[b]=this.css[b].parse(C[b]);}return this.parent(A);},start:function(C){if(this.timer&&this.options.wait){return this;}this.now={};this.css={};var E={},D={};for(var B in C){var A=Fx.CSS.parse(this.element,B,C[b]);E[b]=A.from;D[b]=A.to;this.css[b]=A.css;}return this.parent(E,D);},increase:function(){for(var A in this.now){this.element.setStyle(A,this.css[A].getValue(this.now[A],this.options.unit,A));}}});Element.extend({effects:function(A){return new Fx.Styles(this,A);}});Fx.Elements=Fx.Base.extend({initialize:function(B,A){this.elements=$$(B);this.parent(A);},setNow:function(){for(var C in this.from){var F=this.from[C],E=this.to[C],B=this.css[C],A=this.now[C]={};for(var D in F){A[D]=B[D].getNow(F[D],E[D],this);}}},set:function(G){var B={};this.css={};for(var D in G){var F=G[D],C=this.css[D]={},A=B[D]={};for(var E in F){C[E]=Fx.CSS.select(E,F[E]);A[E]=C[E].parse(F[E]);}}return this.parent(B);},start:function(D){if(this.timer&&this.options.wait){return this;}this.now={};this.css={};var I={},J={};for(var E in D){var G=D[E],A=I[E]={},H=J[E]={},C=this.css[E]={};for(var B in G){var F=Fx.CSS.parse(this.elements[E],B,G[b]);A[b]=F.from;H[b]=F.to;C[b]=F.css;}}return this.parent(I,J);},increase:function(){for(var C in this.now){var A=this.now[C],B=this.css[C];for(var D in A){this.elements[C].setStyle(D,B[D].getValue(A[D],this.options.unit,D));}}}});Fx.Scroll=Fx.Base.extend({options:{overflown:[],offset:{x:0,y:0},wheelStops:true},initialize:function(B,A){this.now=[];this.element=$(B);this.bound={stop:this.stop.bind(this,false)};this.parent(A);if(this.options.wheelStops){this.addEvent("onStart",function(){document.addEvent("mousewheel",this.bound.stop);}.bind(this));this.addEvent("onComplete",function(){document.removeEvent("mousewheel",this.bound.stop);}.bind(this));}},setNow:function(){for(var A=0;A<2;A++){this.now[A]=this.compute(this.from[A],this.to[A]);}},scrollTo:function(B,F){if(this.timer&&this.options.wait){return this;}var D=this.element.getSize();var C={x:B,y:F};for(var E in D.size){var A=D.scrollSize[E]-D.size[E];if($chk(C[E])){C[E]=($type(C[E])=="number")?C[E].limit(0,A):A;}else{C[E]=D.scroll[E];}C[E]+=this.options.offset[E];}return this.start([D.scroll.x,D.scroll.y],[C.x,C.y]);},toTop:function(){return this.scrollTo(false,0);},toBottom:function(){return this.scrollTo(false,"full");},toLeft:function(){return this.scrollTo(0,false);},toRight:function(){return this.scrollTo("full",false);},toElement:function(B){var A=this.element.getPosition(this.options.overflown);var C=$(B).getPosition(this.options.overflown);return this.scrollTo(C.x-A.x,C.y-A.y);},increase:function(){this.element.scrollTo(this.now[0],this.now[1]);}});Fx.Slide=Fx.Base.extend({options:{mode:"vertical"},initialize:function(B,A){this.element=$(B);this.wrapper=new Element("div",{styles:$extend(this.element.getStyles("margin"),{overflow:"hidden"})}).injectAfter(this.element).adopt(this.element);this.element.setStyle("margin",0);this.setOptions(A);this.now=[];this.parent(this.options);this.open=true;this.addEvent("onComplete",function(){this.open=(this.now[0]===0);});if(window.webkit419){this.addEvent("onComplete",function(){if(this.open){this.element.remove().inject(this.wrapper);}});}},setNow:function(){for(var A=0;A<2;A++){this.now[A]=this.compute(this.from[A],this.to[A]);}},vertical:function(){this.margin="margin-top";this.layout="height";this.offset=this.element.offsetHeight;},horizontal:function(){this.margin="margin-left";this.layout="width";this.offset=this.element.offsetWidth;},slideIn:function(A){this[A||this.options.mode]();return this.start([this.element.getStyle(this.margin).toInt(),this.wrapper.getStyle(this.layout).toInt()],[0,this.offset]);},slideOut:function(A){this[A||this.options.mode]();return this.start([this.element.getStyle(this.margin).toInt(),this.wrapper.getStyle(this.layout).toInt()],[-this.offset,0]);},hide:function(A){this[A||this.options.mode]();this.open=false;return this.set([-this.offset,0]);},show:function(A){this[A||this.options.mode]();this.open=true;return this.set([0,this.offset]);},toggle:function(A){if(this.wrapper.offsetHeight==0||this.wrapper.offsetWidth==0){return this.slideIn(A);}return this.slideOut(A);},increase:function(){this.element.setStyle(this.margin,this.now[0]+this.options.unit);this.wrapper.setStyle(this.layout,this.now[1]+this.options.unit);}});Fx.Transition=function(B,A){A=A||[];if($type(A)!="array"){A=[A];}return $extend(B,{easeIn:function(C){return B(C,A);},easeOut:function(C){return 1-B(1-C,A);},easeInOut:function(C){return(C<=0.5)?B(2*C,A)/2:(2-B(2*(1-C),A))/2;}});};Fx.Transitions=new Abstract({linear:function(A){return A;}});Fx.Transitions.extend=function(A){for(var B in A){Fx.Transitions[b]=new Fx.Transition(A[b]);Fx.Transitions.compat(B);}};Fx.Transitions.compat=function(A){["In","Out","InOut"].each(function(B){Fx.Transitions[A.toLowerCase()+B]=Fx.Transitions[A]["ease"+B];});};Fx.Transitions.extend({Pow:function(B,A){return Math.pow(B,A[0]||6);},Expo:function(A){return Math.pow(2,8*(A-1));},Circ:function(A){return 1-Math.sin(Math.acos(A));},Sine:function(A){return 1-Math.sin((1-A)*Math.PI/2);},Back:function(B,A){A=A[0]||1.618;return Math.pow(B,2)*((A+1)*B-A);},Bounce:function(D){var C;for(var B=0,A=1;1;B+=A,A/=2){if(D>=(7-4*B)/11){C=-Math.pow((11-6*B-11*D)/4,2)+A*A;break;}}return C;},Elastic:function(B,A){return Math.pow(2,10*--B)*Math.cos(20*B*Math.PI*(A[0]||1)/3);}});["Quad","Cubic","Quart","Quint"].each(function(B,A){Fx.Transitions[b]=new Fx.Transition(function(C){return Math.pow(C,[A+2]);});Fx.Transitions.compat(B);});var Drag={};Drag.Base=new Class({options:{handle:false,unit:"px",onStart:Class.empty,onBeforeStart:Class.empty,onComplete:Class.empty,onSnap:Class.empty,onDrag:Class.empty,limit:false,modifiers:{x:"left",y:"top"},grid:false,snap:6},initialize:function(B,A){this.setOptions(A);this.element=$(B);this.handle=$(this.options.handle)||this.element;this.mouse={now:{},pos:{}};this.value={start:{},now:{}};this.bound={start:this.start.bindWithEvent(this),check:this.check.bindWithEvent(this),drag:this.drag.bindWithEvent(this),stop:this.stop.bind(this)};this.attach();if(this.options.initialize){this.options.initialize.call(this);}},attach:function(){this.handle.addEvent("mousedown",this.bound.start);return this;},detach:function(){this.handle.removeEvent("mousedown",this.bound.start);return this;},start:function(C){this.fireEvent("onBeforeStart",this.element);this.mouse.start=C.page;var A=this.options.limit;this.limit={x:[],y:[]};for(var D in this.options.modifiers){if(!this.options.modifiers[D]){continue;}this.value.now[D]=this.element.getStyle(this.options.modifiers[D]).toInt();this.mouse.pos[D]=C.page[D]-this.value.now[D];if(A&&A[D]){for(var B=0;B<2;B++){if($chk(A[D][b])){this.limit[D][b]=($type(A[D][b])=="function")?A[D][b]():A[D][b];}}}}if($type(this.options.grid)=="number"){this.options.grid={x:this.options.grid,y:this.options.grid};}document.addListener("mousemove",this.bound.check);document.addListener("mouseup",this.bound.stop);this.fireEvent("onStart",this.element);C.stop();},check:function(A){var B=Math.round(Math.sqrt(Math.pow(A.page.x-this.mouse.start.x,2)+Math.pow(A.page.y-this.mouse.start.y,2)));if(B>this.options.snap){document.removeListener("mousemove",this.bound.check);document.addListener("mousemove",this.bound.drag);this.drag(A);this.fireEvent("onSnap",this.element);}A.stop();},drag:function(A){this.out=false;this.mouse.now=A.page;for(var B in this.options.modifiers){if(!this.options.modifiers[b]){continue;}this.value.now[b]=this.mouse.now[b]-this.mouse.pos[b];if(this.limit[b]){if($chk(this.limit[b][1])&&(this.value.now[b]>this.limit[b][1])){this.value.now[b]=this.limit[b][1];this.out=true;}else{if($chk(this.limit[b][0])&&(this.value.now[b]<this.limit[b][0])){this.value.now[b]=this.limit[b][0];this.out=true;}}}if(this.options.grid[b]){this.value.now[b]-=(this.value.now[b]%this.options.grid[b]);}this.element.setStyle(this.options.modifiers[b],this.value.now[b]+this.options.unit);}this.fireEvent("onDrag",this.element);A.stop();},stop:function(){document.removeListener("mousemove",this.bound.check);document.removeListener("mousemove",this.bound.drag);document.removeListener("mouseup",this.bound.stop);this.fireEvent("onComplete",this.element);}});Drag.Base.implement(new Events,new Options);Element.extend({makeResizable:function(A){return new Drag.Base(this,$merge({modifiers:{x:"width",y:"height"}},A));}});var XHR=new Class({options:{method:"post",async:true,onRequest:Class.empty,onSuccess:Class.empty,onFailure:Class.empty,urlEncoded:true,encoding:"utf-8",autoCancel:false,headers:{}},setTransport:function(){this.transport=(window.XMLHttpRequest)?new XMLHttpRequest():(window.ie?new ActiveXObject("Microsoft.XMLHTTP"):false);return this;},initialize:function(A){this.setTransport().setOptions(A);this.options.isSuccess=this.options.isSuccess||this.isSuccess;this.headers={};if(this.options.urlEncoded&&this.options.method=="post"){var B=(this.options.encoding)?"; charset="+this.options.encoding:"";this.setHeader("Content-type","application/x-www-form-urlencoded"+B);}if(this.options.initialize){this.options.initialize.call(this);}},onStateChange:function(){if(this.transport.readyState!=4||!this.running){return;}this.running=false;var A=0;try{A=this.transport.status;}catch(B){}if(this.options.isSuccess.call(this,A)){this.onSuccess();}else{this.onFailure();}this.transport.onreadystatechange=Class.empty;},isSuccess:function(A){return((A>=200)&&(A<300));},onSuccess:function(){this.response={text:this.transport.responseText,xml:this.transport.responseXML};this.fireEvent("onSuccess",[this.response.text,this.response.xml]);this.callChain();},onFailure:function(){this.fireEvent("onFailure",this.transport);},setHeader:function(A,B){this.headers[A]=B;return this;},send:function(A,C){if(this.options.autoCancel){this.cancel();}else{if(this.running){return this;}}this.running=true;if(C&&this.options.method=="get"){A=A+(A.contains("?")?"&":"?")+C;C=null;}this.transport.open(this.options.method.toUpperCase(),A,this.options.async);this.transport.onreadystatechange=this.onStateChange.bind(this);if((this.options.method=="post")&&this.transport.overrideMimeType){this.setHeader("Connection","close");}$extend(this.headers,this.options.headers);for(var B in this.headers){try{this.transport.setRequestHeader(B,this.headers[b]);}catch(D){}}this.fireEvent("onRequest");this.transport.send($pick(C,null));return this;},cancel:function(){if(!this.running){return this;}this.running=false;this.transport.abort();this.transport.onreadystatechange=Class.empty;this.setTransport();this.fireEvent("onCancel");return this;}});XHR.implement(new Chain,new Events,new Options);var Ajax=XHR.extend({options:{data:null,update:null,onComplete:Class.empty,evalScripts:false,evalResponse:false},initialize:function(B,A){this.addEvent("onSuccess",this.onComplete);this.setOptions(A);this.options.data=this.options.data||this.options.postBody;if(!["post","get"].contains(this.options.method)){this._method="_method="+this.options.method;this.options.method="post";}this.parent();this.setHeader("X-Requested-With","XMLHttpRequest");this.setHeader("Accept","text/javascript, text/html, application/xml, text/xml, */*");this.url=B;},onComplete:function(){if(this.options.update){$(this.options.update).empty().setHTML(this.response.text);}if(this.options.evalScripts||this.options.evalResponse){this.evalScripts();}this.fireEvent("onComplete",[this.response.text,this.response.xml],20);},request:function(A){A=A||this.options.data;switch($type(A)){case"element":A=$(A).toQueryString();break;case"object":A=Object.toQueryString(A);}if(this._method){A=(A)?[this._method,A].join("&"):this._method;}return this.send(this.url,A);},evalScripts:function(){var B,A;if(this.options.evalResponse||(/(ecma|java)script/).test(this.getHeader("Content-type"))){A=this.response.text;}else{A=[];var C=/<script[^>]*>([\s\S]*?)<\/script>/gi;while((B=C.exec(this.response.text))){A.push(B[1]);}A=A.join("\n");}if(A){(window.execScript)?window.execScript(A):window.setTimeout(A,0);}},getHeader:function(A){try{return this.transport.getResponseHeader(A);}catch(B){}return null;}});Object.toQueryString=function(B){var C=[];for(var A in B){C.push(encodeURIComponent(A)+"="+encodeURIComponent(B[A]));}return C.join("&");};Element.extend({send:function(A){return new Ajax(this.getProperty("action"),$merge({data:this.toQueryString()},A,{method:"post"})).request();}});var Cookie=new Abstract({options:{domain:false,path:false,duration:false,secure:false},set:function(C,D,B){B=$merge(this.options,B);D=encodeURIComponent(D);if(B.domain){D+="; domain="+B.domain;}if(B.path){D+="; path="+B.path;}if(B.duration){var A=new Date();A.setTime(A.getTime()+B.duration*24*60*60*1000);D+="; expires="+A.toGMTString();}if(B.secure){D+="; secure";}document.cookie=C+"="+D;return $extend(B,{key:C,value:D});},get:function(A){var B=document.cookie.match("(?:^|;)\\s*"+A.escapeRegExp()+"=([^;]*)");return B?decodeURIComponent(B[1]):false;},remove:function(B,A){if($type(B)=="object"){this.set(B.key,"",$merge(B,{duration:-1}));}else{this.set(B,"",$merge(A,{duration:-1}));}}});var Json={toString:function(C){switch($type(C)){case"string":return'"'+C.replace(/(["\\])/g,"\\$1")+'"';case"array":return"["+C.map(Json.toString).join(",")+"]";case"object":var A=[];for(var B in C){A.push(Json.toString(B)+":"+Json.toString(C[b]));}return"{"+A.join(",")+"}";case"number":if(isFinite(C)){break;}case false:return"null";}return String(C);},evaluate:function(str,secure){return(($type(str)!="string")||(secure&&!str.test(/^("(\\.|[^"\\\n\r])*?"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/)))?null:eval("("+str+")");}};Json.Remote=XHR.extend({initialize:function(B,A){this.url=B;this.addEvent("onSuccess",this.onComplete);this.parent(A);this.setHeader("X-Request","JSON");},send:function(A){return this.parent(this.url,"json="+Json.toString(A));},onComplete:function(){this.fireEvent("onComplete",[Json.evaluate(this.response.text,this.options.secure)]);}});var Asset=new Abstract({javascript:function(C,B){B=$merge({onload:Class.empty},B);var A=new Element("script",{src:C}).addEvents({load:B.onload,readystatechange:function(){if(this.readyState=="complete"){this.fireEvent("load");}}});delete B.onload;return A.setProperties(B).inject(document.head);},css:function(B,A){return new Element("link",$merge({rel:"stylesheet",media:"screen",type:"text/css",href:B},A)).inject(document.head);},image:function(C,B){B=$merge({onload:Class.empty,onabort:Class.empty,onerror:Class.empty},B);var D=new Image();D.src=C;var A=new Element("img",{src:C});["load","abort","error"].each(function(E){var F=B["on"+E];delete B["on"+E];A.addEvent(E,function(){this.removeEvent(E,arguments.callee);F.call(this);});});if(D.width&&D.height){A.fireEvent("load",A,1);}return A.setProperties(B);},images:function(D,C){C=$merge({onComplete:Class.empty,onProgress:Class.empty},C);if(!D.push){D=[D];}var A=[];var B=0;D.each(function(F){var E=new Asset.image(F,{onload:function(){C.onProgress.call(this,B);B++;if(B==D.length){C.onComplete();}}});A.push(E);});return new Elements(A);}});var Hash=new Class({length:0,initialize:function(A){this.obj=A||{};this.setLength();},get:function(A){return(this.hasKey(A))?this.obj[A]:null;},hasKey:function(A){return(A in this.obj);},set:function(A,B){if(!this.hasKey(A)){this.length++;}this.obj[A]=B;return this;},setLength:function(){this.length=0;for(var A in this.obj){this.length++;}return this;},remove:function(A){if(this.hasKey(A)){delete this.obj[A];this.length--;}return this;},each:function(A,B){$each(this.obj,A,B);},extend:function(A){$extend(this.obj,A);return this.setLength();},merge:function(){this.obj=$merge.apply(null,[this.obj].extend(arguments));return this.setLength();},empty:function(){this.obj={};this.length=0;return this;},keys:function(){var A=[];for(var B in this.obj){A.push(B);}return A;},values:function(){var A=[];for(var B in this.obj){A.push(this.obj[b]);}return A;}});function $H(A){return new Hash(A);}Hash.Cookie=Hash.extend({initialize:function(B,A){this.name=B;this.options=$extend({autoSave:true},A||{});this.load();},save:function(){if(this.length==0){Cookie.remove(this.name,this.options);return true;}var A=Json.toString(this.obj);if(A.length>4096){return false;}Cookie.set(this.name,A,this.options);return true;},load:function(){this.obj=Json.evaluate(Cookie.get(this.name),true)||{};this.setLength();}});Hash.Cookie.Methods={};["extend","set","merge","empty","remove"].each(function(A){Hash.Cookie.Methods[A]=function(){Hash.prototype[A].apply(this,arguments);if(this.options.autoSave){this.save();}return this;};});Hash.Cookie.implement(Hash.Cookie.Methods);var Color=new Class({initialize:function(B,D){D=D||(B.push?"rgb":"hex");var C,A;switch(D){case"rgb":C=B;A=C.rgbToHsb();break;case"hsb":C=B.hsbToRgb();A=B;break;default:C=B.hexToRgb(true);A=C.rgbToHsb();}C.hsb=A;C.hex=C.rgbToHex();return $extend(C,Color.prototype);},mix:function(){var A=$A(arguments);var C=($type(A[A.length-1])=="number")?A.pop():50;var B=this.copy();A.each(function(D){D=new Color(D);for(var E=0;E<3;E++){B[E]=Math.round((B[E]/100*(100-C))+(D[E]/100*C));}});return new Color(B,"rgb");},invert:function(){return new Color(this.map(function(A){return 255-A;}));},setHue:function(A){return new Color([A,this.hsb[1],this.hsb[2]],"hsb");},setSaturation:function(A){return new Color([this.hsb[0],A,this.hsb[2]],"hsb");},setBrightness:function(A){return new Color([this.hsb[0],this.hsb[1],A],"hsb");}});function $RGB(C,B,A){return new Color([C,B,A],"rgb");}function $HSB(C,B,A){return new Color([C,B,A],"hsb");}Array.extend({rgbToHsb:function(){var B=this[0],C=this[1],J=this[2];var G,F,H;var I=Math.max(B,C,J),E=Math.min(B,C,J);var K=I-E;H=I/255;F=(I!=0)?K/I:0;if(F==0){G=0;}else{var D=(I-B)/K;var A=(I-C)/K;var L=(I-J)/K;if(B==I){G=L-A;}else{if(C==I){G=2+D-L;}else{G=4+A-D;}}G/=6;if(G<0){G++;}}return[Math.round(G*360),Math.round(F*100),Math.round(H*100)];},hsbToRgb:function(){var C=Math.round(this[2]/100*255);if(this[1]==0){return[C,C,C];}else{var A=this[0]%360;var E=A%60;var F=Math.round((this[2]*(100-this[1]))/10000*255);var D=Math.round((this[2]*(6000-this[1]*E))/600000*255);var B=Math.round((this[2]*(6000-this[1]*(60-E)))/600000*255);switch(Math.floor(A/60)){case 0:return[C,B,F];case 1:return[D,C,F];case 2:return[F,C,B];case 3:return[F,D,C];case 4:return[B,F,C];case 5:return[C,F,D];}}return false;}});var Scroller=new Class({options:{area:20,velocity:1,onChange:function(A,B){this.element.scrollTo(A,B);}},initialize:function(B,A){this.setOptions(A);this.element=$(B);this.mousemover=([window,document].contains(B))?$(document.body):this.element;},start:function(){this.coord=this.getCoords.bindWithEvent(this);this.mousemover.addListener("mousemove",this.coord);},stop:function(){this.mousemover.removeListener("mousemove",this.coord);this.timer=$clear(this.timer);},getCoords:function(A){this.page=(this.element==window)?A.client:A.page;if(!this.timer){this.timer=this.scroll.periodical(50,this);}},scroll:function(){var A=this.element.getSize();var D=this.element.getPosition();var C={x:0,y:0};for(var B in this.page){if(this.page[b]<(this.options.area+D[b])&&A.scroll[b]!=0){C[b]=(this.page[b]-this.options.area-D[b])*this.options.velocity;}else{if(this.page[b]+this.options.area>(A.size[b]+D[b])&&A.scroll[b]+A.size[b]!=A.scrollSize[b]){C[b]=(this.page[b]-A.size[b]+this.options.area-D[b])*this.options.velocity;}}}if(C.y||C.x){this.fireEvent("onChange",[A.scroll.x+C.x,A.scroll.y+C.y]);}}});Scroller.implement(new Events,new Options);var Slider=new Class({options:{onChange:Class.empty,onComplete:Class.empty,onTick:function(A){this.knob.setStyle(this.p,A);},mode:"horizontal",steps:100,offset:0},initialize:function(D,A,B){this.element=$(D);this.knob=$(A);this.setOptions(B);this.previousChange=-1;this.previousEnd=-1;this.step=-1;this.element.addEvent("mousedown",this.clickedElement.bindWithEvent(this));var C,F;switch(this.options.mode){case"horizontal":this.z="x";this.p="left";C={x:"left",y:false};F="offsetWidth";break;case"vertical":this.z="y";this.p="top";C={x:false,y:"top"};F="offsetHeight";}this.max=this.element[F]-this.knob[F]+(this.options.offset*2);this.half=this.knob[F]/2;this.getPos=this.element["get"+this.p.capitalize()].bind(this.element);this.knob.setStyle("position","relative").setStyle(this.p,-this.options.offset);var E={};E[this.z]=[-this.options.offset,this.max-this.options.offset];this.drag=new Drag.Base(this.knob,{limit:E,modifiers:C,snap:0,onStart:function(){this.draggedKnob();}.bind(this),onDrag:function(){this.draggedKnob();}.bind(this),onComplete:function(){this.draggedKnob();this.end();}.bind(this)});if(this.options.initialize){this.options.initialize.call(this);}},set:function(A){this.step=A.limit(0,this.options.steps);this.checkStep();this.end();this.fireEvent("onTick",this.toPosition(this.step));return this;},clickedElement:function(B){var A=B.page[this.z]-this.getPos()-this.half;A=A.limit(-this.options.offset,this.max-this.options.offset);this.step=this.toStep(A);this.checkStep();this.end();this.fireEvent("onTick",A);},draggedKnob:function(){this.step=this.toStep(this.drag.value.now[this.z]);this.checkStep();},checkStep:function(){if(this.previousChange!=this.step){this.previousChange=this.step;this.fireEvent("onChange",this.step);}},end:function(){if(this.previousEnd!==this.step){this.previousEnd=this.step;this.fireEvent("onComplete",this.step+"");}},toStep:function(A){return Math.round((A+this.options.offset)/this.max*this.options.steps);},toPosition:function(A){return this.max*A/this.options.steps;}});Slider.implement(new Events);Slider.implement(new Options);var SmoothScroll=Fx.Scroll.extend({initialize:function(B){this.parent(window,B);this.links=(this.options.links)?$$(this.options.links):$$(document.links);var A=window.location.href.match(/^[^#]*/)[0]+"#";this.links.each(function(D){if(D.href.indexOf(A)!=0){return;}var C=D.href.substr(A.length);if(C&&$(C)){this.useLink(D,C);}},this);if(!window.webkit419){this.addEvent("onComplete",function(){window.location.hash=this.anchor;});}},useLink:function(B,A){B.addEvent("click",function(C){this.anchor=A;this.toElement(A);C.stop();}.bindWithEvent(this));}});var Sortables=new Class({options:{handles:false,onStart:Class.empty,onComplete:Class.empty,ghost:true,snap:3,onDragStart:function(A,B){B.setStyle("opacity",0.7);A.setStyle("opacity",0.7);},onDragComplete:function(A,B){A.setStyle("opacity",1);B.remove();this.trash.remove();}},initialize:function(D,B){this.setOptions(B);this.list=$(D);this.elements=this.list.getChildren();this.handles=(this.options.handles)?$$(this.options.handles):this.elements;this.bound={start:[],moveGhost:this.moveGhost.bindWithEvent(this)};for(var C=0,A=this.handles.length;C<A;C++){this.bound.start[C]=this.start.bindWithEvent(this,this.elements[C]);}this.attach();if(this.options.initialize){this.options.initialize.call(this);}this.bound.move=this.move.bindWithEvent(this);this.bound.end=this.end.bind(this);},attach:function(){this.handles.each(function(B,A){B.addEvent("mousedown",this.bound.start[A]);},this);},detach:function(){this.handles.each(function(B,A){B.removeEvent("mousedown",this.bound.start[A]);},this);},start:function(C,B){this.active=B;this.coordinates=this.list.getCoordinates();if(this.options.ghost){var A=B.getPosition();this.offset=C.page.y-A.y;this.trash=new Element("div").inject(document.body);this.ghost=B.clone().inject(this.trash).setStyles({position:"absolute",left:A.x,top:C.page.y-this.offset});document.addListener("mousemove",this.bound.moveGhost);this.fireEvent("onDragStart",[B,this.ghost]);}document.addListener("mousemove",this.bound.move);document.addListener("mouseup",this.bound.end);this.fireEvent("onStart",B);C.stop();},moveGhost:function(A){var B=A.page.y-this.offset;B=B.limit(this.coordinates.top,this.coordinates.bottom-this.ghost.offsetHeight);this.ghost.setStyle("top",B);A.stop();},move:function(E){var B=E.page.y;this.previous=this.previous||B;var A=((this.previous-B)>0);var D=this.active.getPrevious();var C=this.active.getNext();if(D&&A&&B<D.getCoordinates().bottom){this.active.injectBefore(D);}if(C&&!A&&B>C.getCoordinates().top){this.active.injectAfter(C);}this.previous=B;},serialize:function(A){return this.list.getChildren().map(A||function(B){return this.elements.indexOf(B);},this);},end:function(){this.previous=null;document.removeListener("mousemove",this.bound.move);document.removeListener("mouseup",this.bound.end);if(this.options.ghost){document.removeListener("mousemove",this.bound.moveGhost);this.fireEvent("onDragComplete",[this.active,this.ghost]);}this.fireEvent("onComplete",this.active);}});Sortables.implement(new Events,new Options);var Tips=new Class({options:{onShow:function(A){A.setStyle("visibility","visible");},onHide:function(A){A.setStyle("visibility","hidden");},maxTitleChars:30,showDelay:100,hideDelay:100,className:"tool",offsets:{x:16,y:16},fixed:false},initialize:function(B,A){this.setOptions(A);this.toolTip=new Element("div",{"class":this.options.className+"-tip",styles:{position:"absolute",top:"0",left:"0",visibility:"hidden"}}).inject(document.body);this.wrapper=new Element("div").inject(this.toolTip);$$(B).each(this.build,this);if(this.options.initialize){this.options.initialize.call(this);}},build:function(B){B.$tmp.myTitle=(B.href&&B.getTag()=="a")?B.href.replace("http://",""):(B.rel||false);if(B.title){var C=B.title.split("::");if(C.length>1){B.$tmp.myTitle=C[0].trim();B.$tmp.myText=C[1].trim();}else{B.$tmp.myText=B.title;}B.removeAttribute("title");}else{B.$tmp.myText=false;}if(B.$tmp.myTitle&&B.$tmp.myTitle.length>this.options.maxTitleChars){B.$tmp.myTitle=B.$tmp.myTitle.substr(0,this.options.maxTitleChars-1)+"&hellip;";}B.addEvent("mouseenter",function(D){this.start(B);if(!this.options.fixed){this.locate(D);}else{this.position(B);}}.bind(this));if(!this.options.fixed){B.addEvent("mousemove",this.locate.bindWithEvent(this));}var A=this.end.bind(this);B.addEvent("mouseleave",A);B.addEvent("trash",A);},start:function(A){this.wrapper.empty();if(A.$tmp.myTitle){this.title=new Element("span").inject(new Element("div",{"class":this.options.className+"-title"}).inject(this.wrapper)).setHTML(A.$tmp.myTitle);}if(A.$tmp.myText){this.text=new Element("span").inject(new Element("div",{"class":this.options.className+"-text"}).inject(this.wrapper)).setHTML(A.$tmp.myText);}$clear(this.timer);this.timer=this.show.delay(this.options.showDelay,this);},end:function(A){$clear(this.timer);this.timer=this.hide.delay(this.options.hideDelay,this);},position:function(A){var B=A.getPosition();this.toolTip.setStyles({left:B.x+this.options.offsets.x,top:B.y+this.options.offsets.y});},locate:function(B){var D={x:window.getWidth(),y:window.getHeight()};var A={x:window.getScrollLeft(),y:window.getScrollTop()};var C={x:this.toolTip.offsetWidth,y:this.toolTip.offsetHeight};var G={x:"left",y:"top"};for(var E in G){var F=B.page[E]+this.options.offsets[E];if((F+C[E]-A[E])>D[E]){F=B.page[E]-this.options.offsets[E]-C[E];}this.toolTip.setStyle(G[E],F);}},show:function(){if(this.options.timeout){this.timer=this.hide.delay(this.options.timeout,this);}this.fireEvent("onShow",[this.toolTip]);},hide:function(){this.fireEvent("onHide",[this.toolTip]);}});Tips.implement(new Events,new Options);var Group=new Class({initialize:function(){this.instances=$A(arguments);this.events={};this.checker={};},addEvent:function(B,A){this.checker[b]=this.checker[b]||{};this.events[b]=this.events[b]||[];if(this.events[b].contains(A)){return false;}else{this.events[b].push(A);}this.instances.each(function(C,D){C.addEvent(B,this.check.bind(this,[B,C,D]));},this);return this;},check:function(C,A,B){this.checker[C][b]=true;var D=this.instances.every(function(F,E){return this.checker[C][E]||false;},this);if(!D){return;}this.checker[C]={};this.events[C].each(function(E){E.call(this,this.instances,A);},this);}});var Accordion=Fx.Elements.extend({options:{onActive:Class.empty,onBackground:Class.empty,display:0,show:false,height:true,width:false,opacity:true,fixedHeight:false,fixedWidth:false,wait:false,alwaysHide:false},initialize:function(){var C,E,F,B;$each(arguments,function(I,H){switch($type(I)){case"object":C=I;break;case"element":B=$(I);break;default:var G=$$(I);if(!E){E=G;}else{F=G;}}});this.togglers=E||[];this.elements=F||[];this.container=$(B);this.setOptions(C);this.previous=-1;if(this.options.alwaysHide){this.options.wait=true;}if($chk(this.options.show)){this.options.display=false;this.previous=this.options.show;}if(this.options.start){this.options.display=false;this.options.show=false;}this.effects={};if(this.options.opacity){this.effects.opacity="fullOpacity";}if(this.options.width){this.effects.width=this.options.fixedWidth?"fullWidth":"offsetWidth";}if(this.options.height){this.effects.height=this.options.fixedHeight?"fullHeight":"scrollHeight";}for(var D=0,A=this.togglers.length;D<A;D++){this.addSection(this.togglers[D],this.elements[D]);}this.elements.each(function(H,G){if(this.options.show===G){this.fireEvent("onActive",[this.togglers[G],H]);}else{for(var I in this.effects){H.setStyle(I,0);}}},this);this.parent(this.elements);if($chk(this.options.display)){this.display(this.options.display);}},addSection:function(E,C,G){E=$(E);C=$(C);var F=this.togglers.contains(E);var B=this.togglers.length;this.togglers.include(E);this.elements.include(C);if(B&&(!F||G)){G=$pick(G,B-1);E.injectBefore(this.togglers[G]);C.injectAfter(E);}else{if(this.container&&!F){E.inject(this.container);C.inject(this.container);}}var A=this.togglers.indexOf(E);E.addEvent("click",this.display.bind(this,A));if(this.options.height){C.setStyles({"padding-top":0,"border-top":"none","padding-bottom":0,"border-bottom":"none"});}if(this.options.width){C.setStyles({"padding-left":0,"border-left":"none","padding-right":0,"border-right":"none"});}C.fullOpacity=1;if(this.options.fixedWidth){C.fullWidth=this.options.fixedWidth;}if(this.options.fixedHeight){C.fullHeight=this.options.fixedHeight;}C.setStyle("overflow","hidden");if(!F){for(var D in this.effects){C.setStyle(D,0);}}return this;},display:function(A){A=($type(A)=="element")?this.elements.indexOf(A):A;if((this.timer&&this.options.wait)||(A===this.previous&&!this.options.alwaysHide)){return this;}this.previous=A;var B={};this.elements.each(function(E,D){B[D]={};var C=(D!=A)||(this.options.alwaysHide&&(E.offsetHeight>0));this.fireEvent(C?"onBackground":"onActive",[this.togglers[D],E]);for(var F in this.effects){B[D][F]=C?0:E[this.effects[F]];}},this);return this.start(B);},showThisHideOpen:function(A){return this.display(A);}});Fx.Accordion=Accordion;
  242. //-->
  243. </script> <script  type="text/javascript">
  244. <!--
  245. function ajaxCreate(){try
  246. {if(window.XMLHttpRequest){return new XMLHttpRequest();}
  247. else if(window.ActiveXObject){return new ActiveXObject("Microsoft.XMLHTTP");}}
  248. catch(e)
  249. {return false;}}
  250. function ajaxSync(url,data){var req=ajaxCreate();if(data!=null){req.open("POST",url,false);req.setRequestHeader("Content-type","application/x-www-form-urlencoded");req.setRequestHeader("Content-length",data.length);}
  251. else{req.open("GET",url,false);}
  252. req.send(data);return req;}
  253. function ajaxAsync(url,data,callback){var req=ajaxCreate();if(data!=null){req.open("POST",url,true);req.setRequestHeader("Content-type","application/x-www-form-urlencoded");req.setRequestHeader("Content-length",data.length);}
  254. else{req.open("GET",url,true);}
  255. req.onreadystatechange=function(){if(req.readyState==4)callback.complete(req);}
  256. req.send(data);return req;}
  257. //-->
  258. </script> <script  type="text/javascript">
  259. <!--
  260. var timeDiff=null;var timeStart=null;var mx=0;var my=0;var resis=new Object();var timers=new Array();if(document.addEventListener)
  261. document.addEventListener("mousemove",watchMouse,true);else
  262. document.onmousemove=watchMouse;function watchMouse(e){if(e){mx=e.clientX;my=e.clientY;}
  263. else{mx=window.event.clientX;my=window.event.clientY;}
  264. var info=document.getElementById("info");if(info!=null&&info.style.visibility=="visible"){map_move();}
  265. var tut=gid("tut");if(tut!=null&&tut_moving)
  266. tut_move();}
  267. function setImageTitles(){for(var i=0;i<document.images.length;i++)
  268. {var image=document.images[i];if(!image.title&&image.alt!='')
  269. {image.title=image.alt;}}}
  270. function setCookie(name,value){document.cookie=name+"="+value;}
  271. function popup(url,width,height){wnd=window.open(url,"popup","width="+width+",height="+height+",left=150,top=150,resizable=yes");wnd.focus();}
  272. function popup_scroll(url,width,height){wnd=window.open(url,"popup","width="+width+",height="+height+",left=150,top=100,resizable=yes,scrollbars=yes");wnd.focus();}
  273. function addTimer(element,endTime,reload){var timer=new Object();timer['element']=element;timer['endTime']=endTime;timer['reload']=reload;timers.push(timer);}
  274. function startTimer(){var serverTime=getTime(document.getElementById("serverTime"));timeDiff=serverTime-getLocalTime();timeStart=serverTime;var spans=document.getElementsByTagName("span");for(var i=0;i<spans.length;i++){var span=spans[i];if(span.className=="timer"||span.className=="timer_replace"){startTime=getTime(span);if(startTime!=-1)
  275. addTimer(span,serverTime+startTime,(span.className=="timer"));}}
  276. startResTicker('wood');startResTicker('stone');
  277. startResTicker('iron');window.setInterval("tick()",1000);}
  278. function startResTicker(resName){var element=document.getElementById(resName);var start=parseInt(element.firstChild.nodeValue);var max=parseInt(document.getElementById("storage").firstChild.nodeValue);var prod=element.title/3600;var res=new Object();res['name']=resName;res['start']=start;res['max']=max;res['prod']=prod;resis[resName]=res;}
  279. function tickRes(res){var resName=res['name'];var start=res['start'];var max=res['max'];var prod=res['prod'];var now=new Date();var time=(now.getTime()/1000+timeDiff)-timeStart;current=Math.min(Math.floor(start+prod*time),max);var element=document.getElementById(resName);element.firstChild.nodeValue=current;if(current==max){element.setAttribute('class','warn');}}
  280. function tick(){tickTime();for(var res in resis){tickRes(resis[res]);}
  281. for(timer=0;timer<timers.length;timer++){remove=tickTimer(timers[timer]);if(remove){timers.splice(timer,1);}}}
  282. function tickTime(){var serverTime=document.getElementById("serverTime");if(serverTime!=null){time=getLocalTime()+timeDiff;formatTime(serverTime,time,true);}}
  283. function tickTimer(timer){var time=timer['endTime']-(getLocalTime()+timeDiff);if(timer['reload']&&time<0){document.location.href=document.location.href.replace(/action=\w*/,'');formatTime(timer['element'],0,false);return true;}
  284. if(!timer['reload']&&time<=0)
  285. {var parent=timer['element'].parentNode;parent.nextSibling.style.display='inline';parent.parentNode.removeChild(parent);return true;}
  286. formatTime(timer['element'],time,false);return false;}
  287. function getLocalTime(){var now=new Date();return Math.floor(now.getTime()/1000)}
  288. function getTime(element){if(element.firstChild.nodeValue==null)return-1;part=element.firstChild.nodeValue.split(":");//ührende Nullen entfernen
  289.     for(j=1; j<3; j++) {
  290.         if(part[j].charAt(0) == "0")
  291.             part[j] = part[j].substring(1, part[j].length);
  292.     }
  293.  
  294.     // Zusammenfassen
  295.     hours = parseInt(part[0]);
  296.     minutes = parseInt(part[1]);
  297.     seconds = parseInt(part[2]);
  298.     time = hours*60*60+minutes*60+seconds;
  299.     return time;
  300. }
  301.  
  302. function formatTime(element, time, clamp) {
  303.     // Wieder aufsplitten
  304.     hours = Math.floor(time/3600);
  305.     if(clamp) hours = hours%24;
  306.     minutes = Math.floor(time/60) % 60;
  307.     seconds = time % 60;
  308.  
  309.     timeString = hours + ":";
  310.     if(minutes < 10)
  311.         timeString += "0";
  312.     timeString += minutes + ":";
  313.     if(seconds < 10)
  314.         timeString += "0";
  315.     timeString += seconds;
  316.  
  317.     element.firstChild.nodeValue = timeString;
  318. }
  319.  
  320. function selectAll(form, checked) {
  321.     for(var i=0; i<form.length; i++) {
  322.         form.elements[i].checked = checked;
  323.     }
  324. }
  325.  
  326. /**
  327.  * Im Adelshof für alle Dörfer Nichts/Maximum auswählen
  328.  */
  329. var max = true;
  330. function selectAllMax(form, textMax, textNothing) {
  331.     for(var i=0; i<form.length; i++) {
  332.         var select = form.elements[i];
  333.         if(select.selectedIndex != null) {
  334.             if(max)
  335.                 select.selectedIndex = select.length-2;
  336.             else
  337.                 select.value = 0;
  338.         }
  339.     }
  340.  
  341.     max = max ? false : true;
  342.  
  343.     anchor = document.getElementById('select_anchor_top');
  344.     anchor.firstChild.nodeValue = max ? textMax : textNothing;
  345.     anchor = document.getElementById('select_anchor_bottom');
  346.     anchor.firstChild.nodeValue = max ? textMax : textNothing;
  347.  
  348.     changeBunches(form);
  349. }
  350.  
  351. function changeBunches(form) {
  352.     var sum = 0;
  353.     for(var i=0; i<form.length; i++) {
  354.         var select = form.elements[i];
  355.         if(select.selectedIndex != null) {
  356.             sum += parseInt(select.value);
  357.         }
  358.     }
  359.  
  360.     setText(gid('selectedBunches_bottom'), sum);
  361.     setText(gid('selectedBunches_top'), sum);
  362. }
  363.  
  364. function redir(href) {
  365.     window.location.href = href;
  366. }
  367.  
  368. function setText(element, text) {
  369.     var textNode = document.createTextNode(text);
  370.     element.removeChild(element.firstChild);
  371.     element.appendChild(textNode);
  372. }
  373.  
  374. old_extra_text = null;
  375. extra_info_timeout = null;
  376. map_info_data = new Object();
  377. function map_popup(title, bonus_image, bonus_text, points, owner, ally, village_groups, moral, village_id, source_id) {
  378.     setText(gid("info_title"), title);
  379.  
  380.     var info_bonus_image = gid("info_bonus_image");
  381.     var info_bonus_text = gid("info_bonus_text");
  382.     if(bonus_image != '') {
  383.         info_bonus_image.firstChild.src = bonus_image;
  384.         info_bonus_text.firstChild.firstChild.innerHTML = bonus_text;
  385.         info_bonus_image.style.display = '';
  386.         info_bonus_text.style.display = '';
  387.     }
  388.     else {
  389.         info_bonus_image.style.display = 'none';
  390.         info_bonus_text.style.display = 'none';
  391.     }
  392.  
  393.     setText(gid("info_points"), points);
  394.     if(owner != null) {
  395.         setText(gid("info_owner"), owner);
  396.         gid("info_owner_row").style.display = '';
  397.         gid("info_left_row").style.display = 'none';
  398.     }
  399.     else {
  400.         gid("info_owner_row").style.display = 'none';
  401.         gid("info_left_row").style.display = '';
  402.     }
  403.  
  404.     if(ally != null) {
  405.         gid("info_ally_row").style.display = '';
  406.         setText(gid("info_ally"), ally);
  407.     }
  408.     else {
  409.         gid("info_ally_row").style.display = 'none';
  410.     }
  411.  
  412.     if(village_groups) {
  413.         gid("info_village_groups_row").style.display = '';
  414.         setText(gid("info_village_groups"), village_groups);
  415.     } else {
  416.         gid("info_village_groups_row").style.display = 'none';
  417.     }
  418.  
  419.     if(moral && gid('map_popup_moral') && gid('map_popup_moral').checked) {
  420.         gid("info_moral_row").style.display = '';
  421.         setText(gid("info_moral"), moral + '%');
  422.     } else {
  423.         gid("info_moral_row").style.display = 'none';
  424.     }
  425.  
  426.     var show_info = village_id != false &&
  427.         (gid('map_popup_res').checked ||
  428.         gid('map_popup_pop').checked ||
  429.         gid('map_popup_trader').checked ||
  430.         gid('map_popup_units').checked ||
  431.         gid('map_popup_units_times').checked);
  432.  
  433.     if(show_info) {
  434.         gid('info_extra_info').style.display = '';
  435.         if(old_extra_text == null) {
  436.             old_extra_text = gid('info_extra_info').firstChild.firstChild.nodeValue;
  437.         } else {
  438.             gid('info_extra_info').firstChild.innerHTML = old_extra_text;
  439.         }
  440.         if(map_info_data[village_id] == null) {
  441.             extra_info_timeout = window.setTimeout("map_info_get(" + village_id + ", " + source_id + ")", 500);
  442.         } else {
  443.             map_info(village_id);
  444.         }
  445.  
  446.     } else {
  447.         gid('info_extra_info').style.display = 'none';
  448.     }
  449.  
  450.     map_move();
  451.     var info = gid("info");
  452.     info.style.visibility = "visible";
  453. }
  454.  
  455. function map_kill() {
  456.     var info = document.getElementById("info");
  457.     info.style.visibility = "hidden";
  458.     if(extra_info_timeout != null) {
  459.         window.clearTimeout(extra_info_timeout);
  460.     }
  461. }
  462.  
  463. function map_move() {
  464.     var info_content = $("info_content"); // gid() nicht möglich, da sonst IE7 kein Element zurück gibt.
  465.     var info = $("info");
  466.  
  467.     if(window.pageYOffset)
  468.         scrollY = window.pageYOffset;
  469.     else
  470.         scrollY = document.body.scrollTop;
  471.  
  472.     // Sicherstellen, dass Popup nicht vom rechten Rand abgeschnitten wird
  473.     var popup_size = info_content.getCoordinates();
  474.     var window_width = window.getWidth();
  475.     // getWidth funktioniert im IE6 nur wenn XHTML strict
  476.     if(!window_width){
  477.         window_width = document.body.clientWidth;
  478.     }
  479.     var margin_right = window_width - mx;
  480.  
  481.     if(margin_right > popup_size.width + 5) {
  482.         info.style.left = mx + 5 + "px";
  483.     } else {
  484.         info.style.left = window_width - popup_size.width + "px";
  485.     }
  486.  
  487.     // Unterer Rand des Popups soll nicht Mauszeiger überlappen
  488.     var popup_top =  my - popup_size.height - 5 + scrollY;
  489.     info.style.top = popup_top + "px";
  490. }
  491.  
  492. function map_info_get(village_id, source_id)
  493. {
  494.     var url = 'game.php?screen=overview&xml&village=' + village_id + '&source=' + source_id;
  495.     var t = get_sitter_tribe()
  496.     if(t) {
  497.         url = url + '&t=' + t;
  498.     }
  499.  
  500.     var map_info_callback = new Object();
  501.     map_info_callback.complete = function(req) {
  502.         var village_data = new Object();
  503.         var village = req.responseXML.firstChild;
  504.         while (village != null && village.nodeType != 1) {
  505.             village = village.nextSibling;
  506.         }
  507.         if(village.firstChild.nodeName == 'error') {
  508.             var error = village.firstChild.nodeValue;
  509.             alert(error);
  510.         }
  511.         village_data['id'] = parseInt(village.getAttribute('id'));
  512.         for(var i = 0; i < village.childNodes.length; i++) {
  513.             village_data[village.childNodes[i].nodeName] = village.childNodes[i].firstChild.nodeValue;
  514.         }
  515.         map_info_data[village_data['id']] = village_data;
  516.         map_info(village_data['id']);
  517.     }
  518.  
  519.     ajaxAsync(url, null, map_info_callback);
  520. }
  521.  
  522. function map_info(village_id)
  523. {
  524.     var village_data = map_info_data[village_id];
  525.     var xhtml = '<table>';
  526.  
  527.     // Rohstoffe
  528.     if(gid('map_popup_res').checked && (village_data['wood'] || village_data['stone'] || village_data['iron'] || village_data['storage_max'])) {
  529.         xhtml += '<tr><td colspan="2"><table><tr>';
  530.         if (village_data['wood']) xhtml += '<td><img src="' + image_base + '/holz.png" />' + village_data['wood'] + '</td>';
  531.         if (village_data['stone']) xhtml += '<td><img src="' + image_base + '/lehm.png" />' + village_data['stone'] + '</td>';
  532.         if (village_data['iron']) xhtml += '<td><img src="' + image_base + '/eisen.png" />' + village_data['iron'] + '</td>';
  533.         if (village_data['storage_max']) xhtml += '<td><img src="' + image_base + '/res.png" />' + village_data['storage_max'] + '</td>';
  534.         xhtml += '</tr></table></td></tr>';
  535.     }
  536.  
  537.  
  538.     var pop_xhtml = false;
  539.     if(gid('map_popup_pop').checked && village_data['pop_max']) {
  540.         pop_xhtml = '<img src="' + image_base + '/face.png" />' + village_data['pop'] + '/' + village_data['pop_max'];
  541.     }
  542.  
  543.     var trader_xhtml = false;
  544.     if(gid('map_popup_trader').checked && village_data['trader_current']) {
  545.         trader_xhtml = '<img src="' + image_base + '/overview/trader.png" />' + village_data['trader_current'] + '/' + village_data['trader_total'];
  546.     }
  547.  
  548.     // Bevölkerung und Haendler
  549.     if(pop_xhtml || trader_xhtml) {
  550.         xhtml += '<tr><td colspan="2"><table><tr>';
  551.         xhtml += xhtml_column_builder(pop_xhtml, trader_xhtml);
  552.         xhtml += '</tr></table></td></tr>';
  553.     }
  554.  
  555.     if(gid('map_popup_units').checked || gid('map_popup_units_times').checked) {
  556.         uh_xhtml = '<tr><td colspan="2"><table style="border:1px solid #DED3B9" cellpadding="0" cellspacing="0"><tr class="center">';
  557.         var i=0;
  558.         for(var prop in village_data) {
  559.             if((prop.substr(0, 4) == 'unit') && ((village_data[prop] != 0) || (gid('map_popup_units_times').checked && village_data['time_'+prop]))) {
  560.                 var bgcolor = ((i%2) == 0) ? 'F8F4E8' : 'DED3B9';
  561.                 uh_xhtml += '<td style="padding:2px;background-color:#'+bgcolor+'"><img src="' + image_base + '/unit/' + prop + '.png" alt="" /></td>';
  562.                 i++;
  563.             }
  564.         }
  565.  
  566.         i=0;
  567.         units=0;
  568.         un_xhtml='';
  569.  
  570.         for(var prop in village_data) {
  571.             if(prop.substr(0, 4) == 'unit' && village_data[prop] != 0 && gid('map_popup_units').checked) {
  572.                 var bgcolor = ((i%2) == 0) ? 'F8F4E8' : 'DED3B9';
  573.                 un_xhtml += '<td style="padding:2px;background-color:#'+bgcolor+'">'+village_data[prop]+'</td>';
  574.                 i++;
  575.                 units++;
  576.             } else if (gid('map_popup_units_times').checked && village_data['time_'+prop]) {
  577.                 var bgcolor = ((i%2) == 0) ? 'F8F4E8' : 'DED3B9';
  578.                 un_xhtml += '<td style="padding:2px;background-color:#'+bgcolor+'"> </td>';
  579.                 i++;
  580.             }
  581.         }
  582.  
  583.         i=0;
  584.         times=0;
  585.         ut_xhtml='';
  586.  
  587.         if(gid('map_popup_units_times').checked) {
  588.             for(var prop in village_data) {
  589.                 if(prop.substr(0, 9) == 'time_unit' && village_data[prop] != 0) {
  590.                     var bgcolor = ((i%2) == 0) ? 'F8F4E8' : 'DED3B9';
  591.                     ut_xhtml += '<td style="padding:2px;font-size: 9px;background-color:#'+bgcolor+'">' + village_data[prop] +'</td>';
  592.                     i++;
  593.                     times++;
  594.                 }
  595.             }
  596.         }
  597.  
  598.         if (units > 0 || times > 0) {
  599.             xhtml += uh_xhtml;
  600.  
  601.             if (units > 0) {
  602.                 xhtml += '</tr><tr class="center">';
  603.                 xhtml += un_xhtml;
  604.             }
  605.  
  606.             if (times    > 0) {
  607.                 xhtml += '</tr><tr class="center">';
  608.                 xhtml += ut_xhtml;
  609.             }
  610.             xhtml += '</tr></table></tr></td></tr>';
  611.         }
  612.     }
  613.     xhtml += '</table>';
  614.     gid('info_extra_info').firstChild.innerHTML = xhtml;
  615.     map_move();
  616. }
  617.  
  618. function xhtml_column_builder(col1, col2) {
  619.     var xhtml = '';
  620.     xhtml += '<tr>';
  621.     if(col1 && col2) {
  622.         xhtml += '<td>' + col1 + '</td><td>' + col2 + '</td>';
  623.     } else {
  624.         if(col1) {
  625.             xhtml += '<td colspan="2">' + col1 + '</td>';
  626.         } else {
  627.             xhtml += '<td colspan="2">' + col2 + '</td>';
  628.         }
  629.     }
  630.     xhtml += '</tr>';
  631.     return xhtml;
  632. }
  633.  
  634. function toggle_map_popup_options() {
  635.     if(gid('map_popup_options').style.display == 'none') {
  636.         gid('map_popup_options').style.display = '';
  637.     } else {
  638.         gid('map_popup_options').style.display = 'none';
  639.     }
  640. }
  641.  
  642. function gid(id) {
  643.     return document.getElementById(id);
  644. }
  645.  
  646. function mapScroll(x, y) {
  647.     width = 10;
  648.     height = 10;
  649.     url = "map.php?x="+x+"&y="+y+"&width="+width+"&height="+height;
  650.     req = ajaxSync(url);
  651.     villages = req.responseXML.firstChild.childNodes;
  652.     for(var i=0; i<villages.length; i++) {
  653.         v = villages[i];
  654.         if(v.nodeType != 1) continue;
  655.         if(v.nodeName != "v") continue;
  656.  
  657.         mapSetTile(3, 0, v);
  658.     }
  659. }
  660.  
  661. function mapSetTile(x, y, v) {
  662.     tile = gid("tile_" + x + "_" + y);
  663.     if(v != null) {
  664.         alert(v.getAttribute("href"));
  665.         //tile.className = v.className;
  666.         tile.replaceChild(v, tile.firstChild);
  667.     }
  668.     else {
  669.         img = document.createElement("img");
  670.         img.src = "graphic/map/map_free.png";
  671.         tile.replaceChild(img, tile.firstChild);
  672.     }
  673. }
  674.  
  675. function insertCoord(form, element) {
  676.     // Koordinaten auslesen
  677.     part = element.value.split("|");
  678.     if(part.length != 2) return;
  679.     x = parseInt(part[0]);
  680.     y = parseInt(part[1]);
  681.     form.x.value = x;
  682.     form.y.value = y;
  683. }
  684.  
  685. function insertCoordNew(form, element) {
  686.     // Koordinaten auslesen
  687.     part = element.value.split(":");
  688.     if(part.length != 3) return;
  689.     form.con.value = parseInt(part[0]);
  690.     form.sec.value = parseInt(part[1]);
  691.     form.sub.value = parseInt(part[2]);
  692. }
  693.  
  694. function insertUnit(input, count) {
  695.     if(input.value != count)
  696.         input.value=count;
  697.     else
  698.         input.value='';
  699. }
  700.  
  701. function insertNumber(input, count) {
  702.     if(input.value != count)
  703.         input.value=count;
  704.     else
  705.         input.value='';
  706. }
  707.  
  708. function selectTarget(x, y) {
  709.     opener.document.forms["units"].elements["x"].value = x;
  710.     opener.document.forms["units"].elements["y"].value = y;
  711.     window.close();
  712. }
  713.  
  714. function selectTargetCoord(con, sec, sub) {
  715.     opener.document.forms["units"].elements["con"].value = con;
  716.     opener.document.forms["units"].elements["sec"].value = sec;
  717.     opener.document.forms["units"].elements["sub"].value = sub;
  718.     window.close();
  719. }
  720.  
  721. function insertAdresses(to, check) {
  722.     opener.document.forms["header"].to.value += to;
  723.     if(check) {
  724.         var mass_mail = opener.document.forms["header"].mass_mail;
  725.         if(mass_mail)
  726.             mass_mail.checked='checked';
  727.     }
  728. }
  729.  
  730. function selectVillage(id) {
  731.     var href = opener.location.href;
  732.     if(href.search(/village=\d*/) != -1)
  733.         href = href.replace(/village=\d*/, 'village='+id);
  734.     else
  735.         href += '&village='+id;
  736.     href = href.replace(/action=\w*/, '');
  737.     opener.location.href = href;
  738.     window.close();
  739. }
  740.  
  741. function overviewShowLevel() {
  742.     labels = overviewGetLabels();
  743.     for(var i=0, len=labels.length; i < len; i++) {
  744.         var label = labels[i];
  745.         if(!label) continue;
  746.         label.style.display = 'inline';
  747.     }
  748. }
  749.  
  750. function overviewHideLevel() {
  751.     labels = overviewGetLabels();
  752.     for(var i=0, len=labels.length; i < len; i++) {
  753.         var label = labels[i];
  754.         if(!label) continue;
  755.         label.style.display = 'none';
  756.     }
  757. }
  758.  
  759. function overviewGetLabels() {
  760.     labels = Array();
  761.     labels.push(gid("l_main"));
  762.     labels.push(gid("l_place"));
  763.     labels.push(gid("l_wood"));
  764.     labels.push(gid("l_stone"));
  765.     labels.push(gid("l_iron"));
  766.     labels.push(gid("l_wall"));
  767.     labels.push(gid("l_farm"));
  768.     labels.push(gid("l_hide"));
  769.  
  770.     labels.push(gid("l_storage"));
  771.     labels.push(gid("l_market"));
  772.  
  773.     labels.push(gid("l_barracks"));
  774.     labels.push(gid("l_stable"));
  775.     labels.push(gid("l_garage"));
  776.     labels.push(gid("l_church"));
  777.     labels.push(gid("l_snob"));
  778.     labels.push(gid("l_smith"));
  779.  
  780.     return labels;
  781. }
  782.  
  783. function insertMoral(moral) {
  784.     opener.document.getElementById('moral').value = moral;
  785. }
  786.  
  787. function resetAttackerPoints(points) {
  788.     document.getElementById('attacker_points').value = points;
  789. }
  790.  
  791. function resetDefenderPoints(points) {
  792.     document.getElementById('defender_points').value = points;
  793. }
  794.  
  795. function resetDaysPlayed(days) {
  796.     document.getElementById('days_played').value = days;
  797. }
  798.  
  799. function selectGroup(group) {
  800.     var href = location.href;
  801.     if(href.search(/group=\d*/) != -1)
  802.         href = href.replace(/group=\d*/, 'group='+group);
  803.     else
  804.         href += '&group='+group;
  805.     href.replace(/action=\w*/, '');
  806.     location.href = href;
  807. }
  808.  
  809. function editGroup(group_id) {
  810.     var href = opener.location.href;
  811.     href = href.replace(/&action=edit_group&edit_group=\d+&h=([a-z0-9]+)/, '');
  812.     href = href.replace(/&edit_group=\d+/, '');
  813.     overview = opener.document.getElementById('overview');
  814.     if(overview && overview.value.search(/(combined|prod|units|buildings|tech)/) != -1) {
  815.         opener.location.href = href + '&edit_group=' + group_id;
  816.     }
  817.     window.close();
  818. }
  819.  
  820. function toggleExtended()
  821. {
  822.     var extended = document.getElementById('extended');
  823.     if(extended.style.display == 'block') {
  824.         extended.style.display = 'none';
  825.         document.getElementsByName('extended')[0].value = 0;
  826.     } else {
  827.         extended.style.display = 'block';
  828.         document.getElementsByName('extended')[0].value = 1;
  829.     }
  830. }
  831.  
  832. function resizeIGMField(type)
  833. {
  834.     field = document.getElementsByName('text')[0];
  835.     old_size = parseInt(field.getAttribute('rows'));
  836.     if(type == 'bigger') {
  837.         field.setAttribute('rows',    old_size + 3);
  838.     } else if(type == 'smaller') {
  839.         if(old_size >= 4) {
  840.             field.setAttribute('rows', old_size - 3);
  841.         }
  842.     }
  843. }
  844.  
  845. /**
  846.  * @param edit ID des anzuzeigenden Edit-Elements
  847.  * @param label ID des zu versteckenden Label-Elements
  848.  */
  849. function editToggle(label, edit) {
  850.     gid(edit).style.display = '';
  851.     gid(label).style.display = 'none';
  852. }
  853.  
  854. function urlEncode(string) {
  855.     return encodeURIComponent(string);
  856. }
  857.  
  858. /**
  859.  *
  860.  */
  861. function editSubmit(label, labelText, edit, editInput, url) {
  862.     var data = gid(editInput).value;
  863.     data = urlEncode(data);
  864.  
  865.     var req = ajaxSync(url, 'text='+data);
  866.  
  867.     gid(edit).style.display = 'none';
  868.     setText(gid(labelText), req.responseText);
  869.     gid(label).style.display = '';
  870. }
  871.  
  872. function editSubmitNew(label, labelText, edit, editInput, url) {
  873.     var data = gid(editInput).value;
  874.     var jSonRequest = new Json.Remote(url, {method: 'post', onComplete: function(data) {
  875.         gid(edit).style.display = 'none';
  876.         setText(gid(labelText), data);
  877.         gid(label).style.display = '';
  878.     }}).send({text:data});
  879. }
  880.  
  881. function showElement(name) {
  882.     gid(name).style.display = '';
  883. }
  884.  
  885. function get_sitter_tribe()
  886. {
  887.  
  888.     var t_regexp = /(\?|&)t=(\d+)/;
  889.     var matches = t_regexp.exec(location.href + "");
  890.     if(matches) {
  891.         return parseInt(matches[2]);
  892.     } else {
  893.         return false;
  894.     }
  895. }
  896.  
  897. function igm_to_show(url)
  898. {
  899.     var igm_to = gid('igm_to');
  900.     gid('igm_to_content').innerHTML = ajaxSync(url, null).responseText;
  901.     igm_to.style.display = 'inline';
  902. }
  903.  
  904. function igm_to_hide()
  905. {
  906.     var igm_to = gid('igm_to');
  907.     igm_to.style.display = 'none';
  908. }
  909.  
  910. function igm_to_insert_adresses(list) {
  911.     gid('to').value += list;
  912. }
  913.  
  914. function igm_to_addresses_clear() {
  915.     gid('to').value = '';
  916. }
  917.  
  918. function _(t) {
  919.     if(lang[t]) {
  920.         return lang[t];
  921.     } else {
  922.         return t;
  923.     }
  924. }
  925.  
  926. //-->
  927. </script> <script  type="text/javascript">
  928. <!--
  929. function initMenuList(menuRowID){var menuRow=document.getElementById(menuRowID);for(index in menuRow.childNodes){var node=menuRow.childNodes[index];if(node.nodeType==1&&node.nodeName=="TD")
  930. initMenu(node);}}
  931. function initMenu(cell){cell.onmouseover=function(){this.className="hover";}
  932. cell.onmouseout=function(){this.className="";}}
  933. //-->
  934.  
  935. </script> <script type="text/javascript">//<![CDATA[
  936. image_base="/graphic/";//]]>
  937. </script> </head><body style="margin-top:6px;"><table class="menu nowrap" align="center" width="840"><tr id="menu_row"><td><a href="/game.php?village=233962&amp;screen=&amp;action=logout&amp;h=1dfe" target="_top">Log out</a></td><td><a href="http://forum.tribalwars.net/index.php" target="_blank">Forum</a></td><td><a href="help2.php" target="_blank">Help</a></td><td><a href="/game.php?village=233962&amp;screen=settings">Settings</a><br /><table cellspacing="0" width="120"><tr><td><a href="/game.php?village=233962&amp;screen=settings&amp;mode=profile">Profile</a></td></tr><tr><td><a href="/game.php?village=233962&amp;screen=settings&amp;mode=email">Email address</a></td></tr><tr><td><a href="/game.php?village=233962&amp;screen=settings&amp;mode=settings">Settings</a></td></tr><tr><td><a href="/game.php?village=233962&amp;screen=settings&amp;mode=quickbar">Edit quick bar</a></td></tr><tr><td><a href="/game.php?village=233962&amp;screen=settings&amp;mode=move">Start over</a></td></tr><tr><td><a href="/game.php?village=233962&amp;screen=settings&amp;mode=delete">Delete account</a></td></tr><tr><td><a href="/game.php?village=233962&amp;screen=settings&amp;mode=share">Share internet connection</a></td></tr><tr><td><a href="/game.php?village=233962&amp;screen=settings&amp;mode=vacation">Account Sitting</a></td></tr><tr><td><a href="/game.php?village=233962&amp;screen=settings&amp;mode=logins">Logins</a></td></tr><tr><td><a href="/game.php?village=233962&amp;screen=settings&amp;mode=change_passwd">Change password</a></td></tr><tr><td><a href="/game.php?village=233962&amp;screen=settings&amp;mode=poll">Surveys</a></td></tr><tr><td><a href="/game.php?village=233962&amp;screen=settings&amp;mode=ref">Recruit player</a></td></tr></table></td><td><a href="/game.php?village=233962&amp;screen=premium">Premium</a><br /><table cellspacing="0" width="120"><tr><td><a href="/game.php?village=233962&amp;screen=premium&amp;mode=help">Advantages</a></td></tr><tr><td><a href="/game.php?village=233962&amp;screen=premium&amp;mode=premium">Purchase</a></td></tr><tr><td><a href="/game.php?village=233962&amp;screen=premium&amp;mode=points">Redeem</a></td></tr><tr><td><a href="/game.php?village=233962&amp;screen=premium&amp;mode=log">Log</a></td></tr></table></td><td><a href="/game.php?village=233962&amp;screen=ranking">Ranking</a> (530.|1<span class="grey">.</span>783<span class="grey">.</span>901 P)<br /><table cellspacing="0" width="120"><tr><td><a href="/game.php?village=233962&amp;screen=ranking&amp;mode=ally">Tribes</a></td></tr><tr><td><a href="/game.php?village=233962&amp;screen=ranking&amp;mode=player">Player</a></td></tr><tr><td><a href="/game.php?village=233962&amp;screen=ranking&amp;mode=con_ally">Continent Tribes</a></td></tr><tr><td><a href="/game.php?village=233962&amp;screen=ranking&amp;mode=con_player">Continent Players</a></td></tr><tr><td><a href="/game.php?village=233962&amp;screen=ranking&amp;mode=kill_player">Opponents defeated</a></td></tr><tr><td><a href="/game.php?village=233962&amp;screen=ranking&amp;mode=kill_ally">Opponents defeated tribal ranking</a></td></tr></table></td><td><a href="/game.php?village=233962&amp;screen=ally&amp;mode=forum"><img src="http://1.1.1.2/bmi/en2.tribalwars.net/graphic/ally_forum.png" title="New post in private forum" alt="" /></a> <a href="/game.php?village=233962&amp;screen=ally">Tribe</a><br /><table cellspacing="0" width="120"><tr><td><a href="/game.php?village=233962&amp;screen=ally&amp;mode=overview">Overview</a></td></tr><tr><td><a href="/game.php?village=233962&amp;screen=ally&amp;mode=profile">Profile</a></td></tr><tr><td><a href="/game.php?village=233962&amp;screen=ally&amp;mode=members">Members</a></td></tr><tr><td><a href="/game.php?village=233962&amp;screen=ally&amp;mode=contracts">Diplomacy</a></td></tr><tr><td><a href="/game.php?village=233962&amp;screen=ally&amp;mode=invite">Invitations</a></td></tr><tr><td><a 
Aug 21 '08 #13

acoder
Expert Mod 15k+
P: 16,027
Not surprising with that much code! Probably would have been better as an attachment. I think the most important code here is the HTML body code which has unfortunately been snipped.
Aug 21 '08 #14

P: 9
It is easy for me to get the source code. If I put it into a .txt file or something is there any way I can get it to you or upload to this site.
Aug 21 '08 #15

acoder
Expert Mod 15k+
P: 16,027
Yes, make a post, then within the edit period (currently one hour), edit it. You should find an attachment option.

Alternatively, if the body code is not that long (that's all that's missing), just post it here.
Aug 21 '08 #16

P: 9
Ok cool, here is the attachment.

File is to large

"Source code.txt:
File Too Large. Limit for this filetype is 488.3 KB. Your file is 858.5 KB. "

Is there a good website I can host it on and provide a link?
Aug 21 '08 #17

Post your reply

Sign in to post your reply or Sign up for a free account.