

var _country={ 
	"argentina":"Argentina",
	"australia":"Australia",
	"austria":"Austria",
	"bangladesh":"Bangladesh",
	"belgium":"Belgium",
	"bolivia":"Bolivia",
	"brazil":"Brazil",
	"bulgaria":"Bulgaria",
	"canada":"Canada",
	"caribbean":"Caribbean Islands",
	"chile":"Chile",
	"china":"China",
	"colombia":"Colombia",
	"costarica":"Costa Rica",
	"croatia":"Croatia",
	"czech":"Czech Republic",
	"denmark":"Denmark",
	"dominican":"Dominican",
	"ecuador":"Ecuador",
	"egypt":"Egypt",
	"elsalvador":"El Salvador",
	"ethiopia":"Ethiopia",
	"finland":"Finland",
	"france":"France",
	"germany":"Germany",
	"gb":"Great Britain",
	"ghana":"Ghana",
	"greece":"Greece",
	"guatemala":"Guatemala",
	"hongkong":"Hong Kong",
	"hungary":"Hungary",
	"iceland":"Iceland",
	"india":"India",
	"indonesia":"Indonesia",
	"ireland":"Ireland",
	"israel":"Israel",
	"italy":"Italy",
	"japan":"Japan",
	"korea":"Korea",
	"lebanon":"Lebanon",
	"luxembourg":"Luxembourg",
	"malaysia":"Malaysia",
	"mexico":"Mexico",
	"micronesia":"Micronesia",
	"morocco":"Morocco",
	"netherlands":"Netherlands",
	"nz":"New Zealand",
	"nicaragua":"Nicaragua",
	"norway":"Norway",
	"pakistan":"Pakistan",
	"panama":"Panama",
	"peru":"Peru",
	"philippines":"Phillippines",
	"poland":"Poland",
	"portugal":"Portugal",
	"russia":"Russia",
	"singapore":"Singapore",
	"southafrica":"South Africa",
	"spain":"Spain",
	"sweden":"Sweden",
	"switzerland":"Switzerland (Swiss)",
	"taiwan":"Taiwan",
	"thailand":"Thailand",
	"turkey":"Turkey",
	"uae":"United Arab Emirates",
	"uk":"United Kingdom",
	"uruguay":"Uruguay",
	"us":"United States",
	"venezuela":"Venezuela",
	"vietnam":"Vietnam"
};


var _location_argentina ={'buenosaires':'Buenos Aires','other':'Other'};
var _location_australia ={'sydney':'Sydney','melbourne':'Melbourne','brisbane':'Brisbane','other':'Other'};
var _location_austria ={ 'wien':'Wien (Vienna)','other':'Other'};
var _location_bangladesh ={'dhaka': 'Dhaka','other':'Other'};
var _location_belgium ={'brussels':'Brussels','other':'Other'};
var _location_bolivia ={'all':'All Locations'};
var _location_brazil ={'riodejaneiro': 'Rio de Janeiro','other':'Other'};
var _location_bulgaria ={'all':'All Locations'};
var _location_canada ={'toronto':'Toronto','montreal':'Montreal','vancouver':'Vancouver','ottawa':'Ottawa','calgary':'Calgary','edmonton':'Edmonton','quebeccity':'Quebec City','winnipeg':'Winnipeg','other':'Other'};
var _location_caribbean ={'all':'All Locations'};
var _location_chile ={'santiago':'Santiago','other':'Other'};
var _location_china ={'shanghai':'Shanghai','beijing':'Beijing','guangzhou':'Guangzhou','shenzhen':'Shenzhen','tianjin':'Tianjin','chongqing':'Chongqing','hongkong':'Hong Kong','dongguan':'Dongguan','nanjing':'Nanjing','wuhan':'Wuhan','other':'Other'};
var _location_colombia ={'bogota':'Bogota','other':'Other'};
var _location_costarica ={'all':'All Locations'};
var _location_croatia ={'all':'All Locations'};
var _location_czech ={'prague':'Prague','other':'Other'};
var _location_denmark ={ 'copenhagen':'Copenhagen','other':'Other'};
var _location_dominican ={'all':'All Locations'};
var _location_ecuador ={'all':'All Locations'};
var _location_egypt ={'cairo':'Cairo','other':'Other'};
var _location_elsalvador ={'all':'All Locations'};
var _location_ethiopia ={'all':'All Locations'};
var _location_finland ={'helsinki':'Helsinki','other':'Other'};
var _location_france ={'paris':'Paris','lyon':'Lyon','marseille':'Marseille','Lille':'Lille','toulouse':'Toulouse','bordeaux':'Bordeaux','nice':'Nice','nantes':'Nantes','strasbourg':'Strasbourg','toulon':'Toulon','other':'Other'};
var _location_germany ={'berlin':'Berlin','hamburg':'Hamburg','munich':'Munich','cologne':'Cologne (Köln)','frankfurt':'Frankfurt','stuttgart':'Stuttgart','dortmund':'Dortmund','essen':'Essen','dusseldorf':'Düsseldorf','bremen':'Bremen','hanover':'Hanover','leipzig':'Leipzig','dulsburg':'Duisburg','nuremberg':'Nuremberg','dresden':'Dresden','bochum':'Bochum','wuppertal':'Wuppertal','bielefeld':'Bielefeld','bonn':'Bonn','mannheim':'Mannheim','other':'Other'};
var _location_gb ={'london':'London','birmingham':'Birmingham','glasgow':'Glasgow','liverpool':'Liverpool','leeds':'Leeds','sheffield':'Sheffield','edinburgh':'Edinburgh','bristol':'Bristol','manchester':'Manchester','leicester':'Leicester','other':'Other'};
var _location_ghana ={'all':'All Locations'};
var _location_greece ={'athens':'Athens','other':'Other'};
var _location_guatemala ={'all':'All Locations'};
var _location_hongkong ={'all':'All Locations'};
var _location_hungary ={'budapest':'Budapest','other':'Other'};
var _location_iceland ={'all':'All Locations'};
var _location_india ={'mumbai':'Mumbai','delhi':'Delhi','bangalore':'Bangalore','kolkata':'Kolkata','chennai':'Chennai','hyderabad':'Hyderabad','ahmedabad':'Ahmedabad','pune':'Pune','surat':'Surat','kanpur':'Kanpur','other':'Other'};
var _location_indonesia ={'jakarta':'Jakarta','other':'Other'};
var _location_iran ={'all':'All Locations'};
var _location_iraq ={'all':'All Locations'};
var _location_ireland ={'dublin':'Dublin','other':'Other'};
var _location_israel ={'jerusalem':'Jerusalem','telaviv':'Tel Aviv','other':'Other'};
var _location_italy ={'rome':'Rome','milan':'Milan','naples':'Naples','turin':'Turin','palermo':'Palermo','genoa':'Genoa','bologna':'Bologna','florence':'Florence','bari':'Bari','catania':'Catania','venice':'Venice','verona':'Verona','other':'Other'};
var _location_japan ={'tokyo':'Tokyo','yokohama':'Yokohama','osaka':'Osaka','nagoya':'Nagoya','sapporo':'Sapporo','kobe':'Kobe','fukuoka':'Fukuoka','kawasaki':'Kawasaki','saitama':'Saitama','hiroshima':'Hiroshima','sendai':'Sendai','chiba':'Chiba','other':'Other'};
var _location_korea ={'seoul':'Seoul','busan':'Busan','other':'Other'};
var _location_kuwait ={'all':'All Locations'};
var _location_lebanon ={'beirut':'Beirut','other':'Other'};
var _location_luxembourg ={'all':'All Locations'};
var _location_malaysia ={'kualalumpur':'Kuala Lumpur','other':'Other'};
var _location_mexico ={'mexicocity':'Mexico City','other':'Other'};
var _location_micronesia ={'all':'All Locations'};
var _location_morocco ={'all':'All Locations'};
var _location_netherlands ={'amsterdam':'Amsterdam','other':'Other'};
var _location_nz ={'auckland':'Auckland','christchurch':'Christchurch','wellington':'Wellington','other':'Other'};
var _location_nicaragua ={'all':'All Locations'};
var _location_norway ={'oslo':'Oslo','other':'Other'};
var _location_pakistan ={ 'islamabad':'Islamabad','other':'Other'};
var _location_panama ={'all':'All Locations'};
var _location_peru ={'lima':'Lima','other':'Other'};
var _location_philippines ={'manila':'Manila','cebu':'Cebu','davao':'Davao','other':'Other'};
var _location_poland ={'warsaw':'Warsaw','other':'Other'};
var _location_portugal ={'lisbon':'Lisbon','other':'Other'};
var _location_romania ={'all':'All Locations'};
var _location_russia ={'moscow':'Moscow','other':'Other'};
var _location_singapore ={'all':'All Locations'};
var _location_southafrica ={'johannesburg':'Johannesburg','capetown':'Cape Town','durban':'Durban','other':'Other'};
var _location_spain ={'madrid':'Madrid','barcelona':'Barcelona','other':'Other'};
var _location_sweden ={'stockholm':'Stockholm','other':'Other'};
var _location_switzerland ={'zurich':'Zurich','other':'Other'};
var _location_taiwan ={'taipei':'Taipei','other':'Other'};
var _location_thailand ={'bangkok':'Bangkok','other':'Other'};
var _location_tunisia ={'all':'All Locations'};
var _location_turkey ={'ankara':'Ankara','other':'Other'};
var _location_uae ={'abudhabi':'Abu Dhabi','dubai':'Dubai','other':'Other'};
var _location_uk ={'london':'London','birmingham':'Birmingham','glasgow':'Glasgow','liverpool':'Liverpool','leeds':'Leeds','sheffield':'Sheffield','edinburgh':'Edinburgh','bristol':'Bristol','manchester':'Manchester','leicester':'Leicester','other':'Other'};
var _location_ukraine ={'all':'All Locations'};
var _location_uruguay ={'montevideo':'Montevideo','other':'Other'};
var _location_us ={'alabama':'Alabama','alaska':'Alaska','arizona':'Arizona','arkansas':'Arkansas','california':'California','colorado':'Colorado','connecticut':'Connecticut','delaware':'Delaware','dc':'D.C.','florida':'Florida','georgia':'Georgia','guam':'Guam','hawaii':'Hawaii','idaho':'Idaho','illinois':'Illinois','indiana':'Indiana','iowa':'Iowa','kansas':'Kansas','kentucky':'Kentucky','louisiana':'Louisiana','maine':'Maine','maryland':'Maryland','massachusetts':'Massachusetts','michigan':'Michigan','minnesota':'Minnesota','mississippi':'Mississippi','missouri':'Missouri','montana':'Montana','nebraska':'Nebraska','nevada':'Nevada','newhampshire':'New Hampshire','newjersey':'New Jersey','newmexico':'New Mexico','newyork':'New York','northcarolina':'North Carolina','northdakota':'North Dakota','ohio':'Ohio','oklahoma':'Oklahoma','oregon':'Oregon','pennsylvania':'Pennsylvania','puertorico':'Puerto Rico','rhodeisland':'Rhode Island','southcarolina':'South Carolina','southdakota':'South Dakota','tennessee':'Tennessee','texas':'Texas','utah':'Utah','vermont':'Vermont',/*'Virgin Islands',*/'virginia':'Virginia','washington':'Washington','westvirginia':'West Virginia','wisconsin':'Wisconsin','wyoming':'Wyoming','atlanta':'Atlanta, GA','austin':'Austin, TX','boston':'Boston, MA','chicago':'Chicago, IL','cleveland':'Cleveland, OH','columbus':'Columbus, OH','dallas':'Dallas, TX','denver':'Denver, CO','detroit':'Detroit, MI','honolulu':'Honolulu, HI','houston':'Houston, TX','indianapolis':'Indianapolis, IN','jacksonville':'JacksonVille, FL','kansascity':'Kansas City, MO','lasvegas':'Las Vegas, NV','losangeles':'Los Angeles, CA','miami':'Miami, FL','minneapolis':'Minneapolis, MN','nashville':'Nashville, TN','newyorkcity':'New York City, NY','philadelphia':'Philadelphia, PA','phoenix':'Phoenix, AZ','portland':'Portland, OR','raleigh':'Raleigh, NC','sacramento':'Sacramento, CA','sandiego':'San Diego, CA','seattle':'Seattle, WA','sanfrancisco':'San Francisco, CA','stlouis':'St Louis, MO'};
var _location_venezuela ={'caracas':'Caracas','other':'Other'};
var _location_vietnam ={'hochiminhcity':'Ho Chi Minh City (Saigon)','hanoi':'Hanoi','other':'Other'};


var _location={
	"argentina":_location_argentina,
	"australia":_location_australia,
	"austria":_location_austria,
	"bangladesh":_location_bangladesh,
	"belgium":_location_belgium,
	"bolivia":_location_bolivia,
	"brazil":_location_brazil,
	"bulgaria":_location_bulgaria,
	"canada":_location_canada,
	"caribbean":_location_caribbean,
	"chile":_location_chile,
	"china":_location_china,
	"colombia":_location_colombia,
	"costarica":_location_costarica,
	"croatia":_location_croatia,
	"czech":_location_czech,
	"denmark":_location_denmark,
	"dominican":_location_dominican,
	"ecuador":_location_ecuador,
	"egypt":_location_egypt,
	"elsalvador":_location_elsalvador,
	"ethiopia":_location_ethiopia,
	"finland":_location_finland,
	"france":_location_france,
	"germany":_location_germany,
	"gb":_location_gb,
	"ghana":_location_ghana,
	"greece":_location_greece,
	"guatemala":_location_guatemala,
	"hongkong":_location_hongkong,
	"hungary":_location_hungary,
	"iceland":_location_iceland,
	"india":_location_india,
	"indonesia":_location_indonesia,
	"iran":_location_iran,
	"iraq":_location_iraq,
	"ireland":_location_ireland,
	"israel":_location_israel,
	"italy":_location_italy,
	"japan":_location_japan,
	"korea":_location_korea,
	"kuwait":_location_kuwait,
	"lebanon":_location_lebanon,
	"luxembourg":_location_luxembourg,
	"malaysia":_location_malaysia,
	"mexico":_location_mexico,
	"micronesia":_location_micronesia,
	"morocco":_location_morocco,
	"netherlands":_location_netherlands,
	"nz":_location_nz,
	"nicaragua":_location_nicaragua,
	"norway":_location_norway,
	"pakistan":_location_pakistan,
	"panama":_location_panama,
	"peru":_location_peru,
	"philippines":_location_philippines,
	"poland":_location_poland,
	"portugal":_location_portugal,
	"romania":_location_romania,
	"russia":_location_russia,
	"singapore":_location_singapore,
	"southafrica":_location_southafrica,
	"spain":_location_spain,
	"sweden":_location_sweden,
	"switzerland":_location_switzerland,
	"taiwan":_location_taiwan,
	"thailand":_location_thailand,
	"tunisia":_location_tunisia,
	"turkey":_location_turkey,
	"uae":_location_uae,
	"uk":_location_uk,
	"ukraine":_location_ukraine,
	"uruguay":_location_uruguay,
	"us":_location_us,
	"venezuela":_location_venezuela,
	"vietnam":_location_vietnam
};

var _category={
	"all":"All Categories",
	"accounting":"Accounting & Finance",
	"office":"Admin & Office",
	"arch":"Architecture",
	"art":"Arts, Crafts & Design",
	"biz":"Business & Management",
	"customersvc":"Customer Service",
	"edu":"Education",
	"eng":"Engineering",
	"food":"Food & Beverage",
	"labor":"General Labor",
	"gov":"Government",
	"hotel":"Hotel & Hospitality",
	"human":"Human Resources",
	"it":"IT, Network & Web",
	"legal":"Legal, Paralegal & Tax",
	"manufacture":"Manufacturing",
	"marketing":"Marketing & Ad",
	"media":"Media (TV/Film/etc)",
	"med":"Medicine & Health",
	"nonprofit":"Nonprofit Sector",
	"publish":"Publishing, Writting & Editting",
	"realestate":"Real Estate",
	"retail":"Retail",
	"sales":"Sales",
	"science":"Science & Research",
	"security":"Security",
	"socialcare":"Social Care",
	"sports":"Sports & Fitness",
	"techsupport":"Technical Support",
	"transport":"Transport & Delivery",
	"travel":"Travel & Tourism",
	"volunteer":"Volunteer",
	"other":"Other"
};



function init_form_country()
{
	si=document.getElementById("c_country").value;
	s='';;
	s=s+"<select id='country_select'  onchange='set_country(this);return false;' style='width:165px;font-family:tahoma;font-size:9pt;'>";
	for(i in _country)
	{
		if(i==si)
		{
			s=s+"<option value='"+i+"' selected>"+_country[i]+"</option>";
		//	_url_country=i;
		}else{
			s=s+"<option value='"+i+"'>"+_country[i]+"</option>";
		}
	}
	s=s+"</select>";
	document.getElementById("country_cell").innerHTML=s;
	init_location();
//	set_location(document.getElementById("location_select"));
	init_form_category();
//init_option();
//init_keyword();
}






function init_country()
{
	si=document.getElementById("c_country").value;
	s='';;
	s=s+"<select id='country_select'  onchange='set_country(this);return false;' style='width:165px;font-family:tahoma;font-size:9pt;'>";
	for(i in _country)
	{
		if(i==si)
		{
			s=s+"<option value='"+i+"' selected>"+_country[i]+"</option>";
		//	_url_country=i;
		}else{
			s=s+"<option value='"+i+"'>"+_country[i]+"</option>";
		}
	}
	s=s+"</select>";
	document.getElementById("country_cell").innerHTML=s;
	init_location();
//	set_location(document.getElementById("location_select"));
	init_category();
//init_option();
//init_keyword();
}

function set_country(t)
{
document.getElementById("c_country").value=t.value;
init_location();
}

function init_location()
{
	c=document.getElementById("c_country").value;
	_loc=_location[c];
	si=document.getElementById("c_location").value;//alert(si);
	s='';;
	s=s+"<select id='location_select'  onchange='set_location(this)' style='width:165px;font-family:tahoma;font-size:9pt;'>";
	for(i in _loc)
	{
		if(i==si)
		{
			s=s+"<option value='"+i+"' selected>"+_loc[i]+"</option>";
		//	_url_country=i;
		}else{
			s=s+"<option value='"+i+"'>"+_loc[i]+"</option>";
		}
	}
	s=s+"</select>";
	document.getElementById("location_cell").innerHTML=s;
	document.getElementById("c_location").value=document.getElementById("location_select").value;
}


function init_category()
{
	si=document.getElementById("c_category").value;
	s='';;
	s=s+"<select id='category_select'  onchange='set_category(this);return false;' style='width:265px;font-family:tahoma;font-size:9pt;'>";
	for(i in _category)
	{
		if(i==si)
		{
			s=s+"<option value='"+i+"' selected>"+_category[i]+"</option>";
		//	_url_country=i;
		}else{
			s=s+"<option value='"+i+"'>"+_category[i]+"</option>";
		}
	}
	s=s+"</select>";
	document.getElementById("category_cell").innerHTML=s;
}



function init_form_category()
{
	si=document.getElementById("c_category").value;
	s='';;
	s=s+"<select id='category_select'  onchange='set_category(this);return false;' style='width:265px;font-family:tahoma;font-size:9pt;'>";
	for(i in _category)
	{
	if(i!='all')
	{
		if(i==si)
		{
			s=s+"<option value='"+i+"' selected>"+_category[i]+"</option>";
		//	_url_country=i;
		}else{
			s=s+"<option value='"+i+"'>"+_category[i]+"</option>";
		}
	}
	}
	s=s+"</select>";
	document.getElementById("category_cell").innerHTML=s;

}





function set_category(t)
{
	document.getElementById("c_category").value=t.value;
}


function set_location(t)
{
	document.getElementById("c_location").value=t.value;//alert(t.value);
}



function init_option()
{
tp=document.getElementById("c_type").value;
if(tp&1){document.getElementById("type_fulltime").checked=true;}else{document.getElementById("type_fulltime").checked=false;}
if(tp&2){document.getElementById("type_parttime").checked=true;}else{document.getElementById("type_parttime").checked=false;}
if(tp&4){document.getElementById("type_freelancer").checked=true;}else{document.getElementById("type_freelancer").checked=false;}
if(tp&8){document.getElementById("type_other").checked=true;}else{document.getElementById("type_other").checked=false;}


tm=document.getElementById("c_time").value;
if(tm&1){document.getElementById("time_day").checked=true;}else{document.getElementById("time_day").checked=false;}
if(tm&2){document.getElementById("time_night").checked=true;}else{document.getElementById("time_night").checked=false;}
if(tm&4){document.getElementById("time_weekend").checked=true;}else{document.getElementById("time_weekend").checked=false;}
if(tm&8){document.getElementById("time_homeworking").checked=true;}else{document.getElementById("time_homeworking").checked=false;}

}




function init_keyword()
{
if(document.getElementById("c_key").value!="")
	{
	t=document.getElementById("c_key").value;
	t=t.replace(/,/gi," ");
	document.getElementById("keyword").value=t;
	}
}

























function search_job()
{alert("*");
g=document.getElementById("c_country").value;
l=document.getElementById("c_location").value;
c=document.getElementById("c_category").value;
p=0;
if(document.getElementById("type_fulltime").checked==true){p=p+1;}
if(document.getElementById("type_parttime").checked==true){p=p+2;}
if(document.getElementById("type_freelancer").checked==true){p=p+4;}
if(document.getElementById("type_other").checked==true){p=p+8;}
t=0;
if(document.getElementById("time_day").checked==true){t=t+1;}
if(document.getElementById("time_night").checked==true){t=t+2;}
if(document.getElementById("time_weekend").checked==true){t=t+4;}
if(document.getElementById("time_homeworking").checked==true){t=t+8;}

k='';
if(document.getElementById("keyword").value!='')
{
	ptrn=/^[0-9a-zA-Z]{1,100}$/;
	if(!ptrn.test(document.getElementById("keyword").value)){alert("Keywords must consist of alphabets,numbers and spaces.  \nMaximum length of keywords is 100 characters.");return;}
	//regex filtering
	k=document.getElementById("keyword").value;
	k=k.replace(/\s/,',');
}
//alert("nav="+g+","+l+","+c+","+p+","+t+"&key="+k);

document.location.href="/job?nav="+g+","+l+","+c+","+p+","+t+",1&key="+k;
}



function trim(str)
{
str=str.replace(/^\s*/,'').replace(/s*$/,'');
return str;
}



function goto_job()
{
/*
g=document.getElementById("c_country").value;
l=document.getElementById("c_location").value;
c=document.getElementById("c_category").value;
p=0;
if(document.getElementById("type_fulltime").checked==true){p=p+1;}
if(document.getElementById("type_parttime").checked==true){p=p+2;}
if(document.getElementById("type_freelancer").checked==true){p=p+4;}
if(document.getElementById("type_other").checked==true){p=p+8;}
t=0;
if(document.getElementById("time_day").checked==true){t=t+1;}
if(document.getElementById("time_night").checked==true){t=t+2;}
if(document.getElementById("time_weekend").checked==true){t=t+4;}
if(document.getElementById("time_homeworking").checked==true){t=t+8;}

k='';
if(document.getElementById("keyword").value!='')
{
	ptrn=/^[0-9a-zA-Z\s]{1,100}$/;
	if(!ptrn.test(document.getElementById("keyword").value)){alert("Keywords must consist of alphabets,numbers and spaces.  \nMaximum length of keywords is 50 characters.");return;}
	//regex filtering
	k=document.getElementById("keyword").value;
	k=k.split(/\s/,k);
	alert(k.length);
}
*/
n=document.getElementById("c_section").value;
g=document.getElementById("c_country").value;
l=document.getElementById("c_location").value;
c=document.getElementById("c_category").value;
//s=document.getElementById("c_list").value;

//if((n!='job')||(n!='newjob')){s=1;}

p=0;
if(document.getElementById("type_fulltime").checked==true){p=p+1;}
if(document.getElementById("type_parttime").checked==true){p=p+2;}
if(document.getElementById("type_freelancer").checked==true){p=p+4;}
if(document.getElementById("type_other").checked==true){p=p+8;}
t=0;
if(document.getElementById("time_day").checked==true){t=t+1;}
if(document.getElementById("time_night").checked==true){t=t+2;}
if(document.getElementById("time_weekend").checked==true){t=t+4;}
if(document.getElementById("time_homeworking").checked==true){t=t+8;}

k="";
kw="";
if((document.getElementById("keyword"))&&(document.getElementById("keyword").value!=''))
{
	ptrn=/^[0-9a-zA-Z\s]{1,100}$/;
	if(!ptrn.test(document.getElementById("keyword").value)){alert("Keywords must consist of alphabets,numbers and spaces.  \nMaximum length of keywords is 100 characters.");return;}
	//regex filtering
	k=trim(document.getElementById("keyword").value);
	k=k.split(" ");
	kw="";
	for(i=0;i<k.length;i++)
	{
	if(trim(k[i])!=""){if(kw==""){kw=trim(k[i]);}else{kw=kw+","+trim(k[i]);}}
	}//	k=k.replace(/\s/,',');

/*
	tk=trim(document.getElementById("job_std_keyword").value);
	tk=tk.split(" ");
	kw="";
	sptrn=/^[0-9a-zA-Z가-힣]{1,50}$/;
	for(i=0;i<tk.length;i++)
	{
	tk[i]=trim(tk[i]);//alert("?"+tk[i]+"?");
	if(tk[i]!=""){if(kw==""){kw=tk[i];}else{kw=kw+","+tk[i];}}
	}

kw=encodeURIComponent(kw);//k
*/
kw=encodeURIComponent(kw);
}


document.location.href="/job?list=1&nav="+g+","+l+","+c+","+p+","+t+"&key="+k;
}



function goto_resume()
{
n=document.getElementById("c_section").value;
g=document.getElementById("c_country").value;
l=document.getElementById("c_location").value;
c=document.getElementById("c_category").value;
//s=document.getElementById("c_list").value;
//if((n!='resume')||(n!='newresume')){s=1;}


p=0;
if(document.getElementById("type_fulltime").checked==true){p=p+1;}
if(document.getElementById("type_parttime").checked==true){p=p+2;}
if(document.getElementById("type_freelancer").checked==true){p=p+4;}
if(document.getElementById("type_other").checked==true){p=p+8;}
t=0;
if(document.getElementById("time_day").checked==true){t=t+1;}
if(document.getElementById("time_night").checked==true){t=t+2;}
if(document.getElementById("time_weekend").checked==true){t=t+4;}
if(document.getElementById("time_homeworking").checked==true){t=t+8;}

k="";
kw="";
if((document.getElementById("keyword"))&&(document.getElementById("keyword").value!=''))
{
	ptrn=/^[0-9a-zA-Z\s]{1,100}$/;
	if(!ptrn.test(document.getElementById("keyword").value)){alert("Keywords must consist of alphabets,numbers and spaces.  \nMaximum length of keywords is 100 characters.");return;}
	//regex filtering
	k=trim(document.getElementById("keyword").value);
	k=k.split(" ");
	kw="";
	for(i=0;i<k.length;i++)
	{
	if(trim(k[i])!=""){if(kw==""){kw=trim(k[i]);}else{kw=kw+","+trim(k[i]);}}
	}//	k=k.replace(/\s/,',');

/*
	tk=trim(document.getElementById("job_std_keyword").value);
	tk=tk.split(" ");
	kw="";
	sptrn=/^[0-9a-zA-Z가-힣]{1,50}$/;
	for(i=0;i<tk.length;i++)
	{
	tk[i]=trim(tk[i]);//alert("?"+tk[i]+"?");
	if(tk[i]!=""){if(kw==""){kw=tk[i];}else{kw=kw+","+tk[i];}}
	}

kw=encodeURIComponent(kw);//k
*/
kw=encodeURIComponent(kw);
}

document.location.href="/resume?list=1&nav="+g+","+l+","+c+","+p+","+t+"&key="+kw;
}



function goto_newjob()
{
g=document.getElementById("c_country").value;
l=document.getElementById("c_location").value;
c=document.getElementById("c_category").value;
if(c=='all'){c='accounting';document.getElementById("c_category").value='accounting';}
i=document.getElementById("c_list").value;

p=0;
if(document.getElementById("type_fulltime").checked==true){p=p+1;}
if(document.getElementById("type_parttime").checked==true){p=p+2;}
if(document.getElementById("type_freelancer").checked==true){p=p+4;}
if(document.getElementById("type_other").checked==true){p=p+8;}
t=0;
if(document.getElementById("time_day").checked==true){t=t+1;}
if(document.getElementById("time_night").checked==true){t=t+2;}
if(document.getElementById("time_weekend").checked==true){t=t+4;}
if(document.getElementById("time_homeworking").checked==true){t=t+8;}

k='';
if(document.getElementById("keyword").value!='')
{
	ptrn=/^[0-9a-zA-Z\s]{1,100}$/;
	if(!ptrn.test(document.getElementById("keyword").value)){alert("Keywords must consist of alphabets,numbers and spaces.  \nMaximum length of keywords is 100 characters.");return;}
	//regex filtering
	k=document.getElementById("keyword").value;
	k=k.replace(/\s/,',');
}
document.location.href="/newjob?list="+i+"&nav="+g+","+l+","+c+","+p+","+t+"&key="+k;
}



function goto_newresume()
{
g=document.getElementById("c_country").value;
l=document.getElementById("c_location").value;//alert(l);
c=document.getElementById("c_category").value;
if(c=='all'){c='accounting';document.getElementById("c_category").value='accounting';}

i=document.getElementById("c_list").value;




p=0;
if(document.getElementById("type_fulltime").checked==true){p=p+1;}
if(document.getElementById("type_parttime").checked==true){p=p+2;}
if(document.getElementById("type_freelancer").checked==true){p=p+4;}
if(document.getElementById("type_other").checked==true){p=p+8;}
t=0;
if(document.getElementById("time_day").checked==true){t=t+1;}
if(document.getElementById("time_night").checked==true){t=t+2;}
if(document.getElementById("time_weekend").checked==true){t=t+4;}
if(document.getElementById("time_homeworking").checked==true){t=t+8;}

k='';
if(document.getElementById("keyword").value!='')
{
	ptrn=/^[0-9a-zA-Z\s]{1,100}$/;
	if(!ptrn.test(document.getElementById("keyword").value)){alert("Keywords must consist of alphabets,numbers and spaces.  \nMaximum length of keywords is 100 characters.");return;}
	//regex filtering
	k=document.getElementById("keyword").value;
	k=k.replace(/\s/,',');
}
document.location.href="/newresume?list="+i+"&nav="+g+","+l+","+c+","+p+","+t+"&key="+k;
}


function search(tgt)
{
g=document.getElementById("c_country").value;
l=document.getElementById("c_location").value;
c=document.getElementById("c_category").value;
p=0;
if(document.getElementById("type_fulltime").checked==true){p=p+1;}
if(document.getElementById("type_parttime").checked==true){p=p+2;}
if(document.getElementById("type_freelancer").checked==true){p=p+4;}
if(document.getElementById("type_other").checked==true){p=p+8;}
t=0;
if(document.getElementById("time_day").checked==true){t=t+1;}
if(document.getElementById("time_night").checked==true){t=t+2;}
if(document.getElementById("time_weekend").checked==true){t=t+4;}
if(document.getElementById("time_homeworking").checked==true){t=t+8;}

k="";
kw="";
if(document.getElementById("keyword").value!='')
{
	ptrn=/^[0-9a-zA-Z\s]{1,100}$/;
	if(!ptrn.test(document.getElementById("keyword").value)){alert("Keywords must consist of alphabets,numbers and spaces.  \nMaximum length of keywords is 100 characters.");return;}
	//regex filtering
	k=trim(document.getElementById("keyword").value);
	k=k.split(" ");
	kw="";
	for(i=0;i<k.length;i++)
	{
	if(trim(k[i])!=""){if(kw==""){kw=trim(k[i]);}else{kw=kw+","+trim(k[i]);}}
	}//	k=k.replace(/\s/,',');

kw=encodeURIComponent(kw);
}

document.location.href="/"+tgt+"?list=1&nav="+g+","+l+","+c+","+p+","+t+"&key="+kw;
}










function back_to_job()
{

g=document.getElementById("c_country").value;
l=document.getElementById("c_location").value;
c=document.getElementById("c_category").value;
p=0;
if(document.getElementById("type_fulltime").checked==true){p=p+1;}
if(document.getElementById("type_parttime").checked==true){p=p+2;}
if(document.getElementById("type_freelancer").checked==true){p=p+4;}
if(document.getElementById("type_other").checked==true){p=p+8;}
t=0;
if(document.getElementById("time_day").checked==true){t=t+1;}
if(document.getElementById("time_night").checked==true){t=t+2;}
if(document.getElementById("time_weekend").checked==true){t=t+4;}
if(document.getElementById("time_homeworking").checked==true){t=t+8;}

kw=document.getElementById("c_key").value;
kw=encodeURIComponent(kw);


document.location.href="/job?nav="+g+","+l+","+c+","+p+","+t+"&key="+kw;
}









function back_to_resume()
{

g=document.getElementById("c_country").value;
l=document.getElementById("c_location").value;
c=document.getElementById("c_category").value;
p=0;
if(document.getElementById("type_fulltime").checked==true){p=p+1;}
if(document.getElementById("type_parttime").checked==true){p=p+2;}
if(document.getElementById("type_freelancer").checked==true){p=p+4;}
if(document.getElementById("type_other").checked==true){p=p+8;}
t=0;
if(document.getElementById("time_day").checked==true){t=t+1;}
if(document.getElementById("time_night").checked==true){t=t+2;}
if(document.getElementById("time_weekend").checked==true){t=t+4;}
if(document.getElementById("time_homeworking").checked==true){t=t+8;}

kw=document.getElementById("c_key").value;
kw=encodeURIComponent(kw);


document.location.href="/resume?nav="+g+","+l+","+c+","+p+","+t+"&key="+kw;
}



function update_jobtype()
{
p=0;
if(document.getElementById("type_fulltime").checked==true){p=p+1;}
if(document.getElementById("type_parttime").checked==true){p=p+2;}
if(document.getElementById("type_freelancer").checked==true){p=p+4;}
if(document.getElementById("type_other").checked==true){p=p+8;}
document.getElementById("c_type").value=p;
}


function update_jobtime()
{
t=0;
if(document.getElementById("time_day").checked==true){t=t+1;}
if(document.getElementById("time_night").checked==true){t=t+2;}
if(document.getElementById("time_weekend").checked==true){t=t+4;}
if(document.getElementById("time_homeworking").checked==true){t=t+8;}
document.getElementById("c_time").value=t;
}













































/*

function enable_ret()
{
if(req.readyState==4)
	{
	if(req.status==200)
		{
		txt=req.responseText;
		if(txt=='1')
			{
			document.getElementById("ret_div").innerHTML=document.getElementById("r_ok").value;
			}else if(txt='0'){
			document.getElementById("ret_div").innerHTML=document.getElementById("r_error").value;
			}else{
			alert("over traffic");
			}
		}
	}
}





function enable_post()
{
v_v=document.getElementById("v").value;
v_t=document.getElementById("t").value;
v_u=document.getElementById("u").value;
v_c=document.getElementById("c").value;
v_s=document.getElementById("s").value;
msg="v="+v_v+"&t="+v_t+"&u="+v_u+"&c="+v_c+"&s="+v_s;


	req=null;
	try{
		req=new XMLHttpRequest();
		}catch(trymicrosoft){
			try{
				req=new ActiveXObject("Msxml2.XMLHTTP");
				}catch(othermicrosoft){
					try{
							req=new ActiveXObject("Microsoft.XMLHTTP");
						}catch(failed){
							req=null;
						}
				}
		}

if(req==null)
	{
		alert("XMLHTTP error: Unable to initialize HTTP object.");
	}else{
		var _a=new Date();var _t=_a.getTime();
		msg=msg+"&tm="+_t
		req.open("POST","/enablepost",true);
		req.onreadystatechange=disable_ret;
		req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		req.send(msg);
	}

}









function disable_ret()
{
if(req.readyState==4)
	{
	if(req.status==200)
		{
		txt=req.responseText;
		if(txt=='1')
			{
			document.getElementById("ret_div").innerHTML=document.getElementById("r_ok").value;
			}else if(txt='0'){
			document.getElementById("ret_div").innerHTML=document.getElementById("r_error").value;
			}else{
			alert("over traffic");
			}
		}
	}
}





function disable_post()
{
v_v=document.getElementById("v").value;
v_t=document.getElementById("t").value;
v_u=document.getElementById("u").value;
v_c=document.getElementById("c").value;
v_s=document.getElementById("s").value;
msg="v="+v_v+"&t="+v_t+"&u="+v_u+"&c="+v_c+"&s="+v_s;


	req=null;
	try{
		req=new XMLHttpRequest();
		}catch(trymicrosoft){
			try{
				req=new ActiveXObject("Msxml2.XMLHTTP");
				}catch(othermicrosoft){
					try{
							req=new ActiveXObject("Microsoft.XMLHTTP");
						}catch(failed){
							req=null;
						}
				}
		}

if(req==null)
	{
		alert("XMLHTTP error: Unable to initialize HTTP object.");
	}else{
		var _a=new Date();var _t=_a.getTime();
		msg=msg+"&tm="+_t
		req.open("POST","/disablepost",true);
		req.onreadystatechange=disable_ret;
		req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		req.send(msg);
	}

}



function open_resume_request()
{
document.getElementById("resume_request_view").style.height="100px";
document.getElementById("resume_request_view").innerHTML=document.getElementById("resume_request_form").innerHTML;
}


function close_resume_request()
{
document.getElementById("resume_request_view").innerHTML="";
document.getElementById("resume_request_view").style.height="0px";
}






function send_resume_request_ret()
{
if(req.readyState==4)
	{
	if(req.status==200)
		{
		txt=req.responseText;
eval(txt);

		}
	}
}





function send_resume_request()
{
if(document.getElementById("cache_info").checked==true)
	{
	//alert("cache info!");
	}else{

	}


msg='';

_ptrn=/((\")|(\')|(#)|(;))/;
_t=document.getElementById("req_company_name").value;
if(_t==""){alert("회사명을 입력하여 주시기 바랍니다.");return;}
_t=trim(_t);
if(_ptrn.test(_t)){alert("회사명에 \', \", ;, # 등의 기호는 사용하실 수 없습니다.");return;}
if(_t.length>50){alert("회사명은 50자 이상 입력하실 수 없습니다.");return;}
msg=msg+"company_name="+_t;



_ptrn_0=/([0-9]{2,4})/;_ptrn_1=/([0-9]{3,4})/;_ptrn_2=/([0-9]{4})/;
_v_0=document.getElementById("req_company_tel_0").value;
_v_1=document.getElementById("req_company_tel_1").value;
_v_2=document.getElementById("req_company_tel_2").value;
if((!_ptrn_0.test(_v_0))||(!_ptrn_1.test(_v_1))||(!_ptrn_2.test(_v_2))){alert("전화 번호 형식이 올바르지 않습니다.");return;}
msg=msg+"&company_tel="+_v_0+"-"+_v_1+"-"+_v_2;






_ptrn=/((\")|(\')|(#)|(;))/;
_t=document.getElementById("req_ceo_name").value;
if(_t==""){alert("대표자 성명을 입력하여 주시기 바랍니다.");return;}
_t=trim(_t);
if(_ptrn.test(_t)){alert("대표자 성명에\에 \', \", ;, # 등의 기호는 사용하실 수 없습니다.");return;}
if(_t.length>20){alert("대표자 성명은 20자 이상 입력하실 수 없습니다.");return;}
msg=msg+"&ceo_name="+_t;




_ptrn_0=/([0-9]{3})/;_ptrn_1=/([0-9]{2})/;_ptrn_2=/([0-9]{5})/;
_v_0=document.getElementById("req_tn_0").value;
_v_1=document.getElementById("req_tn_1").value;
_v_2=document.getElementById("req_tn_2").value;
if((!_ptrn_0.test(_v_0))||(!_ptrn_1.test(_v_1))||(!_ptrn_2.test(_v_2)))
{alert("사업자 번호 형식이 올바르지 않습니다.");return;}
msg=msg+"&tn="+_v_0+"-"+_v_1+"-"+_v_2;




_ptrn=/^([0-9a-zA-Z가-힣\s]){1,20}$/;
_t=document.getElementById("req_cperson_name").value;
if(_t==""){alert("담당자 성명을 입력하여 주시기 바랍니다.");return;}
_t=trim(_t);
if(_ptrn.test(_t)){alert("담당자 성명에는 영문자, 한글, 공백문자를 제외한 문자는 사용하실 수 없습니다.");return;}
if(_t.length>20){alert("담당자 성명은 20자 이상 입력하실 수 없습니다.");return;}
msg=msg+"&cperson_name="+_t;




_ptrn_0=/([0-9]{2,4})/;_ptrn_1=/([0-9]{3,4})/;_ptrn_2=/([0-9]{4})/;
_v_0=document.getElementById("req_cperson_tel_0").value;
_v_1=document.getElementById("req_cperson_tel_1").value;
_v_2=document.getElementById("req_cperson_tel_2").value;
if((!_ptrn_0.test(_v_0))||(!_ptrn_1.test(_v_1))||(!_ptrn_2.test(_v_2))){alert("담당자 전화 번호 형식이 올바르지 않습니다.");return;}
msg=msg+"&cperson_tel="+_v_0+"-"+_v_1+"-"+_v_2;



_ptrn=/^([0-9a-zA-Z_-]{1,125})@([0-9a-zA-Z-]{1,63})\.([a-zA-Z]{2,4})([a-zA-Z.]{0,50})$/;
_t=document.getElementById("req_cperson_email").value;
if(_t==""){alert("담당자 이메일 주소를 입력하여 주시기 바랍니다.");return;}
_t=trim(_t);
if(!_ptrn.test(_t)){alert("담당자 이메일 형식이 올바르지 않습니다.");return;}
if(_t.length>50){alert("담당자 이메일은 50자 이상 입력하실 수 없습니다.");return;}
msg=msg+"&cperson_email="+_t;




_t_item=0;
if(document.getElementById("req_item_1").checked==true)
	{
	_t_item=1;
	}else if(document.getElementById("req_item_2").checked==true){
	_t_item=2;
	}else if(document.getElementById("req_item_3").checked==true){
	_t_item=3;
	}
if(_t_item==0){alert("내용을 선택하여 주시기 바랍니다.");return;}
msg=msg+"&req_item="+_t_item;



_t=document.getElementById("req_msg").value;
if(_t.length>100){alert("메시지는 100자 이상 입력하실 수 없습니다.");return;}
msg=msg+"&req_msg="+_t;


_v=document.getElementById("vc").value;
msg=msg+"&v="+_v;




//alert(msg);





	req=null;
	try{
		req=new XMLHttpRequest();
		}catch(trymicrosoft){
			try{
				req=new ActiveXObject("Msxml2.XMLHTTP");
				}catch(othermicrosoft){
					try{
							req=new ActiveXObject("Microsoft.XMLHTTP");
						}catch(failed){
							req=null;
						}
				}
		}

if(req==null)
	{
		alert("XMLHTTP error: Unable to initialize HTTP object.");
	}else{
		var _a=new Date();var _t=_a.getTime();
		msg=msg+"&tm="+_t;
		req.open("POST","/resumerequest",true);
		req.onreadystatechange=send_resume_request_ret;
		req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		req.send(msg);
	}
}










































































function set_cimg()
{
if(document.getElementById("cimg"))
	{
	t=document.getElementById("cimg");
	ti=new Image();
	ti.src=t.src;
	if(ti.width>=750)
		{
		t.width=750;
		}
//document.cimg.width+" / "+document.cimg.height);
	}
}


*/
























function submitjob_ret()
{
if(req.readyState==4)
	{
	if(req.status==200)
		{
		txt=req.responseText;
			if(txt=="1")
			{
	//			alert("OK");// submit
				if(document.getElementById("job_form"))
				{
					document.getElementById("job_form").submit();
				}else{
					document.job_form.submit();
				}
			}else {
				eval(txt);
			}

		}
	}
}






function submit_job()
{
if(document.getElementById("c_type").value==0){alert("Please select job type.");return;}
if(document.getElementById("c_time").value==0){alert("Please select job time.");return;}

t=document.getElementById("job_title").value;
t=trim(t);
if(t==""){alert("Please enter title.");return;}
if(t.length>100){alert("Title must be less than 100 characters.");return;}

t=document.getElementById("job_content").value;
t=trim(t);
if(t==""){alert("Please enter description.");return;}
if(t.length>25000){alert("Description must be less than 25000 characters.");return;}

t=document.getElementById("job_email").value;
t=trim(t);
if(t==""){alert("Please enter email address.");return;}
_ptrn=/^([0-9a-zA-Z_-]{1,125})@([0-9a-zA-Z-]{1,63})\.([a-zA-Z]{2,4})([a-zA-Z.]{0,50})$/;
if(!_ptrn.test(t)){alert("Invalid email format.");return;}
if(t.length>200){alert("Email address must be less than 200 characters.");return;}


t=document.getElementById("job_file").value;
if(t!="")
	{
		n=t.length;
		if((t.substr(n-4,4)!=".gif")&&(t.substr(n-4,4)!=".jpg")&&(t.substr(n-5,5)!=".jpeg")){alert("Image file must be GIF or JPG/JPEG format.");return;}
	}

t=document.getElementById("job_code").value;
t=trim(t);
if(t==""){alert("Please enter security code.");return;}
p=/^[a-z0-9A-Z]{5}$/;
if(!p.test(t)){alert("Invalid security code format.");return;}



	req=null;
	try{
		req=new XMLHttpRequest();
		}catch(trymicrosoft){
			try{
				req=new ActiveXObject("Msxml2.XMLHTTP");
				}catch(othermicrosoft){
					try{
							req=new ActiveXObject("Microsoft.XMLHTTP");
						}catch(failed){
							req=null;
						}
				}
		}
r="c="+t+"&v="+document.getElementById("vc").value;
r=r+"&jobcountry="+document.getElementById("c_country").value;
r=r+"&joblocation="+document.getElementById("c_location").value;
r=r+"&jobcategory="+document.getElementById("c_category").value;
r=r+"&jobtype="+document.getElementById("c_type").value;
r=r+"&jobtime="+document.getElementById("c_time").value;
//r=r+"&jobkey="+document.getElementById("c_key").value;


document.getElementById("form_country").value=document.getElementById("c_country").value;
document.getElementById("form_location").value=document.getElementById("c_location").value;
document.getElementById("form_category").value=document.getElementById("c_category").value;
document.getElementById("form_type").value=document.getElementById("c_type").value;
document.getElementById("form_time").value=document.getElementById("c_time").value;
document.getElementById("form_key").value=document.getElementById("c_key").value;
document.getElementById("form_list").value=document.getElementById("c_list").value;

if(req==null)
	{
		alert("XMLHTTP error: Unable to initialize HTTP object.");
	}else{
		var _a=new Date();
		var _t=_a.getTime();
//		r=r+"&tm="+_t;


tr="vc="+document.getElementById("vc").value+"&sc="+document.getElementById("job_code").value+"&tm="+_t;

//alert(tr);
		req.open("POST","/submitjob",true);
		req.onreadystatechange=submitjob_ret;
		req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		req.send(tr);
	}
}






var vcx;


function update_code()
{
	var _t=new Date();
	var _r=Math.floor(Math.random()*1000000)+1;
	var _tr=_t.getTime()+"vt"+_r;

      var img_list=new Array();
      img_list[0]="scode?v="+_t+_r;


      var _code_image=new Array();
      
      for (i=0;i<img_list.length;i++){
        
         _code_image[i]=new Image();
        _code_image[i].src=img_list[i];
      
      }

      document.images.code_img.src = _code_image[0].src;
}




var t_simg;

function update_rcode()
{

	var _t=new Date();
	var _r=Math.floor(Math.random()*1000000)+1;
	var _tr=_t.getTime()+"vt"+_r;

      var img_list=new Array();
      img_list[0]="scode?v="+_t+_r;


      var _code_image=new Array();
      
      for (i=0;i<img_list.length;i++){
        
         _code_image[i]=new Image();
        _code_image[i].src=img_list[i];
      }
      t_simg.src = _code_image[0].src;
}




function backto_job()
{
//n=document.getElementById("c_section").value;
g=document.getElementById("c_country").value;
l=document.getElementById("c_location").value;
c=document.getElementById("c_category").value;
p=document.getElementById("c_type").value;
t=document.getElementById("c_time").value;
k="";
//kw=encodeURIComponent(kw);
document.location.href="/job?list=1&nav="+g+","+l+","+c+","+p+","+t+"&key="+k;
}



function backto_resume()
{
//n=document.getElementById("c_section").value;
g=document.getElementById("c_country").value;
l=document.getElementById("c_location").value;
c=document.getElementById("c_category").value;
p=document.getElementById("c_type").value;
t=document.getElementById("c_time").value;
k="";
//kw=encodeURIComponent(kw);
document.location.href="/resume?list=1&nav="+g+","+l+","+c+","+p+","+t+"&key="+k;
}


function open_send_resume_form()
{
if(document.getElementById("reqresumediv").style.visibility=="hidden")
	{
	document.getElementById("reqresumediv").style.visibility="visible";
	document.getElementById("reqresumediv").style.height="750px";
	document.getElementById("reqresumesrc").style.height="750px";
	window.scrollTo(0,document.body.scrollHeight);
	window.scrollBy(0,-200);
	}else{
	document.getElementById("reqresumesrc").style.height="0px";
	document.getElementById("reqresumediv").style.height="0px";
	document.getElementById("reqresumediv").style.visibility="hidden";
	}
}


function set_send_resume_form(t)
{
	document.getElementById("reqresumesrc").style.height=""+t+"px";
	document.getElementById("reqresumediv").style.height=""+t+"px";
//	document.getElementById("reqresumediv").innerHTML="OK<br /><input type='button' value='OK' onclick='open_send_resume_form();document.location.reload();'>";
}


function complete_send_resume()
{
/*
t=document.location.href;
document.location.replace(t);
*/
document.getElementById("reqresumesrc").innerHTML='Your resume has been sent successfully.<br />Please check your email and complete sending process by clicking "SEND" link.';
}



function close_send_resume()
{
t=document.location.href;
document.location.replace(t);
}



function reload_page()
{
t=document.location.href;
document.location.replace(t);
}









function set_send_msg_form(t)
{
	document.getElementById("reqresumesrc").style.height=""+t+"px";
	document.getElementById("reqresumediv").style.height=""+t+"px";
//	document.getElementById("reqresumediv").innerHTML="OK<br /><input type='button' value='OK' onclick='open_send_resume_form();document.location.reload();'>";
}




function close_send_msg()
{
t=document.location.href;
document.location.replace(t);
}








































function submitresume_ret()
{
if(req.readyState==4)
	{
	if(req.status==200)
		{
		txt=req.responseText;
			if(txt=="1")
			{
	//			alert("OK");// submit
				if(document.getElementById("job_form"))
				{
					document.getElementById("job_form").submit();
				}else{
					document.job_form.submit();
				}
			}else {
				eval(txt);
			}

		}
	}
}






function submit_resume()
{
if(document.getElementById("c_type").value==0){alert("Please select job type.");return;}
if(document.getElementById("c_time").value==0){alert("Please select job time.");return;}

t=document.getElementById("job_title").value;
t=trim(t);
if(t==""){alert("Please enter title.");return;}
if(t.length>100){alert("Title must be less than 100 characters.");return;}

t=document.getElementById("job_content").value;
t=trim(t);
if(t==""){alert("Please enter description.");return;}
if(t.length>25000){alert("Description must be less than 25000 characters.");return;}

t=document.getElementById("job_email").value;
t=trim(t);
if(t==""){alert("Please enter email address.");return;}
_ptrn=/^([0-9a-zA-Z_-]{1,125})@([0-9a-zA-Z-]{1,63})\.([a-zA-Z]{2,4})([a-zA-Z.]{0,50})$/;
if(!_ptrn.test(t)){alert("Invalid email format.");return;}
if(t.length>200){alert("Email address must be less than 200 characters.");return;}


t=document.getElementById("job_file").value;
if(t!="")
	{
		n=t.length;
		if((t.substr(n-4,4)!=".gif")&&(t.substr(n-4,4)!=".jpg")&&(t.substr(n-5,5)!=".jpeg")){alert("Image file must be GIF or JPG/JPEG format.");return;}
	}

t=document.getElementById("job_code").value;
t=trim(t);
if(t==""){alert("Please enter security code.");return;}
p=/^[a-z0-9A-Z]{5}$/;
if(!p.test(t)){alert("Invalid security code format.");return;}



	req=null;
	try{
		req=new XMLHttpRequest();
		}catch(trymicrosoft){
			try{
				req=new ActiveXObject("Msxml2.XMLHTTP");
				}catch(othermicrosoft){
					try{
							req=new ActiveXObject("Microsoft.XMLHTTP");
						}catch(failed){
							req=null;
						}
				}
		}
r="c="+t+"&v="+document.getElementById("vc").value;
r=r+"&jobcountry="+document.getElementById("c_country").value;
r=r+"&joblocation="+document.getElementById("c_location").value;
r=r+"&jobcategory="+document.getElementById("c_category").value;
r=r+"&jobtype="+document.getElementById("c_type").value;
r=r+"&jobtime="+document.getElementById("c_time").value;
//r=r+"&jobkey="+document.getElementById("c_key").value;


document.getElementById("form_country").value=document.getElementById("c_country").value;
document.getElementById("form_location").value=document.getElementById("c_location").value;
document.getElementById("form_category").value=document.getElementById("c_category").value;
document.getElementById("form_type").value=document.getElementById("c_type").value;
document.getElementById("form_time").value=document.getElementById("c_time").value;
document.getElementById("form_key").value=document.getElementById("c_key").value;
document.getElementById("form_list").value=document.getElementById("c_list").value;

if(req==null)
	{
		alert("XMLHTTP error: Unable to initialize HTTP object.");
	}else{
		var _a=new Date();
		var _t=_a.getTime();
//		r=r+"&tm="+_t;


tr="vc="+document.getElementById("vc").value+"&sc="+document.getElementById("job_code").value+"&tm="+_t;

//alert(tr);
		req.open("POST","/submitresume",true);
		req.onreadystatechange=submitjob_ret;
		req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		req.send(tr);
	}
}
















































function open_send_msg_form()
{
if(document.getElementById("msgdiv").style.visibility=="hidden")
	{
	document.getElementById("msgdiv").style.visibility="visible";
	document.getElementById("msgdiv").style.height="750px";
	document.getElementById("msgsrc").style.height="750px";
	window.scrollTo(0,document.body.scrollHeight);
	window.scrollBy(0,-200);
//document.getElementById("msgdiv").innerHTML="hello";
	}else{
	document.getElementById("msgsrc").style.height="0px";
	document.getElementById("msgdiv").style.height="0px";
	document.getElementById("msgdiv").style.visibility="hidden";
	}
}


function set_send_msg_form(t)
{
	document.getElementById("msgsrc").style.height=""+t+"px";
	document.getElementById("msgdiv").style.height=""+t+"px";
//	document.getElementById("reqresumediv").innerHTML="OK<br /><input type='button' value='OK' onclick='open_send_resume_form();document.location.reload();'>";
}


function complete_send_msg()
{
t=document.location.href;
document.location.replace(t);
}

/*
function reload_page()
{
t=document.location.href;
document.location.replace(t);
}
*/


function open_help(v)
{
for(i=0;i<9;i++)
	{
	document.getElementById("help_"+i).style.backgroundColor="#ffffff";
	document.getElementById("help_"+i).style.color="#505050";
	}

	document.getElementById("help_"+v).style.backgroundColor="#ffc12c";
	document.getElementById("help_"+v).style.color="#404040";

var str="help_text_"+v;
document.getElementById("help_content").innerHTML=document.getElementById(str).innerHTML;

}
