
	var environment = "";
	var url = location.href;
	
	if(url.indexOf("PWwapp") > -1){
		environment = "PWwapp";
	}
	if(url.indexOf("PWwappD") > -1){
		environment = "PWwappD";
	}
	if(url.indexOf("PWwappS") > -1){
		environment = "PWwappS";
	}
	if(url.indexOf("PWAGwapp") > -1){
		environment = "PWAGwapp";
	}
	if(url.indexOf("PWAGwappD") > -1){
		environment = "PWAGwappD";
	}
	if(url.indexOf("PWAGwappS") > -1){
		environment = "PWAGwappS";
	}
	if(url.indexOf("PWBODwapp") > -1){
		environment = "PWBODwapp";
	}
	if(url.indexOf("PWBODwappD") > -1){
		environment = "PWBODwappD";
	}
	if(url.indexOf("PWBODwappS") > -1){
		environment = "PWBODwappS";
	}
	if(url.indexOf("PWBOFwapp") > -1){
		environment = "PWBOFwapp";
	}
	if(url.indexOf("PWBOFwappD") > -1){
		environment = "PWBOFwappD";
	}
	if(url.indexOf("PWBOFwappS") > -1){
		environment = "PWBOFwappS";
	}
	if(url.indexOf("PWBOMwapp") > -1){
		environment = "PWBOMwapp";
	}
	if(url.indexOf("PWBOMwappD") > -1){
		environment = "PWBOMwappD";
	}
	if(url.indexOf("PWBOMwappS") > -1){
		environment = "PWBOMwappS";
	}
	if(url.indexOf("PWCTLwapp") > -1){
		environment = "PWCTLwapp";
	}
	if(url.indexOf("PWCTLwappD") > -1){
		environment = "PWCTLwappD";
	}
	if(url.indexOf("PWCTLwappS") > -1){
		environment = "PWCTLwappS";
	}	
	if(url.indexOf("PWwappPRE") > -1){
		environment = "PWwappPRE";
	}
	if(url.indexOf("PWwappPRES") > -1){
		environment = "PWwappPRES";
	}
	
	
	//T661 環境のアドレスが変わったらコレ使う	
	var env2 = "";
	if(url.indexOf("test") > -1){
		environment = "test/"  +  environment;
	}
	if(url.indexOf("devel") > -1){
		environment = "devel/"  +  environment;
	}
	if(url.indexOf("verity") > -1){
		environment = "verity/"  +  environment;
	}
	if(url.indexOf("educ") > -1){
		environment = "educ/"  +  environment;
	}
	if(url.indexOf("demo") > -1){
		environment = "demo/"  +  environment;
	}
	
function WorksAjax() { }

WorksAjax.get_area1 = function(system_cd, area_cd0, callback)
{
    DWREngine._execute('/'+environment+'/dwr', 'WorksAjax', 'get_area1', system_cd, area_cd0, callback);
}

WorksAjax.get_area2 = function(system_cd, area_cd0, area_cd1, callback)
{
    DWREngine._execute('/'+environment+'/dwr', 'WorksAjax', 'get_area2', system_cd, area_cd0, area_cd1, callback);
}

WorksAjax.get_area3 = function(system_cd, area_cd0, area_cd1, area_cd2, callback)
{
    DWREngine._execute('/'+environment+'/dwr', 'WorksAjax', 'get_area3', system_cd, area_cd0, area_cd1, area_cd2, callback);
}

WorksAjax.get_license2 = function(system_cd, license_cd1, callback)
{
    DWREngine._execute('/'+environment+'/dwr', 'WorksAjax', 'get_license2', system_cd, license_cd1, callback);
}

WorksAjax.get_license3 = function(system_cd, license_cd1, license_cd2, callback)
{
    DWREngine._execute('/'+environment+'/dwr', 'WorksAjax', 'get_license3', system_cd, license_cd1, license_cd2, callback);
}

WorksAjax.get_jobtype2 = function(system_cd, jobtype_cd1, callback)
{
    DWREngine._execute('/'+environment+'/dwr', 'WorksAjax', 'get_jobtype2', system_cd, jobtype_cd1, callback);
}

WorksAjax.get_jobtype3 = function(system_cd, jobtype_cd1, jobtype_cd2, callback)
{
    DWREngine._execute('/'+environment+'/dwr', 'WorksAjax', 'get_jobtype3', system_cd, jobtype_cd1, jobtype_cd2, callback);
}

WorksAjax.get_landmark = function(system_cd, area_cd0, area_cd, callback)
{
    DWREngine._execute('/'+environment+'/dwr', 'WorksAjax', 'get_landmark', system_cd, area_cd0, area_cd, callback);
}

WorksAjax.get_industry2 = function(system_cd, industry_cd1, callback)
{
    DWREngine._execute('/'+environment+'/dwr', 'WorksAjax', 'get_industry2', system_cd, industry_cd1, callback);
}

WorksAjax.get_jobtype_name = function(system_cd, jobtype_cd, callback)
{
    DWREngine._execute('/'+environment+'/dwr', 'WorksAjax', 'get_jobtype_name', system_cd, jobtype_cd, callback);
}

WorksAjax.get_license_name = function(system_cd, license_cd, callback)
{
    DWREngine._execute('/'+environment+'/dwr', 'WorksAjax', 'get_license_name', system_cd, license_cd, callback);
}

WorksAjax.get_area_name = function(system_cd, area_cd, callback)
{
    DWREngine._execute('/'+environment+'/dwr', 'WorksAjax', 'get_area_name', system_cd, area_cd, callback);
}

function set_combo(data, fld){
	set_combo(data, fld, 2);
}

function set_combo(data, fld, len){
	if (data != null && typeof data == 'object')
	{
		alert(DWRUtil.toDescriptiveString(data, 2));
	}
	else
	{		
		var s2 = DWRUtil.toDescriptiveString(data, 1);

		var area = new Array();
		var cnt = 0;
		for(;;)
		{
			idx = s2.indexOf("\t", 0);
			if (idx != -1)
			{
				area[cnt] = s2.substr(0, idx)
				s2 = s2.substr(idx+1);
			}
			else
			{
				area[cnt] = s2;
				break;
			}
			cnt++;
		}

//		var obj = document.getElementById("LICENSE2");
		var obj = document.getElementById(fld);

		obj.options.length = 1;

//		obj.options[0].value = "00";

//20080926 プログラムの方でつけるように変更（javascriptを使わずに一覧を取得することもあるため）
//		obj.options[0].value = "  ";
//		obj.options[0].text = "選択してください";

		if (cnt > 0)
		{
//			obj.options.length=area.length+1;
			obj.options.length=area.length;

//			for(i=1;i<=area.length;i++)
			for(i=0;i<area.length;i++)
			{
//				obj.options[i].value = area[i-1].substr(0,2);
//				obj.options[i].text  = area[i-1].substr(2);
//				obj.options[i].value = area[i-1].substr(0,len);
//				obj.options[i].text  = area[i-1].substr(len);
				obj.options[i].value = area[i].substr(0,len);
				obj.options[i].text  = area[i].substr(len);
			}
		}

		obj.selectedIndex = 0;
	}
}

  function objectEval(text)
  {
    // eval() breaks when we use it to get an object using the { a:42, b:'x' }
    // syntax because it thinks that { and } surround a block and not an object
    // So we wrap it in an array and extract the first element to get around
    // this.
    // The regex = [start of line][whitespace]{[stuff]}[whitespace][end of line]
    text = text.replace(/\n/g, ' ');
    text = text.replace(/\r/g, ' ');
    if (text.match(/^\s*\{.*\}\s*$/))
    {
      text = '[' + text + '][0]';
    }
    return eval(text);
  }

// 20091107 T570 tempイメージファイル削除処理
WorksAjax.del_temp_img = function(company_cd, file_name, callback)
{
    DWREngine._execute('/'+environment+'/dwr', 'WorksAjax', 'del_temp_img', company_cd, file_name, callback);
}

