
// http://accessify.com/tools-and-wizards/developer-tools/html-javascript-convertor/
var strVar="";
strVar += "<div id=\"dropin\" style=\"position:absolute;visibility:hidden;left:0px;top:0px;width:100%;z-index:51;text-align:center;color:black;font-size:17px;font-family:serif;\">";
strVar += "  <div id=\"dropinin\" style=\"width:540px; height:550px;_height:500px; padding:10px;margin:0 auto;text-align:left;background-color:#fff;border:5px solid #1e3f8e;line-height:20px;\">";
strVar += "    <h2 style=\"margin:0px;padding-top:5px;font-size:36px;text-align:center;line-height:30px;font-family:serif;font-weight:bold;color:black;padding-bottom:0;margin-bottom:0;border:none;\">Opravdu je možné ušetřit tisíce<br \/>na povinném ručení?<\/h2>";
strVar += "    <p style=\"margin:10px 0 10px;padding:0;\">Povinné ručení je významnou položkou v nákladech na provoz automobilu. V&nbsp;současné ekonomické krizi je každá uspořená koruna dobrá a proto jsme pro Vás připravili jednoduchý a rychlý způsob, díky kterému na povinném ručení ušetříte ne koruny, ale rovnou celé tisíce.<\/p>";
strVar += "";
strVar += "    <h3 style=\"margin:0;font-size:20px;font-family:serif;font-weight:bold;color:black;padding:0;border:none;line-height:20px;\">Paní Tichá z Kunčic ušetřila 2 142 Kč<\/h3>";
strVar += "    <p style=\"margin:5px 0 10px;padding:0;\">Paní Tichá je jednou z mnoha, kdo využil možnost porovnat si na našich internetových stránkách nabídky všech pojišťoven. Pojištění její Škody Fabie (1.2\/47 kW) z roku 2006 by podle běžné sazby u České pojišťovny vyšlo na 4&nbsp;432 Kč. Naše sazba je 2&nbsp;290 Kč a tak paní Tichá uspořila 2 142 Kč ročně.<\/p>";
strVar += "    ";
strVar += "    <h3 style=\"margin:0;font-size:20px;font-family:serif;font-weight:bold;color:black;padding:0;border:none;line-height:20px;\">Porovnáme za Vás nabídky všech pojišťoven v ČR<\/h3>";
strVar += "    <p style=\"margin:5px 0 10px\">Při každé kalkulaci srovnáváme stovky parametrů, výhod a bonusů, abychom pro Váš vůz našli tu nejvýhodnější nabídku přímo na míru. Exkluzivní smlouvy s&nbsp;pojišťovnami nám navíc umožňují Vaši výslednou pojistku snížit na minimum.<\/p>";
strVar += "";
strVar += "    <h3 style=\"margin:0;font-size:20px;font-family:serif;font-weight:bold;color:black;padding:0;border:none;line-height:20px;\">Jak mohu zjistit, kolik přesně ušetřím na povinném ručení?<\/h3>    ";
strVar += "    <p style=\"margin:5px 0 15px 0;\">Vyplňte speciální formulář na našich internetových stránkách a zobrazí se Vám nejlepší nabídka přímo pro Váš vůz. Hned budete vědět, kolik na povinném ručení ušetříte právě Vy. Pro pokračování klikněte na následující odkaz:<\/p>";
strVar += "    ";
strVar += "    <p style=\"margin:0 0 0 117px;text-align:center;width:270px;height:42px;padding-left:42px;font-size:23px; line-height:23px; background:url('http:\/\/www.mujweb.eu\/sipka.gif') center left no-repeat;\"><a href=\"http:\/\/www.ipojisteni.cz\/porovnani-povinne-ruceni\/?a_aid=4a0daf5355372\" style=\"color:blue;text-decoration:underline;\">Ano, chci zjistit kolik<br \/> ušetřím na povinném ručení<\/a><\/p>";
strVar += "    <p style=\"margin:23px 0 0 0;text-align:center;font-size:18px;float:right;\"><a href=\"#\" onclick=\"dismissbox();return false\" style=\"color:gray;text-decoration:underline;\">Nechci ušetřit<\/a><\/p>";
strVar += "  <\/div>";
strVar += "<\/div>";

function createDiv()
{
            var divTag = document.createElement("div");
         
            divTag.id = "hoverbox";
            
            divTag.innerHTML = strVar;

            document.body.appendChild(divTag);
}
window.onload=createDiv;



var pixel="";
pixel += "<img src=\"http:\/\/pixel.mujweb.eu\/pixel.php?kanal=k1&amp;url="+escape(document.URL)+"\" width=\"1\" height=\"1\" border=\"0\" style=\"visibility:hidden;\" alt=\"\" \/>";


function firePixel()
{
            var divTag = document.createElement("div");
         
            divTag.id = "pixel";
            
            divTag.innerHTML = pixel;

            document.body.appendChild(divTag);
}






// Detect if the browser is IE or not.
// If it is not IE, we assume that the browser is NS.
var IE = document.all?true:false

// If NS -- that is, !IE -- then set up for mouse capture
if (!IE) document.captureEvents(Event.MOUSEMOVE)

// Set-up to use getMouseXY function onMouseMove
document.onmousemove = getMouseXY;

// Temporary variables to hold mouse x-y pos.s
var tempX = 0
var tempY = 0
var oldY = 0

// Main function to retrieve mouse x-y pos.s

function getMouseXY(e) {
  oldY = tempY
  if (IE) { // grab the x-y pos.s if browser is IE
    //tempX = event.clientX + document.body.scrollLeft
    //tempY = event.clientY + document.body.scrollTop
    tempX = event.clientX
    tempY = event.clientY
  } else {  // grab the x-y pos.s if browser is NS
    tempX = e.clientX
    tempY = e.clientY  
  }  
  // catch possible negative values in NS4
  if (tempX < 0){tempX = 0}
  if (tempY < 0){tempY = 0}  
  // show the position values in the form named Show
  // in the text fields named MouseX and MouseY
  //document.Show.MouseX.value = tempX
  //document.Show.MouseY.value = tempY
  
  if (tempY < 10 && oldY > tempY) dropornot()
  return true
}




function grayOut(vis, options) {
  // Pass true to gray out screen, false to ungray
  // options are optional.  This is a JSON object with the following (optional) properties
  // opacity:0-100         // Lower number = less grayout higher = more of a blackout 
  // zindex: #             // HTML elements with a higher zindex appear on top of the gray out
  // bgcolor: (#xxxxxx)    // Standard RGB Hex color code
  // grayOut(true, {'zindex':'50', 'bgcolor':'#0000FF', 'opacity':'70'});
  // Because options is JSON opacity/zindex/bgcolor are all optional and can appear
  // in any order.  Pass only the properties you need to set.
  var options = options || {}; 
  var zindex = options.zindex || 50;
  var opacity = options.opacity || 70;
  var opaque = (opacity / 100);
  var bgcolor = options.bgcolor || '#ffffff';
  var dark=document.getElementById('darkenScreenObject');
  if (!dark) {
    // The dark layer doesn't exist, it's never been created.  So we'll
    // create it here and apply some basic styles.
    // If you are getting errors in IE see: http://support.microsoft.com/default.aspx/kb/927917
    var tbody = document.getElementsByTagName("body")[0];
    var tnode = document.createElement('div');           // Create the layer.
        tnode.style.position='absolute';                 // Position absolutely
        tnode.style.top='0px';                           // In the top
        tnode.style.left='0px';                          // Left corner of the page
        tnode.style.overflow='hidden';                   // Try to avoid making scroll bars            
        tnode.style.display='none';                      // Start out Hidden
        tnode.id='darkenScreenObject';                   // Name it so we can find it later
    tbody.appendChild(tnode);                            // Add it to the web page
    dark=document.getElementById('darkenScreenObject');  // Get the object.
  }
  if (vis) {
    // Calculate the page width and height 
    if( document.body && ( document.body.scrollWidth || document.body.scrollHeight ) ) {
        var pageWidth = document.body.scrollWidth+'px';
        var pageHeight = document.body.scrollHeight+'px';

    } else if( document.body.offsetWidth ) {
      var pageWidth = document.body.offsetWidth+'px';
      var pageHeight = document.body.offsetHeight+'px';
    } else {
       var pageWidth='100%';
       var pageHeight='100%';
    }
    
    if(pageHeight=="0px"){
      var body = document.body,
      html = document.documentElement;
      pageHeight = Math.max( body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight )+'px';    
    }
    
    //set the shader to cover the entire page and make it visible.
    dark.style.opacity=opaque;                      
    dark.style.MozOpacity=opaque;                   
    dark.style.filter='alpha(opacity='+opacity+')'; 
    dark.style.zIndex=zindex;        
    dark.style.backgroundColor=bgcolor;  
    dark.style.width= pageWidth;
    dark.style.height= pageHeight;
    dark.style.display='block';                          
  } else {
     dark.style.display='none';
  }
}



// Drop-in content box- By Dynamic Drive
// For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
// This credit MUST stay intact for use

var ie=document.all
var dom=document.getElementById
var ns4=document.layers
var calunits=document.layers? "" : "px"
var odshora = 25

var bouncelimit=32 //(must be divisible by 8)
var direction="up"

function initbox(){
grayOut(true,{'opacity':'75'})
if (!dom&&!ie&&!ns4)
return
crossobj=(dom)?document.getElementById("dropin").style : ie? document.all.dropin : document.dropin
scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
crossobj.top=scroll_top-250+calunits
crossobj.visibility=(dom||ie)? "visible" : "show"
dropstart=setInterval("dropin()",50)
}

function dropin(){
scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
if (parseInt(crossobj.top)<odshora+scroll_top)
crossobj.top=parseInt(crossobj.top)+40+calunits
else{
clearInterval(dropstart)
bouncestart=setInterval("bouncein()",50)
}
}

function bouncein(){
crossobj.top=parseInt(crossobj.top)-bouncelimit+calunits
if (bouncelimit<0)
bouncelimit+=8
bouncelimit=bouncelimit*-1
if (bouncelimit==0){
clearInterval(bouncestart)
}
}

function dismissbox(){
grayOut(false)
if (window.bouncestart) clearInterval(bouncestart)
crossobj.visibility="hidden"
}

function truebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}


function get_cookie(Name) {
var search = Name + "="
var returnvalue = ""
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = document.cookie.indexOf(";", offset)
if (end == -1)
end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function dropornot(){
//initbox()
//return true;

if (get_cookie("droppedin")==""){
//window.onload=initbox
initbox();
firePixel();
document.cookie="droppedin=yes";
}
}
