/**
 * @(#)default10/view10_css.js
 *
 * Copyright 1999-2008(c) MijnWinkel B.V.
 *
 * $Revision: 4517 $
 *  
 * $Date: 2010-04-08 16:05:16 -0300 (jue, 08 abr 2010) $
 *
 * DEFAULT 10 ROUNDED BORDERS
 */
/* 
 * Product variations functions
 */
function getActiveRow(){return __activeRow}
function setActiveRow(i){__activeRow=i}
function FieldSelection(){
	var me=this,fld=[],fldsel=[];
	me.set=function(col,lst){fld[col]=lst};
	me.setActive=function(col,v){fldsel[col]=v};
	me.get=function(i){return fld[i]};
	me.active=function(i){return fldsel[i]};
}
function Selection(){
	var me=this,ins=[];
	me.has=function(oid,col){return self._fs&&_fs[oid]&&_fs[oid].get(--col)};
	me.get=function(oid,col,first){
		if(first==null)first=false;
		var sel=_fs[oid].get(--col);
		if(first)sel=sel[0];
		else if(sel.length<3&&sel[0].indexOf(';')!=-1){
			sel=sel[0].split(';');
			sel[sel.length]="";
			if(!ins[oid])ins[oid]=[];
			ins[oid][col]=true;
		}
		return sel
	};
	me.active=function(oid,col){return _fs[oid].active(--col)};
	me.enabled=function(oid){return self._fs&&_fs[oid]};
	me.isInlineSelection=function(oid,col){return(ins[oid]&&ins[oid][--col])?ins[oid][col]:false};
	me.reset=function(oid){ins[oid]=[]}; 
}
var selection=new Selection();
function parseDocument(doc,rel){
	function get(c){
		var v="";
		try{v=c.firstChild.nodeValue}
		catch(e){}
		return v
	}
	function getAttr(c,n){
		var v="";
		try{v=c.getAttribute(n)}
		catch(e){}
		return v
	}
	function getCols(r){return r.getElementsByTagName('col')}
	var index=0,rows=doc.getElementsByTagName('row'),type,done=[];
	for(;index<rows.length;index++){
		row=rows[index];
		type=row.getAttribute("type")
	 	if(!done[type]&&type=="catalog"){
	 		done[type]=true;
			var cols=row.getElementsByTagName('col'),s="",v,item=[],l=cols.length,c;
			item[0]=row.getAttribute("number");
			for(var i=0;i<l;i++){
				v=cols[i].firstChild.nodeValue;
				if(v)item[i+1]=v;
				else item[i+1]="";
			}
			setCtlVal("_oid",_i(item[0]+1));
			_d[getActiveRow()]=item;
			__rowData=_d[getActiveRow()];
		}
		else if(!done[type]&&type=="catalog_replace"){
	 		done[type]=true;
			var cols=row.getElementsByTagName('col'),l=cols.length,n,c,i=0;
			for(;i<l;i++){
				c=cols[i];
				n=c.getAttribute("number");
				v=c.firstChild.nodeValue;
				if(v!=null&&v!='*'){
					if(n)setRaw(n,v);
					else{
						n=c.getAttribute("name");
						if(n&&n=="stock")_rel.setStock(v);
					}
				}
			}
		}
		else if(type=="catalog_selection"){
			if(this.selection)selection.reset();
			var cols=row.getElementsByTagName('col'),l=cols.length,col,i=0,opts,optsl,opti,opt,oid=_i(row.getAttribute("number"))+1;
			var info=new FieldSelection();
			_fs[oid]=info;
			for(;i<l;i++){
				col=cols[i];
				colNr=cols[i].getAttribute("number");
				opts=cols[i].getElementsByTagName('option');
				optsl=opts.length;
				var lst=[],sel="";
				for(opti=0;opti<optsl;opti++){
					opt=opts[opti];
					lst[opti]=opt.firstChild.nodeValue;
					if(sel==""&&opt.getAttribute("selected")){
						sel=opt.getAttribute("inline");
						if(sel=="")sel=lst[opti];
					}
				}
				lst[optsl]="";
				info.set(colNr,lst);
				info.setActive(colNr,sel);
			}
		}
		else if(!done[type]&&type=="catalog_localstock"){
	 		done[type]=true;
			var cols=row.getElementsByTagName('col'),l=cols.length,n,c,i=0;
			for(;i<l;i++){
				c=cols[i];
				v=_i(c.firstChild.nodeValue);
				if(v!=null&&v!='*')setRaw(getStockFld(),v);
			}
		}
	}
}
function response(doc){
	if(doc){
		parseDocument(doc,true);
		view.refreshProduct();
	}
}
function _selectProduct(ctl,i,oid,callback,count){
	if(!selection.isInlineSelection(oid,i)){
		var n=(count=="")?"":count+"_";
		for(var f=getData(),c;i<getNrOfFields();i++){
			c=f['_selection'+n+oid+'_'+i];
			if(c!=null)c.selectedIndex=-1;
		}
		setCtlVal("_oid",oid);
		new Remote().request(callback,"catalog_item_data","_oid",oid,"counter",count)
	}
}
function selectProduct(ctl,i,oid,row){
	setActiveRow(row);
	_selectProduct(ctl,i,oid,self.response,"")
}
function orderTriggered(extra,oid,count){
	var f=getData(),s=new SB(),ss=new SB(),sep1='',sep2='',v,l;
	if(f){
		if(!oid)oid=getOID();
		if(selection.enabled(oid)){
			if(count!=null&&count!="")count+="_";
			else count="";
			for(var index=0,c,i=1;i<getNrOfFields();i++){
				if(selection.isInlineSelection(oid,i)){
					c=f['_selection'+count+oid+'_'+(i-1)];
					if(c){
						if(c.selectedIndex!=-1)index=c.selectedIndex;
						v=trim(c.options[index].value);
						l=fieldLabel(i);
						s.append(sep1,l," ",v);
						ss.append(sep2,l,"%3d",v);
						sep1=',';
						sep2=';';
					}
				}
			}
			if(extra){
				extra['_xd']=s.toString();
				extra['_xds']=ss.toString();
			}
		}
		c=f["productcount"];
		if(c&&extra)extra['_xc']=c.value;
	}
}
/*
 * Product variations end
 */
 var view={
	"getFieldValue":function(i){
		var s=new SB();
		if(selection.has(getOID(),i)){
			var list=selection.get(getOID(),i),n=0,len=list.length-1,active=selection.active(getOID(),i);
			if(len>1){
				if(selection.isInlineSelection(getOID(),i))s.append('<input type="hidden" name="_selectionall',getOID(),'_',(i-1),'" value="',selection.get(getOID(),i,true),'">');
				s.append('<a style="text-decoration:none"><select onchange="selectProduct(this,',i,',\''+getOID()+'\',',getActiveRow(),');" name="_selection',getOID(),'_',(i-1),'">');
				for(;n<len;n++)s.append('<option value="',escape(list[n]),'"',((list[n]==active)?' selected ':''),'>',escapeValue(list[n]),'</option>');
				s.append('</select></a>');
			}else s.append(list[0]);
		}else s.append(fieldPlain(i));
		return s.toString();
	},
	"refreshProduct":function(){
		var row='innerbox'+getActiveRow(),c,s=new SB();
		c=getElementOnId(row);
		if(c!=null)c.innerHTML=insertProduct(getNrOfFields());
	},
	"closeTable":true,
	"closeDiv":true
}
function closeControl(elm,isClosed) {
	var s=new SB(),ret,close,txtAlignment=getTxtAlignment(),activeRow=getActiveRow();
	if(elm=='table'&&!isClosed){
		s.append('</table></div>');
		this.view['closeTable']=true;
	}
	if(elm=='div'&&isClosed){
		s.append('<div class="myshp_list_product_buttons"><table id="btn'+activeRow+'" style="position:relative;margin:0 auto;"><tr>');
		this.view['closeDiv']=false;
	}
	return s.toString();
}

function borderchange(c,b){if(c)c.style.borderColor=(b)?getBAColor():getBColor()}
function pageLoad(){
	var navWidth,colsPerPage=getColsPerPage(), nrOfItems=getNrOfItems(), nrOfRows=getNrOfItems()/getColsPerPage();
	//resize image, title and product wrapping adjustment
	if (colsPerPage>1) {
		var maxImgHeight=0,n=0,c=0,aux=0;
		for (i=0;i<nrOfRows;i++) {
		  	n+=colsPerPage;
			c=(n-colsPerPage);
			maxImgHeight=0;
			maxFeatHeight=0;
		  	for (aux=c;aux<n;aux++) {//determine
		  	   if(document.getElementById('divImg'+aux))var divImg=document.getElementById('divImg'+aux);
			   if (divImg&&divImg.offsetHeight>maxImgHeight)maxImgHeight=divImg.offsetHeight;
		  	   if(document.getElementById('divFeat'+aux))var divFeat=document.getElementById('divFeat'+aux);
			   if (divFeat&&divFeat.offsetHeight>maxFeatHeight)maxFeatHeight=divFeat.offsetHeight;
			}//end determine
			//maxImgHeight=(maxImgHeight>18)?maxImgHeight-18:0; //extra Explorer padding
			//maxFeatHeight=(maxFeatHeight>40)?maxFeatHeight-40:0; //extra Explorer padding
			for (aux=c;aux<n;aux++) {//assign
				 if(document.getElementById('divImg'+aux))var divImg=document.getElementById('divImg'+aux);
				 if(divImg) divImg.style.height=(maxImgHeight+'px');
				 if(document.getElementById('divFeat'+aux))var divFeat=document.getElementById('divFeat'+aux);
				 if(divFeat) divFeat.style.height=(maxFeatHeight+'px');
			}//end assign
		}			 
	    var i=0,e;
		for(;i<nrOfItems;i+=colsPerPage){
			var rowEnd=i+colsPerPage,offset=0;
			if(rowEnd>nrOfItems)rowEnd=nrOfItems;
			var maxHeight=0,maxTitleHeight=0;
			for(e=i;e<rowEnd;e++){// determine
				var boxTitle=document.getElementById('myshp_list_product_title'+e);
				if(boxTitle&&boxTitle.offsetHeight>maxTitleHeight){
					maxTitleHeight=boxTitle.offsetHeight;
				}
			}//end determine
			// assign
			if(maxTitleHeight>0){
				for(e=i;e<rowEnd;e++){
					var	boxTitle=document.getElementById('myshp_list_product_title'+e);
					if(boxTitle)boxTitle.style.height=(maxTitleHeight+'px');
				}
			}
			//end assign
		}
		//product wrapping adjust
		var elm=document.getElementById('0'),elmWidth,elmMarginLeft,rowWidth;
		if(elm){
			elmWidth=elm.offsetWidth;
			elmMarginLeft=parseInt(elm.style.marginLeft.replace('px',''),10);
		}
		rowWidth=(elmWidth*colsPerPage+(elmMarginLeft*(colsPerPage+1))+2*colsPerPage);
		for(var e=0;e<getNrOfItems();e+=getColsPerPage()){
			var row=document.getElementById('myshp_list_product_row'+e);
			if(row)row.style.width=rowWidth+'px';
			if(row)row.style.position='relative';
		}
		//end product wrapping adjust
	}
	//end resize image, title and product wrapping adjustment
	
	var navTop=document.getElementById('navTop'),elm=document.getElementById('0');
	if(navTop){//adjust navigation
		if(elm&&hasLayout()&&getColsPerPage()>1){
			navWidth=(getBlockWidth()*getColsPerPage()+(elm.style.marginLeft.replace('px','')*(getColsPerPage()-1)));
			navTop.style.width=navWidth+'px';
		}
		if(elm)navTop.style.marginLeft=elm.style.marginLeft;
	}//end adjust navigation
	if(hasLayout()) {
		var menuSideTopBar=document.getElementById('myshp_menu_side_topbar'),searchBlock=document.getElementById('myshp_info_search_block');
		if(menuSideTopBar&&searchBlock)searchBlock.style.height=menuSideTopBar.style.height;
	}
}
function getStockVal(count,oid){
	var v=-1,n=(oid==null)?__rowData[0]:(_i(oid)-1);
	if(self._stc&&_stc[n]!=null)v=_stc[n];
	if(v==-1)v=fieldRaw(getStockFld());
	v-=getBasketInfo().getProductQuantity(oid,getCID());
	return parseFloat(v=="*")?-1:v;
}
function pageNavigatorStart(){
	var s=new SB();
	var topleft=new Image(),topright=new Image(),bottomleft=new Image(),bottomright=new Image(),leftside=new Image(),rightside=new Image(),topside=new Image(),bottomside=new Image();
	topleft.src='http://mijnwinkel.nl/views/default7/b_leftup.gif';
	topright.src='http://mijnwinkel.nl/views/default7/b_rightup.gif';
	bottomleft.src='http://mijnwinkel.nl/views/default7/b_leftunder.gif';
	bottomright.src='http://mijnwinkel.nl/views/default7/b_rightunder.gif';
	leftside.src='http://mijnwinkel.nl/views/default7/b_left.gif';
	rightside.src='http://mijnwinkel.nl/views/default7/b_right.gif';
	bottomside.src='http://mijnwinkel.nl/views/default7/b_bottom.gif';
	topside.src='http://mijnwinkel.nl/views/default7/b_up.gif';
	s.append('<div id="myshp_list">');
	if(getPage()>0&&(getNrOfItems()/getColsPerPage())>2)s.append(writeNavTopDiv());
	s.append('<div class="clear"></div>');
	return s.toString();
}
function rowStart(){
	return '<div class="myshp_list_product_row" id="myshp_list_product_row'+getActiveRow()+'">';
}
function buildBlock(columns){
	var colsPerPage=getColsPerPage(),s=new SB(),productListPageWidth=getProductListPageWidth(),blockWidth=(colsPerPage!=1)?getBlockWidth():getProductListPageWidth(),blockSpacing=((productListPageWidth-(blockWidth*(colsPerPage)))/(colsPerPage+1))+'px', activeRow=getActiveRow(),_fgcolor,bgColor=getBGColor();
	if(colsPerPage>1)blockWidth=(getBlockWidth()>getProductListPageWidth()/colsPerPage)?(blockWidth=getProductListPageWidth()/colsPerPage):getBlockWidth();
	else blockWidth=getProductListPageWidth();
	_fgcolor=(getFGColor()=='#FFFFFF')?'#f0f0f0':getFGColor();
	var styleHeader=makeStyle("background",_fgcolor);
	s.append('<div id="',activeRow,'" class="myshp_list_product" style="margin-left:',blockSpacing,';width:',(blockWidth-2),'px;border-color:',getBColor(),';background-color:',bgColor,';" onMouseOver="borderchange(this,1)" onMouseOut="borderchange(this,0)">');
	s.append('<div class="myshp_list_product_header" style="color:'+getFGTColor()+';"><div class="myshp_list_top_side"'+styleHeader+'><div class="myshp_list_left_side"><div class="myshp_list_right_side"><div class="myshp_list_topleft_corner"><div class="myshp_list_topright_corner" >');
	s.append('<div class="myshp_list_product_title" id="myshp_list_product_title'+getActiveRow()+'">',((!empty(fieldTitle()))?fieldTitle():'&nbsp;'),'</div>');
	s.append('<div class="clear"></div></div></div></div></div></div></div><div class="clear"></div><div class="myshp_list_left_side" id="ls',getActiveRow(),'" style="width:'+(blockWidth-2)+'px;"><div class="myshp_list_right_side" id="rs',activeRow,'" style="width:'+(blockWidth-2)+'px;"><div id="innerbox'+activeRow+'" class="myshp_list_product_box" style="width:'+(blockWidth-7)+'px;"><div id="text'+activeRow+'" style="font-family:'+getFontName()+',Helvetica,sans-serif;font-size:'+getFontSize()+'pt;position:relative;width:'+(blockWidth-7)+'px;overflow:hidden;">',insertProduct(columns),'<div class="clear"></div></div><div class="clear"></div><div class="clear"></div></div><div class="clear"></div><div class="myshp_list_bottom_side"><div class="myshp_list_bottomleft_corner"><div class="myshp_list_bottomright_corner"><div class="clear"></div></div></div></div><div class="clear"></div></div></div></div>');
	return s.toString();    
}

function insertProduct(columns){
	var getFieldValue=view.getFieldValue;
	var s=new SB(),noRows=(getFieldPresentation()==2),sep='',noRowsFeatOpened=false; 
	var p=getPictureIndex(),t=getTitleIndex(),priceshow=false,q=getPrice();
	var productListPageWidth=getProductListPageWidth(),blockWidth=getBlockWidth(),colsPerPage=(getColsPerPage()>3)?3:getColsPerPage();
	var blockSpacing=((productListPageWidth-(blockWidth*(colsPerPage)))/(colsPerPage+1)),moreInfo=false,txtAlignment=getTxtAlignment(), activeRow=getActiveRow();
	var _buttons=new SB();
	this.view['closeTable']=true;
	this.view['closeDiv']=true;
	if(p!=null) {
		s.append('<div class="myshp_list_product_image" id="divImg'+activeRow+'" >',((hasInfo())?('<a style="text-decoration:none; position:relative;" href="javascript:void(0);" onclick="javascript:return info('+ getOID()+ '),false;">'):('')));
		s.append(getPicture(p,' id="img'+activeRow+'"',true));
		s.append(((hasInfo())?'</a>':''));
		s.append('<div class="clear"></div></div>');
	}
	s.append('<div class="myshp_list_product_features" id="divFeat'+activeRow+'"><table id="features',activeRow,'" style="text-align:left; position:relative;margin:0 auto;" border=0>');
	this.view['closeTable']=false;
	var modulus="myshp_list_product_row_even";
	for(var val,i=1;i<columns;i++){
		if(getColShow(i)){
			if(i==q){
				priceshow=true;
				continue;
			}
			if(i!=p&&i!=t&&i!=q){
				if(noRows){
					if(!noRowsFeatOpened){
						s.append('<tr><td colspan="2" class="myshp_list_product_label" width="100%" style="font-weight:normal;">');
						noRowsFeatOpened=true;
					}
					val=fieldRaw(i);
					if(val!=null && val!=''){
						s.append(sep);
						if(isImage(i))s.append('<div class="myshp_list_product_image" style="padding:3px '+((blockWidth)/5.5)+'"><span>'+getPicture(i)+'</span></div>');
						else s.append(fieldPlain(i));
						sep= ', ';
					}
				}else{
					val=fieldRaw(i);
					if(val!=null && val!=''){
						if(getFieldPresentation()!=1)s.append('<tr><td valign="top" class="myshp_list_product_label">'+fieldLabel(i)+'</td><td class="myshp_list_product_value">'+getFieldValue(i)+'</td></tr>');
						else s.append('<tr><td class="myshp_list_product_value" colspan="2">'+getFieldValue(i)+'</td></tr>');
					}
				}
			}
		}
	}
	if(noRowsFeatOpened){
		s.append('</td></tr>')
	}
	
	if (priceshow){
		s.append('<tr><td class="myshp_list_product_label myshp_list_product_price_label" class="myshp_list_product_label myshp_list_product_price_label">'+fieldLabel(q)+'</td><td class="myshp_list_product_value"><span class="myshp_list_product_value_price">'+getFieldValue(getPrice())+'</span></td></tr>');
	}
	var outOfStock=(checkStock()&&getStockVal(null,getOID())<1);
	if (getMoreInfoLinkState()==1){
		_buttons.append(closeControl('div',this.view['closeDiv']));
		_buttons.append('<td><a class="myshp_list_product_moreinfo_button myshp_list_product_moreinfo_button_' + getLanguage() + '" href="javascript:info(' + getOID() + ');">' + m('moreinfo') + '</a></td>');
	}
	if(hasOrderLink()){
		if (outOfStock)s.append('');
		else{
			if (getQFType()==1) {
				if(getFieldPresentation()!="1")s.append('<tr><td valign="top" class="myshp_list_product_label myshp_list_product_quantity_label">'+getQFLabel()+'</td><td class="myshp_list_product_value"><input name="quantity'+getOID()+'" type="text" onclick="javascript:return false;" value="'+getInfoQuantity("quantity"+getOID())+'" maxlength="6" size="2" onkeypress="javascript:return keyPress(arguments[0],this,'+getOID()+');" onkeyup="javascript:return keyUp(this);"/>');
				else s.append('<tr><td colspan="2" class="myshp_list_product_value"><b>'+getQFLabel()+'&nbsp;</b><input name="quantity'+getOID()+'" type="text" onclick="javascript:return false;" value="'+getInfoQuantity("quantity"+getOID())+'" maxlength="6" size="2" onkeypress="javascript:return keyPress(arguments[0],this,'+getOID()+');" onkeyup="javascript:return keyUp(this);"/>');
				if(self.getMetric&&getMetric()!=null)s.append('&nbsp;'+getMetric());
				s.append('</td></tr>');
				s.append(closeControl('table',this.view['closeTable']));
				_buttons.append(closeControl('div',this.view['closeDiv']));
				_buttons.append('<td><a class="myshp_list_product_order_button myshp_list_product_order_button_'+getLanguage()+'" href="JavaScript:placeOrder(null,'+getOID()+',\'quantity'+getOID() + '\');">'+m('order.lowercase')+'</a></td>');
				moreInfo=true;
			}else{
				s.append(closeControl('table',this.view['closeTable']));
				_buttons.append(closeControl('div',this.view['closeDiv']));
				_buttons.append('<td><a class="myshp_list_product_order_button myshp_list_product_order_button_'+getLanguage()+'" href="JavaScript:order('+getOID()+');">'+m('order.lowercase')+'</a></td>');
				moreInfo=true;
			}
		}
	}else{
		s.append(closeControl('table',this.view['closeTable']));
		_buttons.append(closeControl('div',this.view['closeDiv']));
	}
	s.append(closeControl('table',this.view['closeTable']));
	_buttons.append(closeControl('div',this.view['closeDiv']));
	if(hasQuotationLink()){  
		if (getQFType()==1){
			if (!hasOrderLink()){
				s.append(getQFLabel()+':&nbsp;');
				s.append(closeControl('table',this.view['closeTable']));
				_buttons.append(closeControl('div',this.view['closeDiv']));
				_buttons.append('<td><input class="myshp_list_product_quotation_button myshp_list_product_quotation_button_',getLanguage(),'" name="quantity',getOID(),'" type="text" onclick="javascript:return false;" value="',getInfoQuantity("quantity", getOID()),'" maxlength="6" size="2" onkeypress="javascript:return keyPress(arguments[0],this,', getOID(), ');" onkeyup="javascript:return keyUp(this);" />');
				moreInfo=true;
				if (self.getMetric&&getMetric()!=null)s.append('&nbsp;'+getMetric());
				s.append('</td></tr>');
			}
			s.append(closeControl('table',this.view['closeTable']));
			_buttons.append(closeControl('div',this.view['closeDiv']));
			_buttons.append('<td><a class="myshp_list_product_quotation_button myshp_list_product_quotation_button_'+getLanguage()+'" href="javascript:placeOrder(null,'+getOID()+',\'quantity\');">'+m('quotation.long')+'</a></td>');
			moreInfo=true;
		}else{
			s.append(closeControl('table',this.view['closeTable']));
			_buttons.append(closeControl('div',this.view['closeDiv']));
			_buttons.append('<td><a class="myshp_list_product_quotation_button myshp_list_product_quotation_button_'+getLanguage()+'" href="javascript:order('+getOID()+');">'+m('quotation.long')+'</a></td>');
			moreInfo=true;
		}		
	} else {
		s.append(closeControl('table',this.view['closeTable']));
		_buttons.append(closeControl('div',this.view['closeDiv']));	
	}
	s.append(closeControl('table',this.view['closeTable']));
	_buttons.append(closeControl('div',this.view['closeDiv']));
	if(!this.view['closeDiv']){
		_buttons.append('</tr></table><div class="clear"></div></div><div class="clear"></div>');
		this.view['closeDiv']=true;
	}
	s.append(_buttons.toString());
	return s.toString();
}
function rowEnd(){
	return '<div class="clear"></div></div>';
}
function colSpawning(nrOfCols){return ''}

function pageNavigatorEnd(){
	var s=new SB();
	if(hasResult())s.append(writeNavBottomDiv(),'</div>');
	else if(!this.showCustomNoResults)s.append('<div class="myshp_list_no_results"><br/><br/>&#160;&#160;&#160;',getLabel('noresult'),'</div>');
	s.append('<div class="clear"></div>');
	return s.toString();
}
function writeNavTopDiv() {
	var s=new SB(),elm=document.getElementById("0"),colsPerPage=getColsPerPage(),blockWidth=getBlockWidth(),navMar,tableAlign,divAlign,tableAlign;
	var w,c=document.getElementById('myshp_content'),productListPageWidth=getProductListPageWidth();
	var blockSpacing=(colsPerPage!=1)?((productListPageWidth-(blockWidth*(colsPerPage)))/(colsPerPage+1)):'0';
	blockWidth=(colsPerPage!=1)?(productListPageWidth-(blockSpacing)):productListPageWidth;
	navMar=(colsPerPage<=1)?'':((elm&&elm.style.marginLeft)?((elm.style.marginLeft).replace('px','')):'0');
	s.append('<div style="text-align:left;width:100%;float:left;clear:both;"><table cellpadding="0" cellspacing="0" border="0"><tr><td id="ntlm" width="',navMar,'"></td><td id="ntc" style="text-align:left;" align="left" width="',blockWidth,'">')
	s.append('<div class="myshp_list_navigation" id="navTop">');
	if((getShopState()!=2)&&(getShopState()!=6)&&getSponsorLevel()>3)s.append('<div style="float:left;text-align:left;width:200px;padding:0 0 0 3px;">powered by <a href="http://www.mijnwinkel.nl/?pow=sb'+getVID()+'" target="_blank">mijnWinkel</a></div>');
	s.append('<div style="text-align:right;padding-right:3px;">');
	if(hasPrev())s.append('<div class="myshp_list_navigation_button_prev"><a href="javascript:doPrev();">&#171;'+m('prev')+'</a>&#160;|&#160;</div>');
	if((hasPrev() && hasNext()))s.append(__n,((getPage()*getMaxItemsPerPage())+1),'-',((getPage()*getMaxItemsPerPage())+getNrOfItems()));
	if(hasNext())s.append('<div class="myshp_list_navigation_button_next">&#160;|&#160;<a href="javascript:doNext();">' + m('next') + '&#160;&#187;</a></div>');
	s.append('</div></div></td></tr></table></div>');
	return s.toString();
}

function writeNavBottomDiv(){
	var s=new SB(),blockWidth,elm=document.getElementById("0"),colsPerPage=getColsPerPage(),navMar,divAlign,tableAlign;
	var productListPageWidth=getProductListPageWidth(),blockWidth=getBlockWidth(),w,c=document.getElementById('myshp_content');
	var blockSpacing=(colsPerPage!=1)?((productListPageWidth-(blockWidth*(colsPerPage)))/(colsPerPage+1)):'0';
	blockWidth=(colsPerPage!=1)?(getProductListPageWidth()-(2*blockSpacing)):productListPageWidth;
	navMar=(colsPerPage<=1)?'':((elm&&elm.style.marginLeft)?((elm.style.marginLeft).replace('px','')):'0');
	s.append('<div style="text-align:left;width:100%;float:left;clear:both;"><table cellpadding="0" cellspacing="0" border="0"><tr><td id="nblm" width="',navMar,'"></td><td id="nbc" style="text-align:left;" align="left" width="',blockWidth,'">')
	s.append('<div class="clear"></div><div class="myshp_list_navigation" id="navBottom">');
	s.append('<div style="text-align:center;float:left;clear:both;width:100%;margin-bottom:-12px;">');
	if(!(hasPrev()&&hasNext()))s.append(m('results'),__n);
	s.append(((getPage()*getMaxItemsPerPage())+1),'-',((getPage()*getMaxItemsPerPage())+getNrOfItems())); 
	s.append('</div>'); 
	s.append('<div style="float:left;text-align:left;width:auto;">');
	if(getSponsorLevel()>3){
		s.append('&#160;');
		if(getLanguage()=="nl")s.append('<span>powered by </span><a href="http://www.mijnwinkel.nl/?pow=sb',getVID(),'" target="_blank">mijnwinkel.nl</a>');
		else s.append('<span>powered by </span><a href="http://www.mijnwinkel.nl/?powen=sb',getVID(),'" target="_blank">mijnwinkel.nl</a>');
	}
	 s.append('&#160;</div>')
	 s.append('<div style="text-align:right;float:right;">');
	 if(hasPrev())s.append('<a href="JavaScript:doPrev();">&#171;',m('prev'),'</a>&#160;&#160;');
	 if(hasNext())s.append('&#160;&#160;<a href="JavaScript:doNext();">',m('next'),'&#160;&#187;</a>');
	 s.append('&#160;</div></div>');
	 s.append('<div style="text-align:center;float:left;clear:both;width',blockWidth,'px;">');
	 if(self.__statistic)s.append(__statistic.getCounter());
	 else{
		function pair(n,v){return "&"+n+"="+escape(v)}
		var st=getStatType(true),id=getStatValue(true);
		if(st=="nedstatpro")s.append('<img src="',id,'" border="0" width="1" height="1">');
		if((st=="onestatbasic")||(st=="onestatpremium")||(st=="onestatebusiness")){
			var osp_URL="",osp_Title="";
			if(st=="onestatbasic"){
				osp_URL="http://www.mijnwinkel.nl/shop"+getVID()+"/productlist"+getCID();
				osp_Title=osp_URL;
			}
			if((st=="onestatpremium")||(st=="onestatebusiness")){
				osp_URL="productlist"+getCID()+"("+getName().substring(0,18)+")";
				osp_Title=osp_URL;
			}
			var CONTENTSECTION="",CUSTOMDATA="",osp_ACTION="",osp_TRANSACTION="",osp_AMOUNT="",osp_PRODUCTCODE="",osp_PRODUCTGROUP="",osp_ADCAMPAIGN="";
			var t=new Date(),p="http"+(document.URL.indexOf('https:')==0?'s':'')+"://stat.onestat.com/stat.aspx?tagver=2&sid="+id;
			p+=pair("url",osp_URL);
			p+=pair("ti",osp_Title);
			p+=pair("section",CONTENTSECTION);
			p+=pair("custom",CUSTOMDATA);
			p+=pair("cma",osp_ACTION);
			p+=pair("cmt",osp_TRANSACTION);
			p+=pair("cmm",osp_AMOUNT);
			p+=pair("cmp",osp_PRODUCTCODE);
			p+=pair("cmg",osp_PRODUCTGROUP);
			p+=pair("cmad",osp_ADCAMPAIGN);
			p+=pair("rf",window.document.referrer);
			p+=pair("tz",t.getTimezoneOffset());
			p+=pair("ch=",t.getHours());
			p+=pair("js","1");
			p+=pair("ul",(navigator.appName=="Netscape")?navigator.language:navigator.userLanguage);
			if(typeof(screen)=="object"){
			   p+="&sr="+screen.width+"x"+screen.height;p+="&cd="+screen.colorDepth;
			   p+="&jo="+(navigator.javaEnabled()?"Yes":"No");
			}
			if(st=="onestatbasic")s.append('<a href="http://www.onestat.com/aspx/login.aspx?sid=',id,'" target=_blank><img id="ONESTAT_TAG" border="0" SRC="',p,'" alt="This site tracked by OneStat.com. Get your own free website counter."></a>');
			if((st=="onestatpremium")||(st=="onestatebusiness"))s.append('<img id="ONESTAT_TAG" border="0" width="1" height="1" src="',p,'" />');
		}
	 }
	 s.append('<div class="clear"></div></div><div class="clear"></div></td></tr></table></div>');
	 return s.toString()
}