/* -----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 openNewWindow(w,h,url,title,scroll)
{
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="+scroll+",resizable=1,copyhistory");
}


/* ------Titlebar text------------------------------ */

function titleBarType(txt) 
	{window.status = txt;setTimeout("titleBarErase()",2000);}

function titleBarErase()
	{window.status="";}


/* ------preload bar----------------------------- */

var counter=0;

function count()
{	counter++; }

function continueOn()
{
	if(counter==20) {document.location.href = 'enter.htm';}
	setTimeout("continueOn()", 500);
}


/* ------thumbnail fade effect------------------------------ */


// Written by Julius Klatte for Emagine Web Design
// url: go.to/emagine

var startopacity = 70; // 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+=15; } else { clearInterval(timer); } }
if(dct==2) { if (thing.filters.alpha.opacity>startopacity) { thing.filters.alpha.opacity-=15; } 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()",50);
 }

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()",50);
 }

function blinkit(layer)
 {
         count = 0
         nameLayer = layer
         timeOutID = window.setTimeout("blinkOn()",50);
 }






/* --------imageTemplate---------------------------- */

function imageTemplate(image,w,h)
{
      openWin("", "<HEAD><TITLE>Preview</TITLE><META HTTP-EQUIV='imagetoolbar' CONTENT='NO'></HEAD><BODY BGCOLOR='#333333'><CENTER><TABLE BORDER='0' CELLPADDING='0' CELLSPACING='0' WIDTH='100%' HEIGHT='100%'><TR><TD WIDTH='100%' ALIGN='CENTER'><IMG SRC="+image+" ALIGN='middle' 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;
}



/* --------Dreamweaver imagepreload---------------------------- */

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// -->

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}
