
if(top!= self) top.location.href = self.location.href

	function createCookie(name,value,days) {
		if (days) {
			var date = new Date();
			date.setTime(date.getTime()+(days*24*60*60*1000));
			var expires = "; expires="+date.toGMTString();
		}
		else var expires = "";
		document.cookie = name+"="+value+expires+"; path=/";
	}
	
	function readCookie(name) {
		var nameEQ = name + "=";
		var ca = document.cookie.split(';');
		for(var i=0;i < ca.length;i++) {
			var c = ca[i];
			while (c.charAt(0)==' ') c = c.substring(1,c.length);
			if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
		}
		return null;
	}
	
	function eraseCookie(name) {
		createCookie(name,"",-1);
	}



function fav2(name,id) {
	// alert(id);
	var error = 0;
	if (readCookie(name)) {
		var myArray = readCookie(name).split(',');
		for ( keyVar in myArray ) {
			if (myArray[keyVar] == id) {
				error = error+1;
			}
		}
		if (error < 1) tempVar = readCookie(name) + ',' + id;
	} else {
		tempVar = id;
	}
	// alert('tempVar:'+tempVar);
	if (error < 1) createCookie(name,tempVar,'365');

	starvar = 'changeimg'+name+''+id;
	document.getElementById(starvar).src='images/star_active.jpg';

	functvar = 'changefunct'+name+''+id;
	document.getElementById(functvar).innerHTML='<a href=# onClick=delfav2("'+name+'",'+id+');><img src=images/del.gif border=0></a>';
	
	document.getElementById('showfav').style.display='block';
	document.getElementById('topstar').style.display='block';
}


function delfav2(name,id) {
	// alert(id);
	var error = 0;
	if (readCookie(name)) {
		var myArray = readCookie(name).split(',');
		if (myArray.length == 1) {
			tempVar = 0;
			var foundkey = id;
		} else {
			var i=1;
			for ( keyVar in myArray ) {
				if (myArray[keyVar] == id) {
					var found = 1;
					var foundkey = myArray[keyVar];
				} else {
					if (i == 1 || (found == 1 && i == 2)) tempVar = myArray[keyVar];
					else tempVar += myArray[keyVar];
					tempVar += ',';
					var foundkey = myArray[keyVar];
				}
				i++;
			}
		}
		if (/,$/.test(tempVar)) {
    	    tempVar=tempVar.replace(/,$/,"")
	    }
		eraseCookie(name);
		if (tempVar != 0) createCookie(name,tempVar,'365');
	} else {
		tempVar = 0;
	}
	
	if (!readCookie('properties') && !readCookie('commercials') && !readCookie('rentals')) {
		document.getElementById('showfav').style.display='none';
		document.getElementById('topstar').style.display='none';
	}
	// alert(foundkey);
	starvar = 'changeimg'+name+''+id;
	functvar = 'changefunct'+name+''+id;
	document.getElementById(starvar).src='images/star.jpg';
	document.getElementById(functvar).innerHTML='<a href=# onClick=fav2("'+name+'",'+id+')><img src=images/star_active.jpg border=0></a>';
}


function delallfav() {
	var agree=confirm("Are you sure you wish to delete all favorites?");
	if (agree) {
		eraseCookie('properties');
		eraseCookie('commercials');
		eraseCookie('rentals');
		return true ;
	} else {
		return false ;
	}
}

function emaillayer() {
	if (document.getElementById('showemailform').style.display == "none") document.getElementById('showemailform').style.display = 'block';
	else document.getElementById('showemailform').style.display = 'none';
}


// ur
function getthedate(){

	var mydate=new Date();
	var year=mydate.getYear();

	if (year < 1000)
		year+=1900
	
	var day=mydate.getDay()
	var month=mydate.getMonth()
	var daym=mydate.getDate()
	
	if (daym<10)
		daym="0"+daym

	var hours=mydate.getHours()
	var minutes=mydate.getMinutes()
	var seconds=mydate.getSeconds()
	var dn=""
	
	if (hours>=12)
		dn=""
	
	if (hours>24)
		hours=hours-12
	
	if (hours==0)
		hours=0

	if (minutes<=9)
		minutes="0"+minutes

	if (seconds<=9)
		seconds="0"+seconds

	var cdate=""+dayarray[day]+" "+daym+" "+montharray[month]+" "+year+" "+hours+":"+minutes+":"+seconds+" "+dn+"";
	document.getElementById('clock').innerHTML=cdate;
}

if (!document.all) getthedate();

function goforit(){
	setInterval("getthedate()",1000);
}
// ur slut


// alm vertify
function vertify(arg1,arg2) {
	if (document.getElementById(arg2).value == "" || document.getElementById(arg2).value == arg1) {
		// alert(arg1);
		document.getElementById(arg2).value = arg1;
		return false ;
	}
}

// clearbox
function clearbox(arg1) {
	document.getElementById(arg1).value = "";
}

// clearform
function clearform(arg1,arg2) {
	if (document.getElementById(arg1).value == arg2) {
		document.getElementById(arg1).value = '';
	}
}
	
	
	// menu ned
	function menu_ned(layername) {
		document.getElementById(layername).style.display = "none";
		document.getElementById(layername).style.visibility = "hidden";
		document.getElementById(layername).style.position = "absolute";
	}

	// menu op
	function menu_op(layername) {
		document.getElementById(layername).style.display = "block";
		document.getElementById(layername).style.visibility = "visible";
		document.getElementById(layername).style.position = "relative";
	}
	
function menu_over(id) {
	// show
	document.getElementById(id).className = 'menu_mouseover';
}

function menu_out(id) {
	// hide
	document.getElementById(id).className = 'menu_mouseout';
}


// layerpop
function pop_layer(layername) {
	if (document.getElementById(layername).style.display == "block")	{
		menu_ned(layername);
	} else {
		menu_op(layername);
	}
}

// make menu
startList = function() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("nav");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}

		navRoot1 = document.getElementById("nav1");
		for (i=0; i<navRoot1.childNodes.length; i++) {
			node1 = navRoot1.childNodes[i];
			if (node1.nodeName=="LI") {
				node1.onmouseover=function() {
					this.className+=" over";
				}
				node1.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
		
		navRoot2 = document.getElementById("nav2");
		for (i=0; i<navRoot2.childNodes.length; i++) {
			node1 = navRoot2.childNodes[i];
			if (node1.nodeName=="LI") {
				node1.onmouseover=function() {
					this.className+=" over";
				}
				node1.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}





/**
 * This array is used to remember mark status of rows in browse mode
 */
var marked_row = new Array;


/**
 * Sets/unsets the pointer and marker in browse mode
 *
 * @param   object    the table row
 * @param   interger  the row number
 * @param   string    the action calling this script (over, out or click)
 * @param   string    the default background color
 * @param   string    the color to use for mouseover
 * @param   string    the color to use for marking a row
 *
 * @return  boolean  whether pointer is set or not
 */
function setPointer(theRow, theRowNum, theAction, theDefaultColor, thePointerColor, theMarkColor)
{
    var theCells = null;

    // 1. Pointer and mark feature are disabled or the browser can't get the
    //    row -> exits
    if ((thePointerColor == '' && theMarkColor == '')
        || typeof(theRow.style) == 'undefined') {
        return false;
    }

    // 2. Gets the current row and exits if the browser can't get it
    if (typeof(document.getElementsByTagName) != 'undefined') {
        theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
        theCells = theRow.cells;
    }
    else {
        return false;
    }

    // 3. Gets the current color...
    var rowCellsCnt  = theCells.length;
    var domDetect    = null;
    var currentColor = null;
    var newColor     = null;
    // 3.1 ... with DOM compatible browsers except Opera that does not return
    //         valid values with "getAttribute"
    if (typeof(window.opera) == 'undefined'
        && typeof(theCells[0].getAttribute) != 'undefined') {
        currentColor = theCells[0].getAttribute('bgcolor');
        domDetect    = true;
    }
    // 3.2 ... with other browsers
    else {
        currentColor = theCells[0].style.backgroundColor;
        domDetect    = false;
    } // end 3

    // 4. Defines the new color
    // 4.1 Current color is the default one
    if (currentColor == ''
        || currentColor.toLowerCase() == theDefaultColor.toLowerCase()) {
        if (theAction == 'over' && thePointerColor != '') {
            newColor              = thePointerColor;
        }
        else if (theAction == 'click' && theMarkColor != '') {
            newColor              = theMarkColor;
            marked_row[theRowNum] = true;
        }
    }
    // 4.1.2 Current color is the pointer one
    else if (currentColor.toLowerCase() == thePointerColor.toLowerCase()
             && (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])) {
        if (theAction == 'out') {
            newColor              = theDefaultColor;
        }
        else if (theAction == 'click' && theMarkColor != '') {
            newColor              = theMarkColor;
            marked_row[theRowNum] = true;
        }
    }
    // 4.1.3 Current color is the marker one
    else if (currentColor.toLowerCase() == theMarkColor.toLowerCase()) {
        if (theAction == 'click') {
            newColor              = (thePointerColor != '')
                                  ? thePointerColor
                                  : theDefaultColor;
            marked_row[theRowNum] = (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])
                                  ? true
                                  : null;
        }
    } // end 4

    // 5. Sets the new color...
    if (newColor) {
        var c = null;
        // 5.1 ... with DOM compatible browsers except Opera
        if (domDetect) {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].setAttribute('bgcolor', newColor, 0);
            } // end for
        }
        // 5.2 ... with other browsers
        else {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].style.backgroundColor = newColor;
            }
        }
    } // end 5

    return true;
} // end of the 'setPointer()' function

/*
 * Sets/unsets the pointer and marker in vertical browse mode
 *
 * @param   object    the table row
 * @param   interger  the row number
 * @param   string    the action calling this script (over, out or click)
 * @param   string    the default background color
 * @param   string    the color to use for mouseover
 * @param   string    the color to use for marking a row
 *
 * @return  boolean  whether pointer is set or not
 *
 * @author Garvin Hicking <me@supergarv.de> (rewrite of setPointer.)
 */
function setVerticalPointer(theRow, theRowNum, theAction, theDefaultColor1, theDefaultColor2, thePointerColor, theMarkColor) {
    var theCells = null;

    // 1. Pointer and mark feature are disabled or the browser can't get the
    //    row -> exits
    if ((thePointerColor == '' && theMarkColor == '')
        || typeof(theRow.style) == 'undefined') {
        return false;
    }

    // 2. Gets the current row and exits if the browser can't get it
    if (typeof(document.getElementsByTagName) != 'undefined') {
        theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
        theCells = theRow.cells;
    }
    else {
        return false;
    }

    // 3. Gets the current color...
    var rowCellsCnt  = theCells.length;
    var domDetect    = null;
    var currentColor = null;
    var newColor     = null;

    // 3.1 ... with DOM compatible browsers except Opera that does not return
    //         valid values with "getAttribute"
    if (typeof(window.opera) == 'undefined'
        && typeof(theCells[0].getAttribute) != 'undefined') {
        currentColor = theCells[0].getAttribute('bgcolor');
        domDetect    = true;
    }
    // 3.2 ... with other browsers
    else {
        domDetect    = false;
    } // end 3

    var c = null;
    // 5.1 ... with DOM compatible browsers except Opera
    for (c = 0; c < rowCellsCnt; c++) {
        if (domDetect) {
            currentColor = theCells[c].getAttribute('bgcolor');
        } else {
            currentColor = theCells[c].style.backgroundColor;
        }

        // 4. Defines the new color
        // 4.1 Current color is the default one
        if (currentColor == ''
            || currentColor.toLowerCase() == theDefaultColor1.toLowerCase()
            || currentColor.toLowerCase() == theDefaultColor2.toLowerCase()) {
            if (theAction == 'over' && thePointerColor != '') {
                newColor              = thePointerColor;
            } else if (theAction == 'click' && theMarkColor != '') {
                newColor              = theMarkColor;
                marked_row[theRowNum] = true;
            }
        }
        // 4.1.2 Current color is the pointer one
        else if (currentColor.toLowerCase() == thePointerColor.toLowerCase()
                 && (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])) {
            if (theAction == 'out') {
                if (c % 2) {
                    newColor              = theDefaultColor1;
                } else {
                    newColor              = theDefaultColor2;
                }
            }
            else if (theAction == 'click' && theMarkColor != '') {
                newColor              = theMarkColor;
                marked_row[theRowNum] = true;
            }
        }
        // 4.1.3 Current color is the marker one
        else if (currentColor.toLowerCase() == theMarkColor.toLowerCase()) {
            if (theAction == 'click') {
                newColor              = (thePointerColor != '')
                                      ? thePointerColor
                                      : ((c % 2) ? theDefaultColor1 : theDefaultColor2);
                marked_row[theRowNum] = (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])
                                      ? true
                                      : null;
            }
        } // end 4

        // 5. Sets the new color...
        if (newColor) {
            if (domDetect) {
                theCells[c].setAttribute('bgcolor', newColor, 0);
            }
            // 5.2 ... with other browsers
            else {
                theCells[c].style.backgroundColor = newColor;
            }
        } // end 5
    } // end for

     return true;
 } // end of the 'setVerticalPointer()' function

