﻿$(document).ready(function(){
						   
$('#language_select').click(function(){
if ($('#dropdown_language').is(':visible')) {
$('#dropdown_language').hide();	
} else {
$('#dropdown_language').show();		
}
return false;									 

});
$('#dropdown_language').mouseover(function(){
$('#dropdown_language').show();									   
});

$('#dropdown_language').mouseout(function(){
$('#dropdown_language').hide();									   
});

$('.service_link').mouseover(function(){
obj = $(this);
service_delay = setTimeout(function(){
if (obj.attr('id') != 'active_service') {
obj.parent().find('img').attr('src', obj.parent().find('img').attr('src').replace('normal','active'));
if ($('.service_description:visible').prev().find('img').attr('src') != null)
$('.service_description:visible').prev().find('img').attr('src', $('.service_description:visible').prev().find('img').attr('src').replace('active','normal'));
$('.service_description:visible').prev().find('.service_link').attr('id','');
$('.service_description:visible').slideUp(400);
obj.parent().next().slideDown(300);
obj.attr('id','active_service');
}
},100);
});

$('.service_link').mouseout(function(){
clearTimeout(service_delay);									  
});

$('#wrapper a.lightbox').mouseout(function(){
$('#big_image').attr('src',$('#returnimage').val());											  
});



$('#tminus').click(function(){
newsize = parseInt($('#content_left').css('fontSize').replace('px',''))-1; 
if (newsize < 12) newsize = 12; 
newsize += 'px'; 
$('#content_left').css({'fontSize':newsize}); 
return false;						
});

$('#tplus').click(function(){
newsize = parseInt($('#content_left').css('fontSize').replace('px',''))+1; 
if (newsize > 22) newsize = 22; 
newsize += 'px'; 
$('#content_left').css({'fontSize':newsize}); 
return false;						
});

$('#tfont').click(function(){
$('#content_left').css({'fontSize':'15px'}); 
return false;						
});
$('.chosen_option1').each(function(){								  
$(this).html($('#'+$(this).next().attr('id')+' option:selected').text());								  
});
$('.chosen_option2').each(function(){								  
$(this).html($('#'+$(this).next().attr('id')+' option:selected').text());								  
});

$('.module_title').click(function(){
if ($(this).next().attr('id') != 'active_module') {
$('.module_desc:visible').attr('id','');
$('.module_desc:visible').hide();
if ($(this).next().height() <= 100) $(this).next().slideDown(400);
if ($(this).next().height() > 100 && $(this).next().height() <= 500) $(this).next().slideDown(1000);
if ($(this).next().height() > 500 && $(this).next().height() <= 1000) $(this).next().slideDown(1600);
if ($(this).next().height() > 1000) $(this).next().slideDown(2000);
$(this).next().attr('id','active_module');
}
});
$('.content_right_news_item').eq(0).show();
if ($('.content_right_news_item').length == 1) $('#news_down_arrow').hide();
});

function refreshSelected(obj) {
$(obj).prev().html($("#"+$(obj).attr('id')+" option:selected").text());
}

function changeNews(direction) {
if (direction == 'up') {
news--;
} else {
news++;	
}
$('.content_right_news_item:visible').fadeOut(300,function(){
$('.content_right_news_item').eq(news).fadeIn(300);
});
if (news > 0) {
$('#news_up_arrow').show();	
} else {
$('#news_up_arrow').hide();	
}
if (news < ($('.content_right_news_item').length - 1)) {
$('#news_down_arrow').show();
} else {
$('#news_down_arrow').hide();	
}
}

