uagent = window.navigator.userAgent.toLowerCase();
IEB = (uagent.indexOf('msie') != -1) ? true : false;
var scompat = document.compatMode;
var cfnewsintcomplate = 0;
var howmany = 7;
cfnewsimgarr = new Array();
cfnewsaltarr = new Array();
cfnewslinkarr = new Array();
cfnewstargetarr = new Array();
cfnewstitarr = new Array();
cfnewsdesarr = new Array();
cfnewsimgarr[0] = "";
cfnewsaltarr[0] = "";
cfnewslinkarr[0] = "";
cfnewstargetarr[0] = "";
cfnewstitarr[0] = "";
cfnewsdesarr[0] = "";
cfnewsimgarr[1] = "galleryimages/6.jpg";
cfnewsaltarr[1] = "Mission With a Means";
cfnewslinkarr[1] = "index.php?page=spotlight/spotlightmissionswithmeans";
cfnewstargetarr[1] = "_self";
cfnewstitarr[1] = "";
cfnewsdesarr[1] = "Missions With Means";
cfnewsimgarr[2] = "galleryimages/1.jpg";
cfnewsaltarr[2] = "Nepali Youth Ministries";
cfnewslinkarr[2] = "index.php?page=spotlight/spotlightnepal";
cfnewstargetarr[2] = "_self";
cfnewstitarr[2] = "";
cfnewsdesarr[2] = "Nepali Youth Ministries";
cfnewsimgarr[3] = "galleryimages/2.jpg";
cfnewsaltarr[3] = "Higher Heights Christian Embassy Inc.";
cfnewslinkarr[3] = "index.php?page=spotlight/spotlight0610";
cfnewstargetarr[3] = "_self";
cfnewstitarr[3] = "";
cfnewsdesarr[3] = "Higher Heights Christian Embassy Inc.";
cfnewsimgarr[4] = "galleryimages/3.jpg";
cfnewsaltarr[4] = "Restoration Vision Center";
cfnewslinkarr[4] = "index.php?page=spotlight/spotlightDecember2010";
cfnewstargetarr[4] = "_self";
cfnewstitarr[4] = "";
cfnewsdesarr[4] = "Restoration Vision Center";
cfnewsimgarr[5] = "galleryimages/4.jpg";
cfnewsaltarr[5] = "International Disciples Training Academy";
cfnewslinkarr[5] = "index.php?page=spotlight/spotlightjeremiahnimelysr";
cfnewstargetarr[5] = "_self";
cfnewstitarr[5] = "";
cfnewsdesarr[5] = "International Disciples Training Academy";
cfnewsimgarr[6] = "galleryimages/5.jpg";
cfnewsaltarr[6] = "Asha Nepal";
cfnewslinkarr[6] = "index.php?page=ministries/ashanepal/ashanepal";
cfnewstargetarr[6] = "_self";
cfnewstitarr[6] = "";
cfnewsdesarr[6] = "Asha Nepal";

cfnewsimgarr[7] = "galleryimages/7.jpg";
cfnewsaltarr[7] = "Christ Lambs Church Liberia";
cfnewslinkarr[7] = "index.php?page=spotlight/spotlightchristlambsliberia";
cfnewstargetarr[7] = "_self";
cfnewstitarr[7] = "";
cfnewsdesarr[7] = "Christ Lambs Church Liberia";

var gnrated = '';
var cfnewsstepcount = 20;
var cfnewscurrstep = 10;
var cfnewstimeo = null;
var cfnewshorvert = 0;
var cfnewsllllll = 0;
var cfnewslllllll = 0;
var cfnewsllllllll = 0;
var cfnewsll = new Array();
var cfnewslll = new Array();
var cfnewsllll = new Array();
var cfnewsstartposx = new Array();
var cfnewslllll = new Array();
var i = 0;
var cfnewslllllllll = 0;
var cfnewsDescCalcLeftBir = 0;
var cfnewsDescCalcLeft = 0;
var cfnewsDescCalcWidth = 0;
var cfnewsDescCalcHeight = 0;
var cfnewsDescCalcIcWidth = 0;
var cfnewsDescCalcIcHeight = 0;
var cfnewshpiece = '';
var cfnewsds = "";
var cfnewsIEDescOpacity = 100;
var cfnewsFFOpacity = 1.0;
var cfnewsDescFadeEffectTimer = null;
var cfnewsAutoPlayTimer = null;
var cfnewsAutoPlayCurrent = 1;
var cfnewsicerdemi = 0;

function cfnewsWriteDesc() {
    if (cfnewslinkarr[i].length > 2) {
        cfnewsds = cfnewsds + '<a href="' + cfnewslinkarr[i] + '" target="' + cfnewstargetarr[i] + '" style="text-decoration:none;">';
    }
    cfnewsds = cfnewsds + '<div id="cfnewsadesc' + i + '" style="position:absolute;top:' + 80 + 'px;left:0px;width:' + cfnewsDescCalcWidth + 'px;height:' + cfnewsDescCalcHeight + 'px;visibility:hidden;overflow:hidden;cursor:pointer;filter:alpha(opacity=100);opacity:1.00;" onMouseOut="cfnewsoutall()">';
    cfnewsds = cfnewsds + '<div style="position:absolute;left:0px;top:0px;width:' + cfnewsDescCalcWidth + 'px;height:' + cfnewsDescCalcHeight + 'px;border-style:solid;border-width:0px;border-color:#000000;background-color:#' + '000000' + ';opacity: ' + 0.50 + ';filter:alpha(opacity=' + 50 + ');" onMouseOut="cfnewsoutall()"></div>';
    cfnewsds = cfnewsds + '<div style="position:relative;left:0px;top:0px;width:' + cfnewsDescCalcIcWidth + ';height:' + cfnewsDescCalcIcHeight + 'px;text-align:' + 'left' + ';overflow:hidden;padding:' + 3 + 'px;border-style:' + 'solid' + ';border-width:' + 0 + 'px;border-color:#' + '366899' + ';color:#' + 'FFFFFF' + ';font-family:' + 'arial' + ';font-style:' + 'normal' + ';font-size: ' + 13 + ';font-weight:' + 'bold' + ';text-decoration:' + 'none' + ';opacity: 1.0;filter:alpha(opacity=100);" onMouseOut="cfnewsoutall()">';
    cfnewsds = cfnewsds + '<span style="color:#' + 'FECE3F' + ';font-family:' + 'arial' + ';font-style:' + 'normal' + ';font-size: ' + 14 + ';font-weight:' + 'bold' + ';text-decoration:' + 'none' + ';" onMouseOut="cfnewsoutall()">' + cfnewstitarr[i] + '</span>';
    if (cfnewstitarr[i].length > 0) {
        cfnewsds = cfnewsds + '<br />';
    }
    cfnewsds = cfnewsds + '' + cfnewsdesarr[i];
    cfnewsds = cfnewsds + '</div>';
    cfnewsds = cfnewsds + '</div>';
    if (cfnewslinkarr[i].length > 2) {
        cfnewsds = cfnewsds + '</a>';
    }
}
function cfnewsinit_doc(fstr, hormuvertmi) {
    cfnewsDescCalcLeftBir = 5;
    if ((0 == 0) && (cfnewshorvert == 0)) {
        cfnewsDescCalcLeft = 5 + 2;
    } else {
        cfnewsDescCalcLeft = 5;
    }
    if (0 == 0) {
        cfnewsDescCalcWidth = 250 - 5 - 5;
    } else {
        cfnewsDescCalcWidth = 560 - 5 - 5;
    }
    if ((cfnewshorvert == 1) && (0 == 1)) {
        cfnewsDescCalcHeight = 190 - 80 - 5;
    } else {
        cfnewsDescCalcHeight = 190 - 80 - 5;
    }
    if ((IEB == true) && (scompat == "BackCompat")) {
        cfnewsDescCalcIcWidth = cfnewsDescCalcWidth;
        cfnewsDescCalcIcHeight = cfnewsDescCalcHeight;
    } else {
        cfnewsDescCalcIcWidth = cfnewsDescCalcWidth - 2 * (2) - 2 * (3);
        cfnewsDescCalcIcHeight = cfnewsDescCalcHeight - 2 * (2) - 2 * (3);
    }
    cfnewsfolderset = fstr;
    var tmpleftpad = 0;
    var tmptoppad = 0;
    cfnewshpiece = cfnewshpiece + '<div style="position:relative;width:' + 560 + 'px;height:' + 190 + 'px;border-style:solid;border-width:' + 0 + 'px;border-color:#' + '666666' + ';">';
    cfnewshpiece = cfnewshpiece + '<div style="position:relative;width:' + 560 + 'px;height:' + 190 + 'px;overflow:hidden;border-style:solid;border-width:0px;border-color:#FFFFFF;cursor:default;" onMouseOver="cfnewsoutall()" onMouseOut="cfnewsmouse_divout()">';
    if (0 == 1) {
        for (i = 1; i <= howmany; i++) {
            cfnewsWriteDesc();
        }
    }
    for (i = 1; i <= howmany; i++) {
        if (cfnewshorvert == 0) {
            if (i == 1) {
                tmpleftpad = 0;
            } else {
                tmpleftpad = 2;
            }
            tmptoppad = 0;
        } else {
            tmpleftpad = 0;
            if (i == 1) {
                tmptoppad = 0;
            } else {
                tmptoppad = 2;
            }
        }
        gnrated = gnrated + '<div id="cfnewspo' + i + '" style="position:absolute;left:0px;top:0px;" onMouseOver="cfnewsmouse_over(' + i + ')" onMouseOut="cfnewsoutall()"><div style="background-color:#FFFFFF;padding-left:' + tmpleftpad + 'px;padding-top:' + tmptoppad + 'px;"><a href="' + cfnewslinkarr[i] + '" target="' + cfnewstargetarr[i] + '"><img width="' + 250 + '" height="' + 190 + '" src="' + cfnewsfolderset + cfnewsimgarr[i] + '" style="border-style:solid;border-width:0px;" TITLE="' + cfnewsaltarr[i] + '"></img></a>';
        if (0 == 0) {
            cfnewsds = "";
            cfnewsWriteDesc();
            gnrated = gnrated + cfnewsds;
        }
        gnrated = gnrated + '</div></div>';
    }
    cfnewshpiece = cfnewshpiece + gnrated;
    if (0 == 1) {
        cfnewshpiece = cfnewshpiece + cfnewsds;
    }
    cfnewshpiece = cfnewshpiece + '</div>';
    cfnewshpiece = cfnewshpiece + '</div>';
    document.write('' + cfnewshpiece);
    setTimeout("cfnewsinit_position(" + parseInt(hormuvertmi) + ")", 50);
}
function cfnewsinit_position(hv) {
    cfnewshorvert = hv;
    for (i = 1; i <= howmany; i++) {
        cfnewsll[i] = document.getElementById('cfnewspo' + i);
        cfnewslll[i] = document.getElementById('cfnewsadesc' + i);
        if ((cfnewsll[i] == null) || (cfnewslll[i] == null)) {
            setTimeout("cfnewsinit_position(" + parseInt(hv) + ")", 200);
            return;
        }
    }
    if (cfnewshorvert == 0) {
        cfnewsllllll = parseInt((560 - ((howmany - 1) * 2)) / (howmany));
        cfnewslllllll = cfnewsllllll + 2;
        cfnewsllllllll = parseInt(((560 - 250) / (howmany - 1)));
    } else {
        cfnewsllllll = parseInt((280 - ((howmany- 1) * 2)) / (howmany));
        cfnewslllllll = cfnewsllllll + 2;
        cfnewsllllllll = parseInt(((280 - 190) / (howmany - 1)));
    }
    for (i = 1; i <= howmany; i++) {
        cfnewsll[i] = document.getElementById('cfnewspo' + i);
        sx = (cfnewslllllll * (i - 1)) - 2;
        if (cfnewshorvert == 0) {
            if (i == 1) {
                cfnewsll[i].style.left = "0px";
            } else {
                cfnewsll[i].style.left = "" + sx + "px";
            }
        } else {
            if (i == 1) {
                cfnewsll[i].style.top = "0px";
            } else {
                cfnewsll[i].style.top = "" + sx + "px";
            }
        }
        cfnewsstartposx[i] = sx;
        cfnewslllll[i] = cfnewsstartposx[i];
        if (i == 1) {
            cfnewslll[i].style.left = "" + cfnewsDescCalcLeftBir + "px";
        } else {
            cfnewslll[i].style.left = "" + cfnewsDescCalcLeft + "px";
        }
    }
    cfnewsintcomplate = 1;
    if (1 == 1) {
        cfnewsDoAutoPlay();
    }
}
function cfnewsDoAutoPlay() {
    cfnewsmouse_over(cfnewsAutoPlayCurrent);
    cfnewsAutoPlayCurrent = cfnewsAutoPlayCurrent + 1;
    if (cfnewsAutoPlayCurrent > howmany) {
        cfnewsAutoPlayCurrent = 1;
    }
    cfnewsAutoPlayTimer = setTimeout("cfnewsDoAutoPlay()", 4000);
}
function cfnewsdo_FadeAnim() {
    if (cfnewslllllllll < 1) {
        return;
    }
    cfnewsIEDescOpacity = cfnewsIEDescOpacity + 5;
    cfnewsFFOpacity = cfnewsFFOpacity + 0.05;
    if (IEB == true) {
        if (cfnewsIEDescOpacity > 100) {
            cfnewsIEDescOpacity = 100;
            return;
        }
    } else {
        if (cfnewsFFOpacity > 1.00) {
            cfnewsFFOpacity = 1.00;
            return;
        }
    }
    if (IEB == true) {
        cfnewslll[cfnewslllllllll].filters.item(0).opacity = cfnewsIEDescOpacity;
    } else {
        cfnewslll[cfnewslllllllll].style.opacity = cfnewsFFOpacity;
    }
    cfnewsDescFadeEffectTimer = setTimeout("cfnewsdo_FadeAnim()", 20);
}
function cfnewsdo_anim() {
    if (cfnewscurrstep <= 0) {
        if (cfnewslllllllll >= 1) {
            if (cfnewshorvert == 0) {
                if (cfnewslllllllll == 1) {
                    cfnewslll[cfnewslllllllll].style.left = "" + cfnewsDescCalcLeftBir + "px";
                } else {
                    cfnewslll[cfnewslllllllll].style.left = "" + cfnewsDescCalcLeft + "px";
                }
            } else {
                if (0 == 0) {
                    cfnewslll[cfnewslllllllll].style.left = "" + (cfnewsDescCalcLeft + parseInt(cfnewsll[cfnewslllllllll].style.left)) + "px";
                    var DesvertTop = 0;
                    if ((cfnewslllllllll > 1) && (cfnewslllllllll != howmany)) {
                        DesvertTop = 80 + 2;
                    } else {
                        DesvertTop = 80;
                    }
                    cfnewslll[cfnewslllllllll].style.top = "" + (DesvertTop) + "px";
                } else {
                    cfnewslll[cfnewslllllllll].style.left = "" + (cfnewsDescCalcLeft) + "px";
                    cfnewslll[cfnewslllllllll].style.top = "" + 80 + "px";
                }
            }
            if ((cfnewstitarr[cfnewslllllllll].length > 0) || (cfnewsdesarr[cfnewslllllllll].length > 0)) {
                if (2 == 2) {
                    cfnewsIEDescOpacity = 0;
                    cfnewsFFOpacity = 0.00;
                    cfnewsdo_FadeAnim();
                    cfnewslll[cfnewslllllllll].style.visibility = "visible";
                } else {
                    cfnewslll[cfnewslllllllll].style.visibility = "visible";
                }
            } else {
                cfnewslll[cfnewslllllllll].style.visibility = "hidden";
            }
        }
        return;
    }
    for (i = 2; i <= howmany; i++) {
        cfnewslllll[i] = parseInt(cfnewslllll[i]) + parseInt((cfnewsllll[i] - cfnewslllll[i]) / cfnewscurrstep);
        if (cfnewshorvert == 0) {
            cfnewsll[i].style.left = "" + cfnewslllll[i] + "px";
        } else {
            cfnewsll[i].style.top = "" + cfnewslllll[i] + "px";
        }
    }
    if ((2 == 1) && (cfnewslllllllll >= 1)) {
        var dtop = 0;
        if ((cfnewstitarr[cfnewslllllllll].length > 0) || (cfnewsdesarr[cfnewslllllllll].length > 0)) {
            cfnewslll[cfnewslllllllll].style.visibility = "visible";
        } else {
            cfnewslll[cfnewslllllllll].style.visibility = "hidden";
        }
        dtop = 80 + parseInt(cfnewsDescCalcHeight - ((cfnewsDescCalcHeight / cfnewsstepcount) * (cfnewsstepcount - (cfnewscurrstep - 1))));
        cfnewslll[cfnewslllllllll].style.top = "" + dtop + "px";
    }
    cfnewscurrstep--;
    setTimeout("cfnewsdo_anim()", 20);
}
function cfnewsreposition(g) {
    for (i = 1; i <= howmany; i++) {
        if (i <= g) {
            if (i == 1) {
                cfnewsllll[i] = 0;
            } else {
                cfnewsllll[i] = parseInt(((i - 1) * cfnewsllllllll) - 2);
            }
        } else {
            oncekix = 0;
            for (j = 1; j < (i - 1); j++) {
                oncekix = oncekix + cfnewsllllllll;
            }
            if (cfnewshorvert == 0) {
                cfnewsllll[i] = parseInt(((250) + (oncekix)));
            } else {
                cfnewsllll[i] = parseInt(((190) + (oncekix)));
            }
        }
    }
    if ((cfnewshorvert == 0) && (howmany == g)) {
        var bul1 = cfnewsllll[howmany] + 2 + 250;
        var bul2 = 560 - bul1;
        cfnewsllll[6] = cfnewsllll[howmany] + bul2;
    }
    if ((cfnewshorvert == 1) && (howmany == g)) {
        var bul1 = cfnewsllll[howmany] + 2 + 190;
        var bul2 = 190 - bul1;
        cfnewsllll[howmany] = cfnewsllll[howmany] + bul2;
    }
    cfnewscurrstep = cfnewsstepcount;
    cfnewsdo_anim();
}
function cfnewsmouse_over(g) {
    if (cfnewsintcomplate == 0) {
        return;
    }
    if (g == cfnewslllllllll) {
        return;
    }
    cfnewslllllllll = g;
    clearTimeout(cfnewstimeo);
    if (0 == 1) {
        if (cfnewsicerdemi == 1) {
            clearTimeout(cfnewsAutoPlayTimer);
        }
    }
    for (i = 1; i <= howmany; i++) {
        if (i != g) {
            cfnewslll[i].style.visibility = "hidden";
            if (IEB == true) {
                cfnewslll[i].filters.item(0).opacity = 100;
            } else {
                cfnewslll[i].style.opacity = 1.0;
            }
        }
    }
    cfnewsreposition(g);
}
function cfnewsoutall() {
    cfnewsicerdemi = 1;
    clearTimeout(cfnewsAutoPlayTimer);
    clearTimeout(cfnewstimeo);
}
function cfnewsmouse_divout2() {
    cfnewsicerdemi = 0;
    clearTimeout(cfnewstimeo);
    if (0 == 1) {
        clearTimeout(cfnewsAutoPlayTimer);
        cfnewsAutoPlayCurrent = 1;
        cfnewsDoAutoPlay();
    } else {
        for (i = 1; i <= howmany; i++) {
            cfnewslll[i].style.visibility = "hidden";
        }
        for (i = 1; i <= howmany; i++) {
            sx = (cfnewslllllll * (i - 1)) - 2;
            if (i == 1) {
                cfnewsllll[i] = 0;
            } else {
                cfnewsllll[i] = sx;
            }
        }
        cfnewslllllllll = -1;
        cfnewscurrstep = cfnewsstepcount;
        cfnewsdo_anim();
    }
}
function cfnewsmouse_divout() {
    clearTimeout(cfnewstimeo);
    cfnewstimeo = setTimeout("cfnewsmouse_divout2()", 300);
}
