//CHANGE TAB
function tab(group,num) {
  for (i=1;i<30;i++) {
    tabid = 'tab'+group+'-'+i;
    divid = 'div'+group+'-'+i;
    if (document.getElementById(tabid)) {
      if (i==num)   {
        document.getElementById(tabid).className = 'active';
         document.getElementById(divid).className = 'boxes';
      }
      else {
        document.getElementById(tabid).className = 'a';
        document.getElementById(divid).className = 'boxes dspnone';
      }
    }
    else continue;
  }
}
function tabbig(group,num) {
  for (i=1;i<30;i++) {
    tabid = 'tab'+group+'-'+i;
    divid = 'div'+group+'-'+i;
    if (document.getElementById(tabid)) {
      if (i==num)   {
        document.getElementById(tabid).className = 'active';
         document.getElementById(divid).className = 'boxesbig';
      }
      else {
        document.getElementById(tabid).className = 'a';
        document.getElementById(divid).className = 'boxesbig dspnone';
      }
    }
    else continue;
  }
}
function searchtabselects(group,num) {
  for (i=0;i<300;i++) {
    divid = 'divselects'+group+'-'+i; selects = 'selects'+group+'-'+i;
	dividsm = 'divselects1-'+i; selectssm = 'selects1-'+i;
	if(group==0){
		if(document.getElementById(selectssm)){
			document.getElementById(dividsm).className = 'dspnone';
			document.getElementById(selectssm).selectedIndex = -1;
		}
	}
	if (document.getElementById(selects)) {
		document.getElementById(selects).selectedIndex = 0;
	}
    if (document.getElementById(divid)) {
      if (i==num)   {
         document.getElementById(divid).className = '';
      }
      else {
        document.getElementById(divid).className = 'dspnone';
      }
    }
    else continue;
  }
  if(group==0){ dividsm = 'divselects1-'+0; selectssm = 'selects1-'+0;
  	document.getElementById(dividsm).className = ''; document.getElementById(selectssm).selectedIndex = 0;
	}
}
function searchtabselectsadvance(group,num,numvalu) {
  for (i=0;i<90;i++) {
    divid = 'divselects'+group+'-'+i; selects = 'selects'+group+'-'+i;
	dividsm = 'divselects1-'+i; selectssm = 'selects1-'+i;
	if (document.getElementById(selects)) {
		document.getElementById(selects).selectedIndex = 0;
		document.getElementById(selects).options[0].value =0;
	}
    if (document.getElementById(divid)) {
      if (i==num)   {
         document.getElementById(divid).className = '';
		 document.getElementById(selects).options[0].value = numvalu;
      }
      else {
        document.getElementById(divid).className = 'dspnone';
      }
    }
    else continue;
  }
}
function searchtabselectstype(group,num) {
    divid = 'divselects2-1';
	divid2 = 'divselects9-1';
	if (num==109) {
		document.getElementById(divid).className = 'dspnone';
		document.getElementById(divid2).className = 'dspnone';
	}else{
		document.getElementById(divid).className = '';
		document.getElementById(divid2).className = '';
	}
}

function disp_not_dsp(elemid,num) {	
    if (num==1) {
        document.getElementById(elemid).className = 'popmes dspblock';
     }else{
        document.getElementById(elemid).className = 'dspnone';
    }
}
//END CHANGE TAB
//WINDOW POPUP
function pop_window(pURL, pWidth, pHeight) {
  if (!pURL) {
    return;
  }
  var offsetWidth = 50;
  var offsetHeight = 70;
  var windowFeatures = "toolbar=no,directories=no,location=no,status=no,menubar=no,resizable=yes,scrollbars=yes,"
    + "width=" + (pWidth + offsetWidth) + ",height=" + (pHeight + offsetHeight);
  var popup = window.open(pURL, 'imagePopup', windowFeatures);
  if (popup) {
    popup.focus();
	popup.moveTo(0,0);
  }
}
//END WINDOW  POPUP