function var_dump(obj) {
	if(typeof obj == "object") {
		if(obj.name == 'TypeError'){
			return obj.message + "\nFile: " + obj.fileName + "\nLine: " + obj.lineNumber;		
		} else {
			return "Type: "+typeof(obj)+((obj.constructor) ? "\nConstructor: "+obj.constructor : "")+"\nValue: " + obj;
		}
	} else {
		return "Type: "+typeof(obj)+"\nValue: "+obj;
	}
}

function setAjaxUrl(link){
	var oldUrl = window.location.toString();
	var pos = oldUrl.search(/#/);
	if(pos != -1){
		var newUrl = oldUrl.substring(pos);
		link.href += newUrl;
	}
}

function submitToButton(submit){
	var submitLink = new Element('button', {
		className: submit.readAttribute('class'),
		id: submit.id
	}).update(submit.readAttribute('value'));
	Element.replace(submit, submitLink);
}

// function for popups in Daimler joboffers
function popup(ziel, breite, hoehe){
	if(ziel.search(/http.+/) == -1){
		ziel = "http://career.daimler.de" + ziel;
	}
	if((breite + hoehe) == 0){
		window.location = ziel;
	} else {
		window.open(ziel,'','width='+breite+',height='+hoehe+',scrollbars=yes,resizable=yes');
	}
}