/*
	# Copyright (c) 2001 Moonstone Interactive, Inc.  
	#
	# For more information, see:
	#     http://www.msinteractive.com/
	#
*/			
	
// Code starts here
	
// SR: 2005.02.11 -- Made all paths relative to root and eliminated some old code in but_on and but_off
// SR: the three rollover functions below are better on onecupcoffee...
function LoadGIF(image) {
	var rollover = document.images;
	if (rollover) {
		eval (image + '= new Image()');
		eval (image + '.src  = "images/' + image + '.gif"');
	}
}

LoadGIF('b_add_cart_on');
LoadGIF('b_add_cart_off');
LoadGIF('b_my_shopping_cart_on');
LoadGIF('b_my_shopping_cart_off');

//this creates the button script 



function but_on(butname) {
	var imagepath = document.images;
	
	// Turn on nav item
	eval("imagepath." + butname + ".src='images/" + butname + "_on.gif'");
}

function but_off(butname) {
	var imagepath = document.images;

	// Turn off nav item
	eval("imagepath." + butname + ".src='images/" + butname + "_off.gif'");
}






function WM_netscapeCssFixCheckIn() {
  // This function checks to make sure the version of Netscape 
  // in use contains the bug; if so, it records the window's 
  // width and height and sets all resize events to be handled 
  // by the WM_netscapeCssFix() function.
  if ((navigator.appName == 'Netscape') && (parseInt(navigator.appVersion) == 4)) {
    if (typeof document.WM == 'undefined'){
      document.WM = new Object;
    }
    if (typeof document.WM.WM_scaleFont == 'undefined') {
      document.WM.WM_netscapeCssFix = new Object;
      document.WM.WM_netscapeCssFix.initWindowWidth = window.innerWidth;
      document.WM.WM_netscapeCssFix.initWindowHeight = window.innerHeight;
    }
    window.onresize = WM_netscapeCssFix;
  }
}

/*
** msi_copyright.js
** Version: 004 -- 06.22.00
*/

function include_copyright(startyear) {
	var	blob="";
	var msistartyear = 2005;
	var	today=new Date(); 
	var	thisyear = get_full_year(today);
	if (startyear < thisyear && startyear >= msistartyear) {
		blob += startyear + " - ";
	}
	blob += thisyear;
	blob = "Copyright&nbsp;&copy;&nbsp;" + blob;
	return blob;
}

/* 
** subroutine: get_full_year
** param1: d -> date.  any date object.
*/
function get_full_year(d) { // d is a date object
	yr = d.getYear();
	if (yr < 1000) {
	 	yr+=1900;
	}
	return yr;
}

/*For privacy policy/terms/shipping child window */
function openPrivacy() {
var openWin = window.open("/privacy_policy.html","privacy_terms","resizable=0,location=0,status=0,menubar=0,toolbar=0,scrollbars=1,width=450,height=400,left=0,top=0,screenX=0,screenY=0");
openWin.opener = window;

openWin.focus();
}

function openRefund() {
var openWin = window.open("/refund_policy.html","refund_policy","resizable=0,location=0,status=0,menubar=0,toolbar=0,scrollbars=1,width=450,height=400,left=0,top=0,screenX=0,screenY=0");
openWin.opener = window;

openWin.focus();
}

function openTerms() {
var openWin = window.open("/terms.html","terms","resizable=1,location=0,status=0,menubar=0,toolbar=0,scrollbars=1,width=450,height=400,left=0,top=0,screenX=0,screenY=0");
openWin.opener = window;

openWin.focus();
}

function openshipping() {
var openWin = window.open("/main/shipping_policy.html","privacy_terms_ship","resizable=1,location=0,status=0,menubar=0,toolbar=0,scrollbars=1,width=450,height=400,left=0,top=0,screenX=0,screenY=0");
openWin.opener = window;

openWin.focus();
}




