	function tekst()
	{
		if(document.forma.author.value == "")
		{
		window.document.forma.author.value = "Author";	
		}
	}
	function tekstWiki()
	{
		if(document.forma.title.value == "")
		{
		window.document.forma.title.value = "Expression";	
		}
	}
	function tekstField()
	{
		if(document.forma.bodyComment.value == "")
		{
		window.document.forma.bodyComment.value = "Comment...";
		}
	}	
	function tekstFieldWiki()
	{
		if(document.forma.description.value == "")
		{
		window.document.forma.description.value = "Definition...";
		}
	}
	function tekstGenerate()
	{
		if(document.k.b.value == "")
		{
		window.document.k.b.value = "Confirm code from above!";	
		}
	}
	function cisti()
	{
		if(document.forma.author.value == "Author")
		{
		window.document.forma.author.value = "";
		}
	}
	function cistiWiki()
	{
		if(document.forma.title.value == "Expression")
		{
		window.document.forma.title.value = "";
		}
	}
	function cistiGenerate()
	{
		if(document.k.b.value == "Confirm code from above!")
		{
		window.document.k.b.value = "";
		}
	}
	function cistiField()
	{
		if(document.forma.bodyComment.value == "Comment...")
		{
		window.document.forma.bodyComment.value = "";
		}
	}
	function cistiFieldWiki()
	{
		if(document.forma.description.value == "Definition...")
		{
		window.document.forma.description.value = "";
		}
	}
	function provera()
	{
		var komentar = document.getElementById("comment").value;
		var autor = document.getElementById("author").value;
		
		if(komentar == "" || komentar == "Comment...")
		{	
			document.getElementById("greska").innerHTML = "Comment is required!";
			document.getElementById("comment").select();
			document.getElementById("comment").focus();
			return false;
		}else if(autor == "" || autor == "Author")
			{
				document.getElementById("greska").innerHTML  = "Author is required!";
				document.getElementById("author").select();
				document.getElementById("author").focus();
				return false;

			}
		return true;
	}
	function proveraWiki()
	{
		var definicija = document.getElementById("comment").value;
		var izraz = document.getElementById("author").value;
		
		if(definicija == "" || definicija == "Definition...")
		{	
			document.getElementById("greska").innerHTML = "Definition is required!";
			document.getElementById("comment").select();
			document.getElementById("comment").focus();
			return false;
		}else if(izraz == "" || izraz == "Expression")
			{
				document.getElementById("greska").innerHTML  = "Expression is required!";
				document.getElementById("author").select();
				document.getElementById("author").focus();
				return false;

			}
		return true;
	}
	function odbrojavanje(tekstPolje,maxBroj)
	{
		if (tekstPolje.value.length > maxBroj)
		{
			tekstPolje.value = tekstPolje.value.substring(0, maxBroj);
		}
		else
		{
			document.getElementById("greska").innerHTML = "Letters left : "+(maxBroj - tekstPolje.value.length);
		}
	}
	function randomString() 
{
	var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
	var string_length = 8;
	var randomstring = '';
	for (var i=0; i<string_length; i++) {
		var rnum = Math.floor(Math.random() * chars.length);
		randomstring += chars.substring(rnum,rnum+1);
	}
	document.k.a.value = randomstring;
	document.k.b.value ="";
	document.k.getElementById("c").disabled=true;
}
function doButton(f)
{
	if(f.a.value==f.b.value)
	{
	document.getElementById("c").disabled=false;
	}
	else
	{
	document.getElementById("c").disabled=true;
	}
}

