function clearForm()
{
	var tmp = confirm( "Czy napewno wyczyścić ?" )
	if (tmp==false)
	{
		
	}
	else
	{
		document.getElementById('email').value='     Adres e-mail';
		document.getElementById('name').value='     Imie i nazwisko';
		document.getElementById('title').value='     Telefon';
		document.getElementById('www').value='     www';
		document.getElementById('text').value='';
	}
	
}
function page()
{
alert('as');
}
function sendMail()
{
	var email=document.getElementById('email').value;
	var www=document.getElementById('www').value;
	var regex = /^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z0-9.-]{2,4}$/;
  	var eT = regex.test(email);
  	var spr=1;
  	if(eT==false)
  	{
  		alert('Podany email jest nieprawidłowy');
  		spr=0;
  	}
/*	
	var name=document.getElementById('name').value;
	if(name=='     Imie i nazwisko')
	{
		alert('Prosze podać imie i nazwisko');
  		spr=0;
	}
	
	if(www=='     www')
	{
		alert('Prosze podać adres strony');
  		spr=0;
	}
*/
	var title=document.getElementById('title').value;
	var text=document.getElementById('text').value;
	var name2=document.getElementById('name2').value;
	if(name2=='' && spr==1)
	{
		var http = null;
	    if(window.XMLHttpRequest)
		http = new XMLHttpRequest();
	    else if (window.ActiveXObject)
	    http = new ActiveXObject("Microsoft.XMLHTTP");
	    http.onreadystatechange = function()
	    {
	        if(http.readyState == 4)
		{
		    if( http.status == 200 ) { 
				var odpowiedz = http.responseText;
				document.getElementById('infoMail').innerHTML='<b>Wiadomość została wysłana</b>';
				//document.getElementById('left3').style.padding="16px";
				document.getElementById('email').value='     Adres e-mail';
				document.getElementById('name').value='     Imie i nazwisko';
				document.getElementById('title').value='     Telefon';
				document.getElementById('www').value='     www';
				document.getElementById('text').value='';
				
			}
		}
	    }
		http.open("POST", "aj.php?form=FORM1", true);
	    http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	    http.send("action=sendMail&name="+name+"&email="+email+"&title="+title+"&text="+text+"&www="+www);
    }
}

function sendMail11()
{
	var email=document.getElementById('email11').value;
	var www=document.getElementById('www11').value;
	var regex = /^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z0-9.-]{2,4}$/;
  	var eT = regex.test(email);
  	var spr=1;
  	if(eT==false)
  	{
  		alert('Podany email jest nieprawidłowy');
  		spr=0;
  	}
/*	
	var name=document.getElementById('name').value;
	if(name=='     Imie i nazwisko')
	{
		alert('Prosze podać imie i nazwisko');
  		spr=0;
	}
	
	if(www=='     www')
	{
		alert('Prosze podać adres strony');
  		spr=0;
	}
*/
	var title=document.getElementById('title11').value;
	var text=document.getElementById('text11').value;
	var name2=document.getElementById('name211').value;
	if(name2=='' && spr==1)
	{
		var http = null;
	    if(window.XMLHttpRequest)
		http = new XMLHttpRequest();
	    else if (window.ActiveXObject)
	    http = new ActiveXObject("Microsoft.XMLHTTP");
	    http.onreadystatechange = function()
	    {
	        if(http.readyState == 4)
		{
		    if( http.status == 200 ) { 
				var odpowiedz = http.responseText;
				document.getElementById('infoMail11').innerHTML='<b>Wiadomość została wysłana</b>';
				//document.getElementById('left3').style.padding="16px";
				document.getElementById('email11').value='     Adres e-mail';
				document.getElementById('name11').value='     Imie i nazwisko';
				document.getElementById('title11').value='     Telefon';
				document.getElementById('www11').value='     www';
				document.getElementById('text11').value='';
				
			}
		}
	    }
		http.open("POST", "aj.php", true);
	    http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	    http.send("action=sendMail&name="+name+"&email="+email+"&title="+title+"&text="+text+"&www="+www);
    }
}

function rand()
{
	var infoN = new Array();
    infoN[0] = '<span class="h">Pozycjonowaliśmy serwis produktowy</span> <div class="spaceLine5"></div><span class="h">mark Winiary</span>';
    infoN[1] = '<span class="h">Pozycjonowaliśmy serwis produktowy</span> <div class="spaceLine5"></div><span class="h">mark Winiary</span>';
    infoN[2] = '<span class="h">Pozycjonowaliśmy serwis produktowy</span> <div class="spaceLine5"></div><span class="h">mark Winiary</span>';
    infoN[3] = '<span class="h">Pozycjonowaliśmy serwis produktowy</span> <div class="spaceLine5"></div><span class="h">mark Winiary</span>';
    infoN[4] = '<span class="h">Pozycjonowaliśmy serwis produktowy</span> <div class="spaceLine5"></div><span class="h">mark Winiary</span>';
    
    
    
    var infoN2 = new Array();
    infoN2[0] = '<span class="h">Pozycjonowaliśmy serwis produktowy</span> <div class="spaceLine5"></div><span class="h">mark Winiary</span>';
    infoN2[1] = '<span class="h">Pozycjonowaliśmy serwis produktowy</span> <div class="spaceLine5"></div><span class="h">mark Winiary</span>';
    infoN2[2] = '<span class="h">Pozycjonowaliśmy serwis produktowy</span> <div class="spaceLine5"></div><span class="h">mark Winiary</span>';
    infoN2[3] = '<span class="h">Pozycjonowaliśmy serwis produktowy</span> <div class="spaceLine5"></div><span class="h">mark Winiary</span>';
    infoN2[4] = '<span class="h">Pozycjonowaliśmy serwis produktowy</span> <div class="spaceLine5"></div><span class="h">mark Winiary</span>';
    
    var infoP2 = new Array();
    infoP2[0] = 'Wykonalismy optymalizacje oraz pozycjonowanie serwisu produktowego mark Winiary';
    infoP2[1] = 'Wykonalismy optymalizacje oraz pozycjonowanie serwisu produktowego mark Winiary';
    infoP2[2] = 'Wykonalismy optymalizacje oraz pozycjonowanie serwisu produktowego mark Winiary';
    infoP2[3] = 'Wykonalismy optymalizacje oraz pozycjonowanie serwisu produktowego mark Winiary';
    infoP2[4] = 'Wykonalismy optymalizacje oraz pozycjonowanie serwisu produktowego mark Winiary';
    
    var infoP = new Array();
    infoP[0] = 'Wykonalismy optymalizacje oraz pozycjonowanie serwisu produktowego mark Winiary';
    infoP[1] = 'Wykonalismy optymalizacje oraz pozycjonowanie serwisu produktowego mark Winiary';
    infoP[2] = 'Wykonalismy optymalizacje oraz pozycjonowanie serwisu produktowego mark Winiary';
    infoP[3] = 'Wykonalismy optymalizacje oraz pozycjonowanie serwisu produktowego mark Winiary';
    infoP[4] = 'Wykonalismy optymalizacje oraz pozycjonowanie serwisu produktowego mark Winiary';
    
    var r =Math.floor(Math.random() * infoN.length);
   
    document.getElementById('infoN1').innerHTML=infoN[r];
    document.getElementById('infoP1').innerHTML=infoP[r];
    
    document.getElementById('infoN2').innerHTML=infoN2[r];
    document.getElementById('infoP2').innerHTML=infoP2[r];
           
}

function vShow(n)
{
	
	if(n==1)
	{
		document.getElementById('t1a').style.display='block';
		document.getElementById('t1').style.display='block';
	}
	else
	{
		document.getElementById('t1a').style.display='none';
		document.getElementById('t1').style.display='none';
	}
	
	if(n==2)
	{
		document.getElementById('t2a').style.display='block';
		document.getElementById('t2').style.display='block';
	}
	else
	{
		document.getElementById('t2a').style.display='none';
		document.getElementById('t2').style.display='none';
	}
	
	if(n==3)
	{
		document.getElementById('t3a').style.display='block';
		document.getElementById('t3').style.display='block';
	}
	else
	{
		document.getElementById('t3a').style.display='none';
		document.getElementById('t3').style.display='none';
	}
	
	//document.getElementById('t2').style.display='none';
	//document.getElementById('t3').style.display='none';
	//document.getElementById('t'+n).style.display='block';
	
	
}

function sprPositionGoogle()
	{
	document.getElementById('buttonSpr').disabled=true;
	document.getElementById('buttonSpr').value='Trwa sprawdzanie';
	var url = document.getElementById('url').value;
	var fraza = document.getElementById('fraza').value;
	var code = document.getElementById('security_code').value;
	var http = null;
    if(window.XMLHttpRequest)
	http = new XMLHttpRequest();
    else if (window.ActiveXObject)
    http = new ActiveXObject("Microsoft.XMLHTTP");
    http.onreadystatechange = function()
    {
        if(http.readyState == 4)
	{
	    if( http.status == 200 ) { 
			var odpowiedz = http.responseText;
			
			document.getElementById('lista').innerHTML=odpowiedz;
			document.getElementById('buttonSpr').disabled=false;
			document.getElementById('buttonSpr').value='Sprawdź';
			//onLoadList();
		}
	}
    }
	http.open("POST", "fun.php", true);
    http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    http.send("url="+url+"&fraza="+fraza+"&code="+code);  
	}
	
	function delPositonList(id)
	{
		document.getElementById('del'+id).innerHTML='';
    	var http = null;
        if(window.XMLHttpRequest)
    	http = new XMLHttpRequest();
        else if (window.ActiveXObject)
        http = new ActiveXObject("Microsoft.XMLHTTP");
        http.onreadystatechange = function()
        {
            if(http.readyState == 4)
    	{
    	    if( http.status == 200 ) { 
    			var odpowiedz = http.responseText;
    			
    		}
    	}
        }
    	http.open("POST", "fun.php", true);
        http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
        http.send("action=del&id="+id);  
	}
	
function addEmail()
{
	var http = null;
    if(window.XMLHttpRequest)
	http = new XMLHttpRequest();
    else if (window.ActiveXObject)
    http = new ActiveXObject("Microsoft.XMLHTTP");
    http.onreadystatechange = function()
    {
        if(http.readyState == 4)
	{
	    if( http.status == 200 ) { 
			var odpowiedz = http.responseText;
			var text = document.getElementById('text').value;
			document.getElementById('text').value=text+odpowiedz;
		}
	}
    }
	http.open("POST", "fun.php", true);
    http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    http.send("action=formEmail");  
}	
//setInterval('rand();', 5000);


