// JavaScript Document
	function $(name) {
		if (document.getElementById) {
			return document.getElementById(name);
		} else if (document.all) {
			return document.all[name];
		} else if (document.layers) {
			return document.layers[name];
		}
	}
	
	function opener$(name) {
		if (window.opener.document.getElementById) {
			if (window.opener.document.getElementById(name))
				return window.opener.document.getElementById(name);
		} else if (window.opener.document.all) {
			if (window.opener.document.all[name])
				return window.opener.document.all[name];
		} else if (window.opener.document.layers) {
			if (window.opener.document.layers[name])
				return window.opener.document.layers[name];
		}
	}
	
	function mOut() {
		return nd();
	}
	
	function ebay_auction(auction_id) {
		window.open('http://cgi.ebay.de/ws/eBayISAPI.dll?ViewItem&item='+auction_id);
	}
	
	function center_popup(page, width, height, name) {
		if (name == '') name = 'Popup';
		
		var winl = (screen.width-width)/2;
		var wint = (screen.height-height)/2;
		if (winl < 0) winl = 0;
		if (wint < 0) wint = 0;
		
		windowprops = "height="+height+",width="+width+",top="+wint+",left="+winl+",location=no,"+ "scrollbars=yes,menubars=no,toolbars=no,resizable=no,status=yes";
		var popup = window.open(page, name, windowprops);
		popup.focus();
	}
	
	function last_search_details(tyre_id, rim_id, type) {
		var page = '';
		switch(type) {
			case 't':
				var t24 = (tyre_id.substring(0,1) == '#') ? 0 : 1;
				tyre_id = (tyre_id.substring(0,1) == '#') ? tyre_id.substring(1) : tyre_id;
				page = "tyre_details.php?id="+tyre_id+'&mc=4&t24='+t24; 
			break;
			
			case 'r':
				var t24 = (rim_id.substring(0,1) == '#') ? 0 : 1;
				rim_id = (rim_id.substring(0,1) == '#') ? rim_id.substring(1) : rim_id;
				page = "rims_details.php?id="+rim_id+'&mc=4&t24='+t24; 
			break;
			
			case 'c':
				var tyre_own_stock = (tyre_id.substring(0,1) == '#') ? 1 : 0;
				tyre_id = (tyre_id.substring(0,1) == '#') ? tyre_id.substring(1) : tyre_id;
				var rim_own_stock = (rim_id.substring(0,1) == '#') ? 1 : 0;
				rim_id = (rim_id.substring(0,1) == '#') ? rim_id.substring(1) : rim_id;
				page = 'complete_details.php?id='+tyre_id+'&own='+tyre_own_stock+'&rim_id='+rim_id+'&own_r='+rim_own_stock+'&mc=4';
			break;
			
			case 'a':
				page = 'aluminium_details.php?aid='+rim_id+'&mc=4';
			break;
		}
		
		return page;
	}