// JavaScript Document

document.lastImgs = new Array;

//Sets up the image header
function imageHeader(selector,phpfile,font_file,font_size,font_color, background_color, hover_color,wordwrap){
		// we'd add the rollover functionality here
		this.selector = selector;
		//this.phpfile = phpfile;
		// phpfile is now just the PHP file itself without parameters, parameters are coming in separately
		this.php4file = phpfile+"?font="+font_file+"&amp;font_size="+font_size+"&amp;font_color="+font_color+"&amp;background_color="+background_color;
		this.hover_color = hover_color;
		this.wordwrap = wordwrap;
	}
	var imageHeaders = [
		new imageHeader("h4","heading.php","ANDALEMO","15","bbbdbf","eff5f6","bbbdbf",true)
		
		]

	var testURL = "pics/test.png" ;
	var doNotPrintImages = false;
	var printerCSS = "/css/replacement-print.css";
	var hideFlicker = true;
	var hideFlickerCSS = "/css/replacement-screen.css";
	var hideFlickerTimeout = 1000;
	
//Preloads images
var myimages=new Array()
function preloadimages(){
for (i=0;i<preloadimages.arguments.length;i++){
myimages[i]=new Image()
myimages[i].src=preloadimages.arguments[i]
}
}

function SwapImage () {
  if (document.images) {

   a = SwapImage.arguments;
   inum = 0;
   for (x = 0; x < a.length; x+=2) {
      oldimg = a[x];
      newimg = a[x+1];
      if (document.images[oldimg].src.indexOf(newimg) == -1) {
         document.images[oldimg].oldsrc = document.images[oldimg].src;
         document.images[oldimg].src=newimg;
      }
      
      document.lastImgs[inum] = oldimg;
      inum++;
   
    }
  }
}

function RestoreImage () {
  if (document.images) {
   for (x = 0; x < document.lastImgs.length; x++) {
      img = document.lastImgs[x];
      document.images[img].src=document.images[img].oldsrc;
   }
   document.lastImgs = new Array;
  }
}

function newWindow(url, height, width, nameW) {
    if (nameW==""){nameW='popup';}
 if (navigator.appVersion.indexOf('4') != -1) {
 // Vars for centering the new window on Version 4 Browsers
 xTop = screen.width/2 - (width/2);
 yTop = screen.height/2 - (height/2);
 window.open(url, nameW, 'height='+height+',width='+width+',scrollbars=1,resizable=0,menubar=0,toolbar=0,status=0,location=0,directories=0,left=' + xTop + ',top=' + yTop + '');
 } else {
 window.open(url, nameW, 'height='+height+',width='+width+',scrollbars=1,resizable=0,menubar=0,toolbar=0,status=0,location=0,directories=0,left=150,top=200');
 }
}

function ChangePhoto (oldimg, newimg) {

   document.images[oldimg].src=newimg;

}
function imgSwap(oImg)
{
   var strOver  = "_on"    // image to be used with mouse over
   var strOff = "_off"     // normal image
   var strImg = oImg.src
   if (strImg.indexOf(strOver) != -1) 
      oImg.src = strImg.replace(strOver,strOff)
   else
      oImg.src = strImg.replace(strOff,strOver)
}
function show(inID) {
          document.getElementById(inID).style.visibility = 'visible';
}
function hide(inID) {
          document.getElementById(inID).style.visibility = 'hidden';
}

function FadeIn() {
	//for the main nav
	if(happened == 2)
		ixf.changeDirection();
	else
		crossfade(document.getElementById('one_main'), '/img/nav_on.gif', '1', '');
}

function FadeOut(all_half) {
	if(happened == 2)
		ixf.changeDirection();
	else
		crossfade(document.getElementById('one_main'), '/img/nav_' + all_half + '.gif', '1', '');
}