$(document).ready(function(){
	
	/*$("select").change(function() {

		delivery = $("select option[name=delivery]").val();
		deliveryFloat = '0.' + delivery;
		total = $("#total_change").text();
		total = total.replace(' ','.');

		opt_val = $("select option:selected").val();
		$("#delivery_change").text(opt_val);
		
		if ( $("select option[name=self]:selected").val() ) {
			floatTotal = parseFloat(total) - parseFloat(deliveryFloat);
			floatTotal = floatTotal.toString();
			$("#total_change").text( floatTotal.replace('.',' ') );
		} else {
			floatTotal = parseFloat(total) + parseFloat(deliveryFloat);
			floatTotal = floatTotal.toString();
			$("#total_change").text( floatTotal.replace('.',' ') );
		}
		 
	});*/
	$( ".accord" ).accordion({
		collapsible: true,
		active:false, 
		autoHeight: false
	});
	
	
	if ( $("#slider") ) {
		$("#slider").easySlider({
			auto: true,
			continuous: true,
			speed: 800,
			pause: 7000,
			numeric: true
		});
	}

	$(".site_nav li a, .site_nav li div").hover(function() {
		$(this).next().fadeToggle('fast');
	}, function() {
		$(this).next().toggle();
	});
	
	// SAAS
	
	function orderSAAS(sel, id) {
		$(sel).click(function() {
			$.post("./virtyalnaya-atc/", { "shk-id": id },
				function(data) {
					window.location = "./order/"
					//location.reload();
				}
			);
			return false;
		});
	}
	
	orderSAAS("a.saas_free", 3896);
	orderSAAS("a.saas_lite", 3897);
	orderSAAS("a.saas_biz", 3898);
	orderSAAS("a.saas_pro", 3899);
	
	$('#phone_check').phonesset({wtUrl:"http://thiamis.mcn.ru/welltime", setNumber: false});

        var dataHref = $("a[data-href]").attr("data-href");
        $("a[data-href]").attr("href", dataHref);
	
});

function shadowboxOpen(){
	Shadowbox.open({
	    content:    '<div id="welcome-msg"><video controls width="640" height="360" autoplay=""><source src="/img/banners/video.ogv" type="video/ogg" /><source src="/img/banners/video.mp4" type="video/mp4" /><embed src="http://www.youtube.com/v/9jn8wsBu1AY?fs=1&amp;hl=ru_RU" type="application/x-shockwave-flash" width="640" height="360" allowscriptaccess="always" allowfullscreen="true" autoplay="true"></embed></video></div>',
	    player:     "html",
	    width: 640,
	    height: 360
	});
}
	
$().ready(function(){$(".slider_line").css('display','block');});

	
$(function() {
	
});
