window.onload = function() {
    antispam_emails();
}

function antispam_emails() {
    if (!document.getElementsByTagName) return;
    var anchors = document.getElementsByTagName("a");
    for (var i = 0; i < anchors.length; i++) {
        var anchor = anchors[i];
        if ((email = anchor.getAttribute("href")) && anchor.getAttribute("type") == "antispam") {
			var vsebina = anchor.innerHTML;
            anchor.href = antispam_replace(email);
            anchor.innerHTML = antispam_replace(vsebina);
        }
    }
}

function antispam_replace(email) {
    var modified = email.replace(/%20/g, " "); // za IE
    modified = modified.replace(/ AFNA /g, "@");
    modified = modified.replace(/ PIKA /g, ".");
    return modified;
}


function OpenPopupGallery(URI) {
   var lH = screen.height - 60;
   var Settings = "scrollbars=yes,resizable=yes,";
   Settings = Settings + "width=770";
   Settings = Settings + ",height=" + lH; 
   theNewWin = window.open(URI, 'popup', Settings);
   theNewWin.focus();
}

function DisableSubmit(o,e){
	var characterCode;

	if(e && e.which){ 
		e = e;
		characterCode = e.which;
	}else{
		e = window.event;
		characterCode = e.keyCode;
	}
	if(characterCode == 13){
		e.cancelBubble = true;
				return false;
	}
	return true;
}