// <20100514 new code>

var _url_country;
var _url_location;
var _url_section;
var _url_category;
var _url_mode;
var _url_n;



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",
	/* "iran":"Iran",
	 "iraq":"Iraq",*/
	"ireland":"Ireland",
	"israel":"Israel",
	"italy":"Italy",
	"japan":"Japan",
	"korea":"Korea",
	/*"kuwait":"Kuwait",*/
	"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",
	/*"romania":"Romania",*/
	"russia":"Russia",
	"singapore":"Singapore",
	"southafrica":"South Africa",
	"spain":"Spain",
	"sweden":"Sweden",
	"switzerland":"Switzerland (Swiss)",
	"taiwan":"Taiwan",
	"thailand":"Thailand",
	/*"tunisia":"Tunisia",*/
	"turkey":"Turkey",
	"uae":"United Arab Emirates",
	"uk":"United Kingdom",
	/*"ukraine":"Ukraine",*/
	"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 ={'Kuala Lumpur':'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"
};

//var _section={"job":"Job","resume":"Resume","training":"Training","help":"Help"};


function open_job_panel(t)
{
	_url_country=document.getElementById("current_country").value;
	_url_location=document.getElementById("current_location").value;
//	_url_section=document.getElementById("current_section").value;
	_url_category=document.getElementById("current_category").value;
	
	
	t=document.getElementById(t);
	t.style.width="750px";
	t.style.height="100px";
	t.style.visibility="visible";
	
	si=document.getElementById("current_country").value;
	s='';;
	s=s+"<select id='country_select'  onchange='set_country(this);return false;' style='width:190px;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;
	
	if(!_location[si]){alert("invalid country");document.location.replace("/404");return;}
	
	_location_selected=_location[si];
	si=document.getElementById("current_location").value;
	s='';;
	s=s+"<select id='location_select'  onchange='set_location(this);return false;' style='width:190px;font-family:tahoma;font-size:9pt;'>";
	for(i in _location_selected)
	{
		if(i==si)
		{
			s=s+"<option value='"+i+"' selected>"+_location_selected[i]+"</option>";
			_url_location=i;
		}else{
			s=s+"<option value='"+i+"'>"+_location_selected[i]+"</option>";
		}
	}
	s=s+"</select>";
	document.getElementById("location_cell").innerHTML=s;
	
	si=document.getElementById("current_category").value;
	s='';;
	s=s+"<select id='category_select'  onchange='set_category(this);return false;' style='width:190px;font-family:tahoma;font-size:9pt;'>";
	for(i in _category)
	{
		if(i==si)
		{
			s=s+"<option value='"+i+"' selected>"+_category[i]+"</option>";
			_url_category=i;
		}else{
			s=s+"<option value='"+i+"'>"+_category[i]+"</option>";
		}
	}
	s=s+"</select>";
	document.getElementById("category_cell").innerHTML=s;
	

//	s=s+"<br><br>";
	s="";
	var n=0;
	n=document.getElementById("current_type_option").value;
	n=parseInt(n);

	if(n&1){s=s+"<input type='checkbox' id='type_fulltime' checked=true>Fulltime&nbsp;";}else{s=s+"<input type='checkbox' id='type_fulltime'>Fulltime&nbsp;";};
	if(n&2){s=s+"<input type='checkbox' id='type_parttime' checked=true>Parttime&nbsp;";}else{s=s+"<input type='checkbox' id='type_parttime' >Parttime&nbsp;";};
	if(n&4){s=s+"<input type='checkbox' id='type_freelancer' checked=true>Freelancer&nbsp;";}else{s=s+"<input type='checkbox' id='type_freelancer' >Freelancer&nbsp;";};
	if(n&8){s=s+"<input type='checkbox' id='type_other' checked=true>Other&nbsp;";}else{s=s+"<input type='checkbox' id='type_other' >Other&nbsp;";};

	s=s+"&nbsp;&nbsp;|&nbsp;&nbsp;";

	n=0;
	n=document.getElementById("current_time_option").value;
	n=parseInt(n);
	if(n&1){s=s+"<input type='checkbox' id='time_day' checked=true>Day&nbsp;";}else{s=s+"<input type='checkbox' id='time_day'>Day&nbsp;";};
	if(n&2){s=s+"<input type='checkbox' id='time_night' checked=true>Night&nbsp;";}else{s=s+"<input type='checkbox' id='time_night' >Night&nbsp;";};
	if(n&4){s=s+"<input type='checkbox' id='time_weekend' checked=true>Weekend&nbsp;";}else{s=s+"<input type='checkbox' id='time_weekend' >Weekend&nbsp;";};
	if(n&8){s=s+"<input type='checkbox' id='time_homeworking' checked=true>Home Working&nbsp;";}else{s=s+"<input type='checkbox' id='time_homeworking' >Home Working&nbsp;";};
	document.getElementById("option_cell").innerHTML=s;
	
	s="";
	n=document.getElementById("current_keyword").value;
	if(n.length>100){n=substring(0,99)};
	document.getElementById("keyword_input").value=n;

/*

	if(n&2){t_color_var=t_color[0];}else{t_color_var=t_color[1];}
	s=s+"<span style='color:"+t_color_var+"'>Parttime</span>&nbsp;&nbsp;";

	if(n&4){t_color_var=t_color[0];}else{t_color_var=t_color[1];}
	s=s+"<span style='color:"+t_color_var+"'>Freelancer</span>&nbsp;&nbsp;";

	if(n&8){t_color_var=t_color[0];}else{t_color_var=t_color[1];}
	s=s+"<span style='color:"+t_color_var+"'>Other</span>&nbsp;&nbsp;";

	s=s+"&nbsp;|&nbsp;&nbsp;";
	n=0;
	n=document.getElementById("current_time_option").value;
	n=parseInt(n);
	t_color_var="";

	if(n&1){t_color_var=t_color[0];}else{t_color_var=t_color[1];}
	s=s+"<span style='color:"+t_color_var+"'>Day</span>&nbsp;&nbsp;";

	if(n&2){t_color_var=t_color[0];}else{t_color_var=t_color[1];}
	s=s+"<span style='color:"+t_color_var+"'>Night</span>&nbsp;&nbsp;";

	if(n&4){t_color_var=t_color[0];}else{t_color_var=t_color[1];}
	s=s+"<span style='color:"+t_color_var+"'>Weekend</span>&nbsp;&nbsp;";

	if(n&8){t_color_var=t_color[0];}else{t_color_var=t_color[1];}
	s=s+"<span style='color:"+t_color_var+"'>Home Working</span>&nbsp;&nbsp;";


	v=document.getElementById("current_keyword").value;
	if(v=="")
		{
		s=s+"<br><br>Keywords:&nbsp;";
		}else{
		if(v.length>50){v=v.substring(0,45);v=v+"&nbsp;.....";}
		s=s+"<br><br>Keywords:&nbsp;"+v;
		}
*/

/*	
	si=document.getElementById("current_section").value;
	s='';;
	s=s+"<select id='section_select'  onchange='set_section(this);return false;' >";
	for(i in _section)
	{
		if(i==si)
		{
			s=s+"<option value='"+i+"' selected>"+_section[i]+"</option>";
			_url_section=i;
		}else{
			s=s+"<option value='"+i+"'>"+_section[i]+"</option>";
		}
	}
	s=s+"</select>";
	document.getElementById("section_cell").innerHTML=s;
	
	
	
	si=document.getElementById("current_section").value;
	if(!_category[si]){alert("invalid category");document.location.replace("/404");return;};
	_category_selected=_category[si];
	s='';
	si=document.getElementById("current_category").value;
	s=s+"<select id='category_select'  onchange='set_category(this);return false;'>";
	for(i in _category_selected)
	{
		if(i==si)
		{
			s=s+"<option value='"+i+"' selected>"+_category_selected[i]+"</option>";
			_url_category=i;
		}else{
			s=s+"<option value='"+i+"'>"+_category_selected[i]+"</option>";
		}
	}
	s=s+"</select>";
	document.getElementById("category_cell").innerHTML=s;*/
}

function open_resume_panel(t)
{
	_url_country=document.getElementById("current_country").value;
	_url_location=document.getElementById("current_location").value;
//	_url_section=document.getElementById("current_section").value;
	_url_category=document.getElementById("current_category").value;
	
	
	t=document.getElementById(t);
	t.style.width="750px";
	t.style.height="100px";
	t.style.visibility="visible";
	
	si=document.getElementById("current_country").value;
	s='';;
	s=s+"<select id='country_select'  onchange='set_country(this);return false;' style='width:190px;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;
	
	if(!_location[si]){alert("invalid country");document.location.replace("/404");return;}
	
	_location_selected=_location[si];
	si=document.getElementById("current_location").value;
	s='';;
	s=s+"<select id='location_select'  onchange='set_location(this);return false;' style='width:190px;font-family:tahoma;font-size:9pt;'>";
	for(i in _location_selected)
	{
		if(i==si)
		{
			s=s+"<option value='"+i+"' selected>"+_location_selected[i]+"</option>";
			_url_location=i;
		}else{
			s=s+"<option value='"+i+"'>"+_location_selected[i]+"</option>";
		}
	}
	s=s+"</select>";
	document.getElementById("location_cell").innerHTML=s;
	
	si=document.getElementById("current_category").value;
	s='';;
	s=s+"<select id='category_select'  onchange='set_category(this);return false;' style='width:190px;font-family:tahoma;font-size:9pt;'>";
	for(i in _category)
	{
		if(i==si)
		{
			s=s+"<option value='"+i+"' selected>"+_category[i]+"</option>";
			_url_category=i;
		}else{
			s=s+"<option value='"+i+"'>"+_category[i]+"</option>";
		}
	}
	s=s+"</select>";
	document.getElementById("category_cell").innerHTML=s;
	

//	s=s+"<br><br>";
	s="";
	var n=0;
	n=document.getElementById("current_type_option").value;
	n=parseInt(n);

	if(n&1){s=s+"<input type='checkbox' id='type_fulltime' checked=true>Fulltime&nbsp;";}else{s=s+"<input type='checkbox' id='type_fulltime'>Fulltime&nbsp;";};
	if(n&2){s=s+"<input type='checkbox' id='type_parttime' checked=true>Parttime&nbsp;";}else{s=s+"<input type='checkbox' id='type_parttime' >Parttime&nbsp;";};
	if(n&4){s=s+"<input type='checkbox' id='type_freelancer' checked=true>Freelancer&nbsp;";}else{s=s+"<input type='checkbox' id='type_freelancer' >Freelancer&nbsp;";};
	if(n&8){s=s+"<input type='checkbox' id='type_other' checked=true>Other&nbsp;";}else{s=s+"<input type='checkbox' id='type_other' >Other&nbsp;";};

	s=s+"&nbsp;&nbsp;|&nbsp;&nbsp;";

	n=0;
	n=document.getElementById("current_time_option").value;
	n=parseInt(n);
	if(n&1){s=s+"<input type='checkbox' id='time_day' checked=true>Day&nbsp;";}else{s=s+"<input type='checkbox' id='time_day'>Day&nbsp;";};
	if(n&2){s=s+"<input type='checkbox' id='time_night' checked=true>Night&nbsp;";}else{s=s+"<input type='checkbox' id='time_night' >Night&nbsp;";};
	if(n&4){s=s+"<input type='checkbox' id='time_weekend' checked=true>Weekend&nbsp;";}else{s=s+"<input type='checkbox' id='time_weekend' >Weekend&nbsp;";};
	if(n&8){s=s+"<input type='checkbox' id='time_homeworking' checked=true>Home Working&nbsp;";}else{s=s+"<input type='checkbox' id='time_homeworking' >Home Working&nbsp;";};
	document.getElementById("option_cell").innerHTML=s;
	
	s="";
	n=document.getElementById("current_keyword").value;
	if(n.length>100){n=substring(0,99)};
	document.getElementById("keyword_input").value=n;
}


function goto_url(t)
{
//alert(t);return;
window.document.location.href=t;
}

function close_job_panel(t)
{
_t=document.getElementById(t);
_t.style.height="0px";
_t.style.visibility="hidden";	
}

function close_resume_panel(t)
{
_t=document.getElementById(t);
_t.style.height="0px";
_t.style.visibility="hidden";	
}



function search_job()
{

flag=true;

tp=0;
tm=0;
key="";

if(flag==true)
{
if(document.getElementById("type_fulltime").checked){tp=tp+1;};
if(document.getElementById("type_parttime").checked){tp=tp+2;};
if(document.getElementById("type_freelancer").checked){tp=tp+4;};
if(document.getElementById("type_other").checked){tp=tp+8;};/**/

//
if(tp==0)
	{
	flag=false;
	alert("Please select job type. (Full time / Part time / Freelancer / Other)");return;
	}//else{alert(job_type);}
}


if(flag==true)
{
if(document.getElementById("time_day").checked){tm=tm+1;}
if(document.getElementById("time_night").checked){tm=tm+2;}
if(document.getElementById("time_weekend").checked){tm=tm+4;}
if(document.getElementById("time_homeworking").checked){tm=tm+8;}
if(tm==0)
	{
	flag=false;
	alert("Please select job time. (Day / Night / Weenkend / Home Working)");return;
	}
}

if(flag==true)
{
ptrn=/^([0-9a-zA-Z\s]{1,250})$/;
if(document.getElementById("keyword_input").value!='')
	{
	if(!ptrn.test(document.getElementById("keyword_input").value))
		{
		flag=false;
		alert("Only alphabets, numbers, and spaces are allowed for keywords. \nMaximum length must be less than 250 characters. \Please DO NOT include any space in your keywords.");return;
		}
	}
}

s="";

if(tp!=15){s=s+'tp='+tp;}
if(tm!=15)
	{
	if(s!=""){s=s+'&';}
	s=s+'tm='+tm;
	}
if(document.getElementById("keyword_input").value!="")
	{

// < 20100524 new code >
	//trimming required
//	if(s!=""){s=s+'&';}
	
// > 20100524 < 	
	t=document.getElementById("keyword_input").value;

	_t=trim(document.getElementById("keyword_input").value);
	if(_t!="")
		{
		if(s!=""){s=s+'&';}
			_t=t.split(" ");
			_s="";
			for(i=0;i<_t.length;i++)
				{
				if(_t[i]!=""){_s=_s+_t[i]+",";}
				}
			_s=_s.substring(0,(_s.length-1));

		//	alert(_s);

			s=s+"key="+_s;//+document.getElementById("keyword_input").value;
		}
	}


str='/job/'+_url_country+'/'+_url_location+'/'+_url_category+'/list/1';

// < 20100524 new code >
//if((tp!=0)||(tm!=0)||(document.getElementById("keyword_input").value!="")){str=str+'?'+s;}
if(s!=''){alert(s);str=str+'?'+s;}
// > 20100524 < 

//alert(str);

document.location.href=str;//alert("x");return;

}


function init_job_panel(t)
{
s="";
v=document.getElementById("current_country").value;
s=s+_country[v]+"&nbsp;&nbsp;>&nbsp;&nbsp;";

_v=_location[v];
v=_v[document.getElementById("current_location").value];
s=s+v+"&nbsp;&nbsp;>&nbsp;&nbsp;";

v=document.getElementById("current_category").value;
s=s+_category[v];

// <20100515 new code>
t_color=Array("#ffffff;","#afafaf;");
s=s+"<br><br>";

var n=0;
n=document.getElementById("current_type_option").value;
n=parseInt(n);
t_color_var="";

if(n&1){t_color_var=t_color[0];}else{t_color_var=t_color[1];}
s=s+"<span style='color:"+t_color_var+"'>Full Time</span>&nbsp;&nbsp;";

if(n&2){t_color_var=t_color[0];}else{t_color_var=t_color[1];}
s=s+"<span style='color:"+t_color_var+"'>Part Time</span>&nbsp;&nbsp;";

if(n&4){t_color_var=t_color[0];}else{t_color_var=t_color[1];}
s=s+"<span style='color:"+t_color_var+"'>Freelancer</span>&nbsp;&nbsp;";

if(n&8){t_color_var=t_color[0];}else{t_color_var=t_color[1];}
s=s+"<span style='color:"+t_color_var+"'>Other</span>&nbsp;&nbsp;";

s=s+"&nbsp;|&nbsp;&nbsp;";
n=0;
n=document.getElementById("current_time_option").value;
n=parseInt(n);
t_color_var="";

if(n&1){t_color_var=t_color[0];}else{t_color_var=t_color[1];}
s=s+"<span style='color:"+t_color_var+"'>Day</span>&nbsp;&nbsp;";

if(n&2){t_color_var=t_color[0];}else{t_color_var=t_color[1];}
s=s+"<span style='color:"+t_color_var+"'>Night</span>&nbsp;&nbsp;";

if(n&4){t_color_var=t_color[0];}else{t_color_var=t_color[1];}
s=s+"<span style='color:"+t_color_var+"'>Weekend</span>&nbsp;&nbsp;";

if(n&8){t_color_var=t_color[0];}else{t_color_var=t_color[1];}
s=s+"<span style='color:"+t_color_var+"'>Home Working</span>&nbsp;&nbsp;";


v=document.getElementById("current_keyword").value;
if(v=="")
	{
	s=s+"<br><br>Keywords:&nbsp;";
	}else{
	if(v.length>50){v=v.substring(0,45);v=v+"&nbsp;.....";}
	s=s+"<br><br>Keywords:&nbsp;"+v;
	}
// >20100515<

document.getElementById(t).innerHTML=s;
}


// >new code 20100514<





function init_resume_panel(t)
{
	s="";
	v=document.getElementById("current_country").value;
	s=s+_country[v]+"&nbsp;&nbsp;>&nbsp;&nbsp;";
	
	_v=_location[v];
	v=_v[document.getElementById("current_location").value];
	s=s+v+"&nbsp;&nbsp;>&nbsp;&nbsp;";
	
	v=document.getElementById("current_category").value;
	s=s+_category[v];
	
	// <20100515 new code>
	t_color=Array("#505050;","#afafaf;");
	s=s+"<br><br>";
	
	var n=0;
	n=document.getElementById("current_type_option").value;
	n=parseInt(n);
	t_color_var="";
	
	if(n&1){t_color_var=t_color[0];}else{t_color_var=t_color[1];}
	s=s+"<span style='color:"+t_color_var+"'>Full Time</span>&nbsp;&nbsp;";
	
	if(n&2){t_color_var=t_color[0];}else{t_color_var=t_color[1];}
	s=s+"<span style='color:"+t_color_var+"'>Part Time</span>&nbsp;&nbsp;";
	
	if(n&4){t_color_var=t_color[0];}else{t_color_var=t_color[1];}
	s=s+"<span style='color:"+t_color_var+"'>Freelancer</span>&nbsp;&nbsp;";
	
	if(n&8){t_color_var=t_color[0];}else{t_color_var=t_color[1];}
	s=s+"<span style='color:"+t_color_var+"'>Other</span>&nbsp;&nbsp;";
	
	s=s+"&nbsp;|&nbsp;&nbsp;";
	n=0;
	n=document.getElementById("current_time_option").value;
	n=parseInt(n);
	t_color_var="";
	
	if(n&1){t_color_var=t_color[0];}else{t_color_var=t_color[1];}
	s=s+"<span style='color:"+t_color_var+"'>Day</span>&nbsp;&nbsp;";
	
	if(n&2){t_color_var=t_color[0];}else{t_color_var=t_color[1];}
	s=s+"<span style='color:"+t_color_var+"'>Night</span>&nbsp;&nbsp;";
	
	if(n&4){t_color_var=t_color[0];}else{t_color_var=t_color[1];}
	s=s+"<span style='color:"+t_color_var+"'>Weekend</span>&nbsp;&nbsp;";
	
	if(n&8){t_color_var=t_color[0];}else{t_color_var=t_color[1];}
	s=s+"<span style='color:"+t_color_var+"'>Home Working</span>&nbsp;&nbsp;";
	
	
	v=document.getElementById("current_keyword").value;
	if(v=="")
	{
		s=s+"<br><br>Keywords:&nbsp;";
	}else{
		if(v.length>50){v=v.substring(0,45);v=v+"&nbsp;.....";}
		s=s+"<br><br>Keywords:&nbsp;"+v;
	}
	// >20100515<
	
	document.getElementById(t).innerHTML=s;
}


function search_resume()
{

flag=true;

tp=0;
tm=0;
key="";

if(flag==true)
{
if(document.getElementById("type_fulltime").checked){tp=tp+1;};
if(document.getElementById("type_parttime").checked){tp=tp+2;};
if(document.getElementById("type_freelancer").checked){tp=tp+4;};
if(document.getElementById("type_other").checked){tp=tp+8;};/**/

//
if(tp==0)
	{
	flag=false;
	alert("Please select job type. (Full time / Part time / Freelancer / Other)");return;
	}//else{alert(job_type);}
}


if(flag==true)
{
if(document.getElementById("time_day").checked){tm=tm+1;}
if(document.getElementById("time_night").checked){tm=tm+2;}
if(document.getElementById("time_weekend").checked){tm=tm+4;}
if(document.getElementById("time_homeworking").checked){tm=tm+8;}
if(tm==0)
	{
	flag=false;
	alert("Please select job time. (Day / Night / Weenkend / Home Working)");return;
	}
}

if(flag==true)
{
ptrn=/^([0-9a-zA-Z\s]{1,250})$/;
if(document.getElementById("keyword_input").value!='')
	{
	if(!ptrn.test(document.getElementById("keyword_input").value))
		{
		flag=false;
		alert("Only alphabets, numbers, and spaces are allowed for keywords. \nMaximum length must be less than 250 characters. \Please DO NOT include any space in your keywords.");return;
		}
	}
}

s="";

if(tp!=15){s=s+'tp='+tp;}
if(tm!=15)
	{
	if(s!=""){s=s+'&';}
	s=s+'tm='+tm;
	}
if(document.getElementById("keyword_input").value!="")
	{
	if(s!=""){s=s+'&';}
	
	
	t=document.getElementById("keyword_input").value;

	_t=t.split(" ");
	_s="";
	for(i=0;i<_t.length;i++)
		{
		if(_t[i]!=""){_s=_s+_t[i]+",";}
		}
	_s=_s.substring(0,(_s.length-1));

//	alert(_s);

	s=s+"key="+_s;//+document.getElementById("keyword_input").value;
	}


str='/resume/'+_url_country+'/'+_url_location+'/'+_url_category+'/list/1';
if((tp!=0)||(tm!=0)||(document.getElementById("keyword_input").value!="")){str=str+'?'+s;}
//alert(str);
document.location.href=str;//alert("x");return;

}



/*
function open_job_panel()
{

//document.getElementById("nav_panel").style.width='750px';
//document.getElementById("nav_panel").style.height='72px';
document.getElementById("nav_panel").style.visibility='visible';
//document.getElementById("nav_panel").innerHTML='<div style="padding:10px;"><span style="width:150px;height:70px;background-color:#0000ff;" id="job_country"></span>&nbsp;&nbsp;<span style="width:150px;height:70px;background-color:#ffff50;" id="job_location"></span>&nbsp;&nbsp;<span style="width:150px;height:70px;background-color:#ffff50;" id="job_category"></span></div>';
//document.getElementById("job_country").innerHTML='<select id="job_country_select" style="width:170px;height:20px;font-family:tahoma,AppleGothic;font-size:9pt;"><option>United States</option><option>Canada</option><option>Japan</option></select>';
//
//	document.getElementById("job_country_select").selectedIndex=document.getElementById("i_country").value;//55;

//document.getElementById("job_location").innerHTML='<select id="job_country_select" style="width:170px;height:20px;font-family:tahoma,AppleGothic;font-size:9pt;"><option>United States</option><option>Canada</option><option>Japan</option></select>';
//document.getElementById("job_category").innerHTML='<select id="job_country_select" style="width:170px;height:20px;font-family:tahoma,AppleGothic;font-size:9pt;"><option>United States</option><option>Canada</option><option>Japan</option></select>';
//t_con_idx=document.getElementById("country_index").value;
t_loc_idx=document.getElementById("location_index").value;
//t_location=location_list[55];
//t_location_str=location_str[55];
//t_location=location_list[t_con_idx];
//t_str=location_str[t_location];
t=document.getElementById("job_country_select").selectedIndex;
//setCookie('country',t);
t_location=location_list[t];
t_str=location_str[t];



str='<select id="job_location_select" style="width:170px;height:20px;font-family:tahoma,AppleGothic;font-size:9pt;" onchange="set_job_location(this);return false;">';
t_count=t_location.length;
for(i=0;i<t_count;i++)
	{
		if(i==t_loc_idx)
		{
		str=str+'<option value="'+t_str[i]+'" selected>'+t_location[i]+'</option>';
		}else{
		str=str+'<option value="'+t_str[i]+'">'+t_location[i]+'</option>';
		}
	}
str=str+'</select>';
document.getElementById("job_location").innerHTML=str;
//document.getElementById("job_location_select").selectedIndex=document.getElementById("i_location").value;//74;

//document.getElementById("job_category_select").selectedIndex=document.getElementById("i_category").value;
}
//<td id="job_location_select"><select  style="width:120px;height:20px;font-family:tahoma,AppleGothic;font-size:9pt;"><option>New York, NY</option></select>&nbsp;</td><td id="job_category_select"><select style="width:120px;height:20px;font-family:tahoma,AppleGothic;font-size:9pt;"><option>Office|Admin</option></select></td></tr></table>
//<td><input type="text" style="width:120px;height:20px;font-family:tahoma,AppleGothic;font-size:9pt;">&nbsp;<input type="text" style="width:120px;height:20px;font-family:tahoma,AppleGothic;font-size:9pt;">&nbsp;<br></td></tr></table></div>';


function goto_url(t_section,t_id)
{


//window.document.location.href='/'+t_section+'/post/'+t_id;
alert(t_section+t_id);
window.document.location.href='/'+t_section+t_id;
}

function close_job_panel()
{
document.getElementById("nav_panel").style.visibility='hidden';
}



function close_job_preview()
{
document.getElementById('preview_panel').style.height='0px';
document.getElementById('preview_panel').style.visibility='hidden';
document.getElementById('job_sel').style.visibility='visible';
}




function job_preview()
{
str='';
t_str='';
flag=true;
ptrn=/^[0-9a-zA-Z]{2,250}$/;

str='<input type="button" value="close" onclick="close_job_preview();return false;"><br><br>';

t_str=document.getElementById("job_corp").value;
if(!ptrn.test(t_str)){alert('corp name error');flag=false;}
str=str+t_str+'<br>';

t_str=document.getElementById("job_title").value;
str=str+t_str+'<br>';

t_str=document.getElementById("job_country").selectedIndex;
str=str+t_str+'<br>';

t_str=document.getElementById("job_location").selectedIndex;
str=str+t_str+'<br>';

t_str=document.getElementById("job_category").selectedIndex;
str=str+t_str+'<br>';



t_str=document.getElementById("job_fulltime").checked;
str=str+t_str+'<br>';

t_str=document.getElementById("job_parttime").checked;
str=str+t_str+'<br>';

t_str=document.getElementById("job_freelancer").checked;
str=str+t_str+'<br>';

t_str=document.getElementById("job_other").checked;
str=str+t_str+'<br>';

t_str=document.getElementById("job_night").checked;
str=str+t_str+'<br>';

t_str=document.getElementById("job_weekend").checked;
str=str+t_str+'<br>';

t_str=document.getElementById("job_home").checked;
str=str+t_str+'<br>';


t_str=document.getElementById("job_keywords").value;
str=str+t_str+'<br>';

txt_str=document.getElementById("job_desc").value;
//str=str+t_str+'<br>';




if(flag==true)
{
//str=str+'<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello';
//str='<input type="button" value="close" onclick="ㅊjob_preview();return false;"><br><br>'+str;
document.getElementById('job_sel').style.visibility='hidden';
p=document.getElementById('preview_panel');
p.style.visibility='visible';
p.style.height='500px';
document.getElementById('preview_panel').innerHTML=txt_str;
document.getElementById('preview_panel').innerHTML = document.getElementById('preview_panel').innerHTML.split('').join('<wbr />');
document.getElementById('preview_panel').innerHTML = str+document.getElementById('preview_panel').innerHTML;

}
}
*/
























/*
function set_job_category(t)
{
//document.getElementById("v_category").value=t.value;
u_category=t.value;
}






function set_job_location(t)
{
//document.getElementById("v_location").value=t.value;
u_location=t.value;
}




function set_job_country()
{

u_country=document.getElementById("job_country_select").value;
t=document.getElementById("job_country_select").selectedIndex;
//setCookie('country',t);
t_location=location_list[t];
t_str=location_str[t];
str='<select id="job_location_select" style="width:170px;height:20px;font-family:tahoma,AppleGothic;font-size:9pt;" onchange="set_job_location(this);return false;";>';
t_count=t_location.length;
//document.getElementById("v_country").value=document.getElementById("job_country_select").value;

t_loc_idx=document.getElementById("location_index").value;
for(i=0;i<t_count;i++)
	{
		if(i==0)
		{
		str=str+'<option value="'+t_str[i]+'" selected>'+t_location[i]+'</option>';
		}else{
		str=str+'<option value="'+t_str[i]+'">'+t_location[i]+'</option>';
		}
	}
str=str+'</select>';
document.getElementById("job_location").innerHTML=str;
//                                           20100501                    u_location='all';

//alert(t_str[0]);
//loc_name='ls_'+u_country;alert(loc_name);
//x_arr=location_str[loc_name];

//x_arr=location_str[ls_chile];
//alert('val: '+x_arr[0]);

//t_loc_str=new Array();
//t_loc_str=location_str[loc_name];
//alert(t_loc_str[0]);
u_location=t_str[0];
//alert(t_location[0]);
document.getElementById("v_location").value=t_str[0];
}

*/





function update_location(t)
{
	if(!_location[t.value]){alert("invalid country");/*document.location.replace("/404");*/return;}
	flag=1;
	_location_selected=_location[t.value];
	s='';
	s=s+"<select id='location_select'  onchange='set_location(this);return false;' style='width:190px;font-family:tahoma;font-size:9pt;'>";
	for(i in _location_selected)
	{
		if(flag==1)
		{
			s=s+"<option value='"+i+"' selected>"+_location_selected[i]+"</option>";
			_url_location=i;
			flag=0;		
		}else{
			s=s+"<option value='"+i+"'>"+_location_selected[i]+"</option>";
			flag=0;
		}
	}
	s=s+"</select>";
	document.getElementById("location_cell").innerHTML=s;;
}


function set_country(t)
{
	if(_country[t.value])
	{
		_url_country=t.value;
// < 20100630 new code >
if(document.getElementById("_form_country")){document.getElementById("_form_country").value=t.selectedIndex;}
// > 20100630 <
		update_location(t);


	}else{
		//document.location.replace();
		alert("error: invalid country");
	}
}


function set_location(t)
{
	if(_location[_url_country])
	{
		selected_location=_location[_url_country];
		if(selected_location[t.value])
		{
			_url_location=t.value;

// < 20100630 new code >
if(document.getElementById("_form_location")){document.getElementById("_form_location").value=t.selectedIndex;}
// > 20100630 <



		}else{
			//document.location.replace();
			alert("error: invalid location");
		}
	}else{
		//document.location.replace();
		alert("error: invalid location");
	}
}




function set_category(t)
{
	if(_category[t.value])
	{
		_url_category=t.value;
// < 20100630 new code >
if(document.getElementById("_form_category")){document.getElementById("_form_category").value=t.selectedIndex;}
// > 20100630 <
	}else{
		//document.location.replace();
		alert("error: invalid category");
	}
}








/*
function _search_job()
{alert("search@");return;
flag=true;

job_type=0;
job_time=0;
job_keyword='';

if(flag==true)
{
if(document.getElementById("job_fulltime").checked==true){job_type=job_type+1;}
if(document.getElementById("job_parttime").checked==true){job_type=job_type+2;}
if(document.getElementById("job_freelancer").checked==true){job_type=job_type+4;}
if(document.getElementById("job_other").checked==true){job_type=job_type+8;}

if(job_type==0)
	{
	flag=false;
	alert("Please select job type. (Full time / Part time / Freelancer / Other)");return;
	}//else{alert(job_type);}
}
if(flag==true)
{
if(document.getElementById("job_day").checked==true){job_time=job_time+1;}
if(document.getElementById("job_night").checked==true){job_time=job_time+2;}
if(document.getElementById("job_weekend").checked==true){job_time=job_time+4;}
if(document.getElementById("job_homeworking").checked==true){job_time=job_time+8;}
if(job_time==0)
	{
	flag=false;
	alert("Please select job time. (Day / Night / Weenkend / Homeworking)");return;
	}
}

if(flag==true)
{
ptrn=/^([0-9a-zA-Z,]{1,250})$/;
if(document.getElementById("job_keywords").value!='')
	{
	if(!ptrn.test(document.getElementById("job_keywords").value))
		{
		flag=false;
		alert("Only alphabets, numbers, and spaces are allowed for keywords. \nMaximum length must be less than 250 characters. \Please DO NOT include any space in your keywords.");return;
		}
	}
}

gv='';

if(job_type!=15){gv=gv+'jobtype='+job_type;}
if(job_time!=15)
	{
	if(gv!=''){gv=gv+'&';}
	gv=gv+'jobtime='+job_time;
	}
if(document.getElementById("job_keywords").value!='')
	{
	if(gv!=''){gv=gv+'&';}
	gv=gv+'jobkw='+document.getElementById("job_keywords").value;
	}


str='/job/'+u_country+'/'+u_location+'/'+u_category+'/list/1';
if((job_type!=0)||(job_time!=0)|(document.getElementById("job_keywords").value!='')){str=str+'?'+gv;}
//alert(str);
document.location.href=str;
}
*/




/*

function open_login()
{
if(document.getElementById("login_panel").style.visibility!="visible")
	{
	document.getElementById("nav_panel").style.visibility="hidden";
	document.getElementById("login_panel").style.visibility="visible";
	}else{
	document.getElementById("login_panel").style.visibility="hidden";
	}
}



function update_job_select_location()
{
t=document.getElementById("newjob_country").selectedIndex;

t_location=location_list[t];
t_str=location_str[t];
str='<select id="newjob_location" style="width:170px;height:20px;font-family:tahoma,AppleGothic;font-size:9pt;" >';
t_count=t_location.length;
for(i=0;i<t_count;i++)
	{
		if(i==0)
		{
		str=str+'<option value="'+t_str[i]+'" selected>'+t_location[i]+'</option>';
		}else{
		str=str+'<option value="'+t_str[i]+'">'+t_location[i]+'</option>';
		}
	}
str=str+'</select>';




document.getElementById("newjob_location_cell").innerHTML=str;
}





function submit_newjob()
{
flag=true;
str=document.getElementById("newjob_country").selectedIndex+' : '+document.getElementById("newjob_location").selectedIndex+' : '+document.getElementById("newjob_category").selectedIndex;
alert(str);
if((!document.getElementById("newjob_fulltime").checked)&&(!document.getElementById("newjob_parttime").checked)&&(!document.getElementById("newjob_free").checked)&&(!document.getElementById("newjob_other").checked)){alert('Please select job type');flag=false;}
if((!document.getElementById("newjob_day").checked)&&(!document.getElementById("newjob_night").checked)&&(!document.getElementById("newjob_weekend").checked)&&(!document.getElementById("newjob_home").checked)){alert('Please select job day');flag=false;}
}




var req;



function login_ret()
{
if(req.readyState==4)
	{
	if(req.status==200)
		{
		txt=req.responseText;//;alert(txt);
		eval(txt);
		}
	}
}


function start_login()
{
	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;
						}
				}
		}
//alert(document.getElementById('login_id').value);
if(req==null)
	{
		alert("XMLHTTP error: Unable to initialize HTTP object.");
	}else{
	//	t="login_id="+document.getElementById('login_id').value+'&login_pw='+document.getElementById('login_pw').value;

t_id=document.getElementById("login_id").value;
t_pw=document.getElementById("login_pw").value;
tc="login_id="+t_id+"&login_pw="+t_pw;
alert('ID: '+t_id+' | PW: '+t_pw+' | code: '+document.getElementById("vcode").value);

//return;

		req.open("POST","/userlogin",true);
		req.onreadystatechange=login_ret;
		req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		req.send(tc);


	}
}




//function start_login()
//{
//t_id=document.getElementById("login_id").value;
//t_pw=document.getElementById("login_pw").value;
//alert('ID: '+t_id+' | PW: '+t_pw+' | code: '+document.getElementById("vcode").value);
//}



/*

function logout_ret()
{
if(req.readyState==4)
	{
	if(req.status==200)
		{
		txt=req.responseText;//;alert(txt);
		eval(txt);
		}
	}
}


function logout()
{
	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;
						}
				}
		}
//alert(document.getElementById('login_id').value);
if(req==null)
	{
		alert("XMLHTTP error: Unable to initialize HTTP object.");
	}else{
tc="m=logout&vc="+document.getElementById("vcode").value;alert(tc);
//alert('ID: '+t_id+' | PW: '+t_pw+' | code: '+document.getElementById("vcode").value);

//return;

		req.open("POST","/userlogout",true);
		req.onreadystatechange=logout_ret;
		req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		req.send(tc);


	}
}




function submit_job_ret()
{
if(req.readyState==4)
	{
	if(req.status==200)
		{
		txt=req.responseText;//;alert(txt);
		eval(txt);
		}
	}
}


function submit_job()
{

///////////////////////////////////
	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;
						}
				}
		}
//alert(document.getElementById('login_id').value);
if(req==null)
	{
		alert("XMLHTTP error: Unable to initialize HTTP object.");
	}else{
tc="m=submit&vc="+document.getElementById("vcode").value;alert(tc);
//alert('ID: '+t_id+' | PW: '+t_pw+' | code: '+document.getElementById("vcode").value);

//return;

		req.open("POST","/submitjob",true);
		req.onreadystatechange=submit_job_ret;
		req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		req.send(tc);


	}
}
*/


// < 20100521 new code >


var req;



function signup_ret()
{
if(req.readyState==4)
	{
	if(req.status==200)
		{
		txt=req.responseText;//alert(txt);
		eval(txt);
		}
	}
}


function try_signup(t)
{
/*

*/









	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;
						}
				}
		}
//alert(document.getElementById('login_id').value);
if(req==null)
	{
		alert("XMLHTTP error: Unable to initialize HTTP object.");
	}else{
		var _a=new Date();var _t=_a.getTime();


	//	t="login_id="+document.getElementById('login_id').value+'&login_pw='+document.getElementById('login_pw').value;
		if(t==1)
		{

		tc="v="+document.getElementById("vcode").value+"&tm="+_t;
		}else{





if(!validate_id(document.getElementById("signup_id").value))
	{
	alert("Invalid ID format.");
	return;
	}

if(!validate_pw(document.getElementById("signup_pw").value))
	{
	alert("Invalid password format.");
	return;
	}
if(!validate_pw(document.getElementById("signup_pw_retype").value))
	{
	alert("Invalid retyped password format.");
	return;
	}

if(document.getElementById("signup_pw").value!=document.getElementById("signup_pw_retype").value)
	{
	alert("Password is not equal to retyped password.");
	return;
	}
if(!validate_scode(document.getElementById("signup_scode").value))
	{
	alert("Invalid security code format.");
	return;
	}














		tc="scode="+document.getElementById("signup_scode").value+"&v="+document.getElementById("vcode").value+"&id="+document.getElementById("signup_id").value+"&pw="+document.getElementById("signup_pw").value+"&pw_retype="+document.getElementById("signup_pw_retype").value+"&tm="+_t;
		}
//alert("signup.....sent");
//alert(tc);
		req.open("POST","/usersignup",true);
		req.onreadystatechange=signup_ret;
		req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		req.send(tc);


	}
}

function cancel_signup()
{
document.location.href=document.getElementById("current_url").value;
}
// > 20100521 <








function update_signup_scode()
{//alert("sgn code");
//alert(document.getElementById("vcode").value);

var _t=new Date();
// < 20100715 new code >
var _r=Math.floor(Math.random()*1000000)+1;
var _tr=_t.getTime()+"vt"+_r;



/*
var ximg=document.createElement('img');
ximg.src='http://www.openjobfinder.com/scode?n='+_tr;//document.getElementById("vcode").value;//+"&v="+document.getElementById("vcode").value;;
//document.images['scode_img'].src=ximg.src+'?v='+_t.getTime();
document.images['scode_img'].src=ximg.src;//+'?v='+_tr;
//alert(document.images['scode_img'].src);
// > 20100715 <
*/


//ximg.src='http://www.openjobfinder.com/scode';//?n='+_tr;//document.getElementById("vcode").value;//+"&v="+document.getElementById("vcode").value;;
//document.images['scode_img'].src=ximg.src+'?v='+_t.getTime();
document.images['scode_img'].src='http://www.openjobfinder.com/scode?n='+_tr+'&v='+document.getElementById("vcode").value;
//alert(document.images['scode_img'].src);


}















function check_signup_id_ret()
{
if(req.readyState==4)
	{
	if(req.status==200)
		{
		txt=req.responseText;//alert(txt);
		eval(txt);
		}
	}
}


function check_signup_id()
{
if(!validate_id(document.getElementById("signup_id").value))
	{
	alert("Invalid ID 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;
						}
				}
		}
//alert(document.getElementById('login_id').value);
if(req==null)
	{
		alert("XMLHTTP error: Unable to initialize HTTP object.");
	}else{
		var _a=new Date();var _t=_a.getTime();
		tc="v="+document.getElementById("vcode").value+"&tm="+_t+"&id="+document.getElementById("signup_id").value;
//alert(tc);
		req.open("POST","/usercheckid",true);
		req.onreadystatechange=check_signup_id_ret;
		req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		req.send(tc);
	}
}














function check_signup_scode()
{

}


function signup_error(t)
{
_str="";
if(t&1){_str=_str+"\n\nid error\n";}
if(t&2){_str=_str+"pw error\n";}
if(t&4){_str=_str+"pw retype error\n";}
if(t&8){_str=_str+"pw match error\n";}
if(t&16){_str=_str+"scode format error\n";}
if(t&32){_str=_str+"scode match error\n";}



alert("signup error: "+t+_str);
}











function trim(str)
{
str=str.replace(/^\s*/,'').replace(/s*$/,'');
return str;
}


























































function newpw_ret()
{
if(req.readyState==4)
	{
	if(req.status==200)
		{
		txt=req.responseText;//alert(txt);
		eval(txt);
		}
	}
}


function try_newpw(t)
{
	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;
						}
				}
		}
//alert(document.getElementById('login_id').value);
if(req==null)
	{
		alert("XMLHTTP error: Unable to initialize HTTP object.");
	}else{
		var _a=new Date();var _t=_a.getTime();


	//	t="login_id="+document.getElementById('login_id').value+'&login_pw='+document.getElementById('login_pw').value;
		if(t==1)
		{

		tc="v="+document.getElementById("vcode").value+"&tm="+_t;
		}else{
var npw_flag=true;
if(!validate_id(document.getElementById("newpw_id").value)){alert("Invalid ID format");return}
if(!validate_scode(document.getElementById("newpw_scode").value)){alert("Invalid security code format");return;}

		tc="scode="+document.getElementById("newpw_scode").value+"&v="+document.getElementById("vcode").value+"&id="+document.getElementById("newpw_id").value+"&tm="+_t;
		}
//alert("signup.....sent");
//alert(tc);
		req.open("POST","/usernewpw",true);
		req.onreadystatechange=newpw_ret;//signup_ret;
		req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		req.send(tc);


	}
}

function cancel_newpw()
{
document.location.href=document.getElementById("current_url").value;
}
// > 20100521 <








function update_newpw_scode()
{
//alert("npw code");
var _t=new Date();

/*
var ximg=document.createElement('img');
ximg.src='http://www.openjobfinder.com/scode';
document.images['scode_img'].src=ximg.src+'?v='+_t.getTime();
*/
var _r=Math.floor(Math.random()*1000000)+1;
var _tr=_t.getTime()+"vt"+_r;


/*
var ximg=document.createElement('img');
ximg.src='http://www.openjobfinder.com/scode?n='+_tr+"&v="+document.getElementById("vcode").value;
//document.images['scode_img'].src=ximg.src+'?v='+_t.getTime();
document.images['scode_img'].src=ximg.src;//+'?v='+_tr;
//alert(document.images['scode_img'].src);
// > 20100715 <
*/




// < 20100716 new code >

//ximg.src=
//document.images['scode_img'].src=ximg.src+'?v='+_t.getTime();
document.images['scode_img'].src='http://www.openjobfinder.com/scode?n='+_tr+"&v="+document.getElementById("vcode").value;

// > 20100716 <


}



function newpw_error(t)
{
_str="";
if(t&1){_str=_str+"\n\nid error\n";}
/*
if(t&2){_str=_str+"pw error\n";}
if(t&4){_str=_str+"pw retype error\n";}
if(t&8){_str=_str+"pw match error\n";}
*/
if(t&16){_str=_str+"scode format error\n";}
if(t&32){_str=_str+"scode match error\n";}



alert("new password error: "+t+_str);
}











// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

// < 20100729 new code >
// commented out 20100729
/*

function ret_open_login_panel()
{
if(req.readyState==4)
	{
	if(req.status==200)
		{
		txt=req.responseText;//alert(txt);
		alert(txt);return;
		document.getElementById("login_panel").innerHTML=txt;
		}
	}
}


function try_open_login_panel()
{
	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;
						}
				}
		}
//alert(document.getElementById('login_id').value);
if(req==null)
	{
		alert("XMLHTTP error: Unable to initialize HTTP object.");
	}else{
		var _a=new Date();var _t=_a.getTime();
		tc="v="+document.getElementById("vcode").value+"&tm="+_t;
//		tc=tc+"&mvcode="+t;
//		tc=tc+"&id="+document.getElementById("post_id").value;

//alert("signup.....sent");
//alert(tc);return;
		req.open("POST","/userloginpanel",true);
		req.onreadystatechange=ret_open_login_panel;
		req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		req.send(tc);
	}
}

*/
// 20100729


function open_login(t)
{
var _i="";
switch(t)
{
case 1:_i="/img/job_panel.gif";_s="/img/job_submit.gif";_c="/img/job_cancel.gif";break;
case 2:_i="/img/resume_panel.gif";_s="/img/resume_submit.gif";_c="/img/resume_cancel.gif";break;
case 3:_i="/img/help_panel.gif";_s="/img/help_submit.gif";_c="/img/help_cancel.gif";break;
default:return;
}


if(document.getElementById("login_panel").style.visibility!="visible")
	{
	document.getElementById("nav_panel").style.visibility="hidden";
	document.getElementById("login_panel").style.visibility="visible";
		
		document.getElementById("login_panel").innerHTML='<form ><table style="margin:10px;width:730px;height:80px;font-family:tahoma,AppleGothic;font-size:9pt;border-width:0px;border:none;border-collapse:collapse;" cellpadding="0px" cellspacing="0px"><tr><td style="width:120px;background-color:#ffffff;height:20px;;font-family:tahoma,AppleGothic;font-size:12pt;color:#505050;font-weight:bold;" rowspan="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Login<input type="image" src="/img/login_submit.gif" name="submit" onclick="try_login();return false;"></td><td  style="width:70px;height:25px;background-color:#ffffff;text-align:right;align:right;">ID&nbsp;&nbsp;</td>	<td style="width:350px;background-color:#ffffff;text-align:left;align:left;"><input type="text" id="login_id" style="width:200px;height:19px;font-family:tahoma,AppleGothic;font-size:9pt;"></td><td rowspan="3" id="login_submit_cell" style="background-image:url(\'/img/job_submit.gif\');cursor:hand;cursor:pointer;width:75px;"  onclick="try_login();return false;"><br><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Login</td><td id="login_cancel_cell" rowspan="3" style="background-image:url(\'/img/job_cancel.gif\');cursor:hand;cursor:pointer;width:75px;" onclick="cancel_login();return false;"><br><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Cancel</td></tr><tr><td  style="width:70px;height:25px;background-color:#ffffff;text-align:right;align:right;">Password&nbsp;&nbsp;</td><td style="background-color:#ffffff;height:25px;text-align:left;align:left;" ><input id="login_pw" type="password" style="width:200px;height:19px;font-family:tahoma,AppleGothic;font-size:9pt;"></td></tr><tr><td colspan="2" style="background-color:#ffffff;height:25px;text-align:left;align:left;;font-family:tahoma,AppleGothic;font-size:9pt;" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="" class="newpw_link"  onclick="goto_page(\'newpassword\');return false;">Forgot password? Click here.</a></td></form><!-- border color:#5ca5ff  --></table></tr>';		
//document.getElementById("login_panel").innerHTML='<form ><table style="margin:10px;width:730px;height:80px;font-family:tahoma,AppleGothic;font-size:9pt;border-width:0px;border:none;border-collapse:collapse;" cellpadding="0px" cellspacing="0px"><tr><td style="width:120px;background-color:#ffffff;height:20px;;font-family:tahoma,AppleGothic;font-size:12pt;color:#505050;font-weight:bold;" rowspan="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Login<input type="image" src="/img/login_submit.gif" name="submit" onclick="try_login();return false;"></td><td  style="width:70px;height:25px;background-color:#ffffff;text-align:right;align:right;">ID&nbsp;&nbsp;</td>	<td style="width:350px;background-color:#ffffff;text-align:left;align:left;"><input type="text" id="login_id" style="width:200px;height:19px;font-family:tahoma,AppleGothic;font-size:9pt;"><input type="hidden" id="rvc" value="12345"></td><td rowspan="3" id="login_submit_cell" style="background-image:url(\'/img/job_submit.gif\');cursor:hand;cursor:pointer;width:75px;"  onclick="try_login();return false;"><br><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Login</td><td id="login_cancel_cell" rowspan="3" style="background-image:url(\'/img/job_cancel.gif\');cursor:hand;cursor:pointer;width:75px;" onclick="cancel_login();return false;"><br><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Cancel</td></tr><tr><td  style="width:70px;height:25px;background-color:#ffffff;text-align:right;align:right;">Password&nbsp;&nbsp;</td><td style="background-color:#ffffff;height:25px;text-align:left;align:left;" ><input id="login_pw" type="password" style="width:200px;height:19px;font-family:tahoma,AppleGothic;font-size:9pt;"></td></tr><tr><td colspan="2" style="background-color:#ffffff;height:25px;text-align:left;align:left;;font-family:tahoma,AppleGothic;font-size:9pt;" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="" class="newpw_link"  onclick="goto_page(\'newpassword\');return false;">Forgot password? Click here.</a></td></form><!-- border color:#5ca5ff  --></table></tr>';		
//try_open_login_panel()
		
		document.getElementById("login_panel").style.backgroundImage="url('"+_i+"')";
document.getElementById("login_submit_cell").style.backgroundImage="url('"+_s+"')";
document.getElementById("login_cancel_cell").style.backgroundImage="url('"+_c+"')";
	}else{
	document.getElementById("login_panel").style.visibility="hidden";
	}
}




// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@














function test_try_login()
{
_t=document.getElementById("login_id").value;
alert("LOGIN IN : "+_t);
}










function login_ret()
{
if(req.readyState==4)
	{
	if(req.status==200)
		{
		txt=req.responseText;//alert(txt);
		eval(txt);
		}
	}
}


function try_login(t)
{
if(!validate_id(document.getElementById("login_id").value))
	{
	alert("Invalid ID format.");
	return;
	}
if(!validate_pw(document.getElementById("login_pw").value))
	{
	alert("Invalid password format.");
	return;
	}




//alert("logging in ["+document.getElementById("login_id").value+"] ["+document.getElementById("login_pw").value+"] ");
//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;
						}
				}
		}
//alert(document.getElementById('login_id').value);
if(req==null)
	{
		alert("XMLHTTP error: Unable to initialize HTTP object.");
	}else{
		var _a=new Date();var _t=_a.getTime();


	//	t="login_id="+document.getElementById('login_id').value+'&login_pw='+document.getElementById('login_pw').value;
		if(t==1)
		{

		tc="v="+document.getElementById("vcode").value+"&tm="+_t;
		}else{

		tc="id="+document.getElementById("login_id").value+"&pw="+document.getElementById("login_pw").value+"&v="+document.getElementById("vcode").value+"&tm="+_t;
		}
//alert("signup.....sent");
//alert(tc);
		req.open("POST","/userlogin",true);
		req.onreadystatechange=login_ret;
		req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		req.send(tc);


	}
}

function cancel_login()
{
document.getElementById("login_panel").style.height="0px";
document.getElementById("login_panel").style.visibility="hidden";

//document.location.href=document.getElementById("current_url").value;
}
// > 20100521 <



function goto_page(t)
{
_url=document.location.href;
//_tgt=_url.replace(/(\/(job|resume|help|newpassword|signup)\/)/,"/"+t+"/");alert(_tgt);
//_tgt=_url.replace(/(http:\/\/www.openjobfinder.com\/(job|resume|help|newpassword|signup|activate)\/)/,"/"+t+"/");//alert(_tgt);
_tgt=_url.replace(/(http:\/\/www.openjobfinder.com\/(job|resume|help|newpassword|signup|activate)\/)/,"/"+t+"/");//alert(_tgt);
document.location.href=_tgt;//"http://www.google.com";
}




function logout_ret()
{
if(req.readyState==4)
	{
	if(req.status==200)
		{
		txt=req.responseText;//alert(txt);
		eval(txt);
		}
	}
}






function try_logout()
{
//alert("logging in ["+document.getElementById("login_id").value+"] ["+document.getElementById("login_pw").value+"] ");
//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;
						}
				}
		}
//alert(document.getElementById('login_id').value);
if(req==null)
	{
		alert("XMLHTTP error: Unable to initialize HTTP object.");
	}else{
		var _a=new Date();var _t=_a.getTime();

// < 20100525 new code >
		tc="vc="+document.getElementById("vcode").value+"&tm="+_t;
	//	t="login_id="+document.getElementById('login_id').value+'&login_pw='+document.getElementById('login_pw').value;
/*		if(t==1)
		{

		tc="vc="+document.getElementById("vcode").value+"&tm="+_t;
		}else{

		tc="scode="+document.getElementById("newpw_scode").value+"&v="+document.getElementById("vcode").value+"&id="+document.getElementById("newpw_id").value+"&tm="+_t;
		}
//alert("signup.....sent");
alert(tc);*/
// > 20100525 <

		req.open("POST","/userlogout",true);
		req.onreadystatechange=logout_ret;
		req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		req.send(tc);


	}
}






function mypage_ret()
{
if(document.getElementById("mypage_panel").style.visibility!="visible"){return;}


if(req.readyState==4)
	{
	if(req.status==200)
		{
		txt=req.responseText;//alert(txt);
		if(txt=='')
			{
			alert("Login session expired.\nPlease login again.");
			document.location.reload();
			}else{
// <20100526 new code >
/*

				if(document.getElementById("login_panel").style.visibility!="visible")
					{
					document.getElementById("nav_panel").style.visibility="hidden";
					document.getElementById("login_panel").style.visibility="visible";
					document.getElementById("login_panel").innerHTML=txt;
					}else{
					document.getElementById("login_panel").style.visibility="hidden";
					}



//					document.getElementById("nav_panel").style.visibility="hidden";
					document.getElementById("mypage_panel").style.visibility="visible";
					document.getElementById("mypage_panel").style.height="300px";*/


					document.getElementById("mypage_panel").innerHTML=txt;


// > 20100526 <
			}
		}
	}
}






function get_mypage(s,p)
{
// < 20100729 new code >
// mvc code
// if(document.getElementById("mvc"))return;

// > 20100729 <


//alert("logging in ["+document.getElementById("login_id").value+"] ["+document.getElementById("login_pw").value+"] ");
//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;
						}
				}
		}
//alert(document.getElementById('login_id').value);
if(req==null)
	{
		alert("XMLHTTP error: Unable to initialize HTTP object.");
	}else{
		var _a=new Date();var _t=_a.getTime();

// < 20100525 new code >



// < 20100729 new code >
		tc="v="+document.getElementById("vcode").value+"&tm="+_t+"&mps="+s+"&mpv="+p;
//		tc="v="+document.getElementById("vcode").value+"&tm="+_t+"&mps="+s+"&mpv="+p+"&mvc="+document.getElementById("mvc").value;
// > 20100729 <




	//	t="login_id="+document.getElementById('login_id').value+'&login_pw='+document.getElementById('login_pw').value;
/*		if(t==1)
		{

		tc="vc="+document.getElementById("vcode").value+"&tm="+_t;
		}else{

		tc="scode="+document.getElementById("newpw_scode").value+"&v="+document.getElementById("vcode").value+"&id="+document.getElementById("newpw_id").value+"&tm="+_t;
		}
//alert("signup.....sent");
*/
// > 20100525 <
// alert(tc);
		req.open("POST","/mypage",true);
		req.onreadystatechange=mypage_ret;
		req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		req.send(tc);


	}
}

function open_mypage()
{
// < 20100604 new code >

				if(document.getElementById("mypage_panel").style.visibility=="visible")
					{
					document.getElementById("mypage_panel").style.height="0px";
					document.getElementById("mypage_panel").innerHTML="";
					document.getElementById("mypage_panel").style.visibility="hidden";

// < 20100626 new code >

if(document.getElementById('_nav_buf'))
{
document.getElementById('_nav_panel').innerHTML=document.getElementById('_nav_buf').value;
}
// > 20100626 <

// < 20100630 new code >
// restore



// < 20100709 commented out >
// restore_nav_bar();
// > 20100709 <
if(document.getElementById('_nav_buf')){restore_nav_bar();}

// > 20100630 <
//_newjob_restore();

					}else{
// < 20100626 new code >

if(document.getElementById('_nav_buf'))
{
// < 20100630 new code >
// hide
if(document.getElementById('_nav_buf')){hide_nav_bar();}
// > 20100630 <
//_newjob_hide();

document.getElementById('_nav_buf').value=document.getElementById('_nav_panel').innerHTML;
document.getElementById('_nav_panel').innerHTML='';
//document.getElementById('_nav_panel').innerHTML=document.getElementById('_sel_buf').value;">
}
// > 20100626 <


					document.getElementById("mypage_panel").style.visibility="visible";
					document.getElementById("mypage_panel").style.height="300px";
					get_mypage(0,0);
					//document.getElementById("mypage_panel").innerHTML=txt;
					}
// > 20100604 <


}













function validate_id(t)
{
ptrn=/^([0-9a-zA-Z_-]{1,125})@([0-9a-zA-Z-]{1,63})\.([a-zA-Z]{2,4})([a-zA-Z.]{0,20})$/;
if(ptrn.test(t)){return true;}else{return false;}
}

function validate_scode(t)
{
ptrn=/^([0-9a-zA-Z]{5})$/;
if(ptrn.test(t)){return true;}else{return false;}
}

function validate_pw(t)
{
ptrn=/^([0-9a-zA-Z]{4,25})$/;
if(ptrn.test(t)){return true;}else{return false;}
}


// < 20100604 new code >




function try_resetpw_ret()
{
if(req.readyState==4)
	{
	if(req.status==200)
		{
		txt=req.responseText;//alert(txt);
		document.getElementById("resetpw_panel").innerHTML=txt;
		}
	}
}






function try_resetpw()
{
pw=document.getElementById("rpassword").value;
rtpw=document.getElementById("rtpassword").value;

err_str="";
if(!validate_pw(pw)){err_str=err_str+"Invalid password format \n";}
if(!validate_pw(rtpw)){err_str=err_str+"Invalid re-typed password format \n";}
if(pw!=rtpw){err_str=err_str+"Pasaswords are not same \n";}

if(err_str!=""){
alert(err_str);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;
						}
				}
		}
//alert(document.getElementById('login_id').value);
if(req==null)
	{
		alert("XMLHTTP error: Unable to initialize HTTP object.");
	}else{
		var _a=new Date();var _t=_a.getTime();
		tc="vc="+document.getElementById("vcode").value+"&tm="+_t+"&pw="+pw+"&r="+document.getElementById("rpcode").value;
//alert(tc);
		req.open("POST","/tryresetpw",true);
		req.onreadystatechange=try_resetpw_ret;
		req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		req.send(tc);
	}
}


// > 20100604 <




// < 20100613 new code >

function _open_mypage_option()
{
if(document.getElementById("_mypage_option").style.visibility=="visible")
	{
	document.getElementById("_mypage_option").style.visibility="hidden";
	document.getElementById("_mypage_option").style.height="0px";
	document.getElementById("_mypage_option_form").style.visibility="visible";
	document.getElementById("_mypage_option_form").style.height="300px";
	}else{
	document.getElementById("_mypage_option").style.visibility="visible";
	document.getElementById("_mypage_option").style.height="300px";
	document.getElementById("_mypage_option_form").style.visibility="hidden";
	document.getElementById("_mypage_option_form").style.height="0px";
	}
}










function _mypage_ret()
{
if(document.getElementById("mypage_panel").style.visibility!="visible"){return;}


if(req.readyState==4)
	{
	if(req.status==200)
		{
		txt=req.responseText;//alert(txt);
		if(txt=='')
			{
			alert("Login session expired.\nPlease login again.");
			document.location.reload();
			}else{
// <20100526 new code >
/*

				if(document.getElementById("login_panel").style.visibility!="visible")
					{
					document.getElementById("nav_panel").style.visibility="hidden";
					document.getElementById("login_panel").style.visibility="visible";
					document.getElementById("login_panel").innerHTML=txt;
					}else{
					document.getElementById("login_panel").style.visibility="hidden";
					}



//					document.getElementById("nav_panel").style.visibility="hidden";
					document.getElementById("mypage_panel").style.visibility="visible";
					document.getElementById("mypage_panel").style.height="300px";*/


					document.getElementById("mypage_panel").innerHTML=txt;


// > 20100526 <
			}
		}
	}
}










function _get_mypage(s,p,t)
{
_err_str='';
_cpw=document.getElementById("_option_pw").value;
if(!validate_pw(_cpw)){_err_str='Invalid current password format.\n';}
_npw=document.getElementById("_option_npw").value;
if(!validate_pw(_npw)){_err_str='Invalid new password format.\n';}
_rnpw=document.getElementById("_option_rnpw").value;
if(!validate_pw(_rnpw)){_err_str='Invalid retyped new password format.\n';}
if(_npw!=_rnpw){_err_str='New passwords and retyped new passwords are not same.';}

if(_err_str!='')
{
alert(_err_str);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;
						}
				}
		}
//alert(document.getElementById('login_id').value);
if(req==null)
	{
		alert("XMLHTTP error: Unable to initialize HTTP object.");
	}else{
		var _a=new Date();var _t=_a.getTime();

// < 20100525 new code >
		tc="v="+document.getElementById("vcode").value+"&tm="+_t+"&mps="+s+"&mpv="+p+"&mpx="+t+"&cpw="+_cpw+"&npw="+_npw;
	//	t="login_id="+document.getElementById('login_id').value+'&login_pw='+document.getElementById('login_pw').value;
/*		if(t==1)
		{

		tc="vc="+document.getElementById("vcode").value+"&tm="+_t;
		}else{

		tc="scode="+document.getElementById("newpw_scode").value+"&v="+document.getElementById("vcode").value+"&id="+document.getElementById("newpw_id").value+"&tm="+_t;
		}
//alert("signup.....sent");
*/
// > 20100525 <
//alert(tc);
		req.open("POST","/mypage",true);
		req.onreadystatechange=_mypage_ret;
		req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		req.send(tc);


	}
}















function _change_mypw()
{




//lert(document.getElementById("_option_pw").value+" and code: "+document.getElementById("mypage_code").value);
_get_mypage(3,2,document.getElementById("mypage_code").value);

}
// > 20100613 <











// < 20100614 new code >

function ret_rm_mylist()
{
if(document.getElementById("mypage_panel").style.visibility!="visible"){return;}


if(req.readyState==4)
	{
	if(req.status==200)
		{
		txt=req.responseText;//alert(txt);
		if(txt=='')
			{
			alert("Login session expired.\nPlease login again.");
			document.location.reload();
			}else{
			//		document.getElementById("mypage_panel").innerHTML=txt;
			eval(txt);
			}
		}
	}
}

function rm_mylist(t)
{
	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;
						}
				}
		}
//alert(document.getElementById('login_id').value);
if(req==null)
	{
		alert("XMLHTTP error: Unable to initialize HTTP object.");
	}else{
		var _a=new Date();var _t=_a.getTime();

// < 20100525 new code >
		tc="v="+document.getElementById("vcode").value+"&mpi="+t;
	//	t="login_id="+document.getElementById('login_id').value+'&login_pw='+document.getElementById('login_pw').value;
/*		if(t==1)
		{

		tc="vc="+document.getElementById("vcode").value+"&tm="+_t;
		}else{

		tc="scode="+document.getElementById("newpw_scode").value+"&v="+document.getElementById("vcode").value+"&id="+document.getElementById("newpw_id").value+"&tm="+_t;
		}
//alert("signup.....sent");
*/
// > 20100525 <
//alert(tc);
		req.open("POST","/mylistrm",true);
		req.onreadystatechange=ret_rm_mylist;
		req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		req.send(tc);


	}
}



// > 20100614 <




// < 20100622 new code >



function open_newjob_panel(t)
{
	_url_country=document.getElementById("current_country").value;
	_url_location=document.getElementById("current_location").value;
//	_url_section=document.getElementById("current_section").value;
	_url_category=document.getElementById("current_category").value;
	
	
	t=document.getElementById(t);
	t.style.width="750px";
//	t.style.height="100px";
	t.style.visibility="visible";
	
	si=document.getElementById("current_country").value;
	s='';;
	s=s+"<select id='country_select'  onchange='set_country(this);return false;' style='width:190px;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;
	
	if(!_location[si]){alert("invalid country");document.location.replace("/404");return;}
	
	_location_selected=_location[si];
	si=document.getElementById("current_location").value;
	s='';;
	s=s+"<select id='location_select'  onchange='set_location(this);return false;' style='width:190px;font-family:tahoma;font-size:9pt;'>";
	for(i in _location_selected)
	{
		if(i==si)
		{
			s=s+"<option value='"+i+"' selected>"+_location_selected[i]+"</option>";
			_url_location=i;
		}else{
			s=s+"<option value='"+i+"'>"+_location_selected[i]+"</option>";
		}
	}
	s=s+"</select>";
	document.getElementById("location_cell").innerHTML=s;
	
	si=document.getElementById("current_category").value;
	s='';;
	s=s+"<select id='category_select'  onchange='set_category(this);return false;' style='width:190px;font-family:tahoma;font-size:9pt;'>";
_c_idx=0;
	for(i in _category)
	{
if(si!="all")
{
	if(_c_idx!=0){
		if(i==si)
		{
			s=s+"<option value='"+i+"' selected>"+_category[i]+"</option>";
			_url_category=i;
		}else{
			if(_category[i]!="all"){s=s+"<option value='"+i+"'>"+_category[i]+"</option>";}
		}
	}
	_c_idx++;
}else{
	if(_c_idx!=0){s=s+"<option value='"+i+"'>"+_category[i]+"</option>";}
	_c_idx++;
}
	}
	s=s+"</select>";
	document.getElementById("category_cell").innerHTML=s;
	

//	s=s+"<br><br>";
	s="";
	var n=0;
	n=document.getElementById("current_type_option").value;
	n=parseInt(n);

	if(n&1){s=s+"<input type='checkbox' id='type_fulltime' checked=true>Fulltime&nbsp;";}else{s=s+"<input type='checkbox' id='type_fulltime'>Fulltime&nbsp;";};
	if(n&2){s=s+"<input type='checkbox' id='type_parttime' checked=true>Parttime&nbsp;";}else{s=s+"<input type='checkbox' id='type_parttime' >Parttime&nbsp;";};
	if(n&4){s=s+"<input type='checkbox' id='type_freelancer' checked=true>Freelancer&nbsp;";}else{s=s+"<input type='checkbox' id='type_freelancer' >Freelancer&nbsp;";};
	if(n&8){s=s+"<input type='checkbox' id='type_other' checked=true>Other&nbsp;";}else{s=s+"<input type='checkbox' id='type_other' >Other&nbsp;";};

	s=s+"&nbsp;&nbsp;|&nbsp;&nbsp;";

	n=0;
	n=document.getElementById("current_time_option").value;
	n=parseInt(n);
	if(n&1){s=s+"<input type='checkbox' id='time_day' checked=true>Day&nbsp;";}else{s=s+"<input type='checkbox' id='time_day'>Day&nbsp;";};
	if(n&2){s=s+"<input type='checkbox' id='time_night' checked=true>Night&nbsp;";}else{s=s+"<input type='checkbox' id='time_night' >Night&nbsp;";};
	if(n&4){s=s+"<input type='checkbox' id='time_weekend' checked=true>Weekend&nbsp;";}else{s=s+"<input type='checkbox' id='time_weekend' >Weekend&nbsp;";};
	if(n&8){s=s+"<input type='checkbox' id='time_homeworking' checked=true>Home Working&nbsp;";}else{s=s+"<input type='checkbox' id='time_homeworking' >Home Working&nbsp;";};
	document.getElementById("option_cell").innerHTML=s;
	
/*	s="";
	n=document.getElementById("current_keyword").value;
	if(n.length>100){n=substring(0,99)};
	document.getElementById("keyword_input").value=n;
*/
}



function cancel_newjob()
{
_t="?";
_u="/job/"+document.getElementById("current_country").value+"/"+document.getElementById("current_location").value+"/"+document.getElementById("current_category").value+'/list/1';

if(document.getElementById("current_type_option").value!=""){_u=_u+_t+"tp="+document.getElementById("current_type_option").value;_t="&";}
if(document.getElementById("current_time_option").value!=""){_u=_u+_t+"tm="+document.getElementById("current_type_option").value;_t="&";}
document.location.href=_u;
/*
if(document.getElementById("current_keyword").value!=""){_u=_u+_t+"key="+document.getElementById("current_keyword").value;}
*/
}
// > 20100622 <





// < 20100626 new code >



function ret_job_submit()
{
//if(document.getElementById("mypage_panel").style.visibility!="visible"){return;}


if(req.readyState==4)
	{
	if(req.status==200)
		{
		txt=req.responseText;
		eval(txt);
/*
		if(txt=='')
			{
			alert("Login session expired.\nPlease login again.");
			document.location.reload();
			}else{
			//		document.getElementById("mypage_panel").innerHTML=txt;
			eval(txt);
			}
*/
		}
	}
}



function try_job_submit()
{
	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;
						}
				}
		}
//alert(document.getElementById('login_id').value);
if(req==null)
	{
		alert("XMLHTTP error: Unable to initialize HTTP object.");
	}else{
		var _a=new Date();var _t=_a.getTime();

// < 20100525 new code >
		tc="v="+document.getElementById("vcode").value+"&txv="+_t;
	//	t="login_id="+document.getElementById('login_id').value+'&login_pw='+document.getElementById('login_pw').value;
/*		if(t==1)
		{

		tc="vc="+document.getElementById("vcode").value+"&tm="+_t;
		}else{

		tc="scode="+document.getElementById("newpw_scode").value+"&v="+document.getElementById("vcode").value+"&id="+document.getElementById("newpw_id").value+"&tm="+_t;
		}
//alert("signup.....sent");
*/
// > 20100525 <


// < 20100528 new code >
tp=0;
tm=0;
flag=true;

if(document.getElementById("type_fulltime").checked){tp=tp+1;};
if(document.getElementById("type_parttime").checked){tp=tp+2;};
if(document.getElementById("type_freelancer").checked){tp=tp+4;};
if(document.getElementById("type_other").checked){tp=tp+8;};

//
if(tp==0)
	{
	flag=false;
	alert("Please select job type. (Full time / Part time / Freelancer / Other)");return;
	}//else{alert(job_type);}
//}


if(flag==true)
{
if(document.getElementById("time_day").checked){tm=tm+1;}
if(document.getElementById("time_night").checked){tm=tm+2;}
if(document.getElementById("time_weekend").checked){tm=tm+4;}
if(document.getElementById("time_homeworking").checked){tm=tm+8;}
}
//
if(tm==0)
	{
	flag=false;
	alert("Please select job time. (Day / Night / Weekend / Home Working)");return;
	}

_t_flag=0;
_t_tle='';
_t_con='';

//_t_tle=document.getElementById("").value;


// > 20100528 <

//tc=tc+"&tp="+tp+"&tm="+tm+"&con="+_country[document.getElementById("country_select").value]+"&coni="+document.getElementById("country_select").selectedIndex+"&loc="+document.getElementById("location_select").value+"&loci="+document.getElementById("location_select").selectedIndex+"&cat="+document.getElementById("category_select").value+"&cati="+document.getElementById("category_select").selectedIndex;
// < 20100701 new code >
_t_country=document.getElementById("country_select").value;
_t_location=_location[_t_country];
//alert(_t_location[document.getElementById("location_select").value]);return;
tc=tc+"&tp="+tp+"&tm="+tm+"&con="+_country[document.getElementById("country_select").value]+"&conr="+document.getElementById("country_select").value+"&coni="+document.getElementById("country_select").selectedIndex+"&loc="+_t_location[document.getElementById("location_select").value]+"&locr="+document.getElementById("location_select").value+"&loci="+document.getElementById("location_select").selectedIndex+"&cat="+encodeURIComponent(_category[document.getElementById("category_select").value])+"&catr="+document.getElementById("category_select").value+"&cati="+document.getElementById("category_select").selectedIndex;
// > 20100701 <
_t_title=document.getElementById("jobtitle").value;
_t_title=trim(_t_title);
if(_t_title.length>=255){alert("title too long");return;}
_t_title=encodeURIComponent(_t_title);
tc=tc+"&title="+_t_title;


_t_content=document.getElementById("jobcontent").value;
_t_content=trim(_t_content);
if(_t_content.length>=20000){alert("content too long");return;}
_t_content=encodeURIComponent(_t_content);
tc=tc+"&content="+_t_content;




_t_contact=document.getElementById("jobcontact").value;
_t_contact=trim(_t_contact);
if(_t_contact==""){alert("contact empty");return;}
if(_t_contact.length>=500){alert("contact too long");return;}
_t_contact=encodeURIComponent(_t_contact);
tc=tc+"&contact="+_t_contact;

if(document.getElementById("online").checked==true)
	{
	tc=tc+"&online=1";
	}else{
	tc=tc+"&online=0";
	}

//_txt=document.getElementById("jobcontent").value;


//tc=tc+"&title="+document.getElementById("jobtitle").value;
//_txt=document.getElementById("jobcontent").value;


//x_content=escape(_txt);//_txt.replace("&","\&");
//x_content=encodeURIComponent(_txt);



//tc=tc+"&content="+x_content;//document.getElementById("jobcontent").value;
//alert(tc);return;
		req.open("POST","/submitjob",true);
		req.onreadystatechange=ret_job_submit;
		req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		req.send(tc);


	}
}






function _test_form()
{
//document.getElementById("formtoken").value="2010_token_value";
try_job_submit();
}



// > 20100626 <

// < 20100629 new code >


function _uxtest()
{
tp=0;

if(document.getElementById("type_fulltime").checked){tp=tp+1;};
if(document.getElementById("type_parttime").checked){tp=tp+2;};
if(document.getElementById("type_freelancer").checked){tp=tp+4;};
if(document.getElementById("type_other").checked){tp=tp+8;};

if(tp==0)
	{
	alert("job time empty");//document.getElementById("jobcontent").value);
	return false;
	}else{
	return true;
	}
}


// > 20100629 <


// < 20100630 new code >

function restore_job_form()
{
document.getElementById("job_form_div").innerHTML=document.getElementById("_form_buf").value;
//document.getElementById("_nav_panel").innerHTML=document.getElementById("_nav_buf").value;

}


function hide_nav_bar()
{
_type_var=0;
_time_var=0;

document.getElementById("_form_country").value=document.getElementById("country_select").selectedIndex;
document.getElementById("_form_location").value=document.getElementById("location_select").selectedIndex;
document.getElementById("_form_category").value=document.getElementById("category_select").selectedIndex;

if(document.getElementById("type_fulltime").checked==true){_type_var=_type_var+1;}
if(document.getElementById("type_parttime").checked==true){_type_var=_type_var+2;}
if(document.getElementById("type_freelancer").checked==true){_type_var=_type_var+4;}
if(document.getElementById("type_other").checked==true){_type_var=_type_var+8;}
document.getElementById("_form_type").value=_type_var;

if(document.getElementById("time_day").checked==true){_time_var=_time_var+1;}
if(document.getElementById("time_night").checked==true){_time_var=_time_var+2;}
if(document.getElementById("time_weekend").checked==true){_time_var=_time_var+4;}
if(document.getElementById("time_homeworking").checked==true){_time_var=_time_var+8;}
document.getElementById("_form_time").value=_time_var;
}

function restore_nav_bar()
{
document.getElementById("country_select").selectedIndex=document.getElementById("_form_country").value;
t=document.getElementById("country_select").value;
// < 20100701 new code >
//alert(t);
//if(_country[t.value])
if(_country[t]!='')
	{
//		_url_country=t.value;
		_url_country=t;
// < 20100630 new code >
//if(document.getElementById("_form_country")){document.getElementById("_form_country").value=t.selectedIndex;}
// > 20100630 <
		update_location(document.getElementById("country_select"));


	}else{
		//document.location.replace();
		alert("error: Invalid country");
	}

//set_country('panama');
// > 20100701 <
document.getElementById("location_select").selectedIndex=document.getElementById("_form_location").value;
document.getElementById("category_select").selectedIndex=document.getElementById("_form_category").value;

_type_var=document.getElementById("_form_type").value;
if(_type_var&1){document.getElementById("type_fulltime").checked=true;}else{document.getElementById("type_fulltime").checked=false;}
if(_type_var&2){document.getElementById("type_parttime").checked=true;}else{document.getElementById("type_parttime").checked=false;}
if(_type_var&4){document.getElementById("type_freelancer").checked=true;}else{document.getElementById("type_freelancer").checked=false;}
if(_type_var&8){document.getElementById("type_other").checked=true;}else{document.getElementById("type_other").checked=false;}

_time_var=document.getElementById("_form_time").value;
if(_time_var&1){document.getElementById("time_day").checked=true;}else{document.getElementById("time_day").checked=false;}
if(_time_var&2){document.getElementById("time_night").checked=true;}else{document.getElementById("time_night").checked=false;}
if(_time_var&4){document.getElementById("time_weekend").checked=true;}else{document.getElementById("time_weekend").checked=false;}
if(_time_var&8){document.getElementById("time_homeworking").checked=true;}else{document.getElementById("time_homeworking").checked=false;}
}



function _newjob_hide()
{

document.getElementById("_form_buf").value=document.getElementById("job_form_div").innerHTML;
//alert(document.getElementById("_form_buf").value);

hide_nav_bar();
document.getElementById('_nav_buf').value=document.getElementById('_nav_panel').innerHTML;
document.getElementById('_form_title').value=document.getElementById('jobtitle').value;
document.getElementById('_form_content').value=document.getElementById('jobcontent').value;

document.getElementById("_nav_panel").innerHTML="";

document.getElementById("job_form_div").innerHTML="";
//document.getElementById("job_form_div").style.height="0px";
/*
document.getElementById("job_form_div").style.visibility="hidden";
document.getElementById("job_preview_div").style.visibility="visible";
document.getElementById("job_preview_div").style.position="absolute";
document.getElementById("job_preview_div").innerHTML="panel test";
*/
}

function _newjob_restore()
{
document.getElementById("job_form_div").innerHTML=document.getElementById("_form_buf").value;
document.getElementById('_nav_panel').innerHTML=document.getElementById('_nav_buf').value;
restore_nav_bar();
document.getElementById('jobtitle').value=document.getElementById('_form_title').value;
document.getElementById('jobcontent').value=document.getElementById('_form_content').value;
}


function preview_job()
{

// < 20100701 new code >


// > 20100701 <


document.getElementById('title_preview').innerHTML=document.getElementById('_form_title').value;
}
// > 20100630 <


/*
function set_country(t)
{
	if(_country[t.value])
	{
		_url_country=t.value;
// < 20100630 new code >
//if(document.getElementById("_form_country")){document.getElementById("_form_country").value=t.selectedIndex;}
// > 20100630 <
		update_location(t);


	}else{
		//document.location.replace();
		alert("error: invalid country");
	}
}


function set_location(t)
{
	if(_location[_url_country])
	{
		selected_location=_location[_url_country];
		if(selected_location[t.value])
		{
			_url_location=t.value;

// < 20100630 new code >
//if(document.getElementById("_form_location")){document.getElementById("_form_location").value=t.selectedIndex;}
// > 20100630 <



		}else{
			//document.location.replace();
			alert("error: invalid location");
		}
	}else{
		//document.location.replace();
		alert("error: invalid location");
	}
}




function set_category(t)
{
	if(_category[t.value])
	{
		_url_category=t.value;
// < 20100630 new code >
//if(document.getElementById("_form_category")){document.getElementById("_form_category").value=t.selectedIndex;}
// > 20100630 <
	}else{
		//document.location.replace();
		alert("error: invalid category");
	}
}




*/






// < 20100701 new code >

function show_job_preview()
{
_w=window.open("","Google","width=500,height=500");
_w.document.body.innerHTML="<div style='width:500px;height:500px;background-color:#ff0000;'>hello</div>";
}

// > 20100701 <




















































































var _job_preview_window;



function ret_job_preview()
{
//if(document.getElementById("mypage_panel").style.visibility!="visible"){return;}


if(req.readyState==4)
	{
	if(req.status==200)
		{
		txt=req.responseText;
//_w=window.open("","Google","width=500,height=500");
_job_preview_window.document.title="Job Preview";
_job_preview_window.document.body.innerHTML=txt;//"test title<br><div style='width:750px;background-color:#c0c0c0;font-family:tahoma,AppleGothic;font-size:10pt;'>"+txt+"</div>";
/*
		if(txt=='')
			{
			alert("Login session expired.\nPlease login again.");
			document.location.reload();
			}else{
			//		document.getElementById("mypage_panel").innerHTML=txt;
			eval(txt);
			}
*/
		}
	}
}



function try_job_preview()
{
	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();

// < 20100525 new code >
		tc="v="+document.getElementById("vcode").value+"&txv="+_t;

tp=0;
tm=0;
flag=true;

if(document.getElementById("type_fulltime").checked){tp=tp+1;};
if(document.getElementById("type_parttime").checked){tp=tp+2;};
if(document.getElementById("type_freelancer").checked){tp=tp+4;};
if(document.getElementById("type_other").checked){tp=tp+8;};

//
if(tp==0)
	{
	flag=false;
	alert("Please select job type. (Full time / Part time / Freelancer / Other)");return;
	}

if(flag==true)
{
if(document.getElementById("time_day").checked){tm=tm+1;}
if(document.getElementById("time_night").checked){tm=tm+2;}
if(document.getElementById("time_weekend").checked){tm=tm+4;}
if(document.getElementById("time_homeworking").checked){tm=tm+8;}
}
//
if(tm==0)
	{
	flag=false;
	alert("Please select job time. (Day / Night / Weekend / Home Working)");return;
	}

_t_flag=0;
_t_tle='';
_t_con='';

//_t_tle=document.getElementById("").value;


// > 20100528 <
// < 20100701 new code >
_t_country=document.getElementById("country_select").value;
_t_location=_location[_t_country];
//alert(_t_location[document.getElementById("location_select").value]);return;
tc=tc+"&tp="+tp+"&tm="+tm+"&con="+_country[document.getElementById("country_select").value]+"&conr="+document.getElementById("country_select").value+"&coni="+document.getElementById("country_select").selectedIndex+"&loc="+_t_location[document.getElementById("location_select").value]+"&locr="+document.getElementById("location_select").value+"&loci="+document.getElementById("location_select").selectedIndex+"&cat="+encodeURIComponent(_category[document.getElementById("category_select").value])+"&catr="+document.getElementById("category_select").value+"&cati="+document.getElementById("category_select").selectedIndex;
// > 20100701 <

//tc=tc+"&tp="+tp+"&tm="+tm+"&con="+_country[document.getElementById("country_select").value]+"&coni="+document.getElementById("country_select").selectedIndex+"&loc="+document.getElementById("location_select").value+"&loci="+document.getElementById("location_select").selectedIndex+"&cat="+document.getElementById("category_select").value+"&cati="+document.getElementById("category_select").selectedIndex;

_t_title=document.getElementById("jobtitle").value;
_t_title=trim(_t_title);
if(_t_title==""){alert("title empty");return;}
if(_t_title.length>=255){alert("title too long");return;}
_t_title=encodeURIComponent(_t_title);
tc=tc+"&title="+_t_title;


_t_content=document.getElementById("jobcontent").value;
_t_content=trim(_t_content);
if(_t_content==""){alert("content empty");return;}
if(_t_content.length>=20000){alert("content too long");return;}
_t_content=encodeURIComponent(_t_content);
tc=tc+"&content="+_t_content;




_t_contact=document.getElementById("jobcontact").value;
_t_contact=trim(_t_contact);
if(_t_contact==""){alert("contact empty");return;}
if(_t_contact.length>=500){alert("contact too long");return;}
_t_contact=encodeURIComponent(_t_contact);
tc=tc+"&contact="+_t_contact;

if(document.getElementById("online").checked==true)
	{
	tc=tc+"&online=1";
	}else{
	tc=tc+"&online=0";
	}

//_txt=document.getElementById("jobcontent").value;


//tc=tc+"&title="+document.getElementById("jobtitle").value;
//_txt=document.getElementById("jobcontent").value;


//x_content=escape(_txt);//_txt.replace("&","\&");
//x_content=encodeURIComponent(_txt);



//tc=tc+"&content="+x_content;//document.getElementById("jobcontent").value;
//alert(tc);return;
		req.open("POST","/previewjob",true);
		req.onreadystatechange=ret_job_preview;
		req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		req.send(tc);
//_job_preview_window=window.open("about:blank","","width=500,height=500");
	}
}


// < 20100702 new code >


function cache_job_nav()
{

//document.getElementById("_form_buf").value=document.getElementById("job_form_div").innerHTML;
//alert(document.getElementById("_form_buf").value);
document.getElementById("_form_country").value=document.getElementById("country_select").selectedIndex;
document.getElementById("_form_location").value=document.getElementById("location_select").selectedIndex;
document.getElementById("_form_category").value=document.getElementById("category_select").selectedIndex;
//hide_nav_bar();
//document.getElementById('_nav_buf').value=document.getElementById('_nav_panel').innerHTML;
//document.getElementById('_form_title').value=document.getElementById('jobtitle').value;
//document.getElementById('_form_content').value=document.getElementById('jobcontent').value;

//document.getElementById("_nav_panel").innerHTML="";
}

// > 20100702 <




// < 20100711 new code >


function check_text_length(t,v)
{
if(t.value.length>v)
	{
	alert('Maximum length is '+v);
	t.value=t.value.substring(0,v);
	t.focus();
	}
}





















function ret_job_reply_submit()
{
if(req.readyState==4)
	{
	if(req.status==200)
		{
		txt=req.responseText;
		eval(txt);
		}
	}
}



function try_job_reply_submit()
{
	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();
tc="v="+document.getElementById("vcode").value+"&txv="+_t;
tc=tc+"&id="+document.getElementById("post_id").value+"&title="+document.getElementById("job_reply_title").value+"&content="+document.getElementById("job_reply_content").value;
//alert(tc);
req.open("POST","/submitjobreply",true);
req.onreadystatechange=ret_job_reply_submit;
req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
req.send(tc);
}

}

// > 20100711 <








































// < 20100724 new code >

function ret_add_job_post()
{
if(req.readyState==4)
	{
	if(req.status==200)
		{
		txt=req.responseText;
		eval(txt);
//		alert(txt);
		}
	}
}



function try_add_job_post(t)
{
_ans=confirm("Add this post to your 'MyList'?              ");
if(_ans==false){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;
						}
				}
		}
if(req==null)
{
	alert("XMLHTTP error: Unable to initialize HTTP object.");
}else{
var _a=new Date();var _t=_a.getTime();
tc="v="+document.getElementById("vcode").value+"&txv="+_t;




tc=tc+"&id="+document.getElementById("post_id").value+"&title="+document.getElementById("post_title").value+"&con="+document.getElementById("current_country").value+"&loc="+document.getElementById("current_location").value+"&cat="+document.getElementById("current_category").value+"&tp="+document.getElementById("current_type_option").value+"&tm="+document.getElementById("current_time_option").value;
//tc=tc+"&pv="+t;

//tc=tc+"&id="+document.getElementById("postid").value+"&title="+document.getElementById("job_reply_title").value+"&content="+document.getElementById("job_reply_content").value;
//alert(tc);
req.open("POST","/addjobpost",true);
req.onreadystatechange=ret_add_job_post;
req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
req.send(tc);
}

}
















function open_job_reply()
{
document.getElementById("job_reply_section").style.height="400px";
document.getElementById("job_reply_section").innerHTML="\
<table style='width:750px;border-style:solid;border-width:0px;border-collapse:collapse;' cellspacing='0px' cellpadding='0px'>\
<tr><td style='width:750px;height:25px;color:#505050;font-family:tahoma,AppleGothic;font-size:9pt;background-color:#ffffff;' colspan='2'>\
&nbsp;&nbsp;Title of your resume or your name. (250 Characters limit)\
</td></tr>\
<tr><td style='width:750px;height:25px;color:#505050;font-family:tahoma,AppleGothic;font-size:9pt;background-color:#ffffff;' colspan='2'>\
<input type='text' id='job_reply_title' style='width:750px;font-family:tahoma,AppleGothic;font-size:9pt;color:#505050;border-style:solid;border-width:1px;border-color:#678198;border-collapse:collapse;' size='250'>\
</td></tr>\
<tr><td style='width:750px;height:25px;color:#505050;font-family:tahoma,AppleGothic;font-size:9pt;background-color:#ffffff;' colspan='2'>\
&nbsp;&nbsp;Copy & paste your resume. (2000 Characters limit)\
</td></tr>\
<tr><td style='width:750px;height:250px;color:#505050;font-family:tahoma,AppleGothic;font-size:9pt;background-color:#ffffff;' colspan='2'>\
<textarea id='job_reply_content' style='width:750px;height:250px;background-color:#ffffff;font-family:tahoma,AppleGothic;font-size:9pt;color:#505050;border-style:solid;border-width:1px;border-color:#678198;border-collapse:collapse;' maxlength='2000' onkeyup='check_text_length(this,2000)'></textarea>\
</td></tr>\
<tr><td style='width:750px;height:25px;color:#505050;font-family:tahoma,AppleGothic;font-size:9pt;background-color:#ffffff;' colspan='2'>\
&nbsp;&nbsp;\
</td></tr>\
<tr><td style='width:750px;height:25px;color:#505050;font-family:tahoma,AppleGothic;font-size:9pt;background-color:#ffffff;text-align:right;align:right;' colspan='2'>\
<input type='button' value='Cancel' onclick='close_job_reply();return;'>&nbsp;&nbsp;&nbsp;&nbsp;<input type='button' value='Submit Application' onclick='try_job_reply_submit();return;'>&nbsp;&nbsp;&nbsp;&nbsp;\
</td></tr>\
<tr><td style='width:750px;height:25px;color:#505050;font-family:tahoma,AppleGothic;font-size:9pt;background-color:#ffffff;tezt-align:left;align:left;' colspan='2'>\
&nbsp;&nbsp;\
</td></tr>\
</table>";
}


function close_job_reply()
{
document.getElementById("job_reply_section").innerHTML="";
document.getElementById("job_reply_section").style.height="50px";
document.getElementById("job_reply_section").innerHTML="</td></tr>\
<tr><td style='width:750px;height:25px;color:#505050;font-family:tahoma,AppleGothic;font-size:9pt;background-color:#ffffff;tezt-align:left;align:left;' colspan='2'>\
&nbsp;&nbsp;\
</td></tr>\
<tr><td id='job_reply_section' style='width:750px;height:25px;color:#505050;font-family:tahoma,AppleGothic;font-size:9pt;background-color:#ffffff;text-align:right;align:right;' colspan='2'>\
<input type='button' value='Open Resume Form' onclick='open_job_reply();return;'>&nbsp;&nbsp;&nbsp;&nbsp;\
</td></tr>\
<tr><td style='width:750px;height:25px;color:#505050;font-family:tahoma,AppleGothic;font-size:9pt;background-color:#ffffff;tezt-align:left;align:left;' colspan='2'>\
&nbsp;&nbsp;\
</td></tr></table>";
}






// > 20100724 <














// < 20100726 new code >



function signout_ret()
{
if(req.readyState==4)
	{
	if(req.status==200)
		{
		txt=req.responseText;//alert(txt);
		eval(txt);
		}
	}
}


function try_signout(t)
{
_c=confirm("Do you really want to sign out?          \n");
if(_c==false){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;
						}
				}
		}
//alert(document.getElementById('login_id').value);
if(req==null)
	{
		alert("XMLHTTP error: Unable to initialize HTTP object.");
	}else{
		var _a=new Date();var _t=_a.getTime();
		tc="v="+document.getElementById("vcode").value+"&tm="+_t;
		tc=tc+"&mvcode="+t;
//alert("signup.....sent");
//alert(tc);
		req.open("POST","/usersignout",true);
		req.onreadystatechange=signup_ret;
		req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		req.send(tc);
	}
}












function ret_repost_job()
{
if(req.readyState==4)
	{
	if(req.status==200)
		{
		txt=req.responseText;//alert(txt);
		eval(txt);
		}
	}
}


function try_repost_job()
{
	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;
						}
				}
		}
//alert(document.getElementById('login_id').value);
if(req==null)
	{
		alert("XMLHTTP error: Unable to initialize HTTP object.");
	}else{
		var _a=new Date();var _t=_a.getTime();
		tc="v="+document.getElementById("vcode").value+"&tm="+_t;
//		tc=tc+"&mvcode="+t;
		tc=tc+"&id="+document.getElementById("post_id").value;

//alert("signup.....sent");
//alert(tc);return;
		req.open("POST","/repostjobpost",true);
		req.onreadystatechange=ret_repost_job;
		req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		req.send(tc);
	}
}






function ret_disable_job()
{
if(req.readyState==4)
	{
	if(req.status==200)
		{
		txt=req.responseText;//alert(txt);
		eval(txt);
		}
	}
}


function try_disable_job()
{
	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;
						}
				}
		}
//alert(document.getElementById('login_id').value);
if(req==null)
	{
		alert("XMLHTTP error: Unable to initialize HTTP object.");
	}else{
		var _a=new Date();var _t=_a.getTime();
		tc="v="+document.getElementById("vcode").value+"&tm="+_t;
//		tc=tc+"&mvcode="+t;
		tc=tc+"&id="+document.getElementById("post_id").value;

//alert("signup.....sent");
//alert(tc);return;
		req.open("POST","/disablejobpost",true);
		req.onreadystatechange=ret_disable_job;
		req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		req.send(tc);
	}
}














function ret_enable_job()
{
if(req.readyState==4)
	{
	if(req.status==200)
		{
		txt=req.responseText;//alert(txt);
		eval(txt);
		}
	}
}


function try_enable_job()
{
	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;
						}
				}
		}
//alert(document.getElementById('login_id').value);
if(req==null)
	{
		alert("XMLHTTP error: Unable to initialize HTTP object.");
	}else{
		var _a=new Date();var _t=_a.getTime();
		tc="v="+document.getElementById("vcode").value+"&tm="+_t;
//		tc=tc+"&mvcode="+t;
		tc=tc+"&id="+document.getElementById("post_id").value;

//alert("signup.....sent");
//alert(tc);return;
		req.open("POST","/enablejobpost",true);
		req.onreadystatechange=ret_enable_job;
		req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		req.send(tc);
	}
}












function ret_delete_job_post()
{
if(req.readyState==4)
	{
	if(req.status==200)
		{
		txt=req.responseText;
		eval(txt);
//		alert(txt);
		}
	}
}



function try_delete_job_post(t)
{
_ans=confirm("Delete this post from your 'MyList'?              ");
if(_ans==false){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;
						}
				}
		}
if(req==null)
{
	alert("XMLHTTP error: Unable to initialize HTTP object.");
}else{
var _a=new Date();var _t=_a.getTime();
tc="v="+document.getElementById("vcode").value+"&txv="+_t;




tc=tc+"&id="+t;//+"&title="+document.getElementById("post_title").value+"&con="+document.getElementById("current_country").value+"&loc="+document.getElementById("current_location").value+"&cat="+document.getElementById("current_category").value+"&tp="+document.getElementById("current_type_option").value+"&tm="+document.getElementById("current_time_option").value;
//tc=tc+"&pv="+t;

//tc=tc+"&id="+document.getElementById("postid").value+"&title="+document.getElementById("job_reply_title").value+"&content="+document.getElementById("job_reply_content").value;
//alert(tc);
req.open("POST","/deletejobpost",true);
req.onreadystatechange=ret_delete_job_post;
req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
req.send(tc);
}

}




function ret_repost_job()
{
if(req.readyState==4)
	{
	if(req.status==200)
		{
		txt=req.responseText;
		eval(txt);
//		alert(txt);
		}
	}
}



function try_repost_job()
{
	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();
tc="v="+document.getElementById("vcode").value+"&txv="+_t;




//tc=tc+"&id="+t;//+"&title="+document.getElementById("post_title").value+"&con="+document.getElementById("current_country").value+"&loc="+document.getElementById("current_location").value+"&cat="+document.getElementById("current_category").value+"&tp="+document.getElementById("current_type_option").value+"&tm="+document.getElementById("current_time_option").value;
//tc=tc+"&pv="+t;

//tc=tc+"&id="+document.getElementById("postid").value+"&title="+document.getElementById("job_reply_title").value+"&content="+document.getElementById("job_reply_content").value;
//alert(tc);
req.open("POST","/repostjobpost",true);
req.onreadystatechange=ret_repost_job;
req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
req.send(tc);
}

}

function goto_job_new()
{
_tgt="http://www.openjobfinder.com/job/"+document.getElementById("current_country").value+"/"+document.getElementById("current_location").value+"/"+document.getElementById("post_category").value+"/new";
document.location.href=_tgt;
}







function ret_svp()
{
if(req.readyState==4)
	{
	if(req.status==200)
		{
		txt=req.responseText;//alert(txt);
		if(txt!=''){;eval(txt);}
//		alert(txt);
		}
	}
}




function _svp()
{
	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();
tc="v="+document.getElementById("vcode").value+"&txv="+_t;




//tc=tc+"&id="+t;//+"&title="+document.getElementById("post_title").value+"&con="+document.getElementById("current_country").value+"&loc="+document.getElementById("current_location").value+"&cat="+document.getElementById("current_category").value+"&tp="+document.getElementById("current_type_option").value+"&tm="+document.getElementById("current_time_option").value;
//tc=tc+"&pv="+t;

//tc=tc+"&id="+document.getElementById("postid").value+"&title="+document.getElementById("job_reply_title").value+"&content="+document.getElementById("job_reply_content").value;
//alert(tc);
req.open("POST","/svp",true);
req.onreadystatechange=ret_svp;
req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
req.send(tc);
}
}








function init_job_repost()
{
$_country=document.getElementById("repost_country").value;
if($_country=="")
	{
	document.location.href="http://www.openjobfinder.com/error/serverbusy";
	}else{
document.getElementById("country_select").value=document.getElementById("repost_country").value;
document.getElementById("location_select").value=document.getElementById("repost_location").value;
document.getElementById("category_select").value=document.getElementById("repost_category").value;
_tp=document.getElementById("repost_type").value;
_tm=document.getElementById("repost_time").value;
_tp=parseInt(_tp);
_tm=parseInt(_tm);

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;}
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;}

document.getElementById("jobtitle").value=document.getElementById("repost_title").value;
document.getElementById("jobcontent").innerHTML=document.getElementById("repost_content").value;
document.getElementById("jobcontact").innerHTML=document.getElementById("repost_contact").value;

if(document.getElementById("repost_online").value==1){document.getElementById("online").checked=true;}else{document.getElementById("online").checked=false;}

	}
//alert("init repost job");
}


























function check_signup_nickname_ret()
{
if(req.readyState==4)
	{
	if(req.status==200)
		{
		txt=req.responseText;//alert(txt);
		eval(txt);
		}
	}
}


function check_signup_nickname()
{
/*
if(!validate_id(document.getElementById("signup_id").value))
	{
	alert("Invalid nickname 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;
						}
				}
		}
//alert(document.getElementById('login_id').value);
if(req==null)
	{
		alert("XMLHTTP error: Unable to initialize HTTP object.");
	}else{
		var _a=new Date();var _t=_a.getTime();
		tc="v="+document.getElementById("vcode").value+"&tm="+_t+"&nickname=NICKNAME"//+document.getElementById("signup_id").value;
//alert(tc);
		req.open("POST","/userchecknickname",true);
		req.onreadystatechange=check_signup_nickname_ret;
		req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		req.send(tc);
	}
}






// > 20100726 <





// < 20100728 new code >



function update_mypost_ret()
{
if(req.readyState==4)
	{
	if(req.status==200)
		{
		txt=req.responseText;//alert(txt);
		eval(txt);
		}
	}
}





function update_mypost()
{
// USE MVCODE INSTEAD VCODE

_y=document.getElementById("mypost_year").value;
_m=document.getElementById("mypost_month").value;
//alert("year: "+_y+" / month: "+_m);




	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;
						}
				}
		}
//alert(document.getElementById('login_id').value);
if(req==null)
	{
		alert("XMLHTTP error: Unable to initialize HTTP object.");
	}else{
		var _a=new Date();var _t=_a.getTime();
//		tc="v="+document.getElementById("vcode").value+"&tm="+_t+"&nickname=NICKNAME"//+document.getElementById("signup_id").value;
//alert(tc);
tc="v="+0+"&y="+_y+"&m="+_m+"&tvc="+_t;
		req.open("POST","/userupdatemypost",true);
		req.onreadystatechange=update_mypost_ret;
		req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		req.send(tc);
	}
}









// > 20100728 <



// < 20100731 new code >
function set_month()
{
alert(document.getElementById("mypost_month").selectedIndex);
}
// > 20100731 <










