

function hilite(idi,ion,text)
{
if (ns)
	document.images[idi].src=eval(ion+".src");
	top.window.status=text;
}
 function confirmLink(theLink, theSqlQuery)
{
    // Confirmation is not required in the configuration file
    if (confirmMsg == '') {
        return true;
    }

    var is_confirmed = confirm(confirmMsg + ' :\n' + theSqlQuery);
    if (is_confirmed) 
	{
        theLink.href += '&is_js_confirmed=1';
    }   
	return is_confirmed;
}
var confirmMsg  = 'Naozaj chete zmazať ';

function openup(URL, WIDTH, HEIGHT) 
{
    url = URL;
    width = WIDTH;  
    height = HEIGHT; 
    windowprops = "left=0,top=0,width=" + WIDTH + ",height=" + HEIGHT + "toolbar=no," + "location=no," + "directories=no," + "status=no," + "menubar=no," + "scrollbars=yes," + "resizable=yes,";
    fotogr = window.open(URL, "fotografia", windowprops);
	 fotogr.moveTo((screen.width-WIDTH)/2,(screen.height-HEIGHT)/2)
	
}
    

		
function openup2(URL, WIDTH, HEIGHT) 
{
    url = URL;
    width = WIDTH;  
    height = HEIGHT; 
    windowprops = "left=500,top=200,width=" + WIDTH + ",height=" + HEIGHT + "toolbar=no," + "location=no," + "directories=no," + "status=no," + "menubar=no," + "scrollbars=yes," + "resizable=no,";
    fotogr = window.open(URL, "fotografia", windowprops);
}


if(frames){
         if(top.frames.length>=1)
		 top.location.href=self.location;  
} 

 // blokovanie výberu
//document.onselectstart=new Function("return false"); 

 /*/ blokovanie right buttonu
function rbut(e){
if(document.all){
                   if ((event.button==2)||(event.button==3)){
                            alert('Copy right 2004  \n ©  AT-DESIGN');
							return false
							}							
						}					
					     if(document.layers){
					       if(e.which==3) {
					        alert('Copy right 2004 \n © AT-DESIGN');
							return false
					     }						 
					}				
	}	
	if(document.layers){document.captureEvents(event.mousedown)
	}	
	document.onmousedown=rbut;			 
	*/


function wnd_open() {
	var wnd = window.open("", "map_wnd", "width=500, height=380, resizable=no, toolbar=no, menubar=no, scrollbars=no");
	var topx = (screen.width - 500) / 2; var topy = (screen.height - 370) / 2;
	wnd.moveTo(topx, topy);
	return(true);
}


function check_form() {
	
	var reg = new RegExp(/^][.]|[a-zA-Z0-9_]+/g);		//regularni vyraz na prazdny retezec
	var err = 0;
	
	if (mail_verify() == 0) {
		err++;
	}
	
	//kontrola pole formulare - firma
	if (document.quest_form.firm.value.search(reg) == -1) {
		err++;
	}
	
	//kontrola pole formulare - kontaktni osoba
	if (document.quest_form.customer.value.search(reg) == -1) {
		err++;
	}
	
	//kontrola pole formulare - ICO
	if (document.quest_form.ico.value.search(reg) == -1) {
		err++;
	}
	
	//kontrola pole formulare - DIC
	if (document.quest_form.dic.value.search(reg) == -1) {
		err++;
	}
	
	//kontrola pole formulare - adresa
	if (document.quest_form.address.value.search(reg) == -1) {
		err++;
	}
	
	//kontrola pole formulare - telefon
	if (document.quest_form.phone.value.search(reg) == -1) {
		err++;
	}
	
	if (err > 0) {
		alert("Vyplnte prosím všechna pole\n   formuláře platnými údaji.");
		return(false);
	} else {
		return(true);
	}
}

//kontroluje pole formulare pro email, zda obsahuje platnou emailovou adresu
function mail_verify() {
	var mail_cont = document.quest_form.mail.value;
	var reg = new RegExp("^.+@.+\\..+$");
	var result = reg.exec(mail_cont);
	if (result) {
		return(true);
	} else {
		return(false);
	}
}

