pic1= new Image(658,390); 
pic1.src="images/mainbg.gif"; 

function preloadImages(imgs) {
var imgURLs=['"'+imgs+'"'];

 var x=new Array();
 for(var i=0;i<imgURLs.length;i++){
  x[i]=new Image();
  x[i].src=imgURLs[i];
 }
}

// var newwindow = '';
function popitup(url,wi,hi,scrollbar) {
	if (scrollbar == 'yes') { 
		scrollbar = 'yes';
	} 
	if (scrollbar == 'no') {
		scrollbar = 'no';
	}

//if (newwindow.location && !newwindow.closed) {
//    newwindow.location.href = url;
//    newwindow.focus(); 
// } else {
  window.open(url,'','height='+hi+',width='+wi+',toolbar=no,directories=no,location=no,menubar=no,status=no,scrollbars='+scrollbar+',left=10,top=30');
// }
}

function LoadNextPic(url) {
 window.location = url;
}

var duration = 4;
function SlideShow(url) {
 setTimeout("LoadNextPic('"+url+"')",duration*1000);
}

function showHide(targetName) {
 if( document.getElementById ) { // NS6+
  target = document.getElementById(targetName);
 } else if( document.all ) { // IE4+
  target = document.all[targetName];
 }
 if( target ) {
  if( target.style.display == "none" ) {
   target.style.display = "inline";
  } else {
   target.style.display = "none";
  }
 }
} 
function show(ttName) {
 if( document.getElementById ) { // NS6+
  tt = document.getElementById(ttName);
 } else if( document.all ) { // IE4+
  tt = document.all[ttName];
 }

 tt.style.display = "inline";
}

function hide(targetName) {
 if( document.getElementById ) { // NS6+
  target = document.getElementById(targetName);
 } else if( document.all ) { // IE4+
  target = document.all[targetName];
 }
 target.style.display = "none";
}

isNS4 = (document.layers) ? true : false;
isIE4 = (document.all && !document.getElementById) ? true : false;
isIE5 = (document.all && document.getElementById) ? true : false;
isNS6 = (!document.all && document.getElementById) ? true : false;

function switchDiv(strDivName,bolVisible){

 //identify the element based on browser type
 if (isNS4) {
   objElement = document.layers[strDivName];
 } else if (isIE4) {
   objElement = document.all[strDivName];
 } else if (isIE5 || isNS6) {
   objElement = document.getElementById(strDivName);
 }
 
 if(isNS4){
     if(!bolVisible) {
       //objElement.style.visibility = "hidden";
       objElement.visibility ="hidden"
     } else {
       //objElement.style.visibility = "visible";
       objElement.visibility ="visible"
     }     
 }else{
     if(!bolVisible) {
       objElement.style.visibility = "hidden";
       //document.layers[strDivName].visibility ="hidden"
     } else {
       objElement.style.visibility = "visible";
       //document.layers[strDivName].visibility ="visible"
     }
 }
}

// enable scrolling for overflow:auto elements in Mozilla
function scrollMe(event) {
	var st = event.currentTarget.scrollTop + (event.detail * 12);
	event.currentTarget.scrollTop = st < 0 ? 0 : st;
	event.preventDefault();
}

function scrollDiv(what) { 
	if (document.body.addEventListener) {
		var divs = document.getElementsByTagName('DIV');
		for (var d in divs) {
			if (divs[d].className && divs[d].className == what) {
				try {
					divs[d].addEventListener('DOMMouseScroll', scrollMe, false);
				} catch (ex) {}
			}
		}
	}
}


