m0_r_off=new Image(); m0_r_off.src="images/menu_0_right_off.jpg";
m0_r_on=new Image(); m0_r_on.src="images/menu_0_right_on.jpg";
m0_0_r_off=new Image(); m0_0_r_off.src="images/menu_0_0_right_off.jpg";
m0_0_r_on=new Image(); m0_0_r_on.src="images/menu_0_0_right_on.jpg";
m0_0_0_r_off=new Image(); m0_0_0_r_off.src="images/menu_0_0_0_right_off.jpg";
m0_0_0_r_on=new Image(); m0_0_0_r_on.src="images/menu_0_0_0_right_on.jpg";
m0_0_0_rd_off=new Image(); m0_0_0_rd_off.src="images/menu_0_0_0_down_right_off.jpg";
m0_0_0_rd_on=new Image(); m0_0_0_rd_on.src="images/menu_0_0_0_down_right_on.jpg";
m_fr_off=new Image(); m_fr_off.src="images/menu_first_0_right_off.jpg";
m_fr_on=new Image(); m_fr_on.src="images/menu_first_0_right_on.jpg";
m_lr_off=new Image(); m_lr_off.src="images/menu_last_right_off.jpg";
m_lr_on=new Image(); m_lr_on.src="images/menu_last_right_on.jpg";

d_off=new Image(); d_off.src="images/details_off.gif";
d_on=new Image(); d_on.src="images/details_on.gif";
mo_off=new Image(); mo_off.src="images/more_off.gif";
mo_on=new Image(); mo_on.src="images/more_on.gif";
b_off=new Image(); b_off.src="images/back_off.gif";
b_on=new Image(); b_on.src="images/back_on.gif";
v_off=new Image(); v_off.src="images/vote_off.gif";
v_on=new Image(); v_on.src="images/vote_on.gif";
vr_off=new Image(); vr_off.src="images/voteresults_off.gif";
vr_on=new Image(); vr_on.src="images/voteresults_on.gif";
b_1=new Image(); b_1.src="images/button/button1.gif";
b_1on=new Image(); b_1on.src="images/button/button1_on.gif";
b_11=new Image(); b_11.src="images/button/button11.gif";
b_11on=new Image(); b_11on.src="images/button/button11_on.gif";
b_2=new Image(); b_2.src="images/button/button2.gif";
b_2on=new Image(); b_2on.src="images/button/button2_on.gif";
b_22=new Image(); b_22.src="images/button/button22.gif";
b_22on=new Image(); b_22on.src="images/button/button22_on.gif";

function getElement(aID){
	return (document.getElementById) ? document.getElementById(aID) : document.all[aID];
}

function rowon(table,id,col){
	for (i=1;i<=col;i++){
		getElement(table+'_'+id+'_'+i).className='cf';
		getElement('p'+table+'_'+id+'_'+i).className='highlightc';
	}
}

function rowoff(table,id,col){
	if (id%2)
		color='cd';
	else
		color='ce';
	for (i=1;i<=col;i++){
		getElement(table+'_'+id+'_'+i).className=color;
		getElement('p'+table+'_'+id+'_'+i).className='normalc';
	}
}

function setDivHeight(idDiv1, idDiv2, idDiv3){
	var maxHeight = 0;
	var div1 = document.getElementById(idDiv1).offsetHeight;
	var div2 = document.getElementById(idDiv2).offsetHeight;
	var div3 = document.getElementById(idDiv3).offsetHeight;

	maxHeight = (div1 < div2) ? div2 : div1;
	maxHeight = (div2 < div3) ? div3 : div2;

	$('#menu').height(maxHeight+20);
	$('#content').height(maxHeight);
}

$(document).ready(function() {
	$("a#single_image,a.grouped_elements").fancybox({
		'transitionIn'	:	'elastic',
		'transitionOut'	:	'elastic',
		'speedIn'		:	600,
		'speedOut'		:	200
	});
	$("a#inline").fancybox({
		'hideOnContentClick': true,
		'autoDimensions': true,
		'transitionIn'	:	'elastic',
		'transitionOut'	:	'elastic',
		'speedIn'		:	600,
		'speedOut'		:	200
	});

});

$(window).load(function() {
	setDivHeight('menu', 'content', 'leftborder');
	var settings = {
		tl: { radius: 5 },
		tr: { radius: 5 },
		bl: { radius: 5 },
		br: { radius: 5 },
		antiAlias: true
	}
	curvyCorners(settings, ".imgbox,.newsbox_service,.newsbox_company,.newsbox_other,.mainbox_full,.box,.boxhead");
});
