$(function(){
    $("#navStatistik").click(function(){$(".unvisible").css("display","none");$("#uStatistik").css("display","block");});
    $("#navVerbaende").click(function(){$(".unvisible").css("display","none");$("#uVerbaende").css("display","block");});
    $("#navTurniere").click(function(){$(".unvisible").css("display","none");$("#uTurniere").css("display","block");});

    Init_Link("");
    Init_Vorschau("");
    
    var d=new Date();
    var Year = d.getFullYear();
    Year = Year + 2;
	$("#MonatVon").datepicker();
	$("#MonatBis").datepicker();


});

function Init_Vorschau(site){
    $(".openVorschau").click(function(){
        //window.open(site+"./sites/vorschau.php?ID=" + $(this).attr("VVID"),"","toolbar=no,locationbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=yes,width=970,height=800");
        document.location.href = "index.php?tlm=vorschau&ID=" + $(this).attr("VVID") 
    });   
    $(".openStatistik").click(function(){
        window.open(site+"./sites/spielinfo.php?ID=" + $(this).attr("VVID"),"","toolbar=no,locationbar=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width=970,height=820");  
        //document.location.href = "index.php?tlm=verbandinfo&ID=" + $(this).attr("VVID") 
    });   
}

function Init_Link(site){
    $(".openLink").click(function(){
        //window.open(site+"sites/verbandinfo/verbandinfo.php?ID=" + $(this).attr("VVID"),"","toolbar=no,locationbar=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width=860,height=800");  
        document.location.href = "index.php?tlm=verbandinfo&ID=" + $(this).attr("VVID") 
    }).hover(
      function () {
        $(this).css("background-color","silver");
      },
      function () {
        $(this).css("background-color","");
      }
    ).mouseover(
      function (e) {
        if((document.body.clientHeight/2)<e.screenY)
        {
            var TOP = e.pageY - 270;
        } else {
            var TOP = e.pageY;   
        }
        
        if((document.body.clientWidth/2)<e.screenX)
        {
            var LEFT = e.pageX - 600-10;   
        } else {
            var LEFT = e.pageX+10;
        }
            
        $("#tooltip").css({
            "position" : "absolute",
			"top":  TOP + "px",
			"left":  LEFT  + "px"
            });
        $("#tooltip").load(site+"tooltip/tooltip.php",{id:$(this).attr("VVID")}).show();
        
      }).mouseout(
      function () {
        $("#tooltip").hide();
      }
    );     
}

function create_row(varText,varStyle,varClass,varCustom){
    return "<td class='" + varClass + "' style='" + varStyle + "'" + varCustom + ">" + varText + "</td>";
}

$(window).load(function(){
    //$(".news_header").corner("top 5px")
    //$(".news_weiter").corner("bl 5px");
    //$(".news_comment").corner("br 5px");
    //$("#aenderungUeber").corner("top 5px");
    //$(".comment_header").corner("top 5px");
})
