﻿function doClear(theText) {
     if (theText.value == theText.defaultValue) {
         theText.value = ""
     }
 }
function checkform() {
  var lang = document.getElementById("language").value;	
  var mail = document.getElementById("email").value;
  var name = document.getElementById("attribute1").value;
	if ((name == "") || (name == "Vaše ime")) {
		alert_phplist("Molimo vas da unesete Vaše ime.");
		return false;
	}
	if (mail == "") {
		alert_phplist("Molimo vas da unesete Vašu e-mail adresu.");
		//$("div#response").show();
		//$("div#response").empty();
		//$("div#response").append("Please enter your email address.");
		return false;
    }  
	else
	{
		if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(mail)){
		}
		else{
			alert_phplist("E-mail adresa koju ste uneli je neispravna.")
			//$("div#response").show();
			//$("div#response").empty();
			//$("div#response").append("Email address you entered is not valid.");
			return false;
		}
	}	
	if ((mail != "" && (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(mail))) && (name != "" && name != "Vaše ime"))
		return true;
 }
 
  
function check_unsubscribe_form() {
  var mail = document.getElementById("unsubscribeemail").value;
  var mail_field = document.getElementById("unsubscribeemail");
	if (mail == "") {
		alert_phplist("Molimo vas da unesete Vašu e-mail adresu.");
		return false;
    }  
	else
	{
		if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(mail)){
		}
		else {
			alert_phplist("E-mail adresa koju ste uneli je neispravna");
			return false;
		}
	}
	if (mail != "" && (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(mail)))
		return true;
 }
