function preload(imgObj,imgSrc) {
	if (document.images) {
		eval(imgObj+' = new Image()');
		eval(imgObj+'.src = "'+imgSrc+'"');
	}
}

function swap() {
  if (document.images) {
    for (var i=0; i<swap.arguments.length; i+=2) {
      document[swap.arguments[i]].src = eval(swap.arguments[i+1] + ".src");
    }
  }
}

/* schedules/news/pictures */
preload("snpImgA_off", "/img/snpbox/shcedules.gif");
preload("snpImgB_off", "/img/snpbox/news.gif");
preload("snpImgC_off", "/img/snpbox/pictures.gif");

preload("snpImgA_on", "/img/snpbox/shcedules_on.gif");
preload("snpImgB_on", "/img/snpbox/news_on.gif");
preload("snpImgC_on", "/img/snpbox/pictures_on.gif");

function openWindow(url, winWidth, winHeight, opts){
	var posLeft = (screen.width - winWidth) / 2;
	var posTop = (screen.height - winHeight) / 2;
	var popped = window.open(url,"sbcvbpop","location=no,width="+winWidth+",height="+winHeight+",left="+posLeft+",top="+posTop+opts);
	popped.focus();
}

function openPictureWindow(imageName,imageWidth,imageHeight,alt, newWidth, newHeight) {  // v4.01

	var scroll = "no";
	var winHeight = imageHeight;
	var winWidth = imageWidth;
	
	if( newWidth ) winWidth = newWidth;
	if( newHeight ){
		scroll = "yes";
		winHeight = newHeight;
	}
		
	var posLeft = (screen.width - winWidth) / 2;
	var posTop = (screen.height - winHeight) / 2;
	
	newWindow = window.open("","newWindow","width="+winWidth+",height="+winHeight+",scrollbars="+scroll+",left="+posLeft+",top="+posTop);
	newWindow.document.open();
	newWindow.document.write('<html><title>'+alt+'</title><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onBlur="self.close()">'); 
	newWindow.document.write('<img src=\"'+imageName+'\" width='+imageWidth+' height='+imageHeight+' alt=\"'+alt+'\">');
	newWindow.document.write('</body></html>');
	newWindow.document.close();
	newWindow.focus();
}

function openPictureWindow_Fever(imageType,imageName,imageWidth,imageHeight,alt) {  // v4.01

	var posLeft = (screen.width - imageWidth) / 2;
	var posTop = (screen.height - imageHeight) / 2;

 newWindow = window.open("","newWindow","width="+imageWidth+",height="+imageHeight+",scrollbars=0,left="+posLeft+",top="+posTop);
 newWindow.document.open();
 newWindow.document.write('<html><title>'+alt+'</title><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0">');
 if (imageType == "swf"){
 newWindow.document.write('<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0\" width=\"'+imageWidth+'\" height=\"'+imageHeight+'\">');
 newWindow.document.write('<param name=movie value=\"'+imageName+'\"><param name=quality value=high>');
 newWindow.document.write('<embed src=\"'+imageName+'\" quality=high pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"'+imageWidth+'\" height=\"'+imageHeight+'\">');
 newWindow.document.write('</embed></object>');
 }else{
 newWindow.document.write('<img src=\"'+imageName+'\" width='+imageWidth+' height='+imageHeight+' alt=\"'+alt+'\">');
 }
 newWindow.document.write('</body></html>');
 newWindow.document.close();
}

function isEmail(string) {
    if (string.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
        return true;
    else
        return false;
}

function tg(o) {
	var o = document.getElementById(o);
	if (o) {
		o.style.display = (o.style.display == 'none' ? '' : 'none');
	}
}