<!-- 
// ------------------------------------------------------------------------
// js.js - custom JavaScript library routine
//
// This file "js.js" provides for misc JavaScript functions  
//
// Revision History:
// John Davide 02/17/02 Original Program
//
// THE INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. 
// JOHN DAVIDE's DEVELOPMENT DISCLAIMS ALL WARRANTIES, EITHER EXPRESSED 
// OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS 
// FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL JOHN DAVIDE OR ITS 
// SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, 
// INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR 
// SPECIAL DAMAGES, EVEN IF JOHN DAVIDE OR ITS SUPPLIERS HAVE BEEN 
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW 
// THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR 
// INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.
//
// COPYRIGHT NOTICE:
// a) This code is property of John Davide/Insight Information Services
// b) It is being distributed to you as a customer on an "as is" basis.
// c) Use of this code, or any part thereof, is contingent upon leaving
//     this copyright notice, name and address information in tact.
// d) Written permission must be obtained from us before this code, or any
//     part thereof, is sold or used in a product which is sold.
// e) By using this code, you accept full responsibility for its use
//     and will not hold the John Davide or Insight Information Services, 
//     its employees or officers liable for damages of any sort.
// f) This code is not to be used for illegal purposes.
// g) Please email us any revisions made to this code.
//
// Copyright 2001-2004                       http://www.InsightTools.net
// Insight Information Services
// ------------------------------------------------------------------------
// My Clock
dayName = new Array ("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
monName = new Array ("Jan.", "Feb.", "Mar.", "Apr.", "May", "June", "July", "Aug.", "Sept.", "Oct.", "Nov.", "Dec.");
now = new Date;
thisYr = now.getYear();
if (thisYr < 1900) {thisYr = thisYr + 1900;}
thisHr = now.getHours();	 
thisMin = now.getMinutes();	 
//thisSec = now.getSeconds();	 
var thisTime = "" + ((thisHr > 12) ? thisHr - 12 : thisHr); 
thisTime += ((thisMin < 10) ? ":0" : ":") + thisMin; 
//thisTime += ((thisSec < 10) ? ":0" : ":") + thisSec; 
thisTime += (thisHr >= 12) ? " P.M." : " A.M."; 

// New Clock
var clockID = 0;

function calctime()
{
var currenttime = new Date();
var hours = currenttime.getHours();
var minutes = currenttime.getMinutes();
//var seconds = currenttime.getSeconds();
var timesuffix = "AM";
var nday=currenttime.getDay();
var tday=currenttime.getDay();
var nmonth=currenttime.getMonth();
var ntoday=currenttime.getDate();
var nyear=currenttime.getYear();

if (hours > 11)
{
timesuffix = "PM";
hours = hours - 12;
}
if (hours == 0)
{
hours = 12;
}
if (hours < 10)
{
hours = "0" + hours;
}
if (minutes < 10)
{
minutes = "0" + minutes;
}
//if (seconds < 10)
//{
//seconds = "0" + seconds;
//}
if (tday==0)
  nday="Sunday";
if (tday==1)
  nday="Monday";
if (tday==2)
  nday="Tuesday";
if (tday==3)
  nday="Wednesday";
if (tday==4)
  nday="Thursday";
if (tday==5)
  nday="Friday";
if (tday==6)
  nday="Saturday";

nmonth+=1;

if (nmonth==1) nmonth="January";
if (nmonth==2) nmonth="February";
if (nmonth==3) nmonth="March";
if (nmonth==4) nmonth="April";
if (nmonth==5) nmonth="May";
if (nmonth==6) nmonth="June";
if (nmonth==7) nmonth="July";
if (nmonth==8) nmonth="August";
if (nmonth==9) nmonth="September";
if (nmonth==10) nmonth="October";
if (nmonth==11) nmonth="November";
if (nmonth==12) nmonth="December";

if (nyear<=99)
  nyear= "19"+year;

if ((nyear>99) && (nyear<2000))
 nyear+=1900;

//var clockLocation = document.getElementById('digitalclock');
//clockLocation.innerHTML = nday + ", " + nmonth + " " + ntoday + " " + nyear +
//" " + hours + ":" + minutes + ":" + seconds + " " + timesuffix;
//clockID=setTimeout('calctime()',1000);

var clockLocation = document.getElementById('digitalclock');
clockLocation.innerHTML = nday + ", " + nmonth + " " + ntoday + " " + nyear +
"   " + hours + ":" + minutes +  "  " + timesuffix;
clockID=setTimeout('calctime()',50000);

}

function killClock(pClockID) {
   if(pClockID) {
      clearTimeout(pClockID);
      pClockID  = 0;
   }
}


//<SCRIPT LANGUAGE="JavaScript1.2">
//function myFullscreen() {
//  window.open('http://home.netscape.com','myName',
//  'width='+screen.width+',height='+screen.height+',top=0,left=0');
//}
//</SCRIPT>

// Centering a window
function openCentered (url, width, height, windowName, featureString) {
  if (!windowName)
    windowName = '';
  if (!featureString)
    featureString = '';
  else
    featureString = ',' + featureString;
  var x = Math.round((screen.availWidth - width) / 2);
  var y = Math.round((screen.availHeight - height) / 2);
  featureString = 'left=' + x + ',top=' + y + ',width=' + width 
+ ',height=' + height + featureString;
  return open (url, windowName, featureString);
}


// Initialize window positioning 
        var loaded = false;
	var winwidth = 620;
	var winheight = 500; 

// Re-adjust window size based on resolution - ties in closely with the css
	if (screen.width == 640) {
	   var winwidth = 500;
	   var winheight = 350;
	   var helpwinwidth = 400;
	   var helpwinheight = 250;
	}
	if (screen.width == 800) {
	   var winwidth = 550;
	   var winheight = 400;
	   var helpwinwidth = 450;
	   var helpwinheight = 300;
	}
	if (screen.width == 1024) {
	   var winwidth = 600;
	   var winheight = 450;
	   var helpwinwidth = 500;
	   var helpwinheight = 350;
	}
	if (screen.width == 1280) {
	   var winwidth = 650;
	   var winheight = 500;
	   var helpwinwidth = 550;
	   var helpwinheight = 400;
	}
	if (screen.width == 1600) {
	   var winwidth = 720;
	   var winheight = 600;
	   var helpwinwidth = 620;
	   var helpwinheight = 500;
	}


// Date posting
monName = new Array("January","February","March","April","May","June","July","August","September","October","November","December"); Stamp = new Date(); year = Stamp.getYear(); if (year < 2000){ year = 1900 + year};  

// Center Window 
var x = Math.round((screen.availWidth - winwidth) / 2);
var y = Math.round((screen.availHeight - winheight) / 2);

// Window functions
function popupwin(url) {
    var popupWin = window.open('maincat.php','shopping','width='+winwidth+',height='+winheight+',left='+ x +',top='+ y +',scrollbars=yes,status=yes,resizable=yes');
    window.location = url;
}

function HelpWin(url, winName) {
    var popupWin = window.open(url,winName,'width='+winwidth+',height='+winheight+',left='+ x +',top='+ y +',scrollbars=yes,status=no,resizable=yes');
}

function SearchWindow(url) {
    var popupWin = window.open(url,'shopping','width='+winwidth+',height='+winheight+',left='+ x +',top='+ y +',scrollbars=yes,status=no,resizable=yes');
}

function CreditsWindow(url) {
    var popupWin = window.open(url,'credits');
}

function shopping_window(url)
{
     var NEW_WIN = null;
     NEW_WIN = window.open('','shopping','toobar=yes,width='+700+',height='+400+'left='+leftPos+',top=0'+',directories=no,status=no,scrollbars=yes,resize=no,menubar=no');
     NEW_WIN.location.href=url;
}

function closeWin() {
  close();
}

function display_date() {
	var outstring = wday + " " + lmonth + " " + date + ", " + fyear;
	document.write(outstring);
	return true;
}

// Frames buster
function AW_BustFrames() {
	if (self.parent.frames.length!=0)
	{
		self.parent.location.replace(document.location.href);
	}
}

// Mouse Over imaging
function SwitchImg()
{ //start
  var rem, keep=0, store, obj, switcher=new Array, history=document.Data;
    for (rem=0; rem < (SwitchImg.arguments.length-2); rem+=3) {
    	store = SwitchImg.arguments[(navigator.appName == 'Netscape')?rem:rem+1];
    if ((store.indexOf('document.layers[')==0 && document.layers==null) ||
        (store.indexOf('document.all[')==0 && document.all==null))
         store = 'document'+store.substring(store.lastIndexOf('.'),store.length);
         obj = eval(store);
    if (obj != null) {
   	   switcher[keep++] = obj;
      switcher[keep++] = (history==null || history[keep-1]!=obj)?obj.src:history[keep];
      obj.src = SwitchImg.arguments[rem+2];
  } }
  document.Data = switcher;
} //end

// Mouse Over imaging
function RestoreImg()
{ //start
  if (document.Data != null)
    for (var rem=0; rem<(document.Data.length-1); rem+=2)
      document.Data[rem].src=document.Data[rem+1];
} //end


/*
Disable right mouse click Script (By Crash @ http://walk.to/crash)
var message="Function Disabled";
function click(e) {
if (document.all) {
if (event.button == 2) {
alert(message);
return false;
}
}
if (document.layers) {
if (e.which == 3) {
alert(message);
return false;
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;

*/

//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")

// -->







