var media_place_list = [{i:"1", d:"1", w:"728", h:"90", fd:"-1", bf:"-1"},{i:"2", d:"1", w:"236", h:"90", fd:"-1", bf:"-1"},{i:"8", d:"2", w:"800", h:"35", fd:"-1", bf:"-1"},{i:"26", d:"1", w:"728", h:"90", fd:"-1", bf:"-1"}];try{if(document.addEventListener){window.addEventListener("load",MediaOnLoad,false)}else{if(document.attachEvent){window.attachEvent("onload",MediaOnLoad)}else{MediaOnLoad()}}}catch(e){MediaOnLoad()}var media_loaded=false;var media_session=(new Date()).getTime()+""+MediaRandom(1,5500);function MediaOnLoad(){if(media_loaded==false){media_loaded=true;for(var A=0;A<media_place_list.length;A++){MediaShowPlace(media_place_list[A].i)}}}function MediaShowPlace(K){for(var C=0;C<media_place_list.length;C++){if(media_place_list[C].ok&&media_place_list[C].ok==true){continue}if(media_place_list[C].i==K){media_place_list[C].ok=true;var D=MediaGetElem("media_place_"+media_place_list[C].i);if(D!=false&&D!=null){var B=0;try{D.style.display="block";D.style.visibility="visible";D.style.padding="0px";D.style.width=media_place_list[C].w+"px";D.style.height=media_place_list[C].h+"px";D.innerHTML="";B=1;if(media_place_list[C].d==1){B=11;var J="http://www.anymedia.lv/show.php?p="+media_place_list[C].i+"&r="+media_session;D.innerHTML="<iframe style='' src='"+J+"' width='"+media_place_list[C].w+"' height='"+media_place_list[C].h+"' frameborder='0' marginwidth='0'  marginheight='0' scrolling='no' allowTransparency></iframe>"}else{if(media_place_list[C].d==2){B=12;var A=media_place_list[C].w;var I=media_place_list[C].h;var L=media_place_list[C].fd;var G=media_place_list[C].bf;var H="media_place_"+media_place_list[C].i;ScrollBanner(H,"","",A,I,L,G,media_session)}}}catch(F){alert(["Error at MediaOnLoad()",C,D,F.message,B])}}}}}function MediaShowScrollingRow(B){var D=media_place_list[B].w;var A=media_place_list[B].h;var C="media_place_"+media_place_list[B].i;ScrollBanner(C,media_place_ban_source,media_place_ban_link,D,A,media_place_fill_date_id)}function MediaGetElem(C){var A=false;try{A=document.getElementById(C)}catch(B){A=false}if(A==null){A=false}return A}function MediaRandom(C,B){var A=Math.random();A=A*(B-(C-1));A=Math.floor(A)+C;return A}function ScrollBanner(L,H,G,R,O,T,C,B){try{var D=document.getElementById(L);if(D==null){return }D.style.height=O+"px";D.style.dispaly="none";D.style.margin="0px";D.style.padding="0px";D.style.left="0px";D.style.overflow="hidden";D.style.top="3000px";if(window.attachEvent){window.attachEvent("onscroll",function(){SB_AdjustPosition(D,O)});window.attachEvent("onresize",function(){SB_AdjustPosition(D,O)})}else{window.addEventListener("resize",function(){SB_AdjustPosition(D,O)},1)}SB_AdjustPosition(D,O);var Q=document.createElement("div");D.appendChild(Q);Q.style.position="absolute";Q.style.left="0px";Q.style.width="3000px";var I=document.createElement("a");Q.appendChild(I);I.href=G;I.target="_blank";I.style.padding="0px";I.style.margin="0px";I.style.left="0px";I.style.position="absolute";var K="";if(T!="-1"){K="?fd="+T}if(C!="-1"){K="?bf="+C}if(K!=""){var N="http://www.anymedia.lv/show.php";var M=N+K+"&r="+B;var F="<iframe style='' src='"+M+"' width='"+R+"' height='"+O+"'  frameborder='0' marginwidth='0' marginheight='0' scrolling='no' allowTransparency></iframe>";var P=N+K;var J="<iframe style='' src='"+P+"' width='"+R+"' height='"+O+"'  frameborder='0' marginwidth='0' marginheight='0' scrolling='no' allowTransparency></iframe>";I.innerHTML=F+J+J+J}else{}var A=new ScrollObject(Q,R);A.Start();D.onmouseover=function(){A.Stop()};D.onmouseout=function(){A.Start()}}catch(S){SB_Debugg("ScrollBanner",S)}}function ScrollObject(B,A){try{var G=null;this.Start=function(){G=setInterval(function(){F()},40)};this.Stop=function(){clearInterval(G)};var D=0;function F(){D-=1;if(D<-1*A){D=0}B.style.left=Math.round(D)+"px"}}catch(C){SB_Debugg("ScrollObject",C)}}function SB_AdjustPosition(B,G){try{var A=0;if(!window.innerWidth){var D=document.documentElement.scrollTop+document.documentElement.clientHeight;var C=document.body.scrollTop+document.body.clientHeight;A=(D>0)?D:C;B.style.position="absolute"}else{A=window.innerHeight;B.style.position="fixed"}A-=G;B.style.top=A+"px";B.style.dispaly="block";B.style.width=document.body.clientWidth+"px"}catch(F){SB_Debugg("SB_AdjustPosition",F)}}function SB_AppendBannerImage(C,G,B,A){try{var F=document.createElement("img");C.appendChild(F);F.src=G;F.style.borderWidth="0px";F.style.width=B+"px";F.style.height=A+"px"}catch(D){SB_Debugg("SB_AppendBannerImage",D)}}function SB_Debugg(B,A){alert(["SB_Debugg",B,A,A.message])}function E(A){return document.getElementById(A)}function ToggleDisplay(A){if(A.style.display=="none"){A.style.display="block"}else{A.style.display="none"}}function takeYear(A){x=A.getYear();var B=x%100;B+=(B<38)?2000:1900;return B}function FormatDate(B){var C=B.getFullYear();var D=B.getMonth()+1;if(D<10){D="0"+D}var A=B.getDate();if(A<10){A="0"+A}return C+"-"+D+"-"+A}function MonthName(B){var A="";switch(B){case 1:A="Janvāris";break;case 2:A="Februāris";break;case 3:A="Marts";break;case 4:A="Aprīlis";break;case 5:A="Maijs";break;case 6:A="Jūnijs";break;case 7:A="Jūlijs";break;case 8:A="Augusts";break;case 9:A="Septembris";break;case 10:A="Oktobris";break;case 11:A="Novembris";break;case 12:A="Decembris";break}return A}function GetJsonDom(F,C){try{var A=encodeURIComponent||escape;if(F.match(/\?/)){F=F+"&c="+A(C)}else{F=F+"?c="+A(C)}var B=document.createElement("script");B.type="text/javascript";document.body.appendChild(B);B.src=F}catch(D){alert(["ErGeJe",D.message])}};
