	function checkDomain(form){
			
		var domena=document.getElementById(form).value; //.toLowerCase();
	    var text='Niepoprawna nazwa domeny.\n Nazwa domeny może składać się wyłącznie z małych liter, cyfr i znaku \"-\" \n nie może zaczynać się i kończyć znakiem \"-\" \n nie może zawierać spacji.';
	        
		var first=domena.substring(0,1);
		var last=domena.substring(domena.length-1,domena.length);
		if (domena == "" || first=="-" || last=="-"||first=="." || domena.indexOf("--")!=-1 || domena.length>63){
			alert(text);
			document.getElementById(form).focus();
		   	return false;
		}
	        
		for(i=0;i<domena.length;i++){
			var znak = domena.substring(i,i+1);
			if (znak=="-" || znak!="." && ( (znak>="0" && znak<="9") || (znak>="a" && znak<="z") || idn.indexOf(znak)>=0 )) {}
			else {
				alert(text);
				document.getElementById(form).focus();
				return false;
			}
		}
	}
	
	function ShowHide(id){
	var objectt = document.getElementById(id);
	   if (objectt) {
	   	if (objectt.style.display=='none') objectt.style.display='block';
	   	else objectt.style.display='none';
	   }
	
	}
	
	function printt(typee, zam_id, fv_id, user_id) {
	   if (typee && zam_id) {
	      strona_do_wyswietlenia = "http://strony.papcomputer.pl/drukuj.php?type=" + typee + "&zam_id=" + zam_id + "&fv_id=" +fv_id+"&user_id=" + user_id;
	      window.open (strona_do_wyswietlenia, '','width=800, height=600, status=no,toolbar=yes,menubar=yes,location=no,resizable=yes');
	   }
	
	}
	
function outf(id) {
var show_id = document.getElementById(id);
if (show_id) {show_id.style.backgroundColor='#ffffff';}
}

function CheckValidForm() {
	var test = document.getElementById('UsernameCHECK').value;
	alert(test);
}

function LoadSite(site, where, param) {
	var req = mint.Request();
	req.OnSuccess = function() {
	    }
	req.OnLoading = function() {
		//$(where).innerHTML = "changing ...";
	}
	req.Send(site, where);
}

	function SendRequest(where, what, ans, loading)
	{
	    var req = mint.Request();
	    req.OnSuccess =
	    function() {
	        $(ans).innerHTML = this.responseText;
	    }
	    req.OnLoading = function() {
	    	if (loading) {
	         document.getElementById(loading).style.display='block';
	          SetOpacity("searchMenuload", 50);
	   	 }
	    }
	    req.SendForm(what, where);
	}
	
	function CheckForm(site, where, frm_id) {
   	 var req = mint.Request();
   	 req.OnSuccess = function() {
   	 	document.getElementById(frm_id).disabled = false;
   	 	if (this.responseText && frm_id!='country') {
    	 		document.getElementById(frm_id).style.borderColor='#FF0000';
 		
   	 	} 	
   	 	else if (this.responseText && frm_id=='country') {
   	 		document.getElementById(frm_id).style.borderColor='#B5CEE7';
   	 	}
   	 	else {
   	 		document.getElementById(frm_id).style.borderColor='#B5CEE7';
   	 	}
	    }
	    req.OnLoading = function() {
	    	$(where).innerHTML = "checking ...";
	    	document.getElementById(frm_id).disabled = true;
	    }
	    if (frm_id=='cpass') {req.Send(site+"="+frm_id+"&data2="+document.getElementById('pass').value, where);}
	    else if (frm_id=='username' || frm_id=='email') {req.Send(site+"="+frm_id, where); }
	    else {req.Send(site+"="+frm_id, where);}
	 }
	 
function popup(id, act) {
	document.getElementById(id).style.display = act;
}

function showw() {
	rr=document.getElementById('konsul').checked;
	if (rr) document.getElementById('telshow').style.display = 'block';
	else document.getElementById('telshow').style.display = 'none';
}

function vote (id) {
	//document.getElementById('nr_vote').value = id;
	for (x=1; x<=id; x++) {
		document.getElementById('star'+x).src = "gfx/star_on.jpg";
	}
	if (id != 6) {
	   for (xx=x; xx<=6; xx++) {
	      document.getElementById('star'+xx).src = "gfx/star_off.jpg";
	   }
	}
}
