window.addEvent('domready',function(){
	var hlp = $$('.left-panel').getStyle('height');
	var	hrp = $$('.right-panel').getStyle('height');
	var leftpanel=parseInt(hlp);
	var rightpanel=parseInt(hrp);
	
	if(leftpanel>rightpanel){ 
		var heightadd=leftpanel-rightpanel+4;
		$('addheight').setStyle('height',heightadd);
		
	} else {
		var sdf=$$('.content').getStyle('height');
		var contenth=parseInt(sdf);
		var heightdel=leftpanel-contenth+3;
		var heightadd=rightpanel-heightdel;
		$$('.content').setStyle('height',heightadd);
	}
});


function addBookmark(url, title)
{
 if (!url) url = location.href;
 if (!title) title = document.title;

 //Gecko
 if ((typeof window.sidebar == "object") && (typeof window.sidebar.addPanel == "function")) window.sidebar.addPanel (title, url, "");
 //IE4+
 else if (typeof window.external == "object") window.external.AddFavorite(url, title);
 //Opera7+
 else if (window.opera && document.createElement)
 {

 var a = document.createElement('A');
 if (!a) return false; //IF Opera 6
 a.setAttribute('rel','sidebar');
 a.setAttribute('href',url);
 a.setAttribute('title',title);
 a.click();
 }
 else return false;
 return true;
}

function closewindow(){
	$('myElement').style.visibility = 'hidden';
	$('fonmyElement').style.visibility = 'hidden';
	var allAnsc = $(document.body).getElements("embed");
	allAnsc.each(function(item){
		item.style.visibility = 'visible';
	});
	var allAnsc2 = $(document.body).getElements("object");
	allAnsc2.each(function(item){
		item.style.visibility = 'visible';
	});
};


function openwindow(){
	var em = $('myElement');
	var fem = $('fonmyElement');
	em.style.visibility = 'visible';
	fem.style.visibility = 'visible';
	var allAnsc = $(document.body).getElements("embed");
	allAnsc.each(function(item){
		item.style.visibility = 'hidden';
	});
	var allAnsc2 = $(document.body).getElements("object");
	allAnsc2.each(function(item){
		item.style.visibility = 'hidden';
	});
	fem.effect('opacity',{ duration: 0, transition: Fx.Transitions.linear, wait:true}).start(0,0.5);
	if(window.ie){
		winH = window.getScrollHeight();
		winW = window.getScrollWidth();
			fem.style.width = winW;
			fem.style.height = winH;
			em.style.width = winW;
			em.style.height = winH;
			var allAnchors = $(document.body).getElements('select');
			allAnchors.each(function(item, index){
				item.setStyle('visibility','hidden');
			});
	} else {
		em.style.position = 'fixed';
		fem.style.position = 'fixed';
	};
};


window.addEvent('domready', function() {
	//preload images
	var aPreLoad = new Array();
	var aPreLoadi = 0;
 
	//do rollover
	$$('img.roll').each(function(el){
		//let's preload
		aPreLoad[aPreLoadi] = new Image();
		aPreLoad[aPreLoadi].src = el.src.replace(el.src.replace('_out', '_over'));
		aPreLoadi++;
 
		el.addEvent('mouseover',function(){
			this.setAttribute('src',this.src.replace('_out', '_over'));
		});
 
		el.addEvent('mouseout',function(){
			this.setAttribute('src',this.src.replace('_over', '_out'));
		});
	});
});


var autoLoad=new Array();
autoLoad[1]=new Image();
autoLoad[1].src='img/center/block_ask_star/decor_question_hover.gif';
