function strconv1(form){
var result = "";
str = form.request_email.value;

for (i=0 ; i<str.length; i++)
{
   code = str.charCodeAt(i);
   if (code >= 65281 && code <= 65373)
   {
    result += String.fromCharCode(str.charCodeAt(i) - 65248);
   }else if (code == 12288)
   {
    result += String.fromCharCode(str.charCodeAt(i) - 12288 + 32);
   }else
   {
    result += str.charAt(i);
   }
}
form.request_email.value = result;
}

function strconv2(form){
var result = "";
str = form.request_tel.value;

for (i=0 ; i<str.length; i++)
{
   code = str.charCodeAt(i);
   if (code >= 65281 && code <= 65373)
   {
    result += String.fromCharCode(str.charCodeAt(i) - 65248);
   }else if (code == 12288)
   {
    result += String.fromCharCode(str.charCodeAt(i) - 12288 + 32);
   }else
   {
    result += str.charAt(i);
   }
}
form.request_tel.value = result;
}

function email_check(str)
{
 if(str.length!=0)
 {
    if ( str.charAt(0)=='.' ||        
         str.charAt(0)=='@'||       
         str.indexOf('@', 0) == -1 || 
         str.indexOf('.', 0) == -1 || 
         str.lastIndexOf('@')==str.length-1 || 
         str.lastIndexOf('.')==str.length-1)
    {
      return false;
    }
 }
 return true;
} 

function JS_send_form(form)
{
	set_cookies_str();
    if(err_check(form))
    {

        form.target = "_self";
        form.action = client_url_ + "/request.php";
        form.submit();
    }
}


function set_cookies_str()
{
	var sname;
	sname = "torus_cookie_value";
	document.form.cookies_str.value=getck(sname);
	//alert(document.form.cookies_str.value);
}

function getck(sname)
{
	var acookie=document.cookie.split("; ");
	for(var i=0;i<acookie.length;i++)
	{
		var arr=acookie[i].split("=");
		//alert(arr[0]);
		//alert(unescape(arr[1]));
		if(sname==arr[0])
		{
			if(arr.length>1)
				return unescape(arr[1]);
			else
				return "";
		}
	}
	return "";
}

var flag=false;   
function limitImage(ImgD){   
    var areaWidth = 180;
    var areaHeight = 110;
    var image=new Image();   
    image.src=ImgD.src;   
    if(image.width>0 && image.height>0){   
        flag=true;   
        if(image.width/image.height>= areaWidth/areaHeight){   
            if(image.width>areaWidth){   
                ImgD.width=areaWidth;   
                ImgD.height=(image.height*areaWidth)/image.width;   
            }else{   
                ImgD.width=image.width;   
                ImgD.height=image.height;   
            }   
            ImgD.alt=image.width+"×"+image.height;   
        }else{   
            if(image.height>areaHeight){   
                ImgD.height=areaHeight;   
                ImgD.width=(image.width*areaHeight)/image.height;   
            }else{   
                ImgD.width=image.width;   
                ImgD.height=image.height;   
            }   
            ImgD.alt=image.width+"×"+image.height;   
        }   
    }   
}  

function search_open(obj,no){

	var btn = document.getElementById('act');

	if(document.getElementById('search_'+no).className == 'search_open'){
		document.getElementById('search_'+no).className = 'search_close';
		document.getElementById('search_2').className = 'search_open';
		obj.innerHTML = 'クリックすると「簡易検索」へ';
		btn.value = 'free_search';
	}else{
		document.getElementById('search_'+no).className = 'search_open';
		document.getElementById('search_2').className = 'search_close';
		obj.innerHTML = 'クリックすると「全文検索」へ';
		btn.value = 'search';
	}
}

function oritatami(id1, id2){
	obj1=(document.all)?document.all(id1):((document.getElementById)?document.getElementById(id1):null);
	if(obj1)	obj1.style.display=(obj1.style.display=="none")?"block":"none";
	obj2=(document.all)?document.all(id2):((document.getElementById)?document.getElementById(id2):null);
	if(obj2)	obj2.style.display=(obj2.style.display=="none")?"block":"none";
}

function ChkEmail(chkmail)
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("AJAX ERR！");
  return;
  } 
var url="passport.php";
url=url+"?chkmail="+chkmail;
url=url+"&chkact=ajax";
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function stateChanged()
{ 
if (xmlHttp.readyState==4)
{ 
document.getElementById("txthint").innerHTML=xmlHttp.responseText;
}
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}
