/* -----Check user screen resolution------------------------ */

/*
Screen resolution detection and notification Script- 
© Dynamic Drive (www.dynamicdrive.com)
For full source code, installation instructions,
100's more DHTML scripts, and Terms Of
Use, visit dynamicdrive.com
*/

var correctwidth=1024
var correctheight=768

function screenResolutionDetection(){
if (screen.width<correctwidth||screen.height<correctheight)
document.write("This webpage is bested viewed with screen resolution "+correctwidth+"*"+correctheight+". Your current resolution is "+screen.width+"*"+screen.height+". If possible, please change the resolution!")
}

/* -------New window at startup----------------------------- */


function openNewWindowSB(w,h,url,title)
{
LeftPosition=(screen.width)?(screen.width-w)/2:100;
TopPosition=(screen.height)?(screen.height-h)/2:100;
var window_name = window.open(url,title,"width="+w+",height="+h+",top="+TopPosition+",left="+LeftPosition+",toolbar=0,location=0,directories=0,status,menubar=0,scrollbars=1,resizable=1,copyhistory");
}

function openNewWindow(w,h,url,title)
{
LeftPosition=(screen.width)?(screen.width-w)/2:100;
TopPosition=(screen.height)?(screen.height-h)/2:100;
var window_name = window.open(url,title,"width="+w+",height="+h+",top="+TopPosition+",left="+LeftPosition+",toolbar=0,location=0,directories=0,status,menubar=0,scrollbars=0,resizable=1,copyhistory");
}


/* ------Titlebar text------------------------------ */

function titleBarType(txt) 
	{window.status = txt;setTimeout("titleBarErase()",2000);}

function titleBarErase()
	{window.status="";}



/* ------thumbnail fade effect------------------------------ */


var startopacity = 30; // Set this variable between 1 and 100 as the standard opacity

function fadeIt(obj,direct)
{ 
if(window.timer) { clearInterval(timer); } 
tobj=obj; drct=direct; 
timer=setInterval("flowfilter(tobj,drct);",1);
}

function flowfilter(thing,dct){
if(dct==1) { if (thing.filters.alpha.opacity<100) { thing.filters.alpha.opacity+=25; } else { clearInterval(timer); } }
if(dct==2) { if (thing.filters.alpha.opacity>startopacity) { thing.filters.alpha.opacity-=25; } else { clearInterval(timer); } }
}


var ie4 = (document.all) ? true : false;
var ns4 = (document.layers) ? true : false;
var ns6 = (document.getElementById && !document.all) ? true : false;

function blinkOn(){
	document.all[nameLayer].style.visibility = "hidden"
/*  Removed cause of performance hit
	if (ie4) {document.all[nameLayer].style.visibility = "visible";}
	if (ns4) {document.layers[nameLayer].visibility = "show";}
	if (ns6) {document.getElementById([nameLayer]).style.display = "block";}
*/
         count++;
         timeOutID = window.setTimeout("blinkOff()",5);
 }

function blinkOff(){
	document.all[nameLayer].style.visibility = "visible"
/*  Removed cause of performance hit
	if (ie4) {document.all[nameLayer].style.visibility = "hidden";}
	if (ns4) {document.layers[nameLayer].visibility = "hide";}
	if (ns6) {document.getElementById([nameLayer]).style.display = "none";}
*/
         if (count < 5)
                 timeOutID = window.setTimeout("blinkOn()",5);
 }

function blinkit(layer)
 {
         count = 0
         nameLayer = layer
         timeOutID = window.setTimeout("blinkOn()",5);
 }






/* --------imageTemplate---------------------------- */

function imageTemplate(image,w,h)
{
      openWin("", "<HEAD><TITLE>© 2004 Martin's Lights</TITLE><META HTTP-EQUIV='imagetoolbar' CONTENT='NO'></HEAD><BODY BGCOLOR='#E8E8E8' topmargin='0' leftmargin='2'><CENTER><TABLE BORDER='0' CELLPADDING='0' CELLSPACING='0' WIDTH='100%' HEIGHT='100%' align='top'><TR><TD WIDTH='100%' ALIGN='TOP'><IMG SRC="+image+" ALIGN='TOP' BORDER='1' HSPACE='0' VSPACE=0></TD></TR></TABLE></CENTER>","width="+w+",height="+h,w,h);
}

function openWin(url, str, features,w,h)  // open popup window
  {
  // Netscape recognizes the popupWin object, so we can
  // write code that keeps a single popup window open.
  // IE does not recognize the popupWin object, we must
  // write code that opens multiple popup windows.
  // More info: www.dannyg.com/javascript/jsminifaq.html#q13

  if (navigator.appName.indexOf("Netscape") != -1)  // Netscape only!
    {
    if (!firstWin)  // can't reference popupWin unless it exists
      if (popupWin.document)  // if user didn't already close popupWin,
        popupWin.close();     // close it now (before opening new popupWin)
    }
LeftPosition=(screen.width)?(screen.width-w)/2:100;
TopPosition=(screen.height)?(screen.height-h)/2:100;
  popupWin = window.open(url, "gdImageViewer", features+",width="+w+",height="+h+",top="+TopPosition+",left="+LeftPosition);  // Netscape and IE from here on
  if (str != "")
    {
    popupWin.resizeTo(w,h);
//    popupWin.moveTo(LeftPosition,TopPosition);   This would re-center the window.. 
    popupWin.document.write(str);
    popupWin.document.close();
    }
  firstWin = false;  // because popupWin now exists
  }

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}


/* --------videoTemplate---------------------------- */

function videoTemplate(image,w,h)
{
      openWin("", "<HEAD><TITLE>© 2003 Ed Giddings</TITLE><META HTTP-EQUIV='imagetoolbar' CONTENT='NO'></HEAD><BODY BGCOLOR='#E8E8E8' topmargin='0' leftmargin='2'><CENTER><TABLE BORDER='0' CELLPADDING='0' CELLSPACING='0' WIDTH='100%' HEIGHT='100%' align='top'><TR><TD WIDTH='100%' ALIGN='center'><embed SRC="+image+" ALIGN='TOP' BORDER='1' HSPACE='0' VSPACE=0></TD></TR></TABLE></CENTER>","width="+w+",height="+h,w,h);
}

function openWin(url, str, features,w,h)  // open popup window
  {
  // Netscape recognizes the popupWin object, so we can
  // write code that keeps a single popup window open.
  // IE does not recognize the popupWin object, we must
  // write code that opens multiple popup windows.
  // More info: www.dannyg.com/javascript/jsminifaq.html#q13

  if (navigator.appName.indexOf("Netscape") != -1)  // Netscape only!
    {
    if (!firstWin)  // can't reference popupWin unless it exists
      if (popupWin.document)  // if user didn't already close popupWin,
        popupWin.close();     // close it now (before opening new popupWin)
    }
LeftPosition=(screen.width)?(screen.width-w)/2:100;
TopPosition=(screen.height)?(screen.height-h)/2:100;
  popupWin = window.open(url, "gdImageViewer", features+",width="+w+",height="+h+",top="+TopPosition+",left="+LeftPosition);  // Netscape and IE from here on
  if (str != "")
    {
    popupWin.resizeTo(w,h);
//    popupWin.moveTo(LeftPosition,TopPosition);   This would re-center the window.. 
    popupWin.document.write(str);
    popupWin.document.close();
    }
  firstWin = false;  // because popupWin now exists
  }

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

