// JavaScript Document



function clearbox(selectId) {
	obj = document.getElementById(selectId);
	obj.options.length=0;
	}

function addOption(selectId, val, txt) {
		var objOption = new Option(txt, val);
		document.getElementById(selectId).options.add(objOption);
	}
	
function addOptionSelected(selectId, val, txt) {
		var objOption = new Option(txt, val);
		objOption.selected = true;
		document.getElementById(selectId).options.add(objOption);
	}




function findPosY(obj)
  {
    var curtop = 0;
    if(obj.offsetParent)
        while(1)
        {
          curtop += obj.offsetTop;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.y)
        curtop += obj.y;
    return curtop;
  }

function findPosX(obj)
{
   var curleft = 0;
   if(obj.offsetParent)
   while(1) 
   {
      curleft += obj.offsetLeft;
      if(!obj.offsetParent)
         break;
      obj = obj.offsetParent;
   }
   else if(obj.x)
      curleft += obj.x;
   return curleft;
}

function city_borough_area(id, value)
{
	//alert(id);
	xajax_city_borough_area(id, value);
	
}


function city_borough_area2(id, value)
{
	obj = document.getElementById("filterloading");
		
		if(obj != null)
		{
		loading = "<img src='/images/loading.gif' width=16 height=16 />";
		obj.innerHTML = loading;
		}
		
	xajax_city_borough_area2(id, value);
	
}


function doletter(id, value)
{
	email = document.getElementById("LEmail");
	name = 	document.getElementById("LName");
	
	obj = document.getElementById("LErr");
	
		if(obj != null)
		{
		loading = "<img src='/images/loading.gif' width=16 height=16 />";
		obj.innerHTML = loading;
		}
		
	xajax_doletter(email.value, name.value);
	
}

function selectrd(id){	
	var tg=document.getElementById(id);	
	tg.checked=true;
	
	city_borough_area2('SideTypeID',tg.value);
}

