
// TD szin valtas
function SetRowColor(theRow,bgColor){
  var theCells = null;

  if ( typeof(theRow.style)=='undefined' ){
    return false;
  }

  // browser szerinti aktualis sor
  if ( typeof(document.getElementsByTagName)!='undefined'){
    theCells=theRow.getElementsByTagName('td');
  }else if ( typeof(theRow.cells)!='undefined' ){
     theCells = theRow.cells;
   }else{
      return false;
    }
   
  var domDetect=null;
  if ( (typeof(window.opera)=='undefined') && (typeof(theCells[0].getAttribute)!='undefined') ){
    domDetect=true;
  }else{
     domDetect=false;
   }

  var c=null;
  var rowCellsCnt=theCells.length;
  if (domDetect){
    for (c = 0; c < rowCellsCnt; c++) {
      theCells[c].setAttribute('bgcolor', bgColor, 0);
    }
  }else{
     for (c = 0; c < rowCellsCnt; c++) {
       theCells[c].style.backgroundColor = bgColor;
     }
   }

  return true;
}

 
function jumpURL(url,s){
  if ( window.confirm(s) ){
    location.href=url;
  }
}


function SubmitSubscribe(sid){
  if ( document.hirlevelForm.email.value=='' ){
    window.alert('Kérjük adja meg az e-mail címet!');
    document.hirlevelForm.email.focus();
  }else{
     location.href='hirlevel.php?shopSID=' + sid + '&a=subscribe&email=' + document.hirlevelForm.email.value;
   }
}


function SubmitUnsubscribe(sid){
  if ( document.hirlevelForm.email.value=='' ){
    window.alert('Kérjük adja meg az e-mail címet!');
    document.hirlevelForm.email.focus();
  }else{
     location.href='hirlevel.php?shopSID=' + sid + '&a=unsubscribe&email=' + document.hirlevelForm.email.value;
   }
}


 // layer kezeles
 var bongeszo = navigator.appName;
 var verzio = parseInt(navigator.appVersion);
 var NS6 = (bongeszo == 'Netscape' && verzio >= 5 );
 var NS4 = (bongeszo == 'Netscape' && verzio < 5);
 var IE = (bongeszo == 'Microsoft Internet Explorer' && verzio >= 4);
 
 if ( NS4 ){
   layerStyleRef="layer.";
   layerRef="document.layers";
   styleSwitch="";
 }

 function rejtMind() {
   if ( NS6 || IE || NS4 ) {
     rejt('Ltipus1');
   }
 }

 function rejt(layerName){
   if ( NS6 || IE ) {
	 eval('var obj=document.getElementById("'+layerName+'");');
	 obj.style.visibility="hidden";
   }else if ( NS4 ){
      eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"');
    }
 }
	
 function mutat(layerName){
   if ( NS6 || IE ) {
	 eval('var obj=document.getElementById("'+layerName+'");');
	 obj.style.visibility="visible";
   }else if ( NS4 ){
      eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="visible"');
    }
 }
 
 
 function ShowBigPics(kepurl,w,h){
   var pref="toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width="+w+",height="+h+",left=50,top=50";
   window.open('ShowBigPics.php?p=' + kepurl,'Bigpics',pref);
 }
 
 
 function DailyFormSubmit(){
   var ok=1;
   if ( document.urlapForm.nev.value=='' ){
     window.alert('Kérjük adja meg a Nevét vagy Cégnevét.');
     document.urlapForm.nev.focus();
     ok=0;
   }
   if ( (ok==1) && (document.urlapForm.kontakt_szemely.value=='') ){
     window.alert('Kérjük adja meg a Kontakt személy nevét.');
     document.urlapForm.kontakt_szemely.focus();
     ok=0;
   }
   if ( (ok==1) && (document.urlapForm.cim.value=='') ){
     window.alert('Kérjük adja meg a Címét.');
     document.urlapForm.cim.focus();
     ok=0;
   }
   if ( (ok==1) && (document.urlapForm.telefon.value=='') ){
     window.alert('Kérjük adja meg a Telefonszámát.');
     document.urlapForm.telefon.focus();
     ok=0;
   }
   if ( (ok==1) && (document.urlapForm.email.value=='') ){
     window.alert('Kérjük adja meg az E-mail címét.');
     document.urlapForm.email.focus();
     ok=0;
   }
   if ( (ok==1) && (document.urlapForm.jelenlegi_tevekenyseg.value=='') ){
     window.alert('Kérjük adja meg a Tulajdonosi kör jelenlegi és korábbi tevékenységeit.');
     document.urlapForm.jelenlegi_tevekenyseg.focus();
     ok=0;
   }
   if ( (ok==1) && (document.urlapForm.melyik_varos.value=='') ){
     window.alert('Kérjük adja meg, hogy melyik városban szeretne üzletet nyitni.');
     document.urlapForm.melyik_varos.focus();
     ok=0;
   }
   if ( (ok==1) && (document.urlapForm.pontos_cim.value=='') ){
     window.alert('Kérjük adja meg az üzlethelyiség nyitásának pontos címét.');
     document.urlapForm.pontos_cim.focus();
     ok=0;
   }
   if ( (ok==1) && (document.urlapForm.miert.value=='') ){
     window.alert('Kérjük adja meg, hogy miért szeretne nyitni üzletet.');
     document.urlapForm.miert.focus();
     ok=0;
   }
   if ( ok==1 ){
     document.urlapForm.submit();
   }
 }
 
 function ShowBigPics(kepurl,w,h,name){
   if ( name=='' ) name='BigPics';
   var pref="toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width="+w+",height="+h+",left=50,top=50";
   window.open('ShowBigPics.php?p=' + kepurl,name,pref);
 }
