/* 
  This file is copyrighted. You may not use any code nor information from file without written permission.
  Efoze.co.il site crew (2005) (c)
*/

function writeOrderImages(tdid,fname) {
	var tdobj = document.getElementById(tdid);
	var fieldisselected,orderselected;
	//fieldisselected = (parent.frames['topFrame'].document.forms['frmSearch'].elements['orderByField'].value == fname);
	//orderselected = (parent.frames['topFrame'].document.forms['frmSearch'].elements['orderByOrder'].value == '1');
	
	//rudy topbar update
	fieldisselected = (parent.frames['mainFrame'].document.forms['frmSearch'].elements['orderByField'].value == fname);
	orderselected = (parent.frames['mainFrame'].document.forms['frmSearch'].elements['orderByOrder'].value == '1');
	//end rudy topbar update
	
	tdobj.innerHTML += '<img style="width: 11px; height: 10px; vertical-align: middle" src="images/sort-desc'+(fieldisselected?(orderselected?'':'_over'):'')+'.gif" class="fakeLink" onClick="parent.frames[\'mainFrame\'].changeOrderBy(\''+fname+'\', 0);" />';
	tdobj.innerHTML += '<img src="images/spacer.gif" height="1" width="12" /><img style="width: 11px; height: 10px; vertical-align: middle" src="images/sort-asc'+(fieldisselected?(!orderselected?'':'_over'):'')+'.gif" class="fakeLink" onClick="parent.frames[\'mainFrame\'].changeOrderBy(\''+fname+'\', 1);" />';
}

function itemRow_onMouseOver(that) {
	that.tag = that.className;
	that.className = 'rtRow rtRowSelected';
	return true;
}

function itemRow_onMouseOut(that) {
	that.className = that.tag;
	return true;
}

var iRow = new Array();
var cbCalledOnclick;

function itemRow_onClick(itemid) {
	var divobj = document.getElementById('div_details'+itemid);
	if (cbCalledOnclick) {
			cbCalledOnclick = 0;
			return 0;
	}
	if (iRow[itemid]) { // hide the entire row once again
		closeDiv('div_details'+itemid, 0);
		setTimeout('document.getElementById("trED_'+itemid+'").className = "clsHidden";', 150);
		iRow[itemid] = 0;
	} else { // quit hiding the entire row
		document.getElementById('trED_'+itemid).className = "";
		openDiv('div_details'+itemid, 0);
		iRow[itemid] = 1;
	}
	if (divobj.tag == undefined) {
		xajax_getExtDesc(itemid, ft);
		divobj.tag = '';
	}
	return true;
}
