﻿<!--
 var message="Function Disabled!";

 function clickIE() 
 {
  if (document.all) {
    //alert(message);
    return false;
  }
 }

 function clickNS(e)
  {
    e = e || window.event;
    if (document.layers||(document.getElementById&&!document.all)) 
       { 
        if (e.which==2||e.which==3) {
            //alert(message);
            return false;
        }
       }
  }

  if (document.layers){document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
  else {document.onmouseup=clickNS;document.oncontextmenu=clickIE;}

  document.oncontextmenu = new Function("return false");
  document.ondragstart = new Function("return false");
  //document.onselectstart = new Function("return false");

//function dblclick() {
//  window.scrollTo(0,0)
//}
//if (document.layers) {
//    document.captureEvents(Event.ONDBLCLICK);
//}
//document.ondblclick=dblclick;

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function findObj(theObj, theDoc)
{
  var p, i, foundObj;
  
  if(!theDoc) theDoc = document;
  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
  {
    theDoc = parent.frames[theObj.substring(p+1)].document;
    theObj = theObj.substring(0,p);
  }
  if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  for (i=0; !foundObj && i < theDoc.forms.length; i++) 
    foundObj = theDoc.forms[i][theObj];
  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 
    foundObj = findObj(theObj,theDoc.layers[i].document);
  if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
  
  return foundObj;
}

var TimeID;
var to_y = 0;
//var to_x = 0;

function sGO() {
    var l1 = findObj("quicklink");
    if (!document.all) {
//		l1.style.left = 800 + "px";
	    l1.style.top = to_y + "px";
    } else {
//		l1.style.left = 800 + "px";
	    l1.style.top = (to_y + document.body.scrollTop) + "px";
    }
    //l1.style.left = (to_x + document.body.scrollWidth/2) + "px";
    l1.style.display = "block";

    TimeID = setInterval(setPlace, 100);
}

function setPlace() {
    clearInterval(TimeID);
    var l1 = findObj("quicklink");
    var now_y = parseInt(l1.style.top.substr(0, l1.style.top.length-2));
    if (!document.all) {
	    l1.style.top = (now_y + (to_y + window.pageYOffset - now_y)/5) + "px";
    } else {
	    l1.style.top = (now_y + (to_y + document.documentElement.scrollTop - now_y)/5) + "px";
    }

    TimeID = setInterval(setPlace, 100);
	
}

function js_display(ObjID1,ObjID2,ObjID3) {
    var thisobj = window.document.getElementById('House' + ObjID1);
        thisobj.style.display = "";
    var obj2 = window.document.getElementById('House' + ObjID2);
        obj2.style.display = "none";
    var obj3 = window.document.getElementById('House' + ObjID3);
        obj3.style.display = "none";

    var thisobj_li = window.document.getElementById('li' + ObjID1);
    var obj2_li = window.document.getElementById('li' + ObjID2);
    var obj3_li = window.document.getElementById('li' + ObjID3);

    var thisobj_className = thisobj_li.className.toString();
    var obj2_li_className = obj2_li.className.toString();
    var obj3_li_className = obj3_li.className.toString();

        thisobj_li.className = thisobj_className.substring(thisobj_className.indexOf('pagelabel'),thisobj_className.lastIndexOf('0')+2) + '-select';
        obj2_li.className = obj2_li_className.substring(obj2_li_className.indexOf('pagelabel'),obj2_li_className.lastIndexOf('0')+2);
        obj3_li.className = obj3_li_className.substring(obj3_li_className.indexOf('pagelabel'),obj3_li_className.lastIndexOf('0')+2);
}

function js_displayIconChange(ObjID, ObjclassName, ObjNum, Max) {

    for (var i = 1; i <= Max; i++)
    {
        var this_obj = window.document.getElementById(ObjID + i);
        var this_obj_className = this_obj.className.toString();
        //alert(this_obj_className)
            this_obj.className = this_obj_className.substring(this_obj_className.indexOf(ObjclassName),this_obj_className.lastIndexOf('0')+2);
    }

    var this_obj = window.document.getElementById(ObjID + ObjNum);
        this_obj.className = this_obj.className + '-select'; 

}

function search_iframe(ObjSrc)
{
   var iframeObj = window.document.getElementById('iframe_search');
       //iframeObj.src= ObjSrc;
       iframeObj.contentWindow.location.href = ObjSrc; //encodeURI(ObjSrc);
}

function SetWinHeight(obj)
{
 var win=obj;
 if (document.getElementById)
 {
    if (win && !window.opera)
    {
        if (win.contentDocument && win.contentDocument.body.offsetHeight)
            win.height = win.contentDocument.body.offsetHeight;
    else if(win.Document && win.Document.body.scrollHeight)
        win.height = win.Document.body.scrollHeight;
    }
 }
}

function search_change(obj, id_obj, type)
{
    if (type =='purpose') {
        var idobj =  window.document.getElementById(id_obj);
        //var idobj2 = window.document.getElementById('search_housety_id');
        if (obj.value == 'MNG') {
        idobj.style.display='none';
        //idobj2.style.display='';
        }
        else{
        idobj.style.display='';
        //idobj2.style.display='none';
        }
    }
    else if (type =='park') {
        var idobj =  window.document.getElementsByName(id_obj);
        if (obj.value == '3' && obj.checked) {
            for (var i = 0; i < idobj.length; i++) {
                if (i != (obj.value-1) ) {
                idobj[i].checked=false;}
            }
        }
        else if (obj.checked) {
            idobj[2].checked=false;
        }
    }
    else if (type =='salesty') {
        var idobj =  window.document.getElementsByName(id_obj);
        if (obj.value == 'N' && obj.checked) {
            for (var i = 1; i < idobj.length; i++) {
                idobj[i].checked=false;
            }
        }
        else if (obj.checked) {
            idobj[0].checked=false;
        }
    }
    else if (type =='price') {
        var idobj1 = window.document.getElementById('search_house_price');
        var idobj2 = window.document.getElementById('search_house_price_r');
        if (obj.value == '1') {
            idobj1.style.display='';
            idobj2.style.display='none';
        }
        else {
            idobj1.style.display='none';
            idobj2.style.display='';
        }
    }

}

function js_displayChange(ObjNum, ObjID, ObjMax, Obj_Hidden) {

    for (var i = 1; i <= ObjMax; i++)
    {
        var this_obj = window.document.getElementById(ObjID + i);
            this_obj.style.display='none';
    }

    var this_obj = window.document.getElementById(ObjID + ObjNum);
        this_obj.style.display='';
        
   if (Obj_Hidden != '') {
        var this_obj = window.document.getElementById(Obj_Hidden);
        this_obj.value = ObjNum;
   }
}

function is_OpenTag(id_name)
{
    var this_obj = window.document.getElementById(id_name);
        this_obj.style.display='';

}

function japan_location(obj)
{
    var this_obj = window.document.getElementById('txt_location_other');
    if (obj.value == 'その他') {
        this_obj.style.display='';} 
    else{
        this_obj.style.display='none';}
}

function english_location(obj)
{
    var this_obj = window.document.getElementById('txt_location_other');
    if (obj.value == 'Other') {
        this_obj.style.display='';} 
    else{
        this_obj.style.display='none';}
}
//-->
