function display_case_study_photo(imgname, width, height)
{
  var load=window.open("./display_case_study_photo.php?img="+imgname,"","width="+width+", height="+height+", scrollbars=no, menubar=no, resizable=no, toolbar=no, location=no");
}

function display_help(id, width, height)
{
  var load=window.open("./display_help.php?id="+id,"","width="+width+", height="+height+", scrollbars=yes, menubar=no, resizable=no, toolbar=no, location=no");
}

function selectfinish()
{
 indx=document.product_form.material.selectedIndex;
 val=document.product_form.material.options[indx].value;
 //alert("value of material="+val);
 switch(val)
 {
   case 'Aluminium':
     document.getElementById('finish').style.display ="block";
     document.getElementById('finish2').style.display ="none";	 
   break;
   case 'Brass':
   case 'Stainless Steel':
     document.getElementById('finish').style.display ="none";
     document.getElementById('finish2').style.display ="block";	    
   break;
   default:
     document.getElementById('finish').style.display ="none";
     document.getElementById('finish2').style.display ="none";	       
 }
}

function doEdit()
{
  document.product_form.edit.value="Y";
  product_form.submit();
}

function show_photo(img_no,numphotos)
{
  for(var i = 1; i <= numphotos; i++)  
  {
    imgid="img"+i;
    imgspanid="imgspan"+i;
    //alert("in loop i="+i+" numphotos="+numphotos+", img_no="+img_no+" imgspanid="+imgspanid);
    if(i==img_no)	  
	{
      document.getElementById(imgspanid).style.display = ''; //show
      document.getElementById(imgid).className = 'brdrthumbhighlight'; //return to normal	  	  
	}
    else
	{
      document.getElementById(imgspanid).style.display = 'none'; //show
      document.getElementById(imgid).className = 'brdrthumb'; //return to normal	  
	}
  }
  
  return;
}

