function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_setTextOfLayer(objName,x,newText) { //v4.01
  if ((obj=MM_findObj(objName))!=null) with (obj)
    if (document.layers) {document.write(unescape(newText)); document.close();}
    else innerHTML = unescape(newText);
}

//Products
allrows=new Object();
allcols=new Object();
colsrows=new Object();

function get_itemsh_val(obj){
	if(obj.length && obj.length>0){
		for(i=0;i<obj.length;i++){
			if(obj[i].checked) return(obj[i].value);
		}
	}
	if(obj.options) return(obj.options[obj.options.selectedIndex].value);
	else return(obj.value);
}

function setopts(form_name, prefix, item_id, set_col, set_layers){
	f=document.forms[form_name];
//Set cols
	if(set_col && f['comb_col'].options){
		if(f['comb_col'].options) currcolval=f['comb_col'].options[f['comb_col'].options.selectedIndex].value;
//Clear options
		if(f['comb_col'].options) for(i=f['comb_col'].options.length;i>-1;i--) f['comb_col'].options[i]=null;
		newrowval=get_itemsh_val(f['comb_row']);
		n=0;
		for(var i in colsrows[item_id][newrowval]){
			no = document.createElement("OPTION");
			no.text=allrows[item_id][i];
			no.value=i;
			if(i==currcolval) no.selected=1;
			f['comb_col'].options[n]=no;
			n++;
		}
	}
	if(set_layers){
		newcolval=get_itemsh_val(f['comb_col']);
		newrowval=get_itemsh_val(f['comb_row']);
//Set price
		MM_setTextOfLayer('pricelayer'+prefix,'',colsrows[item_id][newrowval][newcolval]['price_displ']);
		MM_setTextOfLayer('pricesalelayer'+prefix,'',colsrows[item_id][newrowval][newcolval]['price_sale_displ']);
	}
}

function check_subscr(){
	if(document.forms.nlsubscr.nemail.value==''){
		alert('Please enter your E-mail address');
		document.forms.nlsubscr.nemail.focus();
		return(false);
	}
	return(true);
}