///////////////////////////////////
//OPEN WINDOW
///////////////////////////////////

function MM_openBrWindow(theURL,winName,features, myWidth, myHeight, isCenter) { //v3.0
  if(window.screen)if(isCenter)if(isCenter=="true"){
    var myLeft = (screen.width-myWidth)/2;
    var myTop = (screen.height-myHeight)/2;
    features+=(features!='')?',':'';
    features+=',left='+myLeft+',top='+myTop;
  }
  window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);
}

///////////////////////////////////
//OPEN WINDOW 2 - v.LVL 4
///////////////////////////////////

function Lvl_openWin(u,n,w,h,l,t,c,f) { //v2.2 4LevelWebs
  var x=((screen.width-w)/2);if(c==1){l=x;t=(screen.height-h)/2;}if(c==2){l=x}
	f+=',top='+t+',left='+l;LvlWin=window.open(u,n,f);LvlWin.focus();
}

///////////////////////////////////
//CLOSE WINDOW
///////////////////////////////////

function closeIt(){
	self.close();
}

///////////////////////////////////
//PRINT SCRIPT
///////////////////////////////////

// (C) 2000 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this  header

function printWindow(){
   bV = parseInt(navigator.appVersion)
   if (bV >= 4) window.print()
}

///////////////////////////////////
//STATUS MSG
///////////////////////////////////


function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}

///////////////////////////////////
//Disable right click script III- By Renigade (renigade@mediaone.net)
//For full source code, visit http://www.dynamicdrive.com
///////////////////////////////////

var message="";
///////////////////////////////////
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if 
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers) 
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}

document.oncontextmenu=new Function("return false")

///////////////////////////////////
//SLIDE DIV
///////////////////////////////////

function flevSlideDiv() { // v1.1, Marja Ribbers-de Vroed, FlevOOware
	if (arguments.length < 4) {return;}
	var sDivID = arguments[0]; if (sDivID == "") {return;}
	var docObj = eval("MM_findObj('" + sDivID + "')"); if (docObj == null) {return;}
	var iNewX = parseInt(arguments[1]), iNewY = parseInt(arguments[2]);
	var iSpeed = parseInt(arguments[3]);
	var iPx = (arguments.length > 4) ? parseInt(arguments[4]) : 0;
	iTimeout = 10, sSuffix = "";
	if (!document.layers) {docObj = docObj.style;} // not NS4.x 
	if (docObj.tmpTimeout != null) {clearTimeout(docObj.tmpTimeout);}
	var iCurX = parseInt(docObj.left), iCurY = parseInt(docObj.top);
	if ((iCurX != iNewX) || (iCurY != iNewY)) {  // layer position needs to be adjusted
		if (iPx > 0) { // constant speed
			iTimeout = iSpeed;
			var iPxX = iPx, iPxY = iPx, iMoveX = Math.abs(iCurX - iNewX), iMoveY = Math.abs(iCurY - iNewY);
			// take care of diagonal movement
			if (iMoveX < iMoveY) {iPxY = (iMoveX != 0) ? ((iMoveY/iMoveX)*iPx) : iPx;}
			else {iPxX = (iMoveY != 0) ? ((iMoveX/iMoveY)*iPx) : iPx;}
			if (iPxX >= iMoveX) {iPxX = Math.min(Math.ceil(iPxX), iPx);}
			if (iPxY >= iMoveY) {iPxY = Math.min(Math.ceil(iPxY), iPx);}
			// calculate temporary X/Y coordinates
			if ((iCurX < iNewX) && (iCurX + iPxX < iNewX)) {iNewX = iCurX + iPxX;}
			if ((iCurX > iNewX) && (iCurX - iPxX > iNewX)) {iNewX = iCurX - iPxX;}
			if ((iCurY < iNewY) && (iCurY + iPxY < iNewY)) {iNewY = iCurY + iPxY;}
			if ((iCurY > iNewY) && (iCurY - iPxY > iNewY)) {iNewY = iCurY - iPxY;}
		}
		else { // gradually decreasing speed
			var iMoveX = ((iNewX - iCurX) / iSpeed); 
			iMoveX = (iMoveX > 0) ? Math.ceil(iMoveX) : Math.floor(iMoveX);
			iNewX = iCurX + iMoveX; 
			var iMoveY = ((iNewY - iCurY) / iSpeed); 
			iMoveY = (iMoveY > 0) ? Math.ceil(iMoveY) : Math.floor(iMoveY);
			iNewY = iCurY + iMoveY;
		}
		// now actually move div
		if ((parseInt(navigator.appVersion)>4 || navigator.userAgent.indexOf("MSIE")>-1) && (!window.opera)) {sSuffix="px";}
		if (iMoveX != 0) {eval("docObj.left = '" + iNewX + sSuffix + "'");}
		if (iMoveY != 0) {eval("docObj.top = '" + iNewY + sSuffix + "'");}
		var sFunction = "flevSlideDiv('" + sDivID + "'," + arguments[1] + "," + arguments[2] + "," + iSpeed + "," + iPx + ")";
		docObj.tmpTimeout = setTimeout(sFunction,iTimeout);
	}
}

///////////////////////////////////
//PRELOAD IMAGES
///////////////////////////////////

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];}}
}

///////////////////////////////////
//SHOW HIDE LAYERS
///////////////////////////////////

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; }
}

function MM_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.getElementById(n); return x;
}

///////////////////////////////////
//IMAGE FADER
///////////////////////////////////

/*
Gradual-Highlight Image Script II- 
By J. Mark Birenbaum (birenbau@ugrad.cs.ualberta.ca)
Permission granted to Dynamicdrive.com to feature script in archive
For full source to script, visit http://dynamicdrive.com
*/

nereidFadeObjects = new Object();
nereidFadeTimers = new Object();

/* object - image to be faded (actual object, not name);
 * destop - destination transparency level (ie 80, for mostly solid)
 * rate   - time in milliseconds between trasparency changes (best under 100)
 * delta  - amount of change each time (ie 5, for 5% change in transparency)
 */

function nereidFade(object, destOp, rate, delta){
if (!document.all)
return
    if (object != "[object]"){  //do this so I can take a string too
        setTimeout("nereidFade("+object+","+destOp+","+rate+","+delta+")",0);
        return;
    }
        
    clearTimeout(nereidFadeTimers[object.sourceIndex]);
    
    diff = destOp-object.filters.alpha.opacity;
    direction = 1;
    if (object.filters.alpha.opacity > destOp){
        direction = -1;
    }
    delta=Math.min(direction*diff,delta);
    object.filters.alpha.opacity+=direction*delta;

    if (object.filters.alpha.opacity != destOp){
        nereidFadeObjects[object.sourceIndex]=object;
        nereidFadeTimers[object.sourceIndex]=setTimeout("nereidFade(nereidFadeObjects["+object.sourceIndex+"],"+destOp+","+rate+","+delta+")",rate);
    }
}


///////////////////////////////////
//P7
///////////////////////////////////


function P7_autoLayers() { //v1.2 by PVII
 var g,b,k,f,args=P7_autoLayers.arguments;
 var a = parseInt(args[0]);if(isNaN(a))a=0;
 if(!document.p7setc) {p7c=new Array();document.p7setc=true;
  for (var u=0;u<10;u++) {p7c[u] = new Array();}}
 for(k=0; k<p7c[a].length; k++) {
  if((g=MM_findObj(p7c[a][k]))!=null) {
   b=(document.layers)?g:g.style;b.visibility="hidden";}}
 for(k=1; k<args.length; k++) {
  if((g=MM_findObj(args[k])) != null) {
   b=(document.layers)?g:g.style;b.visibility="visible";f=false;
   for(j=0;j<p7c[a].length;j++) {
    if(args[k]==p7c[a][j]) {f=true;}}
  if(!f) {p7c[a][p7c[a].length++]=args[k];}}}
}

function P7_hideDiv(evt) { //v1.0 by PVII
 var b,relT,mT=false; 
 if(document.layers){b=evt.target;if(b.p7aHide){
  b.visibility="hidden";}else{routeEvent(evt);}
 }else if(document.all&&!window.opera){b=event.srcElement;
  while(b!=null){if(b.tagName=="DIV"){mT=true;break;}b=b.parentElement;}
  if(!b.contains(event.toElement)){b.style.visibility="hidden";}
 }else if(document.getElementById){b=evt.currentTarget;relT=evt.relatedTarget;
  while(relT!=null){if(b==relT){mT=true;break;}
  relT=relT.parentNode;}if(!mT){b.style.visibility="hidden";}}
}

function P7_autoHide() { //v1.0 by PVII
 var i,g,args=P7_autoHide.arguments;
 for(i=0;i<args.length;i++){if((g=MM_findObj(args[i]))!=null){
  g.p7aHide=true;if(document.layers){
  g.captureEvents(Event.MOUSEOUT);}g.onmouseout=P7_hideDiv;}}
}

///////////////////////////////////
//auto size store image
///////////////////////////////////

// Script Source: CodeLifter.com
// Copyright 2003
// Do not remove this notice.

// SETUPS:
// ===============================

// Set the horizontal and vertical position for the popup

PositionX = (screen.width-233)/2;
PositionY = (screen.height-350)/2;

// Set these value approximately 20 pixels greater than the
// size of the largest image to be used (needed for Netscape)

defaultWidth  = 260;
defaultHeight = 370;

// Set autoclose true to have the window close automatically
// Set autoclose false to allow multiple popup windows

var AutoClose = true;

// Do not edit below this line...
// ================================
if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;
function popImage(imageURL,imageTitle){
if (isNN){imgWin=window.open('about:blank','',optNN);}
if (isIE){imgWin=window.open('about:blank','',optIE);}
with (imgWin.document){
writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);');
writeln('width=100-(document.body.clientWidth-document.images[0].width);');
writeln('height=100-(document.body.clientHeight-document.images[0].height);');
writeln('window.resizeTo(width,height);}');writeln('if (isNN){');       
writeln('window.innerWidth=document.images["George"].width;');writeln('window.innerHeight=document.images["George"].height;}}');
writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');
if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
else writeln('<META HTTP-EQUIV="imagetoolbar" CONTENT="no"></head><body bgcolor=ffffff scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
writeln('<img name="George" src='+imageURL+' style="display:block"></body></html>');
close();		
}}
