/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


al_vars = {};  
             
al_vars.vtid = 1;
al_vars.vtcid = 1;

$(function() {
    $('.aTrainingListTitle').each(function() {
	$(this).hover(function() {
	    $(this).stop().animate({
		opacity: 0.65
	    }, 100);
	},
	function() {
	    $(this).stop().animate({
		opacity: 1.0
	    }, 100);
	});
    });
});

$(function() {
    $("#ulTopMenu a")
    .mouseover(function() { 
	var classId = "#" + $(this).attr("class");
	$(classId).css("visibility", "visible");
    })
    .mouseout(function() {
	var classId = "#" + $(this).attr("class");
	$(classId).css("visibility", "hidden");
    });
});

$(function() {
    $(".aBlockPurple8").mouseover(function () {
	$(this).parent().addClass("ulBlockOrange8");
    });
    $(".aBlockPurple8").mouseleave(function () {
	$(this).parent().removeClass("ulBlockOrange8");
    });
});

$(function() {
    $(".aBlockPurple9").mouseover(function () {
	$(this).parent().addClass("ulBlockOrange9");
    });
    $(".aBlockPurple9").mouseleave(function () {
	$(this).parent().removeClass("ulBlockOrange9");
    });
});

$(function() {
    $(".aChapterActive").click(function(event) {
	event.preventDefault();
	$('#divChapterListAddOn').fadeOut('slow');
	$('#divChapterListAll').toggle('slow');
    });
});
$(function() {
    $(".aChapterActive2").click(function(event) {
	event.preventDefault();
	$('#divChapterListAll').fadeOut('slow');
	$('#divChapterListAddOn').toggle('slow');
    });
});

$(document).ready(function() {
    $('table.tableEvenOdd tbody tr:odd').addClass('trOdd');
    $('table.tableEvenOdd tbody tr:even').addClass('trEven');
});


function embedSWF(idName, videoWidth, videoHeight, videoFolderName, videoFileName, videoId, videoChapter) {
    
    var queryString = "";
    var queryStringNext = "";
    var queryStringPrev = "";

    if (videoWidth == ""){
	videoWidth = "960";
    }

    if (videoHeight == ""){
	videoHeight = "600";
    }

    if (idName == ""){
	idName = "mediaspace";
    }

    if (videoFileName == ""){
	return false;
    }

    try{
	$.jwbox.mediaspace.sendEvent("STOP");
	$.jwbox.mediaspace = null;
    }catch(err){}

    /*
	    if (videoId > 0){
		queryString = "?vtid=" + videoId;
		if (videoChapter > 1){
		    if (videoChapter == 1){
		       queryStringPrev =  queryString + "?vtcid=" + (videoChapter);
		    }else{
		       queryStringPrev =  queryString + "?vtcid=" + (videoChapter - 1);
		    }
		    queryStringNext =  queryString + "&vtcid=" + (videoChapter + 1);
		}
		var jqxhrPrev = $.getJSON("/jsonVideo" + queryStringPrev, function() {
		    alert("successPrev");
		});

		var jqxhrNext = $.getJSON("/jsonVideo" + queryStringNext, function() {
		    alert("successNext");
		});
	    }
	 */
    var so = new SWFObject('/public/flash/jwplayer.swf','myPlayer',videoWidth,videoHeight,'9','#000000');
    so.addParam('allowfullscreen','true');
    so.addParam('allowscriptaccess','always');
    so.addParam('wmode','opaque');
    so.addVariable('autostart','true');
    so.addVariable('file',videoWidth + "/" + videoFileName);
    so.addVariable('streamer','rtmp://stream.cycot.de/' + videoFolderName);
    so.addVariable('controlbar', 'over');
    //	so.addVariable('skin','/de/home.nsf/skins/carbon/carbon.zip');
    so.write(idName);
    $.jwbox.toggle();
}



$(function() {
    $(".divTrainingListDesc").hover(function(){
	// $(this).css("background-color", "red");
	if ( $('.jSpanHidden', this).length){
	    $(this).next('.jSpanDisplay').fadeOut(100);
	    $(this).parent().
	    find('.divTrainingListData').fadeOut(100);
	    $("span", this).toggle('slow');
	}
    }, function(){
	if ( $('.jSpanHidden', this).length){
	    $(this).next('.jSpanDisplay').fadeIn("show");
	    $(this).parent().
	    find('.divTrainingListData').fadeIn("slow");
	    $("span", this).toggle('slow');
	}
    });
});

function displayAd(){

}

function show(){

    if (screen.availWidth >= 1180){
        
	if (screen.availHeight >= 625){
	    return true;
	}
    }
    
    return false;
}

function showBanner(){
    
}





