
var youthforum_PicCnt = 6;
var youthforum_foldername = "/fileadmin/slideshow/slides/youthforum/";
var youthforum_StayTime = 5000;
var youthforum_ImgWidth = 560;
var youthforum_ImgHeight = 274;
var youthforum_playing = false;


uagent = window.navigator.userAgent.toLowerCase();
IEB = (uagent.indexOf('msie') != -1) ? true : false;
OPB = (uagent.indexOf('opera') != -1) ? true : false;
CRB = (uagent.indexOf('chrome') != -1) ? true : false;
SFB = (uagent.indexOf('safari') != -1) ? true : false;
var youthforum_IsInitialStart = 0;
var scompat = document.compatMode;
var youthforum_s = null;
var youthforum_cwidth = 0;
var youthforum_cheight = 0;
var youthforum_calc = 0;
var youthforum_tam = 0;
var youthforum_ts = "";
var youthforum_ds = "";
var youthforum_jbtype = 0;
var youthforum_realcurrent = 0;
var youthforum_timeo = null;
var CursorStr = "default";
var youthforum_DescCalcWidth = 0;
var youthforum_DescCalcHeight = 0;
var youthforum_DescCalcIcWidth = 0;
var youthforum_DescCalcIcHeight = 0;
var youthforum_ShowStopped = false;
youthforum_imgarr = new Array();
youthforum_imgstr = new Array();
youthforum_linkstr = new Array();
youthforum_clslinkstr = new Array();
youthforum_titarr = new Array();
youthforum_desarr = new Array();

for (var pidx = 0; pidx < youthforum_PicCnt; pidx++) {
    youthforum_imgarr[pidx] = new Image();
    youthforum_imgarr[pidx].c = 0;
    youthforum_imgarr[pidx].onload = youthforum_secondcomplate;
    youthforum_imgarr[pidx].src = youthforum_foldername + 'image' + pidx + '.jpg';
    youthforum_imgstr[pidx] = youthforum_foldername + 'image' + pidx + '.jpg';
    youthforum_linkstr[pidx] = '';
    youthforum_clslinkstr[pidx] = '';
    youthforum_titarr[pidx] = "";
    youthforum_desarr[pidx] = "";
}

if ((IEB == true) && (scompat == "BackCompat")) {
    youthforum_cwidth = youthforum_ImgWidth;
    youthforum_cheight = youthforum_ImgHeight;
} else {
    youthforum_cwidth = youthforum_ImgWidth - 2 * (0);
    youthforum_cheight = youthforum_ImgHeight - 2 * (0);
}
var youthforum_icwidth = youthforum_ImgWidth - 2 * (0);
var youthforum_icheight = youthforum_ImgHeight - 2 * (0);
youthforum_DescCalcWidth = 260;
youthforum_DescCalcHeight = 80;
if ((IEB == true) && (scompat == "BackCompat")) {
    youthforum_DescCalcIcWidth = youthforum_DescCalcWidth;
    youthforum_DescCalcIcHeight = youthforum_DescCalcHeight;
} else {
    youthforum_DescCalcIcWidth = youthforum_DescCalcWidth - 2 * (2) - 2 * (3);
    youthforum_DescCalcIcHeight = youthforum_DescCalcHeight - 2 * (2) - 2 * (3);
}
document.write('<div style="position:relative;width:' + youthforum_cwidth + 'px;height:' + youthforum_cheight + 'px;overflow:hidden;border-style:' + 'solid' + ';border-width:' + 0 + 'px;border-color:#' + '000000' + ';' + '' + '' + '">');
document.write('<div id="youthforum_dv" style="position:relative;width:' + youthforum_icwidth + 'px;height:' + youthforum_icheight + 'px;overflow:hidden;padding:0px;margin:0px;z-index:1;' + 'FILTER: progid:DXImageTransform.Microsoft.Fade(Overlap=1.00,duration=2,enabled=false);' + '"' + ' onfilterchange=youthforum_FadeBitti()' + '></div>');
for (i = 0; i < youthforum_PicCnt; i++) {

    if (0 == 0) {
        youthforum_ds = youthforum_ds + youthforum_linkstr[i];
        if (youthforum_linkstr[i].length > 2) {
            CursorStr = "pointer";
        } else {
            CursorStr = "default";
        }
    }

    youthforum_ds = youthforum_ds + '<div id="youthforum_desc' + i + '" style="position:absolute;top:' + 120 + 'px;left:' + 10 + 'px;width:' + youthforum_DescCalcWidth + 'px;height:' + youthforum_DescCalcHeight + 'px;visibility:hidden;overflow:hidden;cursor:' + CursorStr + ';z-index:20;">';
    youthforum_ds = youthforum_ds + '<div style="position:absolute;left:0px;top:0px;width:' + youthforum_DescCalcWidth + 'px;height:' + youthforum_DescCalcHeight + 'px;border-style:solid;border-width:0px;border-color:#000000;background-color:#' + '000000' + ';opacity: ' + '0.50' + ';filter:alpha(opacity=' + '50' + ');-moz-opacity:' + '0.50' + ';"></div>';
    youthforum_ds = youthforum_ds + '<div style="position:relative;left:0px;top:0px;width:' + youthforum_DescCalcIcWidth + 'px;height:' + youthforum_DescCalcIcHeight + 'px;overflow:hidden;padding:' + 3 + 'px;text-align:' + 'left' + ';border-style:' + 'solid' + ';border-width:' + 2 + 'px;border-color:#' + '990000' + ';color:#' + 'FFFFFF' + ';font-family:' + 'arial' + ';font-style:' + 'normal' + ';font-size: ' + '13px' + ';font-weight:' + 'normal' + ';text-decoration:' + 'none' + ';opacity: 1.0;filter:alpha(opacity=100);-moz-opacity:1.0;">';
    youthforum_ds = youthforum_ds + '<span style="color:#' + 'FECE3F' + ';font-family:' + 'arial' + ';font-style:' + 'normal' + ';font-size: ' + '14px' + ';font-weight:' + 'bold' + ';text-decoration:' + 'none' + ';">' + youthforum_titarr[i] + '</span><br />' + youthforum_desarr[i];
    youthforum_ds = youthforum_ds + '</div>';
    youthforum_ds = youthforum_ds + '</div>';

    if (0 == 0) {
        youthforum_ds = youthforum_ds + youthforum_clslinkstr[i];
    }

}
document.write('' + youthforum_ds);

document.write('</div>');

function youthforum_Sonraki() {
    youthforum_vcurr = youthforum_vnext;
    youthforum_vnext = youthforum_vnext + 1;
    if (youthforum_vnext >= youthforum_PicCnt) {
        youthforum_vnext = 0;
        youthforum_tam = 1;
    }
    youthforum_objc = document.getElementById('youthforum_d' + youthforum_vcurr);
    youthforum_objn = document.getElementById('youthforum_d' + youthforum_vnext);
}

function youthforum_secondcomplate() {
    this.c = 1;
}

function youthforum_devam(fm, pt) {

    if ((youthforum_imgarr[youthforum_vnext].c == 1) && (youthforum_imgarr[youthforum_vcurr].c == 1)) {
        youthforum_timeo = setTimeout(fm + '()', pt);
    } else {
        youthforum_timeo = null;
        setTimeout('youthforum_devam("' + fm + '")', 500);
    }
    var youthforum_cagain = 1;
    for (i = 0; i < youthforum_PicCnt; i++) {
        if (youthforum_imgarr[i].c == 1) {
        } else {
            youthforum_cagain = 0;
        }
    }
    if (youthforum_cagain == 1) {
        youthforum_tam = 1;
    }
}

function youthforum_sl() {
    youthforum_vcurr = 0;
    youthforum_vnext = 0;
    youthforum_vssdiv = null;
    stepc = 20 * (2);
    youthforum_dif = 0.00;
    youthforum_op = 1.00;
    youthforum_dif = (1.00 / stepc);
    dstr1 = '<div id="';
    dstr2 = '" style="position:absolute;visibility:hidden;' + 'left:0px;top:0px;' + 'padding:0px;margin:0px;overflow:hidden;">';
    dstr23 = '<table cellspacing="0" cellpadding="0" style="position:relative;left:0px;top:0px;padding:0px;margin:0px;"><tr><td style="width:' + youthforum_icwidth + 'px;height:' + youthforum_icheight + 'px;left:0px;top:0px;padding:0px;margin:0px;text-align:' + 'center' + ';vertical-align:' + 'middle' + ';">';
    dstr3 = '<img id="youthforum_img';
    dstr4 = '" src="';
    dstr5 = '"  border="0" style="position:relative;border-style:' + 'solid' + ';border-width:' + '0' + 'px;border-color:' + '#CCCCCC' + ';' + 'width:' + youthforum_icwidth + 'px;height:' + youthforum_icheight + 'px;' + '" alt=""></img>';
    dstr56 = '</td></tr></table>';
    dstr6 = '</div>';
    this.youthforum_dotrans = youthforum_dotrans;
    this.youthforum_initte = youthforum_initte;
    this.youthforum_initte2 = youthforum_initte2;
    this.youthforum_beftrans = youthforum_beftrans;
    this.youthforum_dotransff = youthforum_dotransff;
    this.RestartSlideshow = youthforum_RestartSlideshow;
    this.initialStart = youthforum_initialStart;
}

function youthforum_FadeBitti() {
    youthforum_jbtype = 0;
}

function youthforum_WaitForNextStepIE() {
    youthforum_ShowStopped = false;
    youthforum_Sonraki();
    if (youthforum_tam == 0) {
        youthforum_devam("youthforum_dotrans", ((1000 * 2) + youthforum_StayTime));
        youthforum_timeo = null;
    } else {
        youthforum_timeo = setTimeout('youthforum_dotrans()', ((1000 * 2) + youthforum_StayTime));
    }
    startProgressInfo(youthforum_StayTime);
}


function youthforum_dotrans() {
    youthforum_jbtype = 1;
    if (IEB == true) {
        youthforum_vssdiv.filters[0].apply();
    }
    youthforum_objc.style.visibility = "hidden";
    youthforum_objn.style.visibility = "visible";
    if (IEB == true) {
        youthforum_vssdiv.filters[0].play();
    }
    youthforum_realcurrent = youthforum_vnext;
    if (youthforum_playing) {
        youthforum_WaitForNextStepIE();
    }
    else
        youthforum_ShowStopped = true;
}

function youthforum_WaitForNextStepFF() {
    youthforum_ShowStopped = false;
    youthforum_objc.style.zIndex = 2;
    youthforum_objn.style.zIndex = 3;
    youthforum_realcurrent = youthforum_vnext;
    youthforum_Sonraki();
    if (youthforum_tam == 0) {
        youthforum_devam("youthforum_beftrans", youthforum_StayTime);
        youthforum_timeo = null;
    } else {
        youthforum_timeo = setTimeout('youthforum_beftrans()', youthforum_StayTime);
    }
    youthforum_jbtype = 0;
    startProgressInfo(youthforum_StayTime);
}


function youthforum_dotransff() {
    youthforum_op = youthforum_op - youthforum_dif;
    if (youthforum_op < (0.00)) {
        youthforum_op = 0.00;
    }
    youthforum_objc.style.opacity = youthforum_op;
    youthforum_objn.style.opacity = 1.00 - youthforum_op;
    if (youthforum_op > (0.00)) {
        setTimeout('youthforum_dotransff()', 50);
    } else {
        if (youthforum_playing) {
            youthforum_WaitForNextStepFF();
        }
        else
            youthforum_ShowStopped = true;
    }
}

function youthforum_beftrans() {
    youthforum_jbtype = 1;
    youthforum_op = 1.00;
    youthforum_objc.style.visibility = "visible";
    youthforum_objn.style.visibility = "visible";
    youthforum_objc.style.zIndex = 3;
    youthforum_objn.style.zIndex = 2;
    youthforum_objc.style.opacity = 1.00;
    youthforum_objn.style.opacity = 1.00;
    youthforum_dotransff();
}


function youthforum_RestartSlideshow() {
    if (IEB)
        youthforum_WaitForNextStepIE();
    else {
        //        if (this.youthforum_vnext > 0)
        //            this.youthforum_vnext = this.youthforum_vnext - 1;
        youthforum_WaitForNextStepFF();
    }

}

function youthforum_initialStart() {
    youthforum_IsInitialStart = 2;
    if (IEB == true) {
        youthforum_Sonraki();
        youthforum_devam("youthforum_dotrans", youthforum_StayTime);
    } else {
        youthforum_Sonraki();
        youthforum_devam("youthforum_beftrans", youthforum_StayTime);
    }
    startProgressInfo(youthforum_StayTime);
}

function youthforum_initte2() {
    youthforum_vssdiv = document.getElementById("youthforum_dv");

    youthforum_objc = document.getElementById('youthforum_d' + 0);
    youthforum_objc.style.visibility = "visible";

    youthforum_vcurr = 0;
    youthforum_vnext = 0;
    youthforum_realcurrent = 0;

    if (youthforum_playing) {
        youthforum_initialStart();
    }
    else
        youthforum_IsInitialStart = 1;
}

function youthforum_initte() {
    i = 0;
    innertxt = "";
    for (i = 0; i < youthforum_PicCnt; i++) {
        innertxt = innertxt + dstr1 + "youthforum_d" + i + dstr2 + dstr23 + youthforum_linkstr[i] + dstr3 + i + dstr4 + youthforum_imgstr[i] + dstr5 + youthforum_clslinkstr[i] + dstr56 + dstr6;
    }
    spage = document.getElementById('youthforum_dv');
    spage.innerHTML = "" + innertxt;

    setTimeout('youthforum_initte2()', 100);
}

function youthforum_Bas() {

    youthforum_s = new youthforum_sl();
    youthforum_s.youthforum_initte();
}

setTimeout('youthforum_Bas()', 100);

function youthforum_stopSlideshow() {
    youthforum_playing = false;
}

function youthforum_startSlideshow() {
    if (!youthforum_playing) {
        youthforum_playing = true;
        if (youthforum_IsInitialStart == 1) {
            if (youthforum_s.initialStart != undefined)
                youthforum_s.initialStart();
            else
                alert("nixx da");
        }
        else if (youthforum_ShowStopped) {
            youthforum_s.RestartSlideshow();
        }
    }
}


     
