
var gmp_PicCnt = 14;
var gmp_foldername = "/fileadmin/slideshow/slides/gmp/";
var gmp_StayTime = 5000;
var gmp_playing = false;

var gmp_ImgWidth = 580;
var gmp_ImgHeight = 274;


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 gmp_IsInitialStart = 0;
var scompat = document.compatMode;
var gmp_s = null;
var gmp_cwidth = 0;
var gmp_cheight = 0;
var gmp_calc = 0;
var gmp_tam = 0;
var gmp_ts = "";
var gmp_ds = "";
var gmp_jbtype = 0;
var gmp_realcurrent = 0;
var gmp_timeo = null;
var CursorStr = "default";
var gmp_DescCalcWidth = 0;
var gmp_DescCalcHeight = 0;
var gmp_DescCalcIcWidth = 0;
var gmp_DescCalcIcHeight = 0;
var gmp_ShowStopped = false;
gmp_imgarr = new Array();
gmp_imgstr = new Array();
gmp_linkstr = new Array();
gmp_clslinkstr = new Array();
gmp_titarr = new Array();
gmp_desarr = new Array();

for (var pidx = 0; pidx < gmp_PicCnt; pidx++) {
    gmp_imgarr[pidx] = new Image();
    gmp_imgarr[pidx].c = 0;
    gmp_imgarr[pidx].onload = gmp_secondcomplate;
    gmp_imgarr[pidx].src = gmp_foldername + 'image' + pidx + '.jpg';
    gmp_imgstr[pidx] = gmp_foldername + 'image' + pidx + '.jpg';
    gmp_linkstr[pidx] = '';
    gmp_clslinkstr[pidx] = '';
    gmp_titarr[pidx] = "";
    gmp_desarr[pidx] = "";
}

if ((IEB == true) && (scompat == "BackCompat")) {
    gmp_cwidth = gmp_ImgWidth;
    gmp_cheight = gmp_ImgHeight;
} else {
    gmp_cwidth = gmp_ImgWidth - 2 * (0);
    gmp_cheight = gmp_ImgHeight - 2 * (0);
}
var gmp_icwidth = gmp_ImgWidth - 2 * (0);
var gmp_icheight = gmp_ImgHeight - 2 * (0);
gmp_DescCalcWidth = 260;
gmp_DescCalcHeight = 80;
if ((IEB == true) && (scompat == "BackCompat")) {
    gmp_DescCalcIcWidth = gmp_DescCalcWidth;
    gmp_DescCalcIcHeight = gmp_DescCalcHeight;
} else {
    gmp_DescCalcIcWidth = gmp_DescCalcWidth - 2 * (2) - 2 * (3);
    gmp_DescCalcIcHeight = gmp_DescCalcHeight - 2 * (2) - 2 * (3);
}
document.write('<div style="position:relative;width:' + gmp_cwidth + 'px;height:' + gmp_cheight + 'px;overflow:hidden;border-style:' + 'solid' + ';border-width:' + 0 + 'px;border-color:#' + '000000' + ';' + '' + '' + '">');
document.write('<div id="gmp_dv" style="position:relative;width:' + gmp_icwidth + 'px;height:' + gmp_icheight + 'px;overflow:hidden;padding:0px;margin:0px;z-index:1;' + 'FILTER: progid:DXImageTransform.Microsoft.Fade(Overlap=1.00,duration=2,enabled=false);' + '"' + ' onfilterchange=gmp_FadeBitti()' + '></div>');
for (i = 0; i < gmp_PicCnt; i++) {

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

    gmp_ds = gmp_ds + '<div id="gmp_desc' + i + '" style="position:absolute;top:' + 120 + 'px;left:' + 10 + 'px;width:' + gmp_DescCalcWidth + 'px;height:' + gmp_DescCalcHeight + 'px;visibility:hidden;overflow:hidden;cursor:' + CursorStr + ';z-index:20;">';
    gmp_ds = gmp_ds + '<div style="position:absolute;left:0px;top:0px;width:' + gmp_DescCalcWidth + 'px;height:' + gmp_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>';
    gmp_ds = gmp_ds + '<div style="position:relative;left:0px;top:0px;width:' + gmp_DescCalcIcWidth + 'px;height:' + gmp_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;">';
    gmp_ds = gmp_ds + '<span style="color:#' + 'FECE3F' + ';font-family:' + 'arial' + ';font-style:' + 'normal' + ';font-size: ' + '14px' + ';font-weight:' + 'bold' + ';text-decoration:' + 'none' + ';">' + gmp_titarr[i] + '</span><br />' + gmp_desarr[i];
    gmp_ds = gmp_ds + '</div>';
    gmp_ds = gmp_ds + '</div>';

    if (0 == 0) {
        gmp_ds = gmp_ds + gmp_clslinkstr[i];
    }

}
document.write('' + gmp_ds);

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

function gmp_Sonraki() {
    gmp_vcurr = gmp_vnext;
    gmp_vnext = gmp_vnext + 1;
    if (gmp_vnext >= gmp_PicCnt) {
        gmp_vnext = 0;
        gmp_tam = 1;
    }
    gmp_objc = document.getElementById('gmp_d' + gmp_vcurr);
    gmp_objn = document.getElementById('gmp_d' + gmp_vnext);
}

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

function gmp_devam(fm, pt) {

    if ((gmp_imgarr[gmp_vnext].c == 1) && (gmp_imgarr[gmp_vcurr].c == 1)) {
        gmp_timeo = setTimeout(fm + '()', pt);
    } else {
        gmp_timeo = null;
        setTimeout('gmp_devam("' + fm + '")', 500);
    }
    var gmp_cagain = 1;
    for (i = 0; i < gmp_PicCnt; i++) {
        if (gmp_imgarr[i].c == 1) {
        } else {
            gmp_cagain = 0;
        }
    }
    if (gmp_cagain == 1) {
        gmp_tam = 1;
    }
}

function gmp_sl() {
    gmp_vcurr = 0;
    gmp_vnext = 0;
    gmp_vssdiv = null;
    stepc = 20 * (2);
    gmp_dif = 0.00;
    gmp_op = 1.00;
    gmp_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:' + gmp_icwidth + 'px;height:' + gmp_icheight + 'px;left:0px;top:0px;padding:0px;margin:0px;text-align:' + 'center' + ';vertical-align:' + 'middle' + ';">';
    dstr3 = '<img id="gmp_img';
    dstr4 = '" src="';
    dstr5 = '"  border="0" style="position:relative;border-style:' + 'solid' + ';border-width:' + '0' + 'px;border-color:' + '#CCCCCC' + ';' + 'width:' + gmp_icwidth + 'px;height:' + gmp_icheight + 'px;' + '" alt=""></img>';
    dstr56 = '</td></tr></table>';
    dstr6 = '</div>';
    this.gmp_dotrans = gmp_dotrans;
    this.gmp_initte = gmp_initte;
    this.gmp_initte2 = gmp_initte2;
    this.gmp_beftrans = gmp_beftrans;
    this.gmp_dotransff = gmp_dotransff;
    this.RestartSlideshow = gmp_RestartSlideshow;
    this.initialStart = gmp_initialStart;
}

function gmp_FadeBitti() {
    gmp_jbtype = 0;
}

function gmp_WaitForNextStepIE() {
    gmp_ShowStopped = false;
    gmp_Sonraki();
    if (gmp_tam == 0) {
        gmp_devam("gmp_dotrans", ((1000 * 2) + gmp_StayTime));
        gmp_timeo = null;
    } else {
        gmp_timeo = setTimeout('gmp_dotrans()', ((1000 * 2) + gmp_StayTime));
    }
    startProgressInfo(gmp_StayTime);
}


function gmp_dotrans() {
    gmp_jbtype = 1;
    if (IEB == true) {
        gmp_vssdiv.filters[0].apply();
    }
    gmp_objc.style.visibility = "hidden";
    gmp_objn.style.visibility = "visible";
    if (IEB == true) {
        gmp_vssdiv.filters[0].play();
    }
    gmp_realcurrent = gmp_vnext;
    if (gmp_playing) {
        gmp_WaitForNextStepIE();
    }
    else
        gmp_ShowStopped = true;
}

function gmp_WaitForNextStepFF() {
    gmp_ShowStopped = false;
    gmp_objc.style.zIndex = 2;
    gmp_objn.style.zIndex = 3;
    gmp_realcurrent = gmp_vnext;
    gmp_Sonraki();
    if (gmp_tam == 0) {
        gmp_devam("gmp_beftrans", gmp_StayTime);
        gmp_timeo = null;
    } else {
        gmp_timeo = setTimeout('gmp_beftrans()', gmp_StayTime);
    }
    gmp_jbtype = 0;
    startProgressInfo(gmp_StayTime);
}


function gmp_dotransff() {
    gmp_op = gmp_op - gmp_dif;
    if (gmp_op < (0.00)) {
        gmp_op = 0.00;
    }
    gmp_objc.style.opacity = gmp_op;
    gmp_objn.style.opacity = 1.00 - gmp_op;
    if (gmp_op > (0.00)) {
        setTimeout('gmp_dotransff()', 50);
    } else {
        if (gmp_playing) {
            gmp_WaitForNextStepFF();
        }
        else
            gmp_ShowStopped = true;
    }
}

function gmp_beftrans() {
    gmp_jbtype = 1;
    gmp_op = 1.00;
    gmp_objc.style.visibility = "visible";
    gmp_objn.style.visibility = "visible";
    gmp_objc.style.zIndex = 3;
    gmp_objn.style.zIndex = 2;
    gmp_objc.style.opacity = 1.00;
    gmp_objn.style.opacity = 1.00;
    gmp_dotransff();
}


function gmp_RestartSlideshow() {
    if (IEB)
        gmp_WaitForNextStepIE();
    else {
        //        if (this.gmp_vnext > 0)
        //            this.gmp_vnext = this.gmp_vnext - 1;
        gmp_WaitForNextStepFF();
    }

}

function gmp_initialStart() {
    gmp_IsInitialStart = 2;
    if (IEB == true) {
        gmp_Sonraki();
        gmp_devam("gmp_dotrans", gmp_StayTime);
    } else {
        gmp_Sonraki();
        gmp_devam("gmp_beftrans", gmp_StayTime);
    }
    startProgressInfo(gmp_StayTime);
}

function gmp_initte2() {
    gmp_vssdiv = document.getElementById("gmp_dv");

    gmp_objc = document.getElementById('gmp_d' + 0);
    gmp_objc.style.visibility = "visible";

    gmp_vcurr = 0;
    gmp_vnext = 0;
    gmp_realcurrent = 0;

    if (gmp_playing) {
        gmp_initialStart();
    }
    else
        gmp_IsInitialStart = 1;
}

function gmp_initte() {
    i = 0;
    innertxt = "";
    for (i = 0; i < gmp_PicCnt; i++) {
        innertxt = innertxt + dstr1 + "gmp_d" + i + dstr2 + dstr23 + gmp_linkstr[i] + dstr3 + i + dstr4 + gmp_imgstr[i] + dstr5 + gmp_clslinkstr[i] + dstr56 + dstr6;
    }
    spage = document.getElementById('gmp_dv');
    spage.innerHTML = "" + innertxt;

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

function gmp_Bas() {

    gmp_s = new gmp_sl();
    gmp_s.gmp_initte();
}

setTimeout('gmp_Bas()', 100);

function gmp_stopSlideshow() {
    gmp_playing = false;
}

function gmp_startSlideshow() {
    if (!gmp_playing) {
        gmp_playing = true;
        if (gmp_IsInitialStart == 1) {
            if (gmp_s.initialStart != undefined)
                gmp_s.initialStart();
            else
                alert("nixx da");
        }
        else if (gmp_ShowStopped) {
            gmp_s.RestartSlideshow();
        }
    }
}


     