/*

Copyright (c) 2010 Vanni Valle. All rights reserved.

*/

$(document).ready(function() {
    $('#bgSlide').cycle({
		fx: 'fade',
        speed: 2000,
        timeout: 5000
	});
	
	var as_sx = Raphael("paper_sx", 1600, 1000).path("M0 0L1303 0L304 1000L0 1000L0 0").attr({stroke: "none", fill: "#000"});
	var as_dx = Raphael("paper_dx", 1600, 1000).path("M1600 0L1600 1000L305 1000L1305 0").attr({stroke: "none", fill: "#000"});
	
	
	$('#paper_sx').hide();
	$('#paper_dx').hide();

	
	
	//$('#paper_sx').css({opacity:0});
	//$('#paper_dx').css({opacity:0});
	

    /*
    
    $(".one").hover(
        function(){
   	        $('#paper_sx').animate({opacity: 1}, 200);
        },
        function(){
   	        $('#paper_sx').animate({opacity: 0}, 200);
        }
    );
    
    
    $(".two").hover(
        function(){
   	        $('#paper_dx').animate({opacity: 1}, 200);
        },
        function(){
   	        $('#paper_dx').animate({opacity: 0}, 200);
        }
    ); 
    
    */     
    
    $(".one").hover(
        function(){
   	        $('#paper_sx').fadeIn(200);
   	        $('#paper_dx').fadeOut(200);
        },
        function(){
   	        $('#paper_sx').fadeOut(200);
        }
    );
    
    
    $(".two").hover(
        function(){
   	        $('#paper_dx').fadeIn(200);
   	        $('#paper_sx').fadeOut(200);
        },
        function(){
   	        $('#paper_dx').fadeOut(200);
        }
    ); 
    
   
    
    
    
	
	
	
	
	
	/*$("#paper_sx").hover(
    function(){
   	    $("#paper_sx").stop(true,true).fadeIn();
   	    $(".enter.two").stop(true,true).fadeIn();
    },
    function(){
   	    $("#paper_sx").stop(true,true).fadeOut();
   	    $(".enter.two").stop(true,true).fadeOut();        
    }
    );
    
    
    $("li.fade").hover(function(){$(this).fadeOut(100);$(this).fadeIn(500);});*/
    
    /*
    $("#canvas").hover(
        function () {
            alert("ok");
        },
        function () {
            
        }
    );
    */
	
	
	
	
	//paper_dx.css({opacity:0});
	
	
	
	
	/*
	var R = Raphael("paper", 1600, 1000);
	
	
	
	
	Raphael.el.cross = function () {
    this.attr({fill: "red"});
    this.paper.path("M10,10L50,50M50,10L10,50")
        .attr({stroke: "red"});
}
	*/
	
	
	/*var R = Raphael("paper", 1600, 1000);
    var attr = {
        fill: "#333",
        opacity: 0
    };
    var aus = {};
    aus.vic = R.path("M0,0l1172,0-900,900-270-0z").attr(attr);
    aus.vic.node.id="sx";
        
    aus.wa = R.path("M1175,0l262,0,0,900-1160-0z").attr(attr);
    aus.wa.node.id="dx";*/




    /*    var R = Raphael("paper", 1600, 1000);
        var attr = {
        fill: "#333",
        opacity: 0
        };
    var aus = {};
    aus.vic = R.path("M0,0l1172,0-900,900-270-0z").attr(attr);
    aus.vic.node.id="sx";
        
    aus.wa = R.path("M1175,0l262,0,0,900-1160-0z").attr(attr);
    aus.wa.node.id="dx";   
         
    $('#dx').mouseover(function() {
   	    $("#splash2").fadeIn();
   	    $(".enter.two").fadeIn();
   	    $("#splash3").fadeOut();
   	    $(".enter.one").fadeOut();
    });         
    
    $("#sx").mouseover(function() {
   	    $("#splash3").fadeIn();
   	    $(".enter.one").fadeIn();
   	    $("#splash2").fadeOut();
   	    $(".enter.two").fadeOut();
    });
    */
    

    $("#footer_intro").hover(
    function(){
   	    $("#splash2").stop(true,true).fadeIn();
   	    $(".enter.two").stop(true,true).fadeIn();
    },
    function(){
    }
    );
    
    
    
    
    
   


});
