var isNav = 0;
var isIE  = 0;
if (navigator.appName.indexOf("Netscape") != -1) { isNav = 1; }
if (navigator.appName.indexOf("Microsoft") != -1) { isIE = 1; }


function javaRedirect(myurl) { // investigate doing this differently
        if ((parseFloat(navigator.appVersion) < 4.06 ) && (navigator.appName.indexOf("Netscape") != -1)) {
                browserWarn();
        } else {
                commandString = "window.location='" + myurl + "';";
                returnVal = eval(commandString);
        }
}

function PriceAlertWindow(url, name) {
	var w = 450;
	var h = 270;
	var x = 20;
	var y = 20; // a little buffer too.
	var features = "resizable,width=" + w +",height=" + h + ",top=" + y + ",left=" + x + ",screenX=" + x + ",screenY=" + y;
	popupPriceAlertWin = window.open(url, name, features);
	if (popupPriceAlertWin) {
		popupPriceAlertWin.focus();
	}
}

// This is the javascript for the tooltips (ALT style)
if (!document.layers&&!document.all) {
	event="test";
}

function openPromoWindow(url, name) {
	var w = 350;
	var h = 495;
	var x = 20;
	var y = 20; // a little buffer too.
	var features = "resizable,scrollbars,width=" + w +",height=" + h + ",top=" + y + ",left=" + x + ",screenX=" + x + ",screenY=" + y;
	popupPromoWin = window.open(url, name, features);
	if (popupPromoWin) {
		popupPromoWin.focus();
	}
	
	if (popupPromoWin.opener == null) { // if there is a problem
		popupPromoWin.opener = window;
	}
	popupPromoWin.opener.name = "mainWin";
}

function openHelpWindow(url, name) {
	var w = 600;
	var h = 350;
	var x = 20;
	var y = 20; // a little buffer too.
	var features = "scrollbars,resizable,width=" + w +",height=" + h + ",top=" + y + ",left=" + x + ",screenX=" + x + ",screenY=" + y;
	popupHelpWin = window.open(url, name, features);
	if (popupHelpWin) {
		popupHelpWin.focus();
	}
}

function printReviewFrame(reviewurl) {
    var name = "reviews";
    var w = 650;
    var h = 475;
    var x = 20;
    var y = 20; // a little buffer too.
    var features = "scrollbars,width=" + w +",height=" + h + ",top=" + y + ",left=" + x + ",screenX=" + x + ",screenY=" + y;
    popupReviewWin = window.open("<!--**AFUrl-->blank.html", name, features);
    d=popupReviewWin.document;
    d.write('<HTML>');
    d.write('<HEAD>');
    d.write('<TITLE>Reviews</TITLE>');
    d.write('</HEAD>');
    d.write('<FRAMESET BORDER=0 COLS="100%">');
    d.write('  <FRAMESET BORDER=0 ROWS="95,*">');
    d.write('    <FRAME SRC="<!--**AFUrlCGI(a=stat:AFTtopreview)-->" NAME="topreview" MARGINWIDTH="1" MARGINHEIGHT="1" SCROLLING="no" NORESIZE>');
    d.write('    <FRAME SRC="' + reviewurl + '" NAME="reviewframe" MARGINWIDTH="1" MARGINHEIGHT="1">');
    d.write('  </FRAMESET>');
    d.write('</FRAMESET>');
    d.write('</HTML>');
    d.close();
    return;
  }

  function openReviewWindow(reviewurl) {

    if (self.popupReviewWin) {
      if (self.popupReviewWin.reviewframe) {
        popupReviewWin.reviewframe.location = reviewurl;
        popupReviewWin.focus();
      }
      else
      {
        printReviewFrame(reviewurl);
        popupReviewWin.focus();
      }
    }
    else
    {
      printReviewFrame(reviewurl);
      popupReviewWin.focus();
    }
    return;
  }


// This is the javascript for the tooltips (ALT style)
if (!document.layers&&!document.all) {
	event="test";
}

function showtip(current,e,text) {
	text = text.replace(/(......................... )/g, "$1<BR>");
	if (document.all) {
		thetitle=text.split("<BR>");
		if (thetitle.length > 1) {
			thetitles="";
			for (i=0; i < thetitle.length; i++) {
				thetitles+= thetitle[i];
			}
			current.title=thetitles;
		} else {
			current.title=text;
		}
	} else if (document.layers) {
		document.tooltip.document.write("<layer bgColor='FFFFCC' style='border:1px solid black;font-size:12px;font-family:Arial,sans-serif;'>"+text+" </layer>");
		document.tooltip.document.close();
		document.tooltip.left=e.pageX + 5;
		document.tooltip.top=e.pageY + 5;
		document.tooltip.visibility="show";
	}
}

function hidetip() {
	if (document.layers) {
		document.tooltip.visibility="hidden";
	}
}

