// JavaScript Document

// aus der header.php ausgelagerter Javascript

// BOF Hammermodul ########################## -->

	var global_x = 0;
	var global_y = 0;
	
	var ie = (document.all) ? true : false;
	if(!ie) document.captureEvents(Event.MOUSEMOVE);
	document.onmousemove = getPosXY;
	
	function getPosXY(e) {
	    x = (ie) ? event.clientX + document.body.scrollLeft : e.pageX;
	    y = (ie) ? event.clientY + document.body.scrollTop : e.pageY;
	    if(x < 0) { x = 0; }
	    if(y < 0) { y = 0; } 
	    global_x = x;
	    global_y = y;
	}	
	function show_info(div_id) {
		<?php
		if(nc_get_conf('use_flyover') != 'checked')
			echo 'return false;'."\n";
		?>
		document.getElementById(div_id).style.visibility 	= "visible";
		document.getElementById(div_id).style.left  			= (global_x+10) + "px";
		document.getElementById(div_id).style.top 				= (global_y-60) + "px";
	}
	function hide_info(div_id) {
		<?php
		if(nc_get_conf('use_flyover') != 'checked')
			echo 'return false;'."\n";
		?>
		document.getElementById(div_id).style.visibility 	= "hidden";
	}


// EOF Hammermodul ########################## 



function highlight_cell(cellID, cellType) {
	switch(cellType) {
	case "categories":
		document.getElementById(cellID).style.backgroundColor='<?echo NC_HOVER_CATEGORIES?>';
		break;
	case "cells":
		document.getElementById(cellID).style.backgroundColor='<?echo NC_HOVER_CELLS?>';
		break;
	}
}

function reset_cell(cellID, cellType) {
	switch(cellType) {
	case "categories":
		document.getElementById(cellID).style.backgroundColor='<?echo NC_BOXBODY_BGCOLOR?>';
		break;
	case "cells":
		document.getElementById(cellID).style.backgroundColor='<?echo NC_SHOP_BGCOLOR?>';
		break;
	}
}



function submit_to_wishlist() {
	document.cart_quantity.submit_target.value = "wishlist";
	document.cart_quantity.submit();
}



var selected;
var submitter = null;

function submitFunction() {
    submitter = 1;
}
function popupWindow(url) {
  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150')
}  

function selectRowEffect(object, buttonSelect) {
  if (!selected) {
    if (document.getElementById) {
      selected = document.getElementById('defaultSelected');
    } else {
      selected = document.all['defaultSelected'];
    }
  }

  if (selected) selected.className = 'moduleRow';
  object.className = 'moduleRowSelected';
  selected = object;

// one button is not an array
  if (document.getElementById('payment'[0])) {
    document.getElementById('payment'[buttonSelect]).checked=true;
  } else {
    //document.getElementById('payment'[selected]).checked=true;
  }
}

function rowOverEffect(object) {
  if (object.className == 'moduleRow') object.className = 'moduleRowOver';
}

function rowOutEffect(object) {
  if (object.className == 'moduleRowOver') object.className = 'moduleRow';
}

function popupImageWindow(url) {
  window.open(url,'popupImageWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150')
}
