


var base_url = 'http://www.flotte.de/';

var d = document;
var topdoc = top.document;
var act_slide = 1;
var timer = null;


var scroll_timer_call   = 20;
var scroll_xpos_now    = 0;
var scroll_xpos_target = 0;
var scroll_step_by     = 1212;

var scroll_dir             = '';
var scroll_pics_timer_call = 40;
var scroll_pics_step       = 16;
var scroll_pics_limit      = 0;


 var ns6 = (!document.all && document.getElementById); 
 var ie4 = (document.all);
 var ns4 = (document.layers);
 var ie6 = (document.documentElement);









function getElement(i)
{ 
 var ob = d.all?d.all[i]:d.layers?d.layers[i]:d.getElementById(i); 
 return ob; 
} 








function getTopElement(i)
{ 
 var ob = topdoc.all?topdoc.all[i]:topdoc.layers?topdoc.layers[i]:topdoc.getElementById(i); 
 return ob; 
} 








function divMng(id, param)
{ 
 var ob = getElement(id); 
 
 if (last_act!='' && id!=last_act)
   {
    obpop = getElement(last_act);
    obpop.style.display = 'none'; 
    obpop.clpsd = 0; 
   }
 
 if (ob.clpsd && param=='-') 
   { 
    ob.style.display = 'none'; 
    ob.clpsd = 0; 
   }
 else 
   if (!ob.clpsd && param=='+')
     { 
      getElement(id+'').style.display='none'; 
      getElement(id+'').clpsd = 0; 
      ob.style.display = 'block'; 
      ob.clpsd = 1; 
     } 
 
 
 last_act = id;
} 








function magArtPicShow(newdiv)
{
 if (last_active_picdiv!='') getElement(last_active_picdiv).style.display = 'none';
 
 getElement(newdiv).style.display = 'block';
 
 last_active_picdiv = newdiv;
}








function slideNews(sl)
{
 xpos = 0 - (act_slide * 606) + 606;
 
 if (sl=="+") act_slide ++;
 if (sl=="-") act_slide --;
 
 //if (act_slide>3 || act_slide<1) scroll_step_by = 50;
 //else                            scroll_step_by = 20;
 
 if (act_slide>3) act_slide = 1;
 if (act_slide<1) act_slide = 3;
 
 scroll_xpos_target = 0 - (act_slide * 606) + 606;
}







function autoSlide()
{
 //alert(scroll_xpos_now+' '+scroll_xpos_target);
 
 pre_xpos_now = scroll_xpos_now;
 
 if (scroll_xpos_now < scroll_xpos_target)
   {
    scroll_xpos_now = scroll_xpos_now + scroll_step_by;
    
    if (scroll_xpos_now > scroll_xpos_target) scroll_xpos_now = scroll_xpos_target;
   }
 
 else
   if (scroll_xpos_now > scroll_xpos_target)
     {
      scroll_xpos_now = scroll_xpos_now - scroll_step_by;
      
      if (scroll_xpos_now < scroll_xpos_target) scroll_xpos_now = scroll_xpos_target;
     }
 
 if (pre_xpos_now != scroll_xpos_now) getElement('newslide').style.left = scroll_xpos_now;


 clearTimeout(timer);
 timer = setTimeout("autoSlide()", scroll_timer_call);
}








function replacePictBig(n)
{
 getElement('pictbig').src = n;
}








function scrollPics()
{
 pre_xpos_now = scroll_xpos_now;
 
 if (scroll_dir=='right')
   {
    scroll_xpos_now = scroll_xpos_now - scroll_pics_step;
    
    if (scroll_xpos_now<scroll_pics_limit) scroll_xpos_now = scroll_pics_limit;
   }
 
 if (scroll_dir=='left')
   {
    scroll_xpos_now = scroll_xpos_now + scroll_pics_step;
    
    if (scroll_xpos_now>0) scroll_xpos_now = 0;
   }
 
 
 if (pre_xpos_now != scroll_xpos_now) getElement('magpicslist').style.left = scroll_xpos_now;
 
 
 
 clearTimeout(timer);
 timer = setTimeout("scrollPics()", scroll_pics_timer_call);
}






function scrollPicsRun(dir)
{
 scroll_dir = dir;
}







function scrollPicsStop()
{
 scroll_dir = '';
}







function init()
{ 
} 








function changeDIVcontent(div_id, content, doc)
{ 
 if (doc=='') doc=document;
 
 if(doc.layers)
 with(doc.layers[div_id+""].document)
  {
   write(content);
   close();
  }
 else
  {
   if(doc.getElementById)
    doc.getElementById(div_id+"").innerHTML=content;
   
   else
    if(doc.all)
     doc.all[div_id+""].innerHTML=content;
  }
}








function companiesUpdatePage(path)
{
 frames["fgc"].location.href=base_url+'companies_dynamic.php?path='+path+'&dt='+getDateTime();
 
 
 return false;
}





function getDateTime()
{
 dt=new Date();
 
 
 return dt.getDate()+''+dt.getMonth()+''+dt.getFullYear()+''+dt.getHours()+''+dt.getMinutes()+''+dt.getSeconds();
}  





function activateFAP(width, height)
{
 getElement('flplfa').style.left = 210;
 getElement('flplfa').style.top  = 360;
 getElement('flplfa').style.display  = 'block';
}





function deActivateFAP()
{
 getElement('flplfa').style.display  = 'none';
}





function ShowPI()
{
 var czas  = new Date();
 
 width = 393;
 height = 270;
 
 url = '/popup.html';
 
 rok   = czas.getYear();
 mies  = ( ( czas.getMonth() < 10 ) ? "0": "" ) + ( czas.getMonth() + 1 );
 dzien = ( ( czas.getDate()  < 10 ) ? "0": "" ) + ( czas.getDate() );
 godz  = ( ( czas.getHours() < 10 ) ? "0": "" ) + ( czas.getHours() );
 min   = ( ( czas.getMinutes() < 10 ) ? "0": "" ) + ( czas.getMinutes() );
 sek   = ( ( czas.getSeconds() < 10 ) ? "0": "" ) + ( czas.getSeconds() );

 aktdata=dzien+"_"+mies+"_"+rok+"_"+godz+"_"+min+"_"+sek;

 maxszer=window.screen.width;
 maxwys=window.screen.height;
 polx=Math.round( (maxszer-width)/2);
 poly=Math.round( (maxwys-height)/2);
 
 window.open(url,aktdata,"toolbar=no,scrollbars=auto,directories=no,top="+poly+",left="+polx+",menubar=no,width="+ width +",height="+ height +",resizable=no, statusbar=no");

}





function cmpShHiDi(dn)
{
 if (getElement('mg'+dn).src!=(base_url+'gfx/over.gif'))
   {
    getElement(dn).style.display = 'block';
    getElement('mg'+dn).src=base_url+'gfx/over.gif';
   }
 else
   {
    getElement(dn).style.display = 'none';
    getElement('mg'+dn).src=base_url+'gfx/off.gif';
   }
}





function arrPSomov(dn)
{
 if (getElement('mg'+dn).src==base_url+'gfx/off.gif') getElement('mg'+dn).src=base_url+'gfx/on.gif'
}





function arrPSomou(dn)
{
 if (getElement('mg'+dn).src==base_url+'gfx/on.gif') getElement('mg'+dn).src=base_url+'gfx/off.gif'
}





function setSendToParams(link, hash)
{
 df = document.forms.fose2fr;
 
 df.referred_url.value = link;
 df.hash.value = hash;
 
 showSendToWindow();
}





function closeSendToWindow()
{
 getElement('ds2fbg').style.display = 'none';
 getElement('ds2f').style.display = 'none';
}





function showSendToWindow()
{
 docH=self.document.body.scrollHeight;
 docW=self.document.body.scrollWidth;
 
 var obbg = getElement('ds2fbg'); 
 
 obbg.style.display = 'block';
 
 obbg.style.width = docW;
 obbg.style.height = docH;
 
 
 
 var ob = getElement('ds2f'); 
 
 ob.style.display = 'block';

 if (ns4) 
   { 
    winTop    = window.pageYOffset;
	winHeight = innerHeight;
   } 
 else if(ns6) 
   {
    winTop    = scrollY;
	winHeight = innerHeight;
   } 
 else if(ie4) 
   { 
    winTop	  = document.body.scrollTop; 
	winHeight = document.body.clientHeight;
   } 



 
 newDivTop = Math.round((winHeight-240)/2);
 
 
 if (ns4)     ob.top = newDivTop; 
 else if(ns6) ob.style.top = newDivTop; 
 else if(ie4) ob.style.pixelTop = newDivTop;
}








function compareCarAdd(brand_id, model_id, version_id)
{
 frames["ifrccmp"].location.href=base_url+'cars_compare.php?brand_id='+brand_id+'&model_id='+model_id+'&version_id='+version_id+'&action=add&dt='+getDateTime();
}








function compareCarDel(compare_id)
{
 frames["ifrccmp"].location.href=base_url+'cars_compare.php?compare_id='+compare_id+'&action=del&dt='+getDateTime();
}







function compareCarsDisplay()
{
 var obbnr = getElement('bnrright'); 
 
 obbnr.style.display = 'none';
 
 
 
 docH=self.document.body.scrollHeight;
 docW=self.document.body.scrollWidth;
 
 var obbg = getElement('dccmpbg'); 
 
 obbg.style.display = 'block';
 
 obbg.style.width = docW;
 obbg.style.height = docH;
 
 
 
 var ob = getElement('dccmp'); 
 
 ob.style.display = 'block';

 if (ns4) 
   { 
    newDivTop = window.pageYOffset;
	winHeight = innerHeight;
   } 
 else if(ns6) 
   {
    newDivTop = scrollY;
	winHeight = innerHeight;
   } 
 else if(ie4) 
   { 
    newDivTop = document.body.scrollTop; 
	winHeight = document.body.clientHeight;
   } 


 
 
 if (ns4)     ob.top = newDivTop; 
 else if(ns6) ob.style.top = newDivTop; 
 else if(ie4) ob.style.pixelTop = newDivTop;
 
 
 
 frames["ifrccmp"].location.href=base_url+'cars_compare.php?action=display&dt='+getDateTime();
}







function compareCarsClose()
{
 var obbg = getElement('dccmpbg'); 
 
 obbg.style.display = 'none';



 var ob = getElement('dccmp'); 
 
 ob.style.display = 'none';



 var obbnr = getElement('bnrright'); 
 
 obbnr.style.display = 'block';
}






