// JavaScript Document
function printer(get){
 var neu; 
 neu = window.open('print.php?page_id='+get,'Printing','width=490, height=550, left=40, top=50, scrollbars');
 neu.focus();
}

function big_pic(image_file,folder,width1,height1){
	var neu
	help2 = "pop_pic.php?image_file=" + image_file + "&folder=" + folder;
	neu = window.open(help2, 'Picture','width='+width1+', height='+height1+', left=40, top=50, scrollbars')
	neu.focus();
}

function big_gallery(width1,image_file,height1){
	var neu
	help2 = "gallery_pop.php?image_file=" + image_file;
	neu = window.open(help2, 'Picture','width='+width1+', height='+height1+', left=40, top=50, scrollbars')
	neu.focus();
}

function news_pop(news_id){
	var neu
	help2 = "view_newsletter.php?news_id=" + news_id;
	neu = window.open(help2, 'Newsletter','width=540, height=550, left=40, top=50, scrollbars')
	neu.focus();
}

function print_projects(get){
 var neu; 
 neu = window.open('projects_print.php?id='+get,'Printing','width=490, height=550, left=40, top=50, scrollbars');
 neu.focus();
}

function print_all_news(get){
 var neu; 
 neu = window.open('news_all_print.php?id='+get,'Printing','width=490, height=550, left=40, top=50, scrollbars');
 neu.focus();
}

function print_news(get){
 var neu; 
 neu = window.open('news_print.php?id='+get,'Printing','width=490, height=550, left=40, top=50, scrollbars');
 neu.focus();
}

function press(){
 var neu; 
 neu = window.open('press_all_print.php','Printing','width=490, height=550, left=40, top=50, scrollbars');
 neu.focus();
}

function press_detail(get){
 var neu; 
 neu = window.open('press_print.php?id='+get,'Printing','width=490, height=550, left=40, top=50, scrollbars');
 neu.focus();
}

function member_all(){
 var neu; 
 neu = window.open('member_all_print.php','Member','width=490, height=550, left=40, top=50, scrollbars');
 neu.focus();
}



// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 8000

// Duration of crossfade (seconds)
var crossFadeDuration = 3

// Specify the image files
var Pic = new Array() // don't touch this
var Links = new Array()
// to add more images, just continue
// the pattern, adding to the array below

Pic[0] = 'images/events/adventskalender_sml.jpg'
Pic[1] = 'images/events/bingo_sml.jpg'

Links[0] = 'events.php'
Links[1] = 'bingo.php'


// =======================================
// do not edit anything below this line
// =======================================

var t
var j = 0
var p = Pic.length

var preLoad = new Array()
var prelink = new Array()
for (i = 0; i < p; i++){
   preLoad[i] = new Image()
   preLoad[i].src = Pic[i]
   prelink[i] = Links[i]
}

function runSlideShow(){
   if (document.all){
      document.images.SlideShow.style.filter="blendTrans(duration=2)"
      document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
      document.images.SlideShow.filters.blendTrans.Apply()      
   }
   document.images.SlideShow.src = preLoad[j].src
   document.getElementById('SlideShows').href = prelink[j]
   if (document.all){
      document.images.SlideShow.filters.blendTrans.Play()
   }
   j = j + 1
   if (j > (p-1)) j=0
   t = setTimeout('runSlideShow()', slideShowSpeed)
}

//----------------------------- slideshow advertising -------------------------------------//

// Set slideShowSpeed (milliseconds)
var slideShowSpeedAd = 5000

// Duration of crossfade (seconds)
var crossFadeDurationAd = 3

// Specify the image files
var PicAd = new Array() // don't touch this
var LinksAd = new Array()
// to add more images, just continue
// the pattern, adding to the array below

PicAd[0] = 'images/sponsors/bsdat_ad.jpg'
PicAd[1] = 'images/sponsors/africanbuildingsupplies_ad.jpg'
PicAd[2] = 'images/sponsors/fischer_ad.jpg'
PicAd[3] = 'images/sponsors/newlife_ad.jpg'

LinksAd[0] = 'http://www.bsdat.com'
LinksAd[1] = 'mailto:enquiries@afbs.com.na'
LinksAd[2] = 'mailto:wtb@iafrica.com.na'
LinksAd[3] = 'mailto:new-life@mweb.com.na'


// =======================================
// do not edit anything below this line
// =======================================

var tAd
var jAd = 0
var pAd = PicAd.length

var preLoadAd = new Array()
var prelinkAd = new Array()
for (iAd = 0; iAd < pAd; iAd++){
   preLoadAd[iAd] = new Image()
   preLoadAd[iAd].src = PicAd[iAd]
   prelinkAd[iAd] = LinksAd[iAd]
}

function runSlideShowAd(){
   if (document.all){
      document.images.SlideShowAd.style.filter="blendTrans(duration=2)"
      document.images.SlideShowAd.style.filter="blendTrans(duration=crossFadeDurationAd)"
      document.images.SlideShowAd.filters.blendTrans.Apply()      
   }
   document.images.SlideShowAd.src = preLoadAd[jAd].src
   document.getElementById('SlideShowsAd').href = prelinkAd[jAd]
   if (document.all){
      document.images.SlideShowAd.filters.blendTrans.Play()
   }
   jAd = jAd + 1
   if (jAd > (pAd-1)) jAd=0
   tAd = setTimeout('runSlideShowAd()', slideShowSpeedAd)
}
