// JavaScript Document
Bild01 = new Image();
Bild01.src = "v6/grafiken/loader_2.gif";
  
function init(){
  //new Effect.Opacity('video_balken',{duration:0.1, from:1.0, to:0.4});
}

function change_mini_1(rb,num){
  if(num == "a"){
    var div_1 = document.getElementById('part_1');
    var div_2 = document.getElementById('part_2');
    var div_3 = document.getElementById('part_3');
    var div_4 = document.getElementById('part_4'); 
  }
  if(num == "b"){
    var div_1 = document.getElementById('part_5');
    var div_2 = document.getElementById('part_6');
    var div_3 = document.getElementById('part_7');
    var div_4 = document.getElementById('part_8'); 
  }
  if(rb == "routen"){
    div_3.style.display = "block";
    div_4.style.display = "none";
    div_2.style.backgroundColor = "#eeeeee";
    div_1.style.backgroundColor = "#ffffff";
    div_2.style.borderWidth = "0 0 1px 1px";
    div_1.style.borderWidth = "0 0 0 0";
    div_1.style.fontWeight = "bold";
    div_2.style.fontWeight = "normal"; 
  }
  if(rb == "boulder"){
    div_3.style.display = "none";
    div_4.style.display = "block";
    div_1.style.backgroundColor = "#eeeeee";
    div_2.style.backgroundColor = "#ffffff";
    div_2.style.borderWidth = "0 0 0 0";
    div_1.style.borderWidth = "0 1px 1px 0";
    div_2.style.fontWeight = "bold";
    div_1.style.fontWeight = "normal"; 
  }
}

function video(flv,id){
  document.getElementById("medien").style.display = "block";
  
  var flv_ = "video/clip.swf?flv=" + flv;
  var f1 = new SWFObject(flv_, "flash_movie", "340", "280", "8", "#ffffff");
  f1.addParam("quality", "high");
  f1.write("film"); 
  
  $("clips_all").innerHTML = "<div style='margin:2px 2px'><img id='loader_1' src=''></div>";
  $("loader_1").src = Bild01.src;
 
  var opt = "id=" + id;
  var url = 'video/video_daten.php';
  new Ajax.Request(url, {method: 'post', parameters: opt, onComplete: successHandler});
  
  var url = 'video/video_all.php';
  new Ajax.Request(url, {method: 'post', onComplete: successHandler_all});
}

function successHandler(o){
  $("daten").innerHTML = o.responseText;
}

function successHandler_all(o){
  $("clips_all").innerHTML = o.responseText;
}

function close_video(){
  $("film").innerHTML = "";
  $("daten").innerHTML = "";
  $("medien").style.display = "none";
}

function send_flv(flv,id){
  $("flash_movie").sendToFlash_flv(flv);
  $("daten").innerHTML = "<div style='margin:2px 2px'><img id='loader_3' src=''></div>";
  $("loader_3").src = Bild01.src;
  
  var opt = "id=" + id;
  var url = 'video/video_daten.php';
  new Ajax.Request(url, {method: 'post', parameters: opt, onComplete: successHandler});

}

function thisMovie(movieName) {
    if (navigator.appName.indexOf("Microsoft") != -1) {
        return window[movieName]
    }
    else {
        return document[movieName]
    }
}

function set_move_false(){
  move = false;
}

var move = false;
var bottom_intern = 0;

function v_scroll_up(){
  var bottom = parseInt($('v_scroll_bottom_anz').innerHTML);
  var top = parseInt($('v_scroll_top_anz').innerHTML);
  if(top > 0 && !move){
    move = true;
    new Effect.MoveBy('video _thumb_container', 204, 0, {fps:75, duration:0.5, afterFinish:set_move_false});
    $('v_scroll_bottom_anz').innerHTML = bottom + 3 + bottom_intern;
    $('v_scroll_top_anz').innerHTML = top - 3;
    if(bottom_intern != 0){
      bottom_intern = 0;
    }
  }
}

function v_scroll_down(){
  var bottom = parseInt($('v_scroll_bottom_anz').innerHTML);
  var top = parseInt($('v_scroll_top_anz').innerHTML);
  if(bottom > 0 && !move){
    move = true;
    new Effect.MoveBy('video _thumb_container', -204, 0, {fps:75, duration:0.5, afterFinish:set_move_false}); 
    $('v_scroll_top_anz').innerHTML = top + 3;
    if((bottom - 3) <= 0){
      $('v_scroll_bottom_anz').innerHTML = 0;
      bottom_intern = bottom - 3;
    }
    else{
      $('v_scroll_bottom_anz').innerHTML = bottom - 3;
      bottom_intern = 0;
    }
  }
}

function change_arrow_top(obj_id){
 $(obj_id).style.backgroundImage = "url(v6/grafiken/arrow_top.png)";
}

function change_arrow_top_back(obj_id){
 $(obj_id).style.backgroundImage = "url(v6/grafiken/arrow_top_light.png)";
}

function change_arrow_bottom(obj_id){
 $(obj_id).style.backgroundImage = "url(v6/grafiken/arrow_bottom.png)";
}

function change_arrow_bottom_back(obj_id){
 $(obj_id).style.backgroundImage = "url(v6/grafiken/arrow_bottom_light.png)";
}

function change_bg(obj,id){
  obj.style.backgroundColor = "#111111";
  $(id).style.borderColor = "#ffffff";
}

function change_bg_back(obj,id){
  obj.style.backgroundColor = "#666666";
  $(id).style.borderColor = "#000000";
}

function under(id,style_nr){
  if(style_nr == 1){
    $(id).style.textDecoration ="underline";
  }
  if(style_nr == 0){
    $(id).style.textDecoration ="none";
  }
}

function show_img(id){
  var pfad = "fotos/foto_bild.php?id_nr=" + id;
  window.open(pfad, id, 'toolbar=no,scrollbars,resizable,height=700,width=720,left=0,top=0');
  return false;
}

var show_info = false;
function show_info_video(nr){
  if(nr==1 && !show_info){
    Effect.SlideDown('video_info', {fps:75, duration:0.3, beforeStart:setflag, afterFinish:delflag});
  }
  if(nr==0 && !show_info){
    Effect.SlideUp('video_info', {fps:75, duration:0.2, beforeStart:setflag, afterFinish:delflag});
  }
}

function setflag(){
  show_info = true;
}

function delflag(){
  show_info = false;
}

function post(id){
  var pfad = "send_news_form.php?id=" + id;
  window.open(pfad, id, 'toolbar=no,scrollbars,resizable=no,height=420,width=420,left=300,top=100');
  return false;
}

function print_(id){
  var pfad = "news_print.php?id=" + id;
  window.open(pfad, id, 'toolbar=no,scrollbars,resizable,height=600,width=520,left=300,top=50');
  return false;
}

function show_element(id){
  $(id).style.visibility = "visible";
}

function hide_element(id){
  $(id).style.visibility = "hidden";
}

function popup_xy(url, x, y, win_id){
  //var url_complete = "http;//www.kletternimnorden.de/" + url;
  var options = "toolbar=no, scrollbars=no, resizable=no, height=" + y + ", width=" + x + ", left = 50, top = 50";
  javascript:window.open(url, win_id, options);
  return false;
}

function link_over(obj){
  obj.style.textDecoration = "none";
}

function link_out(obj){
  obj.style.textDecoration = "underline";
}