function dummy() { }
nobasket=true;
function showItem(itemid){
	window.location='/'+pageId+'.php?itemid='+itemid;
	return false;
}
function showOffert(pId) {
	var content = '<div id="offertcloser" onclick="hideOffert();">X</div><img id="offertloader" src="/admin/objects/loading.gif" alt="laddar" /><div id="offertcontent"></div>';
	if(!$('offertdiv')) {
		$(document.body).insert('<div id="offertdiv"></div>');
	}
	$('offertdiv').update(content);
	$('offertloader').show();
	$('offertloader').setStyle({'position':'absolute','left':'284px','top':'184px'});
	$('offertdiv').show();
	positionOffert();
	new Ajax.Request('/mod/offert.php?doWCM=get&itemid='+pId,{onSuccess:fillOffert});
}
function fillOffert(t){
	$('offertcontent').update(t.responseText);
	positionOffert();
	$('offertloader').hide();
	//setTimeout('positionOffert();$(\'offertloader\').hide();',100);
}
function hideOffert(){
	$('offertdiv').hide();
}
function positionOffert(){
	//return true;
	var sz=$('offertcontent').getDimensions();
	var vp=document.viewport.getDimensions();
	//var vs=document.viewport.getScrollOffsets();
	var h=400;
	var w=630;
	var t=100;
	var l=0;
	if(vp.width < 630){
		w=vp.width-40;
		l=20;
	}else{
		l=(vp.width/2) - (w/2);
	}
	$('offertdiv').setStyle({width:w+'px',left:l+'px'});
	sz=$('offertcontent').getDimensions();
	if(sz.height > vp.height-40){
		h=vp.height-40;
		t=20;
	}else{
		h=400;
		if(sz.height > 400){
			h=sz.height;
		}
		t=(vp.height/2) - (h/2);
	}
	$('offertdiv').setStyle({height:h+'px',top:t+'px'});
	
	//alert('H: '+sz['height']+' W:'+sz['width']);
}
function requestOffert(){
	new Ajax.Request('/mod/offert.php',{onSuccess:showOffertSuccess,postBody:$('offertform').serialize()});
}
function showOffertSuccess(t){
	$('offertdiv').hide();
	$('offertcontent').update('');
	alert('Tack för din förfrågan.');
}
function clearSearch(t) {
	if(t.value==lang('SEARCHWORD')) {
		t.value='';
	}
}
function fillSearch(t) {
	if(t.value=='') {
		t.value=lang('SEARCHWORD');
	}
}
function checkSingleSelectors(elm, evt){
	var d=$(elm).up('div.checkholder');
	var checked=$A(d.select('input:checked'));
	var p=checked.each(
			function(chb){
				if(chb.value!=elm.value){
					chb.checked=false;
				}
			});
	shop.checkShopSelection(elm);
}
lngArr['RELATIONS'] = 'Tillbehör';
lngArrWCM['RELATIONS'] = 'Tillbehör';