

function writestyle(platform) {
	if (platform == "mac") {
		document.write("<link rel='stylesheet' type='text/css' href='/scripts/mac_style.css'>")
	}
	else {
		document.write("<link rel='stylesheet' type='text/css' href='/scripts/pc_style.css'>")
	}
}

if (navigator.appVersion.indexOf("Mac") != -1 ) {
	writestyle("mac")
}
else { 
	writestyle("pc")
}

//
//
// used to lock out left click and keypress
//
//


isNN = document.layers ? 1 : 0; 
function noContext(){return false;}
function noContextKey(e) {
    if(isNN){
        if (e.keyCode == 96){ return (false);}
    } else {
        if (event.keyCode == 96){ return (false);}
    }
}
function noClick(e){
    if(isNN){
        if(e.which > 1) {return false;}
    } else { 
        if(event.button > 1){return false;}
    }
}
if(isNN){ 
    document.captureEvents(Event.MOUSEDOWN);
}
document.oncontextmenu = noContext;
document.onkeypress    = noContextKey;
document.onmousedown   = noClick;
document.onmouseup     = noClick;



//
//
//this is for making the image popups
//
//

var popup = "";
function LaunchDetail(id) {
  if ((navigator.userAgent.indexOf('Mac') != -1)) var os = "mac";
  // Check if XP SP2, if so we will set the window height differently below to account for the permanent status bar
  else if ((navigator.userAgent.indexOf('Windows NT 5.1;') != -1) && (navigator.userAgent.indexOf('; SV1') != -1)) var os = "xpsp2";
  else var os = "other";
  var browser = navigator.appName;
  var large_height = document.images.laydown.height;
  var x = 0;
  var y = 0;
  if (large_height>=370){
  	  x = 508;
  	  if (os=="mac") y = 720;
	  else if (os=="xpsp2" && browser=="Microsoft Internet Explorer") y = 756;
	  else y = 730;
	  size = "tall";
	}
	else{
	  x = 542;
	  if (os=="mac") y = 650;
	  else if (os=="xpsp2" && browser=="Microsoft Internet Explorer") y = 686;
	  else y = 660;
	  size = "short";
	}
  if(popup && !popup.closed) {
	popup.resizeTo(x,y);
	popup.location = 'enlargeProduct.asp?id=' + id;
	popup.focus();

  }
  else {
	var popupURL = 'enlargeProduct.asp?id=' + id;
	popup = window.open(popupURL,"detailview",'top=7,screenY=7,left=7,screenX=7,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width='+x+',height='+y);
	popup.location = popupURL;
	popup.opener = self;
	popup.focus();
	popup.resizeTo(x,y);
  }
}


//
//
//this is used for finding focuas of window
//
//


function findframe(what) {
    for (var i=0;i<parent.frames.length;i++) {
         if (parent.frames[i].name == what)
             return true;
    }
    return false;
}

function killframe(){
	if (top.frames.length!=0) {
		if (window.location.href.replace)
			top.frames[i].location.href = self.location.href;
			
			//top.location.replace(self.location.href);
		else 
			top.location.href=self.document.href;
	}
}




