function fixH(one,two) 
{
if (document.getElementById(one) && document.getElementById(two)) 
	{
	var lh=document.getElementById(one).offsetHeight;
	var rh=document.getElementById(two).offsetHeight;
	var nh = Math.max(lh, rh); 
	document.getElementById(one).style.height=nh+"px";
	document.getElementById(two).style.height=nh+"px";
	}
}


NiftyLoad=function(){
	


if('<?= $no_sidebar?>' != '1')
	{
	fixH('main','sidebar');
	}
Nifty("div#header","big top");
Nifty("p#loginheader","small top");
Nifty("p#tableheader","small top");

Nifty("div.round_div","");
Nifty("div.round_bottom","bottom");
Nifty("div.round_top","top");
Nifty("div#footer","big bottom");

if(isIE){addIEGlossy(); }else {addGlossy();}

}

function placeholderSetup(id) {
	var el=ge(id);
	if(!el)return;var ph=el.getAttribute("placeholder");
	if(ph&&ph!="") {
		el.value=ph;el.style.color='#777';
		el.is_focused=0;
		el.onfocus=placeholderFocus;
		el.onblur=placeholderBlur;
	}
}

function placeholderFocus() {
	if(!this.is_focused) {
		this.is_focused=1;
		this.value='';
		this.style.color='#000';
		var rs=this.getAttribute("radioselect");
		if(rs&&rs!="") {
			var re=document.getElementById(rs);
			if(!re){return;}
			if(re.type!='radio')return;
			re.checked=true;
		}
	}
}

function ge() {
	var ea;
	for(var i=0;i<arguments.length;i++) {
		var e=arguments[i];
		if(typeof e=='string')
			e=document.getElementById(e);
		if(arguments.length==1)
			return e;
		if(!ea)
			ea=new Array();
		ea[ea.length]=e;
	}
return ea;
}

function placeholderBlur() {
	var ph=this.getAttribute("placeholder")
	if(this.is_focused&&ph&&this.value=="") {
		this.is_focused=0;this.value=ph;this.style.color='#777';
	}
}

function adjustImage(obj,stop_word,max) {
	var pn=obj.parentNode;
	if(stop_word==null)
		stop_word='note_content';
	if(max==null) {
		while(pn.className.indexOf(stop_word)==-1)
			pn=pn.parentNode;
		if(pn.offsetWidth)
			max=pn.offsetWidth;
		else
			max=400;
	}
	obj.className=obj.className.replace('img_loading','img_ready');
	if(obj.width>max) {
		if(window.ActiveXObject) {
			try{var img_div=document.createElement('div');
			img_div.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+obj.src.replace('"','%22')+'", sizingMethod="scale")';
			img_div.style.width=max+'px';
			img_div.style.height=((max/obj.width)*obj.height)+'px';
			if(obj.parentNode.tagName=='A')
				img_div.style.cursor='pointer';obj.parentNode.insertBefore(img_div,obj);obj.removeNode(true);
		}
		catch(e){obj.style.width=max+'px';}
	}
	else
		obj.style.width=max+'px';
	}
}

