// s'envia cridant la funció i de parametres: pagina,300,300,0 (tamany,tamany,maximizada(1)o no(0)

function PopUp2(pagina,ancho,alto,cerrar){ //amb scroll
	if (pagina != ""){
		if ((ancho > 0)&&(alto > 0)){
			tamanio=" width="+ancho+",height="+alto;
		} else {
			tamanio="fullscreen=Yes";
		}
		window.open(pagina,"","directories=no, toolbar=no, status=no, location=no, menubar=no, scrollbars=no, rezizable=no,"+tamanio);
	}
	if (cerrar == 1){
		esta_ventana=window.self;
		esta_ventana.opener=window.self;
		esta_ventana.close();
	}
}

function calc() { 
vent=window.open('','tpv','width=725,height=600,scrollbars=no,resizable=yes,status=yes,menubar=no,location=no');
document.forms[0].submit();}


function checkCheckBox(f){
var pass=true;
if (document.images) 
{
  for (i=0;i<f.length;i++) 
  {
    var tempobj=f.elements[i];
    if (tempobj.name.substring(0,8)=="required") 
	{
      if (((tempobj.type=="text"||tempobj.type=="textarea")&&
      tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s"&&
      tempobj.selectedIndex==0)) 
	  {
        pass=false;
        break;
      }
    }
   }
}
if (!pass) 
{
  shortFieldName=tempobj.name.substring(8,30).toUpperCase();
  alert("Please make sure the "+shortFieldName+" field was properly completed.");
 // return false;
  var compl=1;
}else{
 // return true;
  var compl=0;
}	

if (f.agree.checked == false )
{
   alert('No es pot procedir a la compra si no s\'accepten les condicions.');
   var compl=2;
}else{
  if (compl == 0){	
   var compl=3;
  }
}
if (compl==1 || compl == 2)
{
	return false;
}else{
    return true;
}
}
//  End -->

function PopUp3(pagina,ancho,alto,cerrar){ //amb scroll
	if (pagina != ""){
		if ((ancho > 0)&&(alto > 0)){
			tamanio=" width="+ancho+",height="+alto;
		} else {
			tamanio="fullscreen=Yes";
		}
		window.open(pagina,"","directories=no, toolbar=no, status=no, location=no, menubar=no, scrollbars=yes, rezizable=no,"+tamanio);
	}
	if (cerrar == 1){
		esta_ventana=window.self;
		esta_ventana.opener=window.self;
		esta_ventana.close();
	}
}

function doblelink(esquerra,dreta) {
                        top.leftFrame.location = esquerra;
                        top.mainFrame.location = dreta;
}

