<!-- BEGIN
// JavaScript Document
/*
	File is generated for use varius function which is need to draw real estate search form
	Created By: Md. Shahadat Hossain Khan Razon   eMail: razonklnbd@yahoo.com   web: www.razon.s5.com/personal
	Created Date: 20.04.2005
	Last Modified By: Md. Shahadat Hossain Khan Razon   eMail: razonklnbd@yahoo.com   web: www.razon.s5.com/personal
	Last Modified Date: 20.04.2005
*/
function changeTdBg(theCell, newColor){
	if (newColor == '' || typeof(theCell.style) == 'undefined') {
        return false;
    }
    // 1. Gets the current color...
    var domDetect    = null;
    var currentColor = null;
//    var newColor     = null;
    // 1.1 ... with DOM compatible browsers except Opera that does not return
    //         valid values with "getAttribute"
    if (typeof(window.opera) == 'undefined' && typeof(theCell.getAttribute) != 'undefined') {
        currentColor = theCell.getAttribute('bgcolor');
        domDetect    = true;
    }
    // 1.2 ... with other browsers
    else {
        currentColor = theCell.style.backgroundColor;
        domDetect    = false;
    }
    // 1.3 ... Opera changes colors set via HTML to rgb(r,g,b) format so fix it
    if (currentColor.indexOf("rgb") >= 0)
    {
        var rgbStr = currentColor.slice(currentColor.indexOf('(') + 1,
                                     currentColor.indexOf(')'));
        var rgbValues = rgbStr.split(",");
        currentColor = "#";
        var hexChars = "0123456789ABCDEF";
        for (var i = 0; i < 3; i++)
        {
            var v = rgbValues[i].valueOf();
            currentColor += hexChars.charAt(v/16) + hexChars.charAt(v%16);
        }
    } // end 1
    if (domDetect) theCell.setAttribute('bgcolor', newColor, 0);
	else theCell.style.backgroundColor = newColor;
}
function getBgColor(a){
	var clr = Array();
	clr[0] = "ffffff";
	clr[1] = "EEFCD2";
	clr[2] = "D2E4FC";
	clr[3] = "F9D3FA";
	return clr[a];
}
function getBorderColor(b){
	var clr = Array();
	clr[0] = "000000";
	clr[1] = "549400";
	clr[2] = "0075EB";
	clr[3] = "B01FAA";
	return clr[b];
}
function getColWidth(d){
	var w = Array();
	w[0] = 115;
	w[1] = 75;
	w[2] = 75;
	w[3] = 135;
	return w[d];
}
function getBlankGif(w, h){
	return "<img src='http://www.suchona.com/images/blank.gif' width="+w+" height="+h+" border=0>";
}
function getDownArrow(x){
	var arr = Array();
	arr[0] = "blank.gif";
	arr[1] = "fr.gif";
	arr[2] = "fs.gif";
	arr[3] = "wr.gif";
//	return "; border-bottom: none'; background-image: url(\"file:///C|/Documents%20and%20Settings/Administrator/Desktop/"+arr[x]+"\"); background-repeat: no-repeat; background-position: center";
	return "";
}
function getRow1(n){
	var on = Array();
	var off = Array();
	var height = 2;
	off[0] = "<td height="+height+" width="+getColWidth(0)+">"+getBlankGif(getColWidth(0), height)+"</td>";
	off[1] = "<td height="+height+" width="+getColWidth(1)+">"+getBlankGif(getColWidth(1), height)+"</td>";
	off[2] = "<td height="+height+" width="+getColWidth(2)+">"+getBlankGif(getColWidth(2), height)+"</td>";
	off[3] = "<td height="+height+" width="+getColWidth(3)+">"+getBlankGif(getColWidth(3), height)+"</td>";
	on[0] = "<td height="+height+" width="+getColWidth(0)+">"+getBlankGif(getColWidth(0), height)+"</td>";
	on[1] = "<td height="+height+" width="+getColWidth(1)+" style='background-color: #"+getBorderColor(1)+"; border-bottom: none; border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000'>"+getBlankGif(getColWidth(1), height)+"</td>";
	on[2] = "<td height="+height+" width="+getColWidth(2)+" style='background-color: #"+getBorderColor(2)+"; border-bottom: none; border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000'>"+getBlankGif(getColWidth(2), height)+"</td>";
	on[3] = "<td height="+height+" width="+getColWidth(3)+" style='background-color: #"+getBorderColor(3)+"; border-bottom: none; border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000'>"+getBlankGif(getColWidth(3), height)+"</td>";
	var returnVal = Array();
	for(i=0;i<=3;i++){
		returnVal[i] = off[i];
		if(i==n) returnVal[i] = on[i];
	}
	return returnVal;
}
function getRow2(n){
	var on = Array();
	var off = Array();
	var sap = Array();
	sap[0] = "none";
	sap[1] = "2 solid #e5e5e5";
	sap[2] = "none";
	sap[3] = "2 solid #e5e5e5";

/*	off[0] = "<td width="+getColWidth(0)+" align=center style='border-left: 1 solid #E5E5E5; border-top: 1 solid #e5e5e5; border-bottom: none; border-right: none' class=comment>"+getHeadingText(0)+"</td>";
	off[1] = "<td width="+getColWidth(1)+" align=center onMouseOver=\"return changeTdBg(this, '#F0F0F0')\" onMouseOut=\"return changeTdBg(this, '#ffffff')\" onClick='drawReSearchForm(1)' style='border-left: none; border-top: 1 solid #e5e5e5; border-bottom: none; border-right: "+sap[n]+"' class=hdOff><a href='#' title='"+getHeadingText(1)+"' onmouseover=\"window.status='"+getHeadingText(1)+"'; return true;\" onmouseout=\"window.status=''; return true;\" style='text-decoration: none'>"+getHeadingText(1)+"</a></td>";
	off[2] = "<td width="+getColWidth(2)+" align=center onMouseOver=\"return changeTdBg(this, '#F0F0F0')\" onMouseOut=\"return changeTdBg(this, '#ffffff')\" onClick='drawReSearchForm(2)' style='border-left: none; border-top: 1 solid #e5e5e5; border-bottom: none; border-right: none' class=hdOff><a href='#' title='"+getHeadingText(2)+"' onmouseover=\"window.status='"+getHeadingText(2)+"'; return true;\" onmouseout=\"window.status=''; return true;\" style='text-decoration: none'>"+getHeadingText(2)+"</a></td>";
	off[3] = "<td width="+getColWidth(3)+" align=center onMouseOver=\"return changeTdBg(this, '#F0F0F0')\" onMouseOut=\"return changeTdBg(this, '#ffffff')\" onClick='drawReSearchForm(3)' style='border-left: "+sap[n]+"; border-top: 1 solid #e5e5e5; border-bottom: none; border-right: 1 solid #e5e5e5' class=hdOff><a href='#' title='"+getHeadingText(3)+"' onmouseover=\"window.status='"+getHeadingText(3)+"'; return true;\" onmouseout=\"window.status=''; return true;\" style='text-decoration: none'>"+getHeadingText(3)+"</a></td>";*/
	off[0] = "<td width="+getColWidth(0)+" align=center style='border-left: 1 solid #E5E5E5; border-top: 1 solid #e5e5e5; border-bottom: none; border-right: none' class=comment>"+getHeadingText(0)+"</td>";
	off[1] = "<td width="+getColWidth(1)+" align=center onMouseOver=\"window.status='"+getHeadingText(1)+"'; return changeTdBg(this, '#F0F0F0')\" onMouseOut=\"window.status=''; return changeTdBg(this, '#ffffff')\" onClick='drawReSearchForm(1)' style='border-left: none; border-top: 1 solid #e5e5e5; border-bottom: none; border-right: "+sap[n]+"' class=hdOff>"+getHeadingText(1)+"</td>";
	off[2] = "<td width="+getColWidth(2)+" align=center onMouseOver=\"window.status='"+getHeadingText(2)+"'; return changeTdBg(this, '#F0F0F0')\" onMouseOut=\"window.status=''; return changeTdBg(this, '#ffffff')\" onClick='drawReSearchForm(2)' style='border-left: none; border-top: 1 solid #e5e5e5; border-bottom: none; border-right: none' class=hdOff>"+getHeadingText(2)+"</td>";
	off[3] = "<td width="+getColWidth(3)+" align=center onMouseOver=\"window.status='"+getHeadingText(3)+"'; return changeTdBg(this, '#F0F0F0')\" onMouseOut=\"window.status=''; return changeTdBg(this, '#ffffff')\" onClick='drawReSearchForm(3)' style='border-left: "+sap[n]+"; border-top: 1 solid #e5e5e5; border-bottom: none; border-right: 1 solid #e5e5e5' class=hdOff>"+getHeadingText(3)+"</td>";
	on[0] = "<td width="+getColWidth(0)+" align=center style='border-left: 1 solid #E5E5E5; border-top: 1 solid #e5e5e5; border-bottom: none; border-right: none' class=comment>"+getHeadingText(0)+"</td>";
	on[1] = "<td width="+getColWidth(1)+" align=center style='background-color: #"+getBorderColor(1)+"; border-bottom: none; border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: none' class=hdOn>"+getHeadingText(1)+"</td>";
	on[2] = "<td width="+getColWidth(2)+" align=center style='background-color: #"+getBorderColor(2)+"; border-bottom: none; border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: none' class=hdOn>"+getHeadingText(2)+"</td>";
	on[3] = "<td width="+getColWidth(3)+" align=center style='background-color: #"+getBorderColor(3)+"; border-bottom: none; border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: none' class=hdOn>"+getHeadingText(3)+"</td>";
	var returnVal = Array();
	for(i=0;i<=3;i++){
		returnVal[i] = off[i];
		if(i==n) returnVal[i] = on[i];
	}
	return returnVal;
}

function getRow3(n){
	var on = Array();
	var off = Array();
	var height = 2;
	off[0] = "<td height="+height+" width="+getColWidth(0)+" style='border-left: 1px solid #"+getBorderColor(n)+"; border-top: 1px solid #"+getBorderColor(n)+";background-color: #"+getBgColor(n)+"; border-right: none; border-bottom: none'>"+getBlankGif(getColWidth(0), height)+"</td>";
	off[1] = "<td height="+height+" width="+getColWidth(1)+" style='border-left: none; border-top: 1px solid #"+getBorderColor(n)+";background-color: #"+getBgColor(n)+"; border-right: none; border-bottom: none'>"+getBlankGif(getColWidth(1), height)+"</td>";
	off[2] = "<td height="+height+" width="+getColWidth(2)+" style='border-left: none; border-top: 1px solid #"+getBorderColor(n)+";background-color: #"+getBgColor(n)+"; border-right: none; border-bottom: none'>"+getBlankGif(getColWidth(2), height)+"</td>";
	off[3] = "<td height="+height+" width="+getColWidth(3)+" style='border-left: none; border-top: 1px solid #"+getBorderColor(n)+";background-color: #"+getBgColor(n)+"; border-right: 1px solid #"+getBorderColor(n)+"; border-bottom: none'>"+getBlankGif(getColWidth(3), height)+"</td>";
	on[0] = "<td align=center height="+height+" width="+getColWidth(0)+" style='border-left: 1px solid #"+getBorderColor(n)+"; border-top: 1px solid #"+getBorderColor(n)+";background-color: #"+getBgColor(n)+"; border-right: none; border-bottom: none'>"+getBlankGif(getColWidth(0), height)+"</td>";
	on[1] = "<td align=center height="+height+" width="+getColWidth(1)+" style='border-left: none; border-top: 1px solid #"+getBorderColor(n)+";background-color: #"+getBgColor(n)+"; border-right: none; border-bottom: none"+getDownArrow(1)+"'>"+getBlankGif(getColWidth(1), height)+"</td>";
	on[2] = "<td align=center height="+height+" width="+getColWidth(2)+" style='border-left: none; border-top: 1px solid #"+getBorderColor(n)+";background-color: #"+getBgColor(n)+"; border-right: none; border-bottom: none'"+getDownArrow(2)+"'>"+getBlankGif(getColWidth(2), height)+"</td>";
	on[3] = "<td align=center height="+height+" width="+getColWidth(3)+" style='border-left: none; border-top: 1px solid #"+getBorderColor(n)+";background-color: #"+getBgColor(n)+"; border-right: 1px solid #"+getBorderColor(n)+""+getDownArrow(3)+"'>"+getBlankGif(getColWidth(3), height)+"</td>";
	var returnVal = Array();
	for(i=0;i<=3;i++){
		returnVal[i] = off[i];
		if(i==n) returnVal[i] = on[i];
	}
	return returnVal;
}

function drawReSearchForm(n){
	var spanName = getSpanName();
	var r = Array();
	var rw = Array();
	rw[0]=getRow1(n);
	rw[1]=getRow2(n);
	rw[2]=getRow3(n);

	r[0] = "<tr>"+rw[0][0]+rw[0][1]+rw[0][2]+rw[0][3]+"</tr>";
	r[1] = "<tr>"+rw[1][0]+rw[1][1]+rw[1][2]+rw[1][3]+"</tr>";
	r[2] = "<tr>"+rw[2][0]+rw[2][1]+rw[2][2]+rw[2][3]+"</tr>";
	r[3] = "<tr><td colspan=4 style='border-left: 1px solid #"+getBorderColor(n)+"; border-top: none;background-color: #"+getBgColor(n)+"; border-right: 1px solid #"+getBorderColor(n)+"; border-bottom: 1px solid #"+getBorderColor(n)+"; padding: 10px' class=details>"+getForm(n)+"</td></tr>";
	
	document.getElementById(spanName).innerHTML = "<table width=400 border=0 cellspacing=0 cellpadding=0>"+r[0]+r[1]+r[2]+r[3]+"</table>";
}
// End -->
