// JavaScript Document
function MM_openBrWindow(theURL, winName, features) { //v2.0
    window.open(theURL, winName, features);
}
function openBrowser(theURL, width, height) {
    var left = (screen.width / 2) - 250;
    features = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,left=' + left + ',top=100,titlebar=no,width=500,height=500';
    window.open(theURL, 'Marabda', features);
}

function openBrowser2(theURL, width, height) {
    var left = (screen.width / 2) - 250;
    features = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,left=' + left + ',top=100,titlebar=no,width='+width+',height='+height;
    window.open(theURL, 'Marabda2', features);
}
function openBrowser3(theURL, width, height) {
    var left = (screen.width / 2) - 400;
    features = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,left=' + left + ',top=50,titlebar=no,width='+width+',height='+height;
    window.open(theURL, 'Marabda2', features);
}
function openBrowser4(theURL, width, height) {
    var left = (screen.width / 2) - 250;
    features = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,left=' + left + ',top=100,titlebar=no,width='+width+',height='+height;
    window.open(theURL, 'Marabda3', features);
}

function JustSoPicWindow(imageName, imageWidth, imageHeight, alt, bgcolor, hugger, hugMargin) {
    // by E Michael Brandt of ValleyWebDesigns.com - Please leave these comments intact.
    // version 3.0.4

    if (bgcolor == "") {
        bgcolor = "#FFFFFF";
    }
    var adj = 10
    var w = screen.width;
    var h = screen.height;
    var byFactor = 1;

    if (w < 740) {
        var lift = 0.90;
    }
    if (w >= 740 & w < 835) {
        var lift = 0.91;
    }
    if (w >= 835) {
        var lift = 0.93;
    }
    if (imageWidth > w) {
        byFactor = w / imageWidth;
        imageWidth = w;
        imageHeight = imageHeight * byFactor;
    }
    if (imageHeight > h - adj) {
        byFactor = h / imageHeight;
        imageWidth = (imageWidth * byFactor);
        imageHeight = h;
    }

    var scrWidth = w - adj;
    var scrHeight = (h * lift) - adj;

    if (imageHeight > scrHeight) {
        imageHeight = imageHeight * lift;
        imageWidth = imageWidth * lift;
    }

    var posLeft = 0;
    var posTop = 0;

    if (hugger == "hug image") {
        if (hugMargin == "") {
            hugMargin = 0;
        }
        var scrHeightTemp = imageHeight - 0 + 2 * hugMargin;
        if (scrHeightTemp < scrHeight) {
            scrHeight = scrHeightTemp;
        }
        var scrWidthTemp = imageWidth - 0 + 2 * hugMargin;
        if (scrWidthTemp < scrWidth) {
            scrWidth = scrWidthTemp;
        }

        if (scrHeight < 100) { scrHeight = 100; }
        if (scrWidth < 100) { scrWidth = 100; }

        posTop = ((h - (scrHeight / lift) - adj) / 2);
        posLeft = ((w - (scrWidth) - adj) / 2);
    }

    if (imageHeight > (h * lift) - adj || imageWidth > w - adj) {
        imageHeight = imageHeight - adj;
        imageWidth = imageWidth - adj;
    }
    posTop = parseInt(posTop);
    posLeft = parseInt(posLeft);
    scrWidth = parseInt(scrWidth);
    scrHeight = parseInt(scrHeight);

    var agt = navigator.userAgent.toLowerCase();
    if (agt.indexOf("opera") != -1) {
        var args = new Array();
        args[0] = 'parent';
        args[1] = imageName;
        var i; document.MM_returnValue = false;
        for (i = 0; i < (args.length - 1); i += 2) eval(args[i] + ".location='" + args[i + 1] + "'");
    } else {
        newWindow = window.open("vwd_justso.htm", "newWindow", "width=" + scrWidth + ",height=" + scrHeight + ",left=" + posLeft + ",top=" + posTop);
        newWindow.document.open();
        newWindow.document.write('<html><title>' + alt + '</title><body leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" bgcolor=' + bgcolor + ' onBlur="self.close()" onClick="self.close()">');
        newWindow.document.write('<table width=' + imageWidth + ' border="0" cellspacing="0" cellpadding="0" align="center" height=' + scrHeight + ' ><tr><td>');
        newWindow.document.write('<img src="' + imageName + '" width=' + imageWidth + ' height=' + imageHeight + ' alt="Click screen to close" >');
        newWindow.document.write('</td></tr></table></body></html>');
        newWindow.document.close();
        newWindow.focus();
    }
}
function validgo() {

    if (document.Addgo.email.value.indexOf('@', 0) == -1 || document.Addgo.email.value.indexOf('.', 0) == -1) {
        alert("please enter a valid e-mail");
        document.Addgo.email.focus();
        return;
    }
    else {
        document.Addgo.submit();

    }
}

function EvalSound(soundobj) {
    var thissound = eval("document." + soundobj);
    thissound.Play();
}


var PanelSlideOut = "";

function revelerCacherSousNav(LienId) {
    var LI = document.getElementById(LienId).parentNode;
    var Sub = document.getElementById(LienId + "_sub");
    if (Sub.style.display == "none") {
        document.getElementById(LienId).style.color = "#5B5859";
        document.getElementById('span').innerHTML = "&nbsp;-";
        document.getElementById('span').style.color = "#5B5859";
        //document.getElementById (LienId).className= "maronite";
        //LI.className = "bgtdleft2";
        Sub.style.display = "";
        if (PanelSlideOut != "") revelerCacherSousNav(PanelSlideOut);
        PanelSlideOut = LienId;
    }
    else {
        document.getElementById('span').innerHTML = "+";
        document.getElementById('span').style.color = "#FFFFFF";
        document.getElementById(LienId).style.color = "#FFFFFF";

        //document.getElementById (LienId).style.color="#F4130D";
        //document.getElementById (LienId).className= "maronite";
        //LI.className = "bgtdleft";
        Sub.style.display = "none";
        PanelSlideOut = "";
    }
}

var PanelSlideOut2 = "";
function revelerCacherSousNav2(LienId) {
    var Sub = document.getElementById(LienId + "_sub");
    if (Sub.style.display == "none") {
        document.getElementById(LienId).style.color = "#5B5859";
        document.getElementById('span2').innerHTML = "&nbsp;-";
        document.getElementById('span2').style.color = "#5B5859";
        Sub.style.display = "";
        if (PanelSlideOut2 != "") revelerCacherSousNav2(PanelSlideOut2);
        PanelSlideOut2 = LienId;
    }
    else {
        document.getElementById('span2').innerHTML = "+";
        document.getElementById('span2').style.color = "#FFFFFF";
        document.getElementById(LienId).style.color = "#FFFFFF";
        Sub.style.display = "none";
        PanelSlideOut2 = "";
    }
}

var PanelSlideOut3 = "";
function revelerCacherSousNav3(LienId) {
    var Sub = document.getElementById(LienId + "_sub");
    if (Sub.style.display == "none") {
        document.getElementById(LienId).style.color = "#5B5859";
        document.getElementById('span3').innerHTML = "&nbsp;-";
        document.getElementById('span3').style.color = "#5B5859";
        Sub.style.display = "";
        if (PanelSlideOut3 != "") revelerCacherSousNav3(PanelSlideOut3);
        PanelSlideOut3 = LienId;
    }
    else {
        document.getElementById('span3').innerHTML = "+";
        document.getElementById('span3').style.color = "#FFFFFF";
        document.getElementById(LienId).style.color = "#FFFFFF";
        Sub.style.display = "none";
        PanelSlideOut3 = "";
    }
}

var PanelSlideOut4 = "";
var spanIDSlideOut="";
function showHido(LienId,SpanId) {
    var Sub = document.getElementById(LienId + "_sub");
    if (Sub.style.display == "none") {
        document.getElementById(LienId).style.color = "#5B5859";
        document.getElementById(SpanId).innerHTML = "&nbsp;-";
        document.getElementById(SpanId).style.color = "#5B5859";
        Sub.style.display = "";
        if (PanelSlideOut4 != "") showHido(PanelSlideOut4,spanIDSlideOut);
        PanelSlideOut4 = LienId;
		spanIDSlideOut = SpanId;
    }
    else {
        document.getElementById(SpanId).innerHTML = "+";
        document.getElementById(SpanId).style.color = "#FFFFFF";
        document.getElementById(LienId).style.color = "#FFFFFF";
        Sub.style.display = "none";
        PanelSlideOut4 = "";
		spanIDSlideOut="";
    }
}

var PanelSlideOut4_sub = "";
var spanIDSlideOut_sub="";
function showHidoSub(LienId,SpanId) {
    var Sub = document.getElementById(LienId + "_sub");
    if (Sub.style.display == "none") {
        document.getElementById(LienId).style.color = "#5B5859";
        document.getElementById(SpanId).innerHTML = "&nbsp;-";
        document.getElementById(SpanId).style.color = "#5B5859";
        Sub.style.display = "";
        if (PanelSlideOut4_sub != "") showHido(PanelSlideOut4_sub,spanIDSlideOut_sub);
        PanelSlideOut4_sub = LienId;
		spanIDSlideOut_sub = SpanId;
    }
    else {
        document.getElementById(SpanId).innerHTML = "+";
        document.getElementById(SpanId).style.color = "#FFFFFF";
        document.getElementById(LienId).style.color = "#FFFFFF";
        Sub.style.display = "none";
        PanelSlideOut4_sub = "";
		spanIDSlideOut_sub="";
    }
}

function validOnlineForm() {
    if (document.OnlineForm.fullname.value == "") {
        alert("Please enter a value for the \"Full Name\" field.");
        document.OnlineForm.fullname.focus();
        return;
    }
    if (document.OnlineForm.email.value.indexOf('@', 0) == -1 || document.OnlineForm.email.value.indexOf('.', 0) == -1) {
        alert("please enter a valid e-mail");
        document.OnlineForm.email.focus();
        return;
    }
    if (document.OnlineForm.comments.value == "") {
        alert("Please enter a value for the \"Comments\" field.");
        document.OnlineForm.comments.focus();
        return;
    }
    else document.OnlineForm.submit();
}

function valid() {
    if (document.Add.firstname.value == "") {
        alert("Please enter a value for the \"First Name\" field.");
        document.Add.firstname.focus();
        return;
    }
    if (document.Add.lastname.value == "") {
        alert("Please enter a value for the \"Last Name\" field.");
        document.Add.lastname.focus();
        return;
    }
    if (document.Add.email.value.indexOf('@', 0) == -1 || document.Add.email.value.indexOf('.', 0) == -1) {
        alert("please enter a valid e-mail");
        document.Add.email.focus();
        return;
    }

    if (document.Add.country.selectedIndex <= 0) {
        alert("Please select a value for the \"Country\" field.");
        document.Add.country.focus();
        return;

    }
    else document.Add.submit();
}

function reset() {
    (document.Add.reset())

}


var MyInterval;
var CurrentNews = 1;
var MaxNews = 3;
var Myfunction = "Next"


function AutoChange() {
    if (Myfunction == "Next") {
        NextNews()
    } else {
        PreviousNews()
    }
}



function NextNews() {
    if (document.getElementById('news' + (CurrentNews + 1))) {
        for (i = 1; i <= MaxNews; i++) {
            document.getElementById('news' + i).style.display = "none";
            document.getElementById('Parish' + i).style.display = "none";
        }

        document.getElementById('news' + (CurrentNews + 1)).style.display = "";
        document.getElementById('Parish' + (CurrentNews + 1)).style.display = "";
    }
    CurrentNews++;

    if (CurrentNews == MaxNews)
        CurrentNews = 0;
}

function RunDIV() {
    setInterval('NextNews()', 3000);
}

var CurrentNews2 = 1;
var MaxNews2 = 4;
function NextNews2() {
    if (document.getElementById('news' + (CurrentNews2 + 1))) {
        for (i = 1; i <= MaxNews2; i++) {
            document.getElementById('news_' + i).style.display = "none";
        }

        document.getElementById('news_' + (CurrentNews2 + 1)).style.display = "";
    }
    CurrentNews2++;

    if (CurrentNews2 == MaxNews2)
        CurrentNews2 = 0;
}

function RunDIV2() {
    setInterval('NextNews2()', 4100);
}
function clearForm() {
     setInterval('document.OnlineForm.reset();', 1000);
}
function getNumber() {
    /*var now = new Date();
    var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();
    function fourdigits(number)	{
    return (number < 1000) ? number + 1900 : number;}
    today =  date +"/"+
    (now.getMonth()+1) + "/" +
    (fourdigits(now.getYear()));
    alert(today);
	 
	 var date1='';
    var date2='';
    var now = new Date();
    var date = now.getDate();
    if(date>=1 && date<=10)alert('date1 '+date);
    if(date>=11 && date<=20)alert('date2 '+date);
    if(date>=21 && date<=31)alert('date3 '+date);*/
}
/* <script type="text/javascript" language="JavaScript"><!--
function y2k(number) { return (number < 1000) ? number + 1900 : number; }

function getWeek(year,month,day) {
var when = new Date(year,month,day);
var newYear = new Date(year,0,1);
var offset = 7 + 1 - newYear.getDay();
if (offset == 8) offset = 1;
var daynum = ((Date.UTC(y2k(year),when.getMonth(),when.getDate(),0,0,0) - Date.UTC(y2k(year),0,1,0,0,0)) /1000/60/60/24) + 1;
var weeknum = Math.floor((daynum-offset+7)/7);
if (weeknum == 0) {
year--;
var prevNewYear = new Date(year,0,1);
var prevOffset = 7 + 1 - prevNewYear.getDay();
if (prevOffset == 2 || prevOffset == 8) weeknum = 53; else weeknum = 52;
}
return weeknum;
}

var now = new Date();
alert('Week number = ' + getWeek(y2k(now.getYear()),now.getMonth(),now.getDate())); 
//--></script>*/
var PanelSlideOut1 = "";
var PlusSlideOut1 = "";
function revelerCacherSousNav1(LienId, plus) {
    var LI = document.getElementById(LienId).parentNode;
    var Sub = document.getElementById(LienId + "_sub");
    if (Sub.style.display == "none") {
        document.getElementById(plus).innerHTML = "-";
        document.getElementById(LienId).style.color = "#002478";
        document.getElementById(plus).style.color = "#002478";
        document.getElementById(LienId + "_bg").style.backgroundColor = '#EFD7B6';
        Sub.style.display = "";
        if (PanelSlideOut1 != "") revelerCacherSousNav1(PanelSlideOut1, PlusSlideOut1);
        PanelSlideOut1 = LienId;
        PlusSlideOut1 = plus;
    }
    else {
        document.getElementById(plus).innerHTML = "+";
        document.getElementById(LienId).style.color = "";
        document.getElementById(plus).style.color = "";
        document.getElementById(LienId + "_bg").style.backgroundColor = "";
        /*document.getElementById (LienId).className='productTitle';
        document.getElementById (plus).className='plus';*/
        Sub.style.display = "none";
        PanelSlideOut1 = "";
    }
}
Date.prototype.getDOY = function() {
var onejan = new Date(this.getFullYear(), 0, 1);
return Math.ceil((this - onejan) / 86400000);
}
function returnDay()
{
var today = new Date();
var weekno = today.getDOY();
document.getElementById('day_'+weekno).style.display = "";
}
function setBackGround()
{
var today = new Date();
var dayNumber=today.getDay();
if (dayNumber==0)dayNumber=7;
document.getElementById ('backgroundBody').className='body_0'+today.getDay();
}
