function input_value(cell, text){		
	if(cell.value==text){	
	cell.value='';	
	}else if(cell.value==''){
	cell.value=text;		
	}	
}  




function calculate_price(id,ap){
	
	var f=document.getElementById("cart_quantity");
	var at=document.getElementById("multi_atribute");
	var block_product_price=document.getElementById("complex_price");
	var product_price=document.getElementById("hide_product_price");
	var total_sum;
	var regex = new RegExp("[/|]");
	var product_qty=f.products_qty.value;	
	var count_input = f.attrib_count.value;	
	var price=0;
	var r;
	
	
	for (var i = 1; i <=count_input; i++) {	
	
	var attr = eval("f.attrib_qty_"+i) ;	
	
	if(attr.checked){
		
		if(attr.checked & attr.value!=''){
			
			sel_value=attr.className; 
			
			price_value = sel_value.split(regex);			
			price += accAdd(price, (price_value[1]*attr.value));
			
			r='y';
		}
	}
	
	}	
	

	
	
	if(r=='y'){		
		total_sum=accAdd(product_price.innerHTML*product_qty, price);	
		block_product_price.innerHTML=total_sum.toFixed(2)+' EUR';
	}else{
		block_product_price.innerHTML=product_price.innerHTML+' EUR';
		if(ap=='y'){f.products_qty.value='1';   }
		
	}
	
	option_images_selected();
	
	
}


function onmouse_option(id, img_close){	
	
	var block_images=document.getElementById("cache_block");
	var regex = new RegExp("[/|]");
	
	val = id.id;
	img_value = val.split(regex);
	if(img_value[0]!=''){
		
	block_images.innerHTML='<span ><img src="images/product_images/info_images/'+img_value[0]+'"  /></span>';

	}else if(img_value[0]==''){
		
		block_images.innerHTML='<span >&nbsp;</span>';
	
	}
	if(img_close==true){
		block_images.innerHTML='<span >&nbsp;</span>';
	}
}

function option_images_selected(id){	
	var f=document.getElementById("cart_quantity");
	var at=document.getElementById("product_atributes");
	var block_images=document.getElementById("block_images_select");	
	
	var regex = new RegExp("[/|]");	
	var count_input = f.attrib_count.value;	
	
	var cache_block=document.getElementById("cache_block");
	cache_block.innerHTML='';
	
	block_images.innerHTML='';
	
	for (var i = 1; i <=count_input; i++) {
		
		var qty = eval("f.attrib_qty_" + i + ".value") ;		
		
		if(qty>0 || qty!=''){	
		
		sel_value=eval("f.attrib_qty_" + i+".className"); 
		img_value = sel_value.split(regex);
		
		
		
			if(img_value[0]!=''){
				var img='<a  title="'+img_value[2]+'" href="images/product_images/popup_images/'+img_value[0]+'" rel="lightbox['+eval("f.attrib_val_" + i+".value")+']"><span ><b>'+zooming+'</b></span><img src="images/product_images/info_images/'+img_value[0]+'"   class="productimage" /></a> ';
			
			block_images.innerHTML=block_images.innerHTML+img;			
			}	
		}	
	}	
	
}




