// <![CDATA[

$(function() {

	// radius Box

	$('.box_radius').css({"border-radius":"8px", "-moz-border-radius":"8px", "-webkit-border-radius":"8px"});

	

	// Slider script

    //define checker for first playing of slideshow
    var slideshow_first_cycle = true;

	$('#slideshow').cycle({

        fx:     'fade',

        speed:  'slow',

        timeout: 3500,

        pager:  '#slider_nav',

        pagerAnchorBuilder: function(idx, slide) {

            // return sel string for existing anchor

            return '#slider_nav li:eq(' + (idx) + ') a';

        },

        timeoutFn : function(currSlideElement, nextSlideElement, options, forwardFlag){
            //Changing timeout depending on current slide in order to timeout after
            //first slide will be longer then after another
            if ( options.currSlide == 0 & slideshow_first_cycle ){
                //set checker to false, in order to don't do this on next cycles
                //of slideshow
                slideshow_first_cycle = false;
                //timeout for first slide
                return 10000;
            }else{
                //default timeout
                return 3500;
            }
        }

    });

 
	// contact form

	$('#contactform').submit(function(){				  

		var action = $(this).attr('action');

		$.post(action, { 

			name: $('#name').val(),

			email: $('#email').val(),

			company: $('#company').val(),

			subject: $('#subject').val(),

			message: $('#message').val()

		},

			function(data){

				$('#contactform #submit').attr('disabled','');

				$('.response').remove();

				$('#contactform').before('<p class="response">'+data+'</p>');

				$('.response').slideDown();

				if(data=='Message sent!') $('#contactform').slideUp();

			}

		); 

		return false;

	});

});


//Some browsers depending styles fix.

jQuery(document).ready(function($){
    //Fixes for Chrome      
    if ($.browser.safari){
        //for social button of first page,       
        $("#si1").css('margin','-15px 0px 12px 0px');
        //for confirmation page backgound and aligning        
        $('.page-id-4 .body_resize.box_radius').css('height','580px');
        $('.page-id-4 .body_resize.box_radius .right').css('text-align','center');
    }



});


// ]]>

