/**
 * text inhalt von region
 */
function moreInfo(){
    
    $(".short").toggle();
    
    return true;
}
//google maps api

/**
 * staedte anzeigen per buchstaben
 */
verlauf =new Array();
function Zeigen(id) {
    idGross = id;
    id = id.toLowerCase();
    verlauf.push(id);
    for(i =0; i<verlauf.length ; i++){
        //$("#"+verlauf[i]).toggle();
        document.getElementById(verlauf[i]).style.display = "none";
        if($("#"+verlauf[i].toUpperCase()).hasClass("selected")){
            $("#"+verlauf[i].toUpperCase()).removeClass("selected");
        }
         //alert("es klappt der buchstabe ist : "+verlauf[i]);
    }
    $("#"+id).toggle();
    $("#" + idGross).addClass("selected");
        
    return true;
}

/**
 * history zurücl
 */
function Zurueck(){
    history.back();
    return true;
}

/**
 * für image-map
 */
function carte(img) {
    //var imgs = substr(start, length)
    img = img.replace(/-/g, "_");
    c = document.getElementById('carte_france');

    src = '/images/gfx/france_'+img+'.gif';
    c.src = src;
  }
  function rcarte() {
    c = document.getElementById('carte_france');
    c.src = './images/gfx/france.gif';
  }

/**
 * dot position
 */
var min_x = -4; //-584
var max_x = 10.5;  //748

var min_y = 41; // -43
var max_y = 51.2; //-84

var mapWidth = 160;
var mapHeight = 154;

function dotPos(x, y) {
  //document.getElementById(text).innerHTML = name;
  cityBox = document.getElementById("cityBox");
  //box= 'dfdf';
  x = ((x - min_x) * (mapWidth / (max_x - min_x))) ;
  y = ((y - max_y) * (mapHeight / (min_y - max_y)));
  cityBox.style.left = x + 'px';
  cityBox.style.top = y-3 + 'px';
  cityBox.style.display='block';
}

//function dotPosUmgebung(x, y, text, name ) {
//  document.getElementById(text).innerHTML = name;
//  citybox = document.getElementById("cityBox");
//  x = (x - min_x) * (mapWidth / (max_x - min_x));
//  y = (y - max_y) * (mapHeight / (min_y - max_y));
//  citybox.style.left = x + 'px';
//  citybox.style.top = y-3 + 'px';
//  citybox.style.display='block';
//}
	      
function CVformatItem(row) {
  return "<strong>" + row[0] + "</strong>";
}

function CVselectItemDe(li) {
  $('#de').val(li.extra);
  dotPos('cityBoxNear', li.extra[2], li.extra[1], 'cityTextNear', li.selectValue);
}

function CVselectItemA(li) {
  $('#a').val(li.extra[0]);
  dotPos('cityBox', li.extra[2], li.extra[1], 'cityText', li.selectValue);
}
//gallerie photos show
$(document).ready(function() {

    $("a.example2").fancybox({
        'titlePosition'		: 'outside',
        'overlayColor'		: '#000',
        'overlayOpacity'	: 0.9
    });
});
