// JavaScript Document

function fix_full_size(){
  if(Prototype.Browser.IE && parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5))==6){
    elements = $$('.full_width');
    for(i=0;i<elements.length;i++){
      elements[i].parentNode.style.width = myGetDimensions(elements[i].parentNode).width;
      elements[i].parentNode.style.display = 'block';
      elements[i].style.width = '100%'
    }
  }
}

function myGetDimensions(element) {
  var display = element.style.display;
  if (display != 'none' && display != null){ // Safari bug
    els = element.style
    w = element.offsetWidth-els.borderRightWidth-els.borderLeftWidth-els.paddingLeft-els.paddingRight;
    return {width: w, height: element.offsetHeight};
  }
  var els = element.style;
  var originalVisibility = els.visibility;
  var originalPosition = els.position;
  var originalDisplay = els.display;
  els.visibility = 'hidden';
  if (originalPosition != 'fixed') // Switching fixed to absolute causes issues in Safari
    els.position = 'absolute';
  els.display = 'block';
  var originalWidth = element.clientWidth;
  var originalHeight = element.clientHeight;
  els.display = originalDisplay;
  els.position = originalPosition;
  els.visibility = originalVisibility;
  return {width: originalWidth, height: originalHeight};
}

function submitForm(obj){
  if(obj.tagName=='form' || obj.tagName=='FORM')
    obj.submit();
  else
    submitForm(obj.parentNode)
}

function questions(t){
  a = window.confirm(t);
  if(a)
    return true;
  else
    return false;
}

Event.observe(window, 'load', function(){fix_full_size()});



Head = {

  items: new Array(
    'Striptýz od profesionál\u016f',
    'Models & show agency',
    'Dámský striptýz',
    'Pánský striptýz',
    'Lesbi show',
    'Autoerotika',
    'Tanečnice',
    'Modeling',
    'Hostesky'
  ),

  width: new Array(
    409,
    423,
    418
  ),

  pocet: 9,

  actual: 0,

  init: function(){
    for(i=0;i<this.items.length;i++){
      d = Builder.node('div', {id:'headNadpis_'+i, className: 'headNadpis'}, [this.items[i]]);
      $('head').appendChild(d);

      $('headNadpis_'+i).show();
      $('headNadpis_'+i).hide();
    }

    this.pocet = this.items.length;

    c = Cookie.get('head');
    if(c != false){
      this.actual = c;
    }

    $('headNadpis_'+this.actual).show();
    this.next();
  },

  next: function(){

    next = this.actual*1 +1;
    if(next >= this.pocet){
      next = 0;
    }

    Effect.Fade('headNadpis_'+this.actual, { duration: 3.0 });
    Effect.Appear('headNadpis_'+next, { duration: 3.0 });

    this.actual = next;

    Cookie.set('head', next);

    window.setTimeout("Head.next()", 5000);
    
  }
  
}
Event.observe(window, 'load', function(){Head.init()});







PhotoChanger = {

  actual: 1,
  max: 28,

  init: function(){
    a = Cookie.get('PhotoChangerActual');
    if(a){
      this.actual = a;
    }
    window.setTimeout("PhotoChanger.next()", 8000);
    
  },
  
  next: function(){

    //odebrat jestli jsou 2 obrázky tak ten první
    a = $('photoChanger').childElements();
    if(a.length == 2){
      $('photoChanger').removeChild(a[0]);
    }
    
    a = $('photoChanger').childElements();
    ac = a[0];


    this.actual++;
    if(this.actual == 3 || this.actual == 9 || this.actual == 13 || this.actual ==  21 || this.actual ==  27 || this.actual ==  28){
      this.actual++;
    }

    if(this.actual > this.max){
      this.actual = 1;
    }
    
    
    if(this.actual < 10){
      s = '/img/anim/00'+this.actual+'.jpg';
    } else {
      s = '/img/anim/0'+this.actual+'.jpg';
    }
  
    //pridat obrázek
    img = Builder.node('img', { src: s });
    $('photoChanger').appendChild(img);
    a = $('photoChanger').childElements();
    ac1 = a[1];
    ac1.hide();
    
    Effect.Fade(ac, { duration: 5.0 });
    Effect.Appear(ac1, { duration: 5.0 });
  
  

  
  
  
  
  
    Cookie.set('PhotoChangerActual', this.actual);
    window.setTimeout("PhotoChanger.next()", 8000);
  }
  
  

}
Event.observe(window, 'load', function(){PhotoChanger.init()});













