function initChanger()  {
	$('work').observe('click',function(){
		return;
	});
}

var CatListiner = new Class.create({
	
	initialize: function() {
		var cf=new contactForm();
		Event.observe($('order-listiner'),'click',cf.toggle);
	}
	
});


var contactForm = new Class.create({
	initialize: function() {
	    Event.observe($('call-form'),'submit',this.submit);
	},
	toggle:function (e){
		//console.log(Event.element(e));
		if($('call-window').style.display==''){
		    $('call-window').style.display='none';
		}else{
		    $('call-window').style.display='';
		}
		e.stop();
	},
	submit:function (e){
	    var elem=Event.element(e);
	    data=$(elem).serialize(true);
	    $('call-wr').update('<img src="/rc/img/ajax-loader.gif" style="margin:30px"/>');
	    new Ajax.Updater('call-wr',elem.action/*+'.jax'*/, {
		 parameters: data
	    });
	    e.stop();
	}
});

var LayoutFixer = new Class.create({
	
		footer: {},
		
		initialize: function() {
			
			
		},
		
		putFooterIntoBottom: function() {
			this.footer.height = $('footer').getHeight()+parseInt($('footer').getStyle('margin-top'));
			
			vh = document.viewport.getHeight();
			
			ch = $('container').getHeight();
			
			if (vh > this.footer.height+ch) {
				contHeight = vh-this.footer.height;
				$('container').setStyle({'height':contHeight+'px'});
			}
			
			if ($$("#main .content").length>0) {
				c = $('main').down('.content');
				
				offsetVertical = c.cumulativeOffset()[1]+parseInt(c.getStyle('padding-top'))+parseInt(c.getStyle('padding-bottom'));
				c.setStyle({height:$('container').getHeight()-offsetVertical+'px'});
			}
		}
		

});

document.observe('dom:loaded',function(){
	cl = new CatListiner();
	lf = new LayoutFixer();
	lf.putFooterIntoBottom();

	Event.observe(window,'resize',lf.putFooterIntoBottom.bind(lf));
	
	
	//testC();
});





function testC() {
	
	canv = $('paws');
	 var ctx = canv.getContext('2d');  
	 ctx.beginPath();
	 ctx.fillStyle = "rgb(200,0,0)";  
    ctx.arc(20,100,50,0,Math.PI*2, true);   
	ctx.fill(); 
     
     $('paws').observe('click',function(){
     
     	rand(0,256);
     	
     	 ctx.fillStyle = "rgb("+rand(0,256)+","+rand(0,256)+","+rand(0,256)+")";
     	 ctx.fill(); 
     	
     })
	
}


function rand (min, max) {
    // Returns a random number  
    // 
    // version: 1008.1718
    // discuss at: http://phpjs.org/functions/rand
    // +   original by: Leslie Hoare
    // +   bugfixed by: Onno Marsman
    // %          note 1: See the commented out code below for a version which will work with our experimental (though probably unnecessary) srand() function)
    // *     example 1: rand(1, 1);
    // *     returns 1: 1
    
    var argc = arguments.length;
    if (argc === 0) {
        min = 0;
        max = 2147483647;
    } else if (argc === 1) {
        throw new Error('Warning: rand() expects exactly 2 parameters, 1 given');
    }
    return Math.floor(Math.random() * (max - min + 1)) + min;

}















