function test()
{
    document.all.test.style.top=window.event.clientY-10;
    document.all.test.style.left=window.event.clientX+10;


}  



function bookmark()
{
	var title = "Агентство недвижимости 'Глобал'";
	var url = "http://an-global.ru";

	if (window.sidebar)
		window.sidebar.addPanel(title, url, "");
	else if(window.opera && window.print)
	{ 
		var elem = document.createElement('a');
		elem.setAttribute('href',url);
		elem.setAttribute('title',title);
		elem.setAttribute('rel','sidebar');
		elem.click();
	} 
	else if(document.all)
		window.external.AddFavorite(url, title);



}



function tOutput(st,obj)
{
		obj = document.getElementById(obj);
		if(obj.innerHTML == "")
			obj.innerHTML = st;
		else
			obj.innerHTML = "";

}
function getCookieVal (offset) {
    var endstr = document.cookie.indexOf(";", offset);
    if (endstr == -1) endstr = document.cookie.length;
    return unescape(document.cookie.substring(offset, endstr));
}

function GetCookie(name) {
    var arg = name + "=";
    var alen = arg.length;
    var clen = document.cookie.length;
    var i = 0;
    while (i < clen) {
        var j = i + alen;
        if (document.cookie.substring( i , j ) == arg)
         return getCookieVal(j);
        i = document.cookie.indexOf(" ", 1 ) + 1;
        if (i==0) break;
    }
    return null;
}


function check(){
	var scale=GetCookie('scale');

	if(scale=='true'){
		w_resize(0);
		
	}
}

function w_resize(c){
	var flag=GetCookie("scale");
	

	if(c==1 && flag=='true'){
		document.all.pg.style.border='1px solid black';
		document.all.bd.style.margin='7px';
		document.cookie="scale=false";
		return "";
	}
	
	document.all.pg.style.border='0px';
	document.all.bd.style.margin='0px';

	if(!flag || flag=='false'){
		document.cookie="scale=true";
	}
	
	return "";
}
	
