function clearText(thefield)
{
if (thefield.defaultValue==thefield.value)
thefield.value = ""
}

function addText(thefield)
{
if (thefield.value =='')
thefield.value = "Google Пребарување"
}

function addText1(thefield)
{
if (thefield.value =='')
thefield.value = "Google Search"
}

function Datum()
{
var d=new Date()
var den=new Array("Недела","Понеделник","Вторник","Среда","Четврток","Петок","Сабота")
var mesec=new Array( "Јануари","Февруари","Март","Април","Мај","Јуни","Јули","Август","Септември","Октомври","Ноември","Декември")
document.write(den[d.getDay()] + ", ")
document.write(d.getDate() + " ")
document.write(mesec[d.getMonth()] + ", ")
document.write(d.getFullYear())
}


function toggleVisibility(id, NNtype, IEtype, W3Ctype) {
if (document.getElementById) {
eval("document.getElementById(id).style.visibility = \"" + W3Ctype + "\"");
} else {
if (document.layers) {
document.layers[id].visibility = NNtype;
} else {
if (document.all) {
eval("document.all." + id + ".style.visibility = \"" + IEtype + "\"");
}}}}


function valid(form)
{
var field = form.replyemail; // email field
var str = field.value; // email string
var reg1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/; // not valid
var reg2 = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/; // valid
if (!reg1.test(str) && reg2.test(str)) { // if syntax is valid
return true;
}
alert("\"" + str + "\" не е валидна e-mail адреса!"); // this is also optional
field.focus();
field.select();
return false;
}


function newWin(url, w, h, prozor) {
  var l = (screen.width - w) / 2; 
  var g = (screen.height - h) / 2;
  opcii = "width="+w+",height="+h+",left="+l+",top="+g+",screenX="+l+",screenY="+g;
  otvori=window.open(url, prozor, opcii);
  otvori.focus();
}

// toggle visibility 

function toggle( targetId ){
  if (document.getElementById){
  		target = document.getElementById( targetId );
  			if (target.style.display == "none"){
  				target.style.display = "";
  			} else {
  				target.style.display = "none";
  			}
  	}
}
