/**
 * GENERAL FUNCTIONS
**/



function $(id) {

	return document.getElementById(id);
}

function popWindow(url, sizeX, sizeY)
{
	window.open(url, url.substr(0,8), "width=" + sizeX + ",height=" + sizeY + ",status=no,toolbar=no,menubar=no,location=no,scrollbars=yes");
}

function addEvent(oObj, evType, fn, useCapture){
	if (oObj.addEventListener){
		oObj.addEventListener(evType, fn, useCapture);
		return true;
	} else if (oObj.attachEvent){
		var r = oObj.attachEvent("on"+evType, fn);
		return r;
	} else {
		alert("Handler could not be attached");
	}
}

function tick(inputOjb) {
	var radio_btn = inputOjb.parentNode.parentNode.getElementsByTagName('input')[0];
	radio_btn.checked = true;
}


function setContentHeight() {
	// this funktion resizes the content height if the basket height is greater then content height
	var contentDiv = $('shopcontent');
	var basketDiv = $('shopbasket');

	if(contentDiv != null && basketDiv != null) {
		if(contentDiv.offsetHeight < (basketDiv.offsetHeight + 60))
			contentDiv.style.height = (basketDiv.offsetHeight + 60) + "px";
	}
}

addEvent(window, "load", function(){setContentHeight();})


