var aktobj = -1;
var g_sprache;
var g_aktitem;
var buttonDir = '';
g_aktobj = '';

var myimages = new Array();

function setButtonDir( dir ){
	buttonDir = dir;
}

function preloadimages() {
	for( i=0; i<preloadimages.arguments.length; i++ ){
		myimages[i] = new Image();
		myimages[i].src = buttonDir + preloadimages.arguments[i]
	}
}

function setaktobj(objekt, sprache) {
	g_sprache = sprache;
	g_aktobj = objekt;
	document.getElementById(objekt).src = 'images/'+g_sprache+'/'+objekt+'h.gif';
}

function imswap(objekt, aktion) {
	if (g_aktobj == objekt) {
		document.getElementById(objekt).src = 'images/'+g_sprache+'/'+objekt+'h.gif';
	}else{
		if (aktion == 'aus') {
			document.getElementById(objekt).src = 'images/'+g_sprache+'/'+objekt+'c.gif';
		}else{
			document.getElementById(objekt).src = 'images/'+g_sprache+'/'+objekt+'h.gif';
		}
	}
}

function aktswitch(id) {
	if ( id > 0) {
		g_aktitem = id;
		document.getElementById("hk"+id).style.backgroundColor = '#70a300';
		document.getElementById("hk"+id).style.color = '#FFFFFF';
		document.getElementById("hk"+id).style.borderBottomColor = '#336600';
		document.getElementById("hk"+id).style.borderRightColor = '#336600';
	}
}

function swaphk(id, aktion) {
	if (id != g_aktitem && id > 0) {
		if (aktion == 'an') {
			document.getElementById("hk"+id).style.backgroundColor = '#70a300';
			document.getElementById("hk"+id).style.color = '#FFFFFF';
			document.getElementById("hk"+id).style.borderBottomColor = '#336600';
			document.getElementById("hk"+id).style.borderRightColor = '#336600';
		}else{
			document.getElementById("hk"+id).style.backgroundColor = '#d0d868';
			document.getElementById("hk"+id).style.color = '#5c5835';
			document.getElementById("hk"+id).style.borderBottomColor = '#b5bd52';
			document.getElementById("hk"+id).style.borderRightColor = '#b5bd52';
		}
	}
}

function delgru( wk_id, delmsg ){
   var return_value = confirm( delmsg );
   if( return_value == true ){
      var location=("warenkorb.php?aktion=del&wk_id=" + wk_id);
      this.location.href = location;
   }
}

function setValue( id, val ){
	document.getElementById( id ).value = val;
}