swfBig = 'Img/OneStep_Koloseo_nalepka.swf?clickthru=predaj.html';
bigW=500;
bigH=200;
swfSmall = 'Img/OneStep_Koloseo_nalepka.swf?clickthru=predaj.html';
smallW=180;
smallH=250;
C4Xoffset=200;
C4Yoffset=200;

var myWinWidth = 0;
var myWinHeight = 0;
function getWinHeight() {
  if( typeof( window.innerWidth ) == 'number' ) {
    myWinWidth = window.innerWidth;
    myWinHeight = window.innerHeight;
  } else {
    if( document.documentElement &&
        ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
      myWinWidth = document.documentElement.clientWidth;
      myWinHeight = document.documentElement.clientHeight;
    } else {
      if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
        myWinWidth = document.body.clientWidth;
        myWinHeight = document.body.clientHeight;
      }
    }
  }
}

var myScrLeft = 0;
var myScrTop = 0;
function getScrollXY() {
  if( typeof( window.pageYOffset ) == 'number' ) {
    myScrTop = window.pageYOffset;
    myScrLeft = window.pageXOffset;
  } else {
    if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
      myScrTop = document.body.scrollTop;
      myScrLeft = document.body.scrollLeft;
    } else {
      if( document.documentElement &&
          ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
        myScrTop = document.documentElement.scrollTop;
        myScrLeft = document.documentElement.scrollLeft;
      } else {myScrLeft = 0; myScrTop = 0;}
    }
  }
}

var brOK=false;
var mie=false;
var leftPos,topPos;
var change=0;

var aver=parseInt(navigator.appVersion.substring(0,1));
var aname=navigator.appName;
var ns4=document.layers?1:0
var ie=document.all?1:0
var ns6=document.getElementById&&!document.all?1:0
var op=window.opera

getWinHeight();

if (ns4 || ns6 || op) C4Xoffset+=17;

leftPos=myWinWidth-bigW-C4Xoffset;
topPos=myWinHeight-bigH-C4Yoffset;

var chip1;
var chip2;
function pagestart()
{ chip1=new Chip("chip1",bigW,bigH);}

function checkbrOK()
{if(aname.indexOf("Internet Explorer")!=-1)
   {if(aver>=4) brOK=navigator.javaEnabled();
    mie=true;
   }
 if(aname.indexOf("Netscape")!=-1)  
   {if(aver>=4) brOK=navigator.javaEnabled();}
}

function Chip(chipname,width,height)
{this.named=chipname;
 this.w=width;
 this.h=height;
 this.xx=leftPos;
 this.yy=topPos;

 if (ie || op) {
   document.getElementById(this.named).style.left=leftPos;
   document.getElementById(this.named).style.pixelLeft=leftPos;
   document.getElementById(this.named).style.top =topPos; 
   document.getElementById(this.named).style.pixelTop =topPos; 
   document.getElementById(this.named).style.visibility ="visible"; 
 } else {
   document.getElementById(this.named).style.left=leftPos + "px";
   document.getElementById(this.named).style.pixelLeft=leftPos + "px";
   document.getElementById(this.named).style.top =topPos + "px"; 
   document.getElementById(this.named).style.pixelTop =topPos + "px"; 
   document.getElementById(this.named).style.visibility ="visible"; 
 }
  regenerate();
}

function regenerate(){
	getWinHeight();
	getScrollXY();

    if (ie || op) {
        if (change){
         document.getElementById("chip2").style.left=(myScrLeft+myWinWidth-smallW-C4Xoffset);
         document.getElementById("chip2").style.pixelLeft=(myScrLeft+myWinWidth-smallW-C4Xoffset);
         document.getElementById("chip2").style.top =(myScrTop+myWinHeight-smallH-C4Yoffset); 
         document.getElementById("chip2").style.pixelTop =(myScrTop+myWinHeight-smallH-C4Yoffset); 
        }else{
         if (myWinWidth<800) {
            document.getElementById("chip1").style.left=(myScrLeft+800-bigW)/2 -C4Xoffset;
            document.getElementById("chip1").style.pixelLeft=(myScrLeft+800-bigW)/2 -C4Xoffset;
         } else {
            document.getElementById("chip1").style.left=(myScrLeft+myWinWidth-bigW)/2 -C4Xoffset;
            document.getElementById("chip1").style.pixelLeft=(myScrLeft+myWinWidth-bigW)/2 -C4Xoffset;
         }
         document.getElementById("chip1").style.top =(myScrTop+myWinHeight-bigH)/2 -C4Yoffset;
         document.getElementById("chip1").style.pixelTop =(myScrTop+myWinHeight-bigH)/2 -C4Yoffset;
        }
    } else {
        if (change){
         document.getElementById("chip2").style.left=(myScrLeft+myWinWidth-smallW-C4Xoffset) + "px";
         document.getElementById("chip2").style.pixelLeft=(myScrLeft+myWinWidth-smallW-C4Xoffset) + "px";
         document.getElementById("chip2").style.top =(myScrTop+myWinHeight-smallH-C4Yoffset) + "px"; 
         document.getElementById("chip2").style.pixelTop =(myScrTop+myWinHeight-smallH-C4Yoffset) + "px"; 
        }else{
         document.getElementById("chip1").style.left=((myScrLeft+myWinWidth-bigW)/2 -C4Xoffset) + "px";
         document.getElementById("chip1").style.pixelLeft=((myScrLeft+myWinWidth-bigW)/2 -C4Xoffset) + "px";
         document.getElementById("chip1").style.top =((myScrTop+myWinHeight-bigH)/2 -C4Yoffset) + "px";
         document.getElementById("chip1").style.pixelTop =((myScrTop+myWinHeight-bigH)/2 -C4Yoffset) + "px";
        }
    }
    if((ns4 || ns6 )&& !mie){setTimeout('regenerate()',200);}
}

function changeIt() {
  change=1;
  chip2=new Chip("chip2",smallW,smallH);
  
   document.getElementById("chip1").style.left=-1500;
   document.getElementById("chip1").style.pixelLeft=-1500;
   document.getElementById("chip1").style.visibility ="hidden"; 
   regenerate();
}
 
flashText = '<div id="chip1" style="position:absolute; width: ' + bigW + 'px; height: ' + bigH + 'px; z-index: 999; visibility: hidden"> ' +
  '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ' +
  '    codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ' +
  '    width="' + bigW + '" height="' + bigH + '" id="c4-stick-part1" align=""> ' +
  '  <param name=movie value="' + swfBig + '"> ' +
  '  <param name=quality value=high> ' +
  '  <param name=wmode value=transparent> ' +
  '  <param name=bgcolor value=#CCCCCC> ' +
  '  <embed src="' + swfBig + '" quality=high wmode=transparent bgcolor=#CCCCCC WIDTH="' + bigW + '" HEIGHT="' + bigH + '" NAME="c4-stick-part1" ALIGN="" ' +
  '      type="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"> ' +
  '  </embed> ' +
  '</object></div> ' +
  '<div id="chip2" STYLE="position:absolute; width:' + smallW + 'px; height:' + smallH + 'px; z-index:998; top:-500; visibility:hidden"> ' +
  '  <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ' +
  '      codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ' +
  '      width="' + smallW + '" height="' + smallH + '" id="c4-stick-part2" align=""> ' +
  '    <param name=movie value="' + swfSmall + '"> ' +
  '    <param name=quality value=high> ' +
  '  <param name=wmode value=transparent> ' +
  '    <param name=bgcolor value=#CCCCCC> ' +
  '    <embed src="' + swfSmall + '" quality=high wmode=transparent bgcolor=#CCCCCC  width="' + smallW + '" height="' + smallH + '" name="c4-stick-part2" align="" ' +
  '        type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"> ' +
  '    </embed> ' +
  '  </object> ' +
  '</div>';
document.write(flashText);   

window.onload=pagestart;
window.onresize=regenerate;
window.onscroll=regenerate;
if(ns4 || ns6){setTimeout('regenerate()',100);}


