var popupStatus1 = 0;
 popup1 = {
    loadPopup: function(obj_name){
        obj_name = obj_name || 'dialog_form1'
        if(popupStatus1 == 0)
        {
            jQuery("#backgroundPopup1").css({
            "opacity": "0.7"
            });
            jQuery("#backgroundPopup1").fadeIn("slow");
            jQuery("#"+obj_name).fadeIn("slow");
            popupStatus1 = 1;
        }
    },
    centerPopup: function(obj_name, define){
        obj_name = obj_name || 'dialog_form1'
        var windowWidth = document.documentElement.clientWidth;
        var windowHeight = document.documentElement.clientHeight;
        var popupHeight = jQuery("#"+obj_name).height();
        var popupWidth = jQuery("#"+obj_name).width();
        //centering

        if(define == 'contact_form')
            top_value = 50;
        else
            top_value = windowHeight/2-popupHeight/2 + parseInt(jQuery(window).scrollTop());

        jQuery("#"+obj_name).css({
        "position": "absolute",
        //"top": 50,
        "top": top_value,
        "left": windowWidth/2-popupWidth/2,
        "z-index": 1011
        });
        //only need force for IE6

        jQuery("#backgroundPopup1").css({
        "height": windowHeight
        });

    },
    disablePopup: function(obj_name){
                obj_name = obj_name || 'dialog_form1'
        if(popupStatus1 == 1)
        {
            jQuery("#backgroundPopup1").fadeOut("slow");
            jQuery("#"+obj_name).fadeOut("slow");
            popupStatus1 = 0;
        }
    }
}

$().ready(function() {
	$('#coda-slider-1').codaSlider({
		autoHeight:0,
		autoSlide: true,
        autoSlideInterval: 10000,
        autoSlideStopWhenClicked: true,
        dynamicArrows: false,
		dynamicTabs: false
	});
});
$().ready(function() {
	$('#coda-slider-2').codaSlider({
		autoHeight:0,
		autoSlide: true,
        autoSlideInterval: 5000,
        autoSlideStopWhenClicked: true,
        dynamicArrows: false,
		dynamicTabs: false
	});
});

function cssmenuhover()
{
        if(!document.getElementById("cssmenu"))
                return;
        var lis = document.getElementById("cssmenu").getElementsByTagName("LI");
        for (var i=0;i<lis.length;i++)
        {
                lis[i].onmouseover=function(){this.className+=" iehover";}
                lis[i].onmouseout=function() {this.className=this.className.replace(new RegExp(" iehover\\b"), "");}
        }
}
if (window.attachEvent)
        window.attachEvent("onload", cssmenuhover);

var show_ok=0;
function vsplivalka(){
	if (show_ok==0) {
	show_ok=1;
	popup1.centerPopup('dialog_form1');
	popup1.loadPopup('dialog_form1');
	jQuery.ajax({
            			type: "POST",
            			url: "/ajax.php",
            			dataType: 'json',
            			cache:    false,
                        data: {op:'stop_vsplivalka'},
            			success: function(data){

            			}
            		});
	}
}


