//----------------------------------------------------//
//--    BGGUTILS JAVA SCRIPT DATEI
//----------------------------------------------------//
function checkPopUp(again)
{
  var CCount = GetCntC("NEWS",0) ;
  if(CCount <= 1  || again == 1) {
      for (var p = 0; p < PopUp.length; ++p){
         if(dbg>=2){alert("SEL: PopUp["+p+"] ["+PopUp[p]+"]again: "+again+" ")};
         if(PopUp[p][0]>>0) {
             var Now   = new Date();
             var day   = Now.getDate();
             var month = Now.getMonth() + 1;
             var year  = Now.getFullYear() ; //+ 1900;
             if(dbg>=1){alert("DATE   ["+Now+"] \nENTRY["+p+"] ["+PopUp[p][0]+"]["+PopUp[p][1]+"]["+PopUp[p][2]+"]["+PopUp[p][3]+"]["+PopUp[p][4]+"]["+PopUp[p][5]+"]["+PopUp[p][6]+"]["+PopUp[p][7]+"]")};
             Run       =  0 ;
             ActiveFrm = PopUp[p][2];
             ActiveTil = PopUp[p][3];
             SizeLocat = PopUp[p][4];
             var WinID     = p ;
             ActiveTil[2]  =  year ;
             ActiveFrm[2]  =  year ;
             if(PopUp[p][0]==2){
                var d      =  new Date(year, ActiveTil[1]-1, ActiveTil[0], 0, 0, 0, 0);
                var EndD   =  ActiveTil[0]-d.getDay() ;
                ActiveFrm[0]  =  EndD - 5 ;
                ActiveTil[0]  =  EndD ;
             }
             var NowJul    = ymd2julian(year, month, day);  
             var TilJul    = ymd2julian(ActiveTil[2], ActiveTil[1], ActiveTil[0]) ;
             var FrmJul    = ymd2julian(ActiveFrm[2], ActiveFrm[1], ActiveFrm[0]) ;
             if(dbg>=1){alert("NEWSP["+p+"] ["+PopUp[p][0]+"]["+PopUp[p][1]+"]["+PopUp[p][2]+"]["+PopUp[p][3]+"]["+PopUp[p][4]+"]["+PopUp[p][5]+"]["+PopUp[p][6]+"]["+PopUp[p][7]+"]")};
             if(dbg>=2){alert("Til["+ActiveTil[0]+"]["+ActiveTil[1]+"]["+ActiveTil[2]+"] Now["+day+"]["+month+"]["+year+"] TilJul["+TilJul+"] JulNow["+NowJul+"] ")};

             var Parms = ""+PopUp[p][1]+"+"+PopUp[p][2]+"+"+PopUp[p][3]+"+"+PopUp[p][4]+"+"+PopUp[p][5]+"+"+PopUp[p][7]+"+"+dbg+"" ;
             if(NowJul<=TilJul && NowJul >= FrmJul){
                if(dbg>=1){alert("JulNow["+NowJul+"] <= TilJul["+TilJul+"]  && JulNow["+NowJul+"] >= FrmNow["+FrmJul+"] ")};
                NewsWin(PopUp[p][6],Parms,WinID,SizeLocat[0],SizeLocat[1],SizeLocat[2],SizeLocat[3]);
             }
         }
      }
  }
}
//-----------------------------------------------------//
//--         Pause Subrout                             //
//-----------------------------------------------------//
function pausecomp(millis)
{
var date = new Date();
var curDate = null;

do { curDate = new Date(); }
while(curDate-date < millis);
} 
//-----------------------------------------------------//
//--          Weekday Array                           //
//-----------------------------------------------------//
var wday=new Array(7);
wday[0]="So";
wday[1]="Mo";
wday[2]="Di";
wday[3]="Mi";
wday[4]="Do";
wday[5]="Fr";
wday[6]="Sa";
//--
 
//-----------------------------------------------------//
//--          PopUp Array                      //
//-----------------------------------------------------//
var PopUp  = new Array(10);
for (var i = 0; i < PopUp.length; ++i){
  PopUp[i] = new Array();
}
//----------------------------------------------------//
//--      .-  PopUp Index 0                           //
//--------V-------------------------------------------//
var p=0;
i=0;PopUp[p][i] = "2" ;                               // 0 Entry active = 1
i++;PopUp[p][i] = "SZU" ;                             // 1 Titel
i++;PopUp[p][i] =  new Array(31,  3 ,0000 )  ;        // 2 Window active from = (day, month, year) 
i++;PopUp[p][i] =  new Array(31,  3 ,0000 )  ;        // 3 Window active till = (day, month, year) 
i++;PopUp[p][i] =  new Array(500,590,100,20) ;        // 4 WindowSize/Pos (wi,hi,x,y)
i++;PopUp[p][i] =  "/PU/img/ZeitUmstellung.jpg"  ;    // 5 Image Name
i++;PopUp[p][i] =  "/PU/PopUpZU.php"                  // 6 Page Name
i++;PopUp[p][i] =  "20" ;                             // 7 sec Window show time

//----------------------------------------------------//
//--      .-  PopUp Index 1                           //
//--------V-------------------------------------------//
p++;
i=0;PopUp[p][i] = "2" ;                               // Entry active = 1
i++;PopUp[p][i] = "WZU" ;                             // Titel
i++;PopUp[p][i] =  new Array(31, 10, 0000 )  ;        // Window active from = (day, month, year) 
i++;PopUp[p][i] =  new Array(31, 10, 0000 )  ;        // Window active till = (day, month, year) 
i++;PopUp[p][i] =  new Array(500,590,150,40) ;        // WindowSize/Pos (wi,hi,x,y)
i++;PopUp[p][i] =  "/PU/img/ZeitUmstellung.jpg"  ;    // Image Name
i++;PopUp[p][i] =  "/PU/PopUpZU.php"                  // Page Name
i++;PopUp[p][i] =  "20" ;                             // sec Window show time

//----------------------------------------------------//
//--      .-  PopUp Index 2                           //
//--------V-------------------------------------------//
p++;
i=0;PopUp[p][i] = "0" ;                               // Entry active = 1
i++;PopUp[p][i] = "JJS" ;                             // Titel
i++;PopUp[p][i] =  new Array(14,  3 ,0000 )  ;        // Window active from = (day, month, year) 
i++;PopUp[p][i] =  new Array(20,  3 ,0000 )  ;        // Window active till = (day, month, year) 
i++;PopUp[p][i] =  new Array(500,570,200,60) ;        // WindowSize/Pos (wi,hi,x,y)
i++;PopUp[p][i] =  "/PU/img/20100320Jesodos.jpg" ;    // Image Name
i++;PopUp[p][i] =  "/PU/PopUp0.php" ;                 // Page Name
i++;PopUp[p][i] =  "20" ;                             // sec Window show time
//----------------------------------------------------//

//----------------------------------------------------//
//--      .-  PopUp Index 3                           //
//--------V-------------------------------------------//
p++;
i=0;PopUp[p][i] =  "0" ;                              // Entry active = 1
i++;PopUp[p][i] =  "LSNT" ;                            // Titel
i++;PopUp[p][i] =  new Array(29,  9, 2010 )  ;        // Window active from = (day, month, year) 
i++;PopUp[p][i] =  new Array( 8, 10, 2010 )  ;        // Window active till = (day, month, year) 
i++;PopUp[p][i] =  new Array(500,550,250,40) ;        // WindowSize/Pos (wi,hi,x,y)
i++;PopUp[p][i] =  "/PU/img/20101008LadiesNight.jpg" ;           // Image Name
i++;PopUp[p][i] =  "/PU/PopUp0.php" ;                 // Page Name
i++;PopUp[p][i] =  "20" ;                             // sec Window show time
//----------------------------------------------------//

//----------------------------------------------------//
//--      .-  PopUp Index 4                           //
//--------V-------------------------------------------//
p++;
i=0;PopUp[p][i] =  "0" ;                              // Entry active = 1
i++;PopUp[p][i] =  "HGI" ;                            // Titel
i++;PopUp[p][i] =  new Array( 29,  9 ,2010 )  ;        // Window active from = (day, month, year) 
i++;PopUp[p][i] =  new Array(  3, 10 ,2010 )  ;        // Window active till = (day, month, year) 
i++;PopUp[p][i] =  new Array(440,550,700,100) ;       // WindowSize/Pos (wi,hi,x,y)
i++;PopUp[p][i] =  "/PU/img/20101003HeilungGD.jpg" ;                               // Image Name
i++;PopUp[p][i] =  "/PU/PopUp0.php" ;                               // Page Name
i++;PopUp[p][i] =  "15" ;                              // sec Window show time
//----------------------------------------------------//

//----------------------------------------------------//
//--      .-  PopUp Index 5                           //
//--------V-------------------------------------------//
p++;
i=0;PopUp[p][i] =  "0" ;                              // Entry active = 1
i++;PopUp[p][i] =  "UCO" ;                            // Titel
i++;PopUp[p][i] =  new Array(  1,  6 ,2011 )  ;        // Window active from = (day, month, year) 
i++;PopUp[p][i] =  new Array(  3,  6 ,2011 )  ;        // Window active till = (day, month, year) 
i++;PopUp[p][i] =  new Array(500,300,80,10) ;       // WindowSize/Pos (wi,hi,x,y)
i++;PopUp[p][i] =  "/PU/img/Sigi-David.bmp" ;                               // Image Name
i++;PopUp[p][i] =  "/PU/PopUp0.php" ;                               // Page Name
i++;PopUp[p][i] =  "15" ;                              // sec Window show time
//----------------------------------------------------//

//----------------------------------------------------//
//--          PopUp Window Launcher                   //
//----------------------------------------------------//
function NewsWin(Loc, Parms ,PID, wi, hi, x, y) {
      var WN = "W_" + PID ;
      var LocParms = "" ;
      var xx = x ;
      if(x < 0) {
        x = x*-1 ;
        xx = screen.width-x-wi ;
      }
      var yy = y ;
      if(y < 0) {
        y = y*-1 ;
        yy = screen.height-y-hi-45 ;
      }
      wi = wi +  10;
      LocParms = Loc+escape("?")+Parms ;
    if(dbg>=1){alert("NEWS: [window.open "+LocParms+"]" )};
      YWindow = window.open(unescape(LocParms),WN,'width='+wi+',height='+hi+',left='+xx+',top='+yy+',resizable=no,toolbar=no,statusbar=no,scrollbars=no,menubar=no,locationbar=no,personalbar=no');
      YWindow.focus();
      return ;
}


//----------------------------------------------------
//          NEWS
//----------------------------------------------------
function printnews(msg)
{
   for (var i = 0; i < NText[msg].length; ++i){
      document.write(NText[msg][i]);
   }
   return ;
}


//----------------------------------------------------------------------------------------------------------------
var NText = new Array(5);
for (var i = 0; i < NText.length; ++i){
  NText[i] = new Array();
}
//----------------------------------------------------------------------------------------------------------------
var n=0;
i=0;NText[n][i] = "0" ;
//----------------------------------------------------------------------------------------------------------------
n++;
i=0;NText[n][i] = "<font size=3>" ;
i++;NText[n][i] = "<font color=\"#ff0000\"><hr style=\"color:#444444\" noshade align=\"center\" width=\"600px\" size=\"4\">" ;
i++;NText[n][i] = "<font color=\"#d00000\"><center>BGG-B&ouml;blingen - Gospel Center</center>" ;
i++;NText[n][i] = "<font color=\"#ff0000\"><hr style=\"color:#444444\" noshade align=\"center\" width=\"600px\" size=\"4\">" ;
i++;NText[n][i] = "<font color=\"#d00000\"><br><center>Liebe Spender!</center><br>" ;
i++;NText[n][i] = "<font size=2>" ;
i++;NText[n][i] = "<font color=\"#0000ff\">Ganz herzlichen Dank f&uuml;r alle Zuwendungen, die wir erhalten haben!<br>";
i++;NText[n][i] = "<font color=\"#0000ff\">Auf vielfachen Wunsch wollen wir nochmal unsere Kontonummern bekannt geben:<br><br>";
i++;NText[n][i] = "<font color=\"#000000\">F&uuml;r alle Spenden, Zehnter oder Spenden ohne bestimmten Zweck:<br>";
i++;NText[n][i] = "<font color=\"#0000ff\">Spendenkonto: 377 968 005 - - Vereinigte Volksbank AG BLZ: 603 900 00<br>";
i++;NText[n][i] = "<font color=\"#0000ff\">Spendenkonto: 349 805 008 - - Vereinigte Volksbank AG BLZ: 603 900 00<br><br>";
i++;NText[n][i] = "<font color=\"#000000\">Spenden f&uuml;r den Erwerb des neuen Zentrums:<br>";
i++;NText[n][i] = "<font color=\"#0000ff\">Spendenkonto: 377 968 625 - - Vereinigten Volksbank AG BLZ: 603 900 00<br>";
i++;NText[n][i] = "<font color=\"#000000\">Bitte als Verwendungszweck NEUES ZENTRUM angeben!<br><br>";
i++;NText[n][i] = "<font color=\"#0000ff\">Bei allen &Uuml;berweisungen Ihre Adresse deutlich hinterlassen!<br><br>";
i++;NText[n][i] = "<font color=\"#0000ff\">Vielen Dank!<br><br>";
i++;NText[n][i] = "<font color=\"#ff0000\"><hr style=\"color:#444444\" noshade align=\"center\" width=\"600px\" size=\"4\">" ;
//----------------------------------------------------------------------------------------------------------------
n++;
i=0;NText[n][i]= "<font size=4><center>" ;
i++;NText[n][i] = "<font color=\"#ff0000\"><hr style=\"color:#444444\" noshade align=\"center\" size=\"4\">" ;
i++;NText[n][i] = "<font color=\"#4000c0\"><br>Biblische Glaubens Gemeinde B&ouml;blingen - <font color=\"#802080\">GospelCenter<br>&nbsp;" ;
i++;NText[n][i] = "<font color=\"#ff0000\"><hr style=\"color:#444444\" noshade align=\"center\" size=\"4\"><br>" ;
i++;NText[n][i] = "<font size=2><center>" ;
i++;NText[n][i] = "<font color=\"#ff0000\">NEUE B&Uuml;ROZEITEN !<br><br>" ;
i++;NText[n][i] = "<font color=\"#000000\">Unser B&uuml;ro ist an folgenden Tagen besetzt:<br><br>";
i++;NText[n][i] = "<table border=0>";
i++;NText[n][i] = "<tr><td> <font color=\"#0000ff\" size=2>Dienstag                </td><td><font size=2>&nbsp;von</td><td><font size=2>09:00 Uhr - 12:00 Uhr<td><tr>";
i++;NText[n][i] = "<tr><td> <font color=\"#0000ff\" size=2>Mittwoch                </td><td><font size=2>&nbsp;von</td><td><font size=2>14:00 Uhr - 17:00 Uhr<td><tr>";
i++;NText[n][i] = "<tr><td> <font color=\"#0000ff\" size=2>Donnerstag &amp; Freitag</td><td><font size=2>&nbsp;von</td><td><font size=2>09:00 Uhr - 12:00 Uhr<td><tr>";
i++;NText[n][i] = "</table>";
i++;NText[n][i] = "<font color=\"#000000\"> <br>Telefon: 07031-412107&nbsp;&nbsp;&nbsp;E-Mail: info@bgg-boeblingen.de<br>&nbsp;";
i++;NText[n][i] = "<font color=\"#ff0000\"><hr style=\"color:#444444\" noshade align=\"center\" size=\"4\"><br>" ;
//----------------------------------------------------------------------------------------------------------------
n++;
i=0;NText[n][i] = "<font color=\"#008000\">ACHTUNG GOTTESDIENST BESUCHER !<br><br>" ;
i++;NText[n][i] = "<font color=\"#0000ff\">In der Nacht zum Sonntag 29. M&auml;rz wird die Uhr um <br>1 Stunde vorgestellt!<br><br>";
i++;NText[n][i] = "<font color=\"#0000ff\">Wir haben wieder SOMMER-ZEIT!<br><br>";
i++;NText[n][i] = "<font color=\"#008000\">Don't be late!!";
//----------------------------------------------------------------------------------------------------------------
n++;
i=0;NText[n][i] = "<font color=\"#008000\">ACHTUNG GOTTESDIENST BESUCHER !<br><br>" ;
i++;NText[n][i] = "<font color=\"#0000ff\">In der Nacht zum Sonntag 26. Oktober wird die Uhr um <br>1 Stunde zur&uuml;ck gestellt!<br><br>";
i++;NText[n][i] = "<font color=\"#0000ff\">Wir haben wieder NORMAL-ZEIT!<br><br>";
i++;NText[n][i] = "<font color=\"#008000\">Don't be to early!!";
//----------------------------------------------------------------------------------------------------------------




//--
//---------------------------------------------------//
//--  printticker  prints ticker applet + Tickertext //
//---------------------------------------------------//

var TI    = "  +  +  +  " ;
//--
function printticker(m, fdate)
{
    document.write("     <applet  id=\"Ticker\" code=\"zticker.class\" width=\"782\" height=\"28\">\n");
    document.write("     <param name=\"speed\" value=\"3\">\n") ;
    document.write("     <param name=\"txtco\" value=\""+Text[m][0]+"\">\n") ;
    document.write("     <param name=\"bgco\"  value=\""+Text[m][1]+"\">\n") ;
    document.write("     <param name=\"msg\"   value=\"");
    for (var i = 2; i < Text[m].length; ++i){
         document.write(" "+TI+Text[m][i]+" ");
    }
    document.write(" "+TI+" News from "+fdate+" ");
    document.write(" "+TI+"\">\n");
    document.write("     </applet>\n");
    return ;
}

//---------------------------------------------------//
var Text   = new Array(2);
for (var i = 0; i < Text.length; ++i){
  Text[i] = new Array();
}
//---------------------------------------------------//
//--     .-  0 Main index Page Ticker text           //
//-------V-------------------------------------------//
p=0;
i=0;Text[p][i] = "255,000,000" ; // Text Color
i=1;Text[p][i] = "255,255,150" ; // Bg Color
i++;Text[p][i] = "Jeden Sonntag feiern wir Gottesdienst um 10:00 Uhr und um 16:00 Uhr im GOSPEL CENTER.";
i++;Text[p][i] = "Ansprechende Lieder,  fetzige Songs,  ausagekr&auml;ftige Botschaft, super Gemeinschaft!";
i++;Text[p][i] = "Kindergottesdienst und Teeniebibelschule";
i++;Text[p][i] = "SEIEN SIE MIT DABEI!!";
i++;Text[p][i] = "Das Gospel Center in der Sindelfinge Str 35 ist soweit fertig, dass wir wieder Gottesdienst feiern k&ouml;nnen.";
i++;Text[p][i] = "W&auml;hrend der Bauzeit erreichen Sie uns &uuml;ber: 07031-652822.";
i++;Text[p][i] = "Wir werden neue Termine hier anzeigen und nat&uuml;rlich auch im Gottesdienst bekannt geben!";


//--
//---------------------------------------------------//
//--     .- 1 LeiterInfo index Page Ticker text      //
//-------V-------------------------------------------//
p=1;
i=0;Text[p][i] = "000,096,000" ;
i++;Text[p][i] = "255,255,150" ;
i++;Text[p][i] = "Neue Downloads und Anzeigen: Ferienkalender 2011 &amp; 2012 und Wetter. + siehe Buttons unten";
//----------------------------------------------------
//
//----------------------------------------------------




//-
//---------------------------------------------------//
//--  window clock time and calendar calc subrouts
//---------------------------------------------------//

//----------------------------------------------------
//
//----------------------------------------------------
function zoom_in(obj,bg) {
       obj.style.backgroundColor=bg;
 }

//----------------------------------------------------
//
//----------------------------------------------------
function zoom_out(obj){
       obj.style.backgroundColor='';
}

//----------------------------------------------------
//
//----------------------------------------------------
function Print() {
       Print = window.open("/cgi-bin/bggtermine_prt.pl?3+1+20","PRINT","height=10px,width=200px");
       Print.focus();
       window.location="/cgi-bin/bggtermine.pl?3+1+20";
}


//----------------------------------------------------
//
//----------------------------------------------------
function FlexWin(Loc, PID, wi, hi, x, y) {
      var WN = "W" + PID ;
      var xx = x ;
      if(x < 0) {
        x = x*-1 ;
        xx = screen.width-x-wi ;
      }
      var yy = y ;
      if(y < 0) {
        y = y*-1 ;
        yy = screen.height-y-hi-45 ;
      }
      YWindow = window.open(Loc,WN,'width='+wi+',height='+hi+',left='+xx+',top='+yy+', scrollbars=yes, resizable=no, toolbar=no, status=no, scrollbar=no, menubar=no, location=no');
      YWindow.focus();
}

//----------------------------------------------------
//
//----------------------------------------------------
function FlexWinS(Loc, PID, wi, hi, x, y) {
      var WN = "W" + PID ;
      var xx = x ;
      if(x < 0) {
        x = x*-1 ;
        xx = screen.width-x-wi ;
      }
      var yy = y ;
      if(y < 0) {
        y = y*-1 ;
        yy = screen.height-y-hi-45 ;
      }
      YWindow = window.open(Loc,WN,'width='+wi+',height='+hi+',left='+xx+',top='+yy+',scrollbars=no,resizable=no,toolbar=no,status=no,scrollbar=no,menubar=no,location=no');
      YWindow.focus();
}

//----------------------------------------------------
//
//----------------------------------------------------
function NewWin(Loc) {
      NWindow = window.open(Loc,'W100');
      NWindow.focus();
}

//----------------------------------------------------
//
//----------------------------------------------------
function NewWinClose(Loc) {
      NWindow = window.open(Loc,'W100');
      NWindow.close();
}

//----------------------------------------------------
//
//----------------------------------------------------
function Clocktime() 
     {
       Ct();
       window.setTimeout('Clocktime()',1000); 
     }

//----------------------------------------------------
//
//----------------------------------------------------
function Ct()
     {
       now = new Date();
           day = now.getDate();
           month = now.getMonth();
           year = now.getYear();
           month ++ ;
           year  += 1900 ; 
           var dateValue = "" + ((day < 10) ? "0" : "") + day ;
               dateValue += ((month < 10) ? ".0" : ".") + month ;
               dateValue += "." + year ;
           if(document.Form1.Date){
             document.Form1.Date.value = " "+dateValue ;
           }
       var hours = now.getHours();
       var minutes = now.getMinutes();
       var seconds = now.getSeconds();
       var timeValue = "" + ((hours < 10) ? "0" : "") + hours ;
       timeValue += ((minutes < 10) ? ":0" : ":") + minutes ;
       timeValue += ((seconds < 10) ? ":0" : ":") + seconds ;
       if(document.Form1.Clock){
         document.Form1.Clock.value=" "+timeValue ;
       }
     }


//----------------------------------------------------
//--    Compute Julian Date from gregorian Date  -----
//----------------------------------------------------
function ymd2julian(y, m, d) {
  if (m < 3) {
    var f = -1;
  }else{
    var f = 0;
  }
  return Math.floor((1461*(f+4800+y))/4)
        + Math.floor(((m-2-(f*12))*367)/12)
        - Math.floor(3*Math.floor((y+4900+f)/100)/4)
        + d
        - 32075;
}

//----------------------------------------------------
//
//----------------------------------------------------

