var xmlhttp;				// xmlhttp object

// create XMLHttpRequest for all needs of this poll
function createXMLHttpRequest(){
	if (window.XMLHttpRequest){
		// code for IE7+, Firefox, Chrome, Opera, Safari	
		xmlhttp=new XMLHttpRequest();
	} else {
		// code for IE6, IE5	
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}	
}
function voteThis(id){
	createXMLHttpRequest();
	// make a vote!
	url = "plugins/abcmsPoll/index.php?option="+id;
	xmlhttp.open("GET",url,false);
	xmlhttp.send(null);
	// reload modified poll results
	url = "plugins/abcmsPoll/index.php";
	xmlhttp.open("GET",url,false);
	xmlhttp.send(null);		
	// get response with reloaded content :)
	document.getElementById('poll').innerHTML=xmlhttp.responseText;
}


    function checkEmail(email){
        filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
        if (filter.test(email)) {
            // Yay! valid
            document.getElementById('newsletterSubmit').disabled = false;
        }
        else
            document.getElementById('newsletterSubmit').disabled = "disabled";
    }







$(document).ready(function(){

    
    //Page Flip on hover
    $("#pageflip").hover(function() {
        $("#pageflip img , .msg_block").stop()
        .animate({
            width: '110px',
            height: '113px'
        }, 500);
    } , function() {
        $("#brochure img").stop()
        .animate({
            width: '35px',
            height: '36px'
        }, 220);
        $(".msg_block").stop()
        .animate({
            width: '35px',
            height: '36px'
        }, 200);
    });



    // lightbox
    $(function() {
        $('a.lightbox').lightBox();
    });



    function formatText(index, panel) {
        return "";
    }

		
    $('.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: 6000,                    // How long between slide transitions in AutoPlay mode
        startStopped: false,            // If autoPlay is on, this can force it to start stopped
        animationTime: 800,             // 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: "Štart",            			// Start text
        stopText: "Stop",              		  // Stop text
        navigationFormatter: formatText     // Details at the top of the file on this use (advanced use)
    });

    $("#slide-jump").click(function(){
        $('.anythingSlider').anythingSlider(6);
    });
				
    document.getElementById('thumbNav').style.right = '-500px';


})
