
function options_price($n,$currency_code) {
    $options=new Array();
    for($i=1;$i<=$n;$i++) {
       $opt_str="option-"+$i;
		   $this_opt=document.getElementById($opt_str);
		   if(!$this_opt) { continue; }
		   $options[$i-1]=$this_opt.value;
		}
		if($options.length) {
		   $opts=$options.sort();
       url=ROOTURL+'options_price.php?option='+$opts.join(",")+'&code='+$currency_code;
       loadXMLDoc(url,'change_price');
    }
}

//change the price on page
function change_price() {
   if (req.readyState!=4 || req.status!=200) { return; }
   response  = req.responseXML.documentElement;
   price = response.getElementsByTagName('price')[0].firstChild.data;
   stock = response.getElementsByTagName('stock')[0].firstChild.data;
   document.getElementById('totalprice').firstChild.nodeValue=price;
   document.getElementById("quantity").value=1;
}

//preload product enlargement
function preload_enlargement($id) {
   $img=new Image();
   $img.src='content/products/l/'+$id+'.jpg';
}

function select_qbox() {
document.getElementById("quantity").select();
}

function show_hidden_enlarge() {
document.getElementById("hiddenenlarge").style.display='block';
}
function hide_hidden_enlarge() {
document.getElementById("hiddenenlarge").style.display='none';
}