function rowOver(object, y) {
  if (object.className == 'sel' && y != "1") 
  	object.className = '';
  else
	object.className = 'sel';
}

function open_product_detail (x) {
	width = 530;
	height = 610;
	vids = window.open("/product_popup.php" + "?model=" + x, "_blank", "width=" + width + ",height=" + height + ",resizable=yes,scrollbars=no,toolbar=no,titlebar=no,location=no,locationbar=no,directories=no,status=no,menubar=no,personalbar=no,width=350,height=100,left=" + 20 + ",top=" + 20)
}

function resize_window(width, height)
{
	var nn = (navigator.appName == "Netscape" || document.layers) ? true : false
	var ie = document.all ? true : false
	var ieMac = (navigator.platform.indexOf("Mac") != -1 && document.all) ? true : false
	var aol = (navigator.userAgent.indexOf("AOL ") != -1) ? true : false;
	var xp = (navigator.userAgent.indexOf("NT 5.1") != -1) ? true : false;
	var firefox = (navigator.userAgent.indexOf("Firefox") != -1) ? true : false;
	
	window.resizeTo(width, height);
	
	if(ieMac) {
		newHeight = Number(height);
		newHeight -= Number(document.body.clientHeight);
		newHeight += Number(height);
		
		newWidth = Number(width);
		newWidth -= Number(document.body.clientWidth);
		newWidth += Number(width);
	}
	else if(aol) {
		newHeight = Number(height);
		newWidth = Number(width);

		newHeight += 4;
	}
	else if(xp) {
		newHeight = Number(height);
		newWidth = Number(width);

		newHeight += 65;
		newWidth += 12;
	}
	else if(ie)	{
		newHeight = Number(height);
		newWidth = Number(width);

		newHeight += 35;
		newWidth += 12;
	}
	else {
		newHeight = Number(height);
		newHeight -= Number(window.innerHeight);
		newHeight += Number(height);
		
		newWidth = Number(width);
		newWidth -= Number(window.innerWidth);
		newWidth += Number(width);

	}

	if(firefox)
		newHeight += 8;
	
	window.resizeTo(newWidth, newHeight);
	moveWindow();
}

function moveWindow()
{
	var nn = (navigator.appName == "Netscape" || document.layers) ? true : false
	var ie = document.all ? true : false

  if (window.screen) 
  {
	if(ie)
	{
		moveToW = (Number(window.opener.document.body.clientWidth) - Number(document.body.clientWidth)) / 2
		moveToH = (Number(window.opener.document.body.clientHeight) - Number(document.body.clientHeight)) / 2
	}
	else
	{
		moveToW = (Number(window.opener.outerWidth) - Number(window.outerWidth)) / 2
		moveToH = (Number(window.opener.outerHeight) - Number(window.outerHeight)) / 2
	}
    window.moveTo(moveToW, moveToH);
  }
}

function toggleInfo(id) {
	div = document.getElementById(id);
	if(div.style.display == 'block') {
		document.getElementById(id).style.display = 'none'
	} else {
		document.getElementById(id).style.display = 'block'
	}
}

function embedMovie(f_path, f_name, f_width, f_height, f_color, f_vars) {
	document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="' + f_width + '" HEIGHT="' + f_height +'" id="' + f_name + '">\n');
	document.write('<PARAM NAME="movie" VALUE="' + f_path + '">\n');
	document.write('<PARAM NAME="quality" VALUE="high">\n');
	document.write('<PARAM NAME="quality" VALUE="high">\n');
	if(f_color != "") {
		document.write('<PARAM NAME="bgcolor" VALUE="#' + f_color + '">\n');
	}
	document.write('<EMBED src="' + f_path + '" ' + (f_color != "" ? ('bgcolor="#' + f_color):'') + '" quality="high" WIDTH="' + f_width + '" HEIGHT="' + f_height +'" NAME="' + f_name + '" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">\n');
	document.write('</EMBED>\n');
	document.write('</OBJECT>\n');
}

function embedMovieNew(f_path, f_name, f_width, f_height, f_color, f_vars, prot) {
	try {
		if(prot == null)
			prot = document.location.protocol;
		if(f_color != null) {
			if(f_color.substring(0,1) != "#")
				f_color = "#" + f_color;
		}
		
		if(f_color == "#trans") {
			f_wmode = 'transparent';	
		} else {
			f_wmode = 'window';	
		}
		
		if(!f_vars) {
			f_vars = ""
		}	
	
		f_path = f_path.substring(0, f_path.length - 4);
		
		var flash_ver_str = GetSwfVer().toLowerCase().replace("win","").replace(",",".");
		var ver_ind = flash_ver_str.indexOf('.');
		var flash_version = -1;
		if(ver_ind > -1)
			flash_version = flash_ver_str.substring(0,ver_ind);
		
		if(flash_version < 8) {
			document.write('<a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" target="_blank"><img src="/images/video_gallery/video_flashplayer_missing.gif" border="0" hspace="0" width="'+f_width+'" vspace="0"></a>');
			return false;
		}
		
		return AC_FL_RunContent(
				'codebase', prot + '://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0',
				'width', f_width,
				'height', f_height,
				'flashvars', f_vars,
				'src', f_path,
				'quality', 'high',
				'pluginspage', prot + '://www.macromedia.com/go/getflashplayer',
				'align', 'middle',
				'play', 'true',
				'loop', 'true',
				'scale', 'showall',
				'wmode', f_wmode,
				'devicefont', 'false',
				'id', f_name,
				'bgcolor', f_color,
				'name', f_name,
				'menu', 'true',
				'allowFullScreen', 'false',
				'allowScriptAccess','sameDomain',
				'movie', f_path,
				'salign', ''
		); //end AC code

	} catch(err) {}
}

	function close_product() {
	return hs.close(document.getElementById("addProduct"));
}

function product_resize(w, h) {
  var exp = hs.getExpander();
  
  var args = {
    width: Number(w),
    height: Number(h),
    dX: 0,
    dY: 0
  };

  if(exp) {
	  exp.resize(args);

	  // move it to center:
	  var size = hs.getPageSize();
	  exp.x.min = Math.round((size.width - exp.x.span) / 2);
	  exp.y.min = Math.round((size.height - exp.y.span) / 2);
	  hs.setStyles(exp.wrapper, { left: exp.x.min +'px', top: exp.y.min +'px' });
	  exp.resize(args);
  }
}

function toolbox_loaded(){
	return true;
};

