
 function fooCheck(obj){
     alert('');
     return false;
 }
 
 function checkSizeForm(formName) {
 
 	//var formName = formName;
 	
 	//alert(formName);
 
    try{
       var form = document.getElementById(formName);
       var productId = form.productid;
       var productIdChecked = false;
       var paper = form.paper;
       var paperChecked = false;
       
       for(i=0; i<productId.length; i++){
          if(productId[i].checked){
             productIdChecked = true;
          }
       }  
       for(i=0; i<paper.length; i++){
          if(paper[i].checked){
             paperChecked = true;
          }
       } 
       if(!productIdChecked){
          document.getElementById(formName+"_msgProductId").firstChild.data = "Please select";
       }
       if(!paperChecked){
          document.getElementById(formName+"_msgPaper").firstChild.data = "Please select";
       } 
       if(!paperChecked | !productIdChecked){
          return false;
       }else{
          form.submit();
          return true;
       }           
    }catch(e){alert("zange: "+e); return false;}
 }
 
   var overlay = null;
   var badBoy = false;
   var Browser = "";
   function openSizeIdBox(pframe){
    try {
        
      //  var form = document.getElementById(pform);
        var frame = document.getElementById(pframe);
      	overlay = new DialogOverlay(frame, document.body);
    	  overlay.show();   
	  }catch(e){alert("in FunktionopenSizeBox: "+e); return false;}
   }
function DialogOverlay(content, container) {
try{

	// Manage arguments and assign defaults, 

	if (typeof container == 'undefined' ) container = document.body;
	if (null == (this.container = $(container))) throw("container is not valid");
	// Assign instance variables
this.content = content;
	//this.content = document.getElementById("formframe");
	this.content.style.display = "block";
	this.overlay = new Element('div', { 'class': 'overlaySizeIdBox' }).hide();
	this.dialog = new Element('div', { 'class': 'dialogSizeIdBox' }).hide();
 // this.foo = new Element('input', { 'id': 'foo', 'type': 'radio' });
  //this.foo.writeAttribut('type': 'radio');
  
	// Hide the overlay when clicked. Ignore clicks on the dialog.
  Event.observe(this.overlay, 'click', this.hide.bindAsEventListener(this));
 // Event.observe(this.dialog, 'click',  function(event) { alert(event) });
//	Event.observe(this.foo, 'click',  function(event) { this.foo.checked = true });
//	this.foo.writeAttribute('checked','checked');
	
	
	// Insert the elements into the DOM
	this.dialog.insert(this.content);
//	this.dialog.insert(this.foo);
	this.container.insert(this.overlay);
	this.container.insert(this.dialog);


	// Content may have been hidden if it is embedded in the page
	content.show();
	this.dialog.hide();
	}catch(e){ /* alert("Error: "+e); */}
}

DialogOverlay.prototype.show = function() {
	new Effect.Appear(this.overlay, { duration: 0.5,  to: 0.8 });
	this.dialog.show();
	return this;
};
DialogOverlay.prototype.hide = function(event) {
	this.dialog.hide();
	this.overlay.hide();
	return this;
};
