var isChromeSafari = false;
if (/Chrome/.test(navigator.userAgent) || /Safari/.test(navigator.userAgent)) {
	isChromeSafari=true;
}

window.onload = function() {
	checkLinks();
	if (isChromeSafari)	
		checkContentHeight();
}
window.onresize = function() {
	if (isChromeSafari)        
		checkContentHeight();
}
function checkLinks(){
	$('a[rel=external]').attr('target','_blank');
}



function checkContentHeight() {
	var headerHeight = $('div#headerPanel').height();
	var footerHeight = $('div#footerPanel').height();
	var centralHeight = $('div#contentBlock').height()+50;
	var rightMenuHeight = $('div#rightMenuBg').height()+$('div#telBg').height();
	var windowHeight = $('#body').innerHeight();
	if (rightMenuHeight>centralHeight) {
		centralHeight=rightMenuHeight;
	}
	var fullContentHeight = headerHeight+centralHeight+footerHeight;
	if (fullContentHeight>windowHeight) {
		//$('div#centralPanel').css('height',centralHeight);
		$('div#windowPanel').css('height',fullContentHeight);
		$('div#layerPanel').css('height',fullContentHeight);
		//$('div#footerPanel').css('top',headerHeight+centralHeight);	
	} else {
		//$('div#centralPanel').css('height',centralHeight);
		$('div#windowPanel').css('height',windowHeight);
		$('div#layerPanel').css('height',windowHeight);
		//$('div#footerPanel').css('top',windowHeight-$('div#footerPanel').height()-1);            
	}
}

