function fix(id,min){
	//alert(window.navigator.userAgent);
	if(window.navigator.userAgent.indexOf("MSIE")<0)return;
	document.getElementById(id).style.width=((window.innerWidth||document.body.clientWidth)>min)?"100%":min+"px";
}
function newsblock(){
	var newsblock=parseInt(document.getElementById('newsblock').offsetHeight);
	document.getElementById('child0').style.height=newsblock+'px';
	document.getElementById('child1').style.height=newsblock+'px';
}

function formKonq(){
	if(window.navigator.appName=='Konqueror'){
		document.getElementById('formtext').style.width='135px';
		document.getElementById('formsearch').style.left='-25px';
		document.getElementById('formsearch').style.top='2px';
		document.getElementById('khtml').style.margin="108px 0 0 0";
	}
	if(window.navigator.userAgent.indexOf("Safari")>=0){
		document.getElementById('khtml').style.margin="112px 0 0 0";
	}
	//alert(window.navigator.userAgent.indexOf("Safari"));
	/*if(window.navigator.userAgent.indexOf("App")>=0){
		document.getElementById('apple').style.display='none';	
	}*/
}




function leftBlock(){
	var screen=parseInt(document.body.clientWidth);
	/*var leftMarg=(window.navigator.userAgent.indexOf("KHTML")>=0)?parseInt((screen-1004)/2):parseInt((screen-1024)/2);*/
	var leftMarg=parseInt((screen-1004)/2);
	if(screen<='1004'){
		document.getElementById('leftread').style.display='none';
		document.getElementById('centerfoot').style.display='none';
		document.getElementById('rightread').style.marginLeft='0px';
	}	
	else{
		document.getElementById('leftread').style.display='block';
		document.getElementById('leftread').style.width=leftMarg + 'px';
		document.getElementById('rightread').style.marginLeft=leftMarg + 'px';
		document.getElementById('centerfoot').style.display='block';
		document.getElementById('centerfoot').style.width=leftMarg + 'px';
	}
}


function init() {
	if (arguments.callee.done) return;
	arguments.callee.done = true;
	if (_timer) {
		clearInterval(_timer);
		_timer = null;
	}
	// insert stuff here
	fix('root',980);
	newsblock();
	formKonq();
	leftBlock();
	// end of insert
};
/* for Mozilla */
if (document.addEventListener) {
	document.addEventListener("DOMContentLoaded", init, false);
}

/* for Internet Explorer */
/*@cc_on @*/
/*@if (@_win32)
	document.write("<script id=__ie_onload defer src=javascript:void(0)><\/script>");
	var script = document.getElementById("__ie_onload");
	script.onreadystatechange = function() {
		if (this.readyState == "complete") {
			init(); // call the onload handler
		}
	};
/*@end @*/

/* for Safari */
if (/WebKit/i.test(navigator.userAgent)) { // sniff
	var _timer = setInterval(function() {
		if (/loaded|complete/.test(document.readyState)) {
			init(); // call the onload handler
		}
	}, 50);
}

/* for other browsers */
window.onload = init;
