window.onload=function(){
if($('inni1'))inni_rotate3()
if($('ban_left_cert')||$('cert_main'))startit()
for(a=0;a<document.links.length;a++){
document.links[a].onfocus=document.links[a].blur}
}

//---------------------------------------------------------------------------------------
var interval=null, interval2=null, left1=0, left2=0, left3=0, left4=0, wybrany=1

function inni_rotate(){clearInterval(interval2);interval = setInterval("move_inni()",40)}
function inni_rotate3(){interval2 = setInterval("inni_rotate()",3000)}

function move_inni(){
 left1-=2; left2-=2; left3-=2; left4-=2
 var inn=false, inni1=$('inni1'), inni2=$('inni2'), inni3=$('inni3'), inni4=$('inni4')
 
 inni1.style['left']=''+left1+'px'
 inni2.style['left']=''+left2+'px'
 inni3.style['left']=''+left3+'px'
 inni4.style['left']=''+left4+'px'
 if(left1==-284){inni1.style['left']='852px';left1=852;inn=true}
 if(left2==-568){inni2.style['left']='568px';left2=568;inn=true}
 if(left3==-852){inni3.style['left']='284px';left3=284;inn=true}
 if(left4==-1136){inni4.style['left']='0px';left4=0;inn=true}
 if(inn){clearInterval(interval);interval2 = setInterval("inni_rotate()",3000)}
}

function mandreil(z1,style){
 z2='sunrisesystem.pl'
 document.write('<a href=\"mailto:'+z1+'@'+z2+'\" class=\"poczta\" rel=\"nofollow\" style=\"'+style+'\">'+z1+'@'+z2+'<\/a>')
}

function $(e){return document.getElementById(e)}

function show_picture_scroll(pag,pic_w,pic_h){
 if(typeof pag!='string')pag=pag.href
 pic_l=(screen.width)?(screen.width-pic_w)/2:0
 pic_t=(screen.height)?(screen.height-pic_h)/2:0
 window.open(pag,'new','menubar=no, toolbar=no, location=no, scrollbars=yes, resizable=no, status=no,width='+pic_w+', height='+pic_h+', left='+pic_l+', top='+pic_t).focus()
 return false}

function target_new(pag){
 if(typeof pag!='string')pag=pag.href
 window.open(pag,'new','menubar=yes, location=yes, resizable=yes, scrollbars=yes, status=yes, toolbar=yes, directories=yes').focus()
 return false}


function centruj_i_pokaz_diva(elem){
 if ((navigator.userAgent).indexOf("Opera")!=-1){//używamy głupiej Opery co nie potrafi pobrać styli jeśli div ma display none
  elem.style.display='block'
  var left=(document.body.clientWidth)?(document.body.clientWidth-getStylePX(elem,'width'))/2:0
  var top=(document.body.clientHeight)?(document.body.clientHeight-getStylePX(elem,'height'))/2:0
  elem.style.display='none'
 }
 else{
  var left=(document.body.clientWidth)?(document.body.clientWidth-getStylePX(elem,'width'))/2:0
  var top=(document.body.clientHeight)?(document.body.clientHeight-getStylePX(elem,'height'))/2:0
 }
 elem.style.left = left-39+'px'
 elem.style.top = 100+getPageScroll()+'px'
 elem.style.display = 'block'
}

function getPageScroll(){
	var yScroll
	if (self.pageYOffset)
		yScroll = self.pageYOffset
  else if (document.documentElement && document.documentElement.scrollTop)// Explorer 6 Strict
		yScroll = document.documentElement.scrollTop
  else if (document.body) yScroll = document.body.scrollTop
	return yScroll
}

function getStyle(el, style) {
   if(!$) return;
     var value = el.style[toCamelCase(style)];
    if(!value)
        if(document.defaultView)
            value = document.defaultView.
                 getComputedStyle(el, "").getPropertyValue(style);
        else if(el.currentStyle)
            value = el.currentStyle[toCamelCase(style)];
     return value;
}

function getStylePX(el, style) {
 var temp = getStyle(el, style);
 var pocz = temp.indexOf('px');
 return temp.substring(0,pocz)/1;
}

function toCamelCase(s) {
	for(var exp = toCamelCase.exp; 
		exp.test(s); s = s.replace(exp, RegExp.$1.toUpperCase()) );
	return s;
}
toCamelCase.exp = /-([a-z])/;
