$('document').ready(function(){

	e=$("#footerIndex").height()+$("#footer").height();
	PageExtender(e);

	$(".pointsBlock div:last-child").css('background','none');
	$(".faqHolder div:last-child").css('background','none');
	$(".newsList div:last-child").css('background','none');	
	
	$('table.table tr:odd').addClass('dif');
	$('table.contacts tr:even').addClass('dif');
	$('table.contacts tr:last-child').addClass('last');
	
	$("div.faqQuestionHolder a.link").click(function(){;
		e=$(this).parents("div.faqQuestionHolder").attr('class')
		if(e!=="faqQuestionHolder active"){
			$(this).parents("div.faqQuestionHolder").addClass('active');
			return false;		
		}else{
			$(this).parents("div.faqQuestionHolder").removeClass('active');
			return false;
		}
	});	
	
	$('img.withCaption').each(function(i,img){
		if ($(img).attr('alt')) {
			$(img).wrap('<span class="image" style="width:'+$(img).width()+'px"/>');
			$(img).after('<span class="caption">'+$(img).attr('alt')+'</span>');
		}
	});
	
	$("a.fancy_box_pict").fancybox({ 'zoomSpeedIn': 300, 'zoomSpeedOut': 300, 'overlayShow': false }); 
	
});

function PageExtender(used_height){
    var elemet_id = "page_extender";
    var elem = null;
    if(elem = document.getElementById(elemet_id)){
           
        var w, h;
        if (self.innerHeight) // all except Explorer
        {
            w = self.innerWidth;
            h = self.innerHeight;
        }
        else if ((document.documentElement != null) && (document.documentElement.clientHeight != null))
            // Explorer 6 Strict Mode
        {
            w = document.documentElement.clientWidth;
            h = document.documentElement.clientHeight;
        }
        else if (document.body) // other Explorers
        {
            w = document.body.clientWidth;
            h = document.body.clientHeight;
        }
     
      var diff = h - used_height;
      //alert(diff);
      if(diff < 0) diff = 0;
      elem.style.height = diff +"px";
      //ExtendActions();
    }
}


function doNothing(a_obj, name, m_serv, dom){
		  
		  if(name != ''){
			a_obj.href = 'mailto:'+name + '@' + m_serv+'.'+dom;
			return true;
		  } else {
		  	return false;
		  }
		}

