
  /// postavke za slider  
        function formatText(index, panel) {
		  return index + "";
	    }
    
        $(function () {
        
            $('.anythingSlider').anythingSlider({
                easing: "easeInOutExpo",        // Anything other than "linear" or "swing" requires the easing plugin
                autoPlay: true,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.
                delay: 4000,                    // How long between slide transitions in AutoPlay mode
                startStopped: false,            // If autoPlay is on, this can force it to start stopped
                animationTime: 1600,             // How long the slide transition takes
                hashTags: true,                 // Should links change the hashtag in the URL?
                buildNavigation: true,          // If true, builds and list of anchor links to link to each slide
        		pauseOnHover: true,             // If true, and autoPlay is enabled, the show will pause on hover
        		startText: "",             // Start text
		        stopText: "",               // Stop text
		        navigationFormatter: formatText       // Details at the top of the file on this use (advanced use)
            });
            
            $("#slide-jump").click(function(){
                $('.anythingSlider').anythingSlider(6);
            });
            
        });
/// kraj slidera


/// forma za korištenje webmaila

var servers = "otvorena\.hr";
servers = ".*";
var urlTpl = "http://mail.otvorena.com/horde/imp/redirect.php";

function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		
		if (str.indexOf(at)==-1){
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    return false
		 }

 		 return true					
	}


function setFocus()
{
document.implogin.imapuser.focus();
}

function submit_login()
{
	var un = document.implogin.imapuser.value;
	if (un == "") {
		alert('Molimo unesite korisničko ime.');
		document.implogin.imapuser.focus();
		return false;
	} else if (document.implogin.pass.value == "") {
		alert('Molimo unesite lozinku.');
		document.implogin.pass.focus();
		return false;
	} 
	else if (!echeck(un)) {
		alert("Pogrešna e-mail adresa.");
		document.implogin.imapuser.focus();
		return false;	
	}
	else {
		var server = un.substr(un.indexOf("@")+1);
		if( !server.match(servers) ) {
			alert('Pogrešna e-mail adresa.');
			return false;
		}
		document.implogin.action = urlTpl.replace("placeholder", server);
		return true;
	}
}



function enter_key_trap(e)
{
var keyPressed;
if (document.layers) {
keyPressed = String.fromCharCode(e.which);
} else if (document.all) {
keyPressed = String.fromCharCode(window.event.keyCode);
} else if (document.getElementById) {
keyPressed = String.fromCharCode(e.keyCode);
}
if ((keyPressed == "\r" || keyPressed == "\n") && (submit_login())) {
document.implogin.submit();
}
}

/// kraj emaila


