
  function popUp( url , title , xwidth , yheight ) {
	  
    var winl = ( screen.width - xwidth ) / 2;
	  
    var wint = ( screen.height - yheight ) / 2;
	  
    var a = window.open( url , "new" , "left="+winl+" , top="+wint+" , width="+xwidth+" , height="+yheight );
	  
    // nastaveni aktivniho okna
    if ( parseInt(navigator.appVersion) >= 4 ) { 
	    
      a.window.focus(); 
	  
    }
	  
  }


  function checkQuickForm() {
	  
	if( checkFormName( 'quick-contact-' ) == false ) {
		
		alert( 'Jméno a příjmení je třeba vyplnit!' );
		
		return false;
		
	}
	  
	if( checkFormPhone( 'quick-contact-' ) == false && checkFormEmail( 'quick-contact-' ) == false ) {
		
		alert( 'Telefon, nebo e-mail je nutno vyplnit!' );
		
		return false;
		
	}
    
	if( checkFormAccept( 'quick-contact-' ) == false ) {
		
		alert( 'Je třeba souhlasit s ujednáním!' );
		
		return false;
		
	}
	
    return true;
    
  }
  
  
  
  function checkContactForm() {
	  
	if( checkFormName( 'contact-' ) == false ) {
			
		alert( 'Jméno a příjmení je třeba vyplnit!' );
			
		return false;
			
	}
		
	if( checkFormPhone( 'contact-' ) == false && checkFormEmail( 'contact-' ) == false ) {
			
		alert( 'Telefon, nebo e-mail je nutno vyplnit!' );

		return false;
			
	}
	
	if( document.getElementById( 'contact-message' ).value == '' ) {
		
		alert( 'Pole se vzkazem je nutné vyplnit!' );
		
		return false;
		
	}
	
	return true;
	    
  }
  


  function checkFormName( type ) {
    
    if( document.getElementById( type + 'name').value == '' || document.getElementById( type + 'name').value == 'jméno, příjmení' ) {
    
      //alert( 'Jméno a příjmení je třeba vyplnit!' );

      return false;
      
    }
    
    return true;
  
  }
  
  function checkFormEmail( type ) {

    var filter = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
    
    var email = document.getElementById( type + 'email').value;

    if( filter.test( email ) == false ) {
    
      //alert( 'E-mailová adresa není ve správném formátu!' );
      
      return false;
      
    }
    
    return true;
  
  }
  
  
  function checkFormPhone( type ) {
	  
	  var filter = /^([+0-9\s]){9,}$/;

	  var phone = document.getElementById( type + 'phone' ).value;

	  if( filter.test( phone ) == false ) {
		    
	      //alert( 'Telefoní číslo není ve správném formátu!' );
	      
	      return false;
	      
	  }
	    
	  return true;
	  
  }
  
  
  function checkFormAccept( type ) {
	  
	if( document.getElementById( type + 'accept').checked == false ) {
		
		//alert( 'Je třeba souhlasit s ujednáním!' );
		
		return false;
		
	}
	  
	return true;
	
  }
  
  
/* by ascaria */
function get(id)
  {
  return document.getElementById(id);
  }

function getwindow() {
 var d = document, v = window, w, h, l, t;
 if( typeof v.innerWidth==='number' ) {
  w = v.innerWidth;
  h = v.innerHeight;
  l = v.pageXOffset;
  t = v.pageYOffset;
 } else if( ( v = d.documentElement ) &&
   typeof v.clientWidth==='number' &&
   v.clientWidth !== 0 || ( v = d.body ) ) {
  w = v.clientWidth;
  h = v.clientHeight;
  l = v.scrollLeft;
  t = v.scrollTop;
 }
 return {w: w, h: h, l: l, t: t};
}

function getmouse( e ) {
  e = e || window.event || {};
  var moux, mouy, w = getwindow(),
   minx = w.l,
   miny = w.t,
   maxx = w.w + w.l,
   maxy = w.h + w.t;
  if( typeof e.pageX==='number' ) {
    moux = e.pageX;
    mouy = e.pageY;
  } else {
    moux = e.x + w.l;
    mouy = e.y + w.t;
  }

  get('floating_help').style.top=(mouy+25)+'px';
  get('floating_help').style.left=(moux+20)+'px';
   
}

function floating_help(source,shown)
  {
  if(shown)
    {
    get('floating_help').innerHTML = get(source).innerHTML;
    get('floating_help').style.display='block';
    }
  else
    {
    get('floating_help').style.display='none';
    }
  }


