var fishinformer_data = { "count" : "22", "objects": [{"id" : "5416", "name" : "Голавль", "photo" : "http://informer.oxothik.ru/pics/Golavl.png", "morning" : "1", "day" : "1", "evening" : "1", "night" : "0"} , {"id" : "5446", "name" : "Густера", "photo" : "http://informer.oxothik.ru/pics/Gustera.png", "morning" : "1", "day" : "1", "evening" : "1", "night" : "0"} , {"id" : "5506", "name" : "Елец", "photo" : "http://informer.oxothik.ru/pics/Elets.png", "morning" : "1", "day" : "1", "evening" : "1", "night" : "0"} , {"id" : "5536", "name" : "Ерш", "photo" : "http://informer.oxothik.ru/pics/Ersh.png", "morning" : "2", "day" : "2", "evening" : "2", "night" : "0"} , {"id" : "5476", "name" : "Жерех", "photo" : "http://informer.oxothik.ru/pics/Gerech.png", "morning" : "0", "day" : "0", "evening" : "0", "night" : "0"} , {"id" : "5566", "name" : "Карась", "photo" : "http://informer.oxothik.ru/pics/Karas.png", "morning" : "0", "day" : "0", "evening" : "0", "night" : "0"} , {"id" : "5596", "name" : "Красноперка", "photo" : "http://informer.oxothik.ru/pics/Krasnoperka.png", "morning" : "0", "day" : "0", "evening" : "0", "night" : "0"} , {"id" : "5626", "name" : "Лещ", "photo" : "http://informer.oxothik.ru/pics/Lesh.png", "morning" : "0", "day" : "0", "evening" : "0", "night" : "0"} , {"id" : "5656", "name" : "Линь", "photo" : "http://informer.oxothik.ru/pics/Lin.png", "morning" : "0", "day" : "0", "evening" : "0", "night" : "0"} , {"id" : "5686", "name" : "Налим", "photo" : "http://informer.oxothik.ru/pics/Nalim.png", "morning" : "20", "day" : "0", "evening" : "02", "night" : "232"} , {"id" : "5716", "name" : "Окунь", "photo" : "http://informer.oxothik.ru/pics/Okun.png", "morning" : "1", "day" : "1", "evening" : "1", "night" : "0"} , {"id" : "5746", "name" : "Пескарь", "photo" : "http://informer.oxothik.ru/pics/Peskar.png", "morning" : "0", "day" : "0", "evening" : "0", "night" : "0"} , {"id" : "5776", "name" : "Плотва", "photo" : "http://informer.oxothik.ru/pics/Plotva.png", "morning" : "1", "day" : "1", "evening" : "1", "night" : "0"} , {"id" : "5806", "name" : "Подуст", "photo" : "http://informer.oxothik.ru/pics/Podust.png", "morning" : "0", "day" : "0", "evening" : "0", "night" : "0"} , {"id" : "5836", "name" : "Сазан", "photo" : "http://informer.oxothik.ru/pics/Sazan.png", "morning" : "0", "day" : "0", "evening" : "0", "night" : "0"} , {"id" : "5866", "name" : "Сом", "photo" : "http://informer.oxothik.ru/pics/Som.png", "morning" : "0", "day" : "0", "evening" : "0", "night" : "0"} , {"id" : "5896", "name" : "Судак", "photo" : "http://informer.oxothik.ru/pics/Sudak.png", "morning" : "1", "day" : "1", "evening" : "1", "night" : "0"} , {"id" : "5926", "name" : "Тарань", "photo" : "http://informer.oxothik.ru/pics/Taran.png", "morning" : "1", "day" : "1", "evening" : "1", "night" : "0"} , {"id" : "5956", "name" : "Уклейка", "photo" : "http://informer.oxothik.ru/pics/Ukleyka.png", "morning" : "0", "day" : "0", "evening" : "0", "night" : "0"} , {"id" : "5986", "name" : "Чехонь", "photo" : "http://informer.oxothik.ru/pics/Chehon.png", "morning" : "0", "day" : "0", "evening" : "0", "night" : "0"} , {"id" : "6016", "name" : "Щука", "photo" : "http://informer.oxothik.ru/pics/Shuka.png", "morning" : "0", "day" : "1", "evening" : "0", "night" : "0"} , {"id" : "6046", "name" : "Язь", "photo" : "http://informer.oxothik.ru/pics/Yaz.png", "morning" : "1", "day" : "1", "evening" : "1", "night" : "0"} ]};var ompacy = 10; var count_item = 0; var curent = 0; function fishinformer(objid) { var obj = document.getElementById(objid); obj.style.border = "1px solid #CCC"; obj.style.width = "150px"; obj.style.height = "200px"; obj.style.background = "url(http://informer.oxothik.ru/pics/background.jpg)"; var oxothik = obj.getElementsByTagName("a")[0]; oxothik.style.font = "bold 9px Arial"; oxothik.style.color = "#808080"; oxothik.style.margin = "2px"; obj.getElementsByTagName("div")[0].style.textAlign = "center"; obj.getElementsByTagName("div")[0].style.margin = "2px"; obj.getElementsByTagName("div")[0].style.padding = "3px"; //obj.getElementsByTagName("div")[0].style.background = "#9297F1"; obj.getElementsByTagName("div")[0].style.font = "bold 11px Arial"; var d = new Date(); var m = parseInt(d.getMonth())+1; var t = d.getDate() + "." + ((String(m).length == 1) ? "0" + m : m) + "." + d.getFullYear(); obj.getElementsByTagName("div")[0].innerHTML = "Календарь клева рыбы
" + t; infoBlk = document.createElement("div"); infoBlk.style.left = "0"; infoBlk.style.top = "0"; infoBlk.style.width = "100%"; infoBlk.style.height = "145px"; infoBlk.style.background = "url(http://informer.oxothik.ru/pics/background_inn.jpg) top repeat-x"; infoBlk.id = obj.id +"_innerDiv"; infoBlk.style.textAlign = "center"; obj.insertBefore(infoBlk, oxothik); count_item = fishinformer_data.count; showInfo(infoBlk, fishinformer_data, count_item-1, count_item); slider(ompacy); } function slider(ompacy) { ompacy++; if (ompacy == 1000) { ompacy = 0; showInfo(infoBlk, fishinformer_data, curent, count_item); if (curent == count_item-1) curent = 0; else curent++; } if (ompacy < 100) { setOpacity(infoBlk, ompacy/10); } if (ompacy>900) { setOpacity(infoBlk, (1000-ompacy)/10); } setTimeout("slider("+ompacy+")", 10); } function showInfo(obj, json, curent, count) { var leg_txt = new Array("Клева нет", "Слабый клев", "Клев", "Жор", "Нерест", "Возможный клев"); obj.innerHTML = '
' + json.objects[curent].name + '
'; obj.innerHTML += '
'; obj.innerHTML += '
УтроДеньВечерНочь
' + '
' + '
' + '
' + '

'; var leg = json.objects[curent].morning.toString() + json.objects[curent].day.toString() + json.objects[curent].evening.toString() + json.objects[curent].night.toString(); var leg_arr = leg.split(""); var leg_arru = unique(leg_arr); for (i=0; i' + leg_txt[leg_arru[i]]+ ''; } } function setOpacity(obj, value) { obj.style.opacity = value/10; obj.style.filter = 'alpha(opacity=' + value*10 + ')'; } function unique(a) { var r = new Array(); o:for(var i = 0, n = a.length; i < n; i++) { for(var x = 0, y = r.length; x < y; x++) { if(r[x]==a[i]) continue o; } r[r.length] = a[i]; } return r; }