function iewidth(min,max){
	w = document.documentElement.clientWidth;
	return (w <= min) ? min + "px" : ((w >= max) ? max + "px" : "auto");
}

function getCookie(name) {
	var cookie = " " + document.cookie;
	var search = " " + name + "=";
	var setStr = null;
	var offset = 0;
	var end = 0;
	if (cookie.length > 0) {
		offset = cookie.indexOf(search);
		if (offset != -1) {
			offset += search.length;
			end = cookie.indexOf(";", offset)
			if (end == -1) {
				end = cookie.length;
			}
			setStr = unescape(cookie.substring(offset, end));
		}
	}
	return(setStr);
}


//gag
if($.browser.msie && $.browser.version < 7 && getCookie('useie') == null)
{
	location.href = '/templates/gag/ie6.html';
}
//..gag

jQuery(document).ready(function(){
	//Main page
	$('div.mainmenu div.hr').each(function(i, el){
		el.style.width = (224+i*64)+'px';
	});
	$('div.main').each(function (i, el){
		el.style.marginTop = ($(el.parentNode.parentNode.parentNode).height()/2-$(el).height()/2)+'px';
	});

	$('div.leftColl, div.rightColl').css({height: $('div.body').height()+'px'});
	if($.browser.msie)
	{
		//if($('div.leftColl').height() < 707)	$('div.leftColl').css({height: '707px'});
	}
});

function hideShowDiv(id)
{
	var div = $('#'+id)[0];
	if(div.style.display == 'none')
		div.style.display = 'block';
	else
		div.style.display = 'none';
}

