function showCalendar(id)
{
	var date = showModalDialog("../editor/popup_calendar.php", "", "help: no; status: no; scroll: no;");
	if (date)
	{
		eval(id).value=date;
	}
}
function showCalendar_out(id)
{
	var date = showModalDialog("../includes/popup_calendar.php", "", "help: no; status: no; scroll: no;");
	if (date)
	{
		eval(id).value=date;
	}
}
function showContact(id)
{
	open("../candidate/popup_contact.php?candidate_id="+id, "", "toolbar=no,scrollbars=no,height=240,width=420");
}
function showAddFolder(id)
{
	showModalDialog("../includes/popup_folder.php?candidate_id="+id, "", "help: no; status: no; scroll: no;");
}
function showAddEmail(id)
{
	showModalDialog("../includes/popup_email.php?candidate_id="+id, "", "help: no; status: no; scroll: no;");
}
function showGuide(file)
{
	showModalDialog(file, "", "help: no; status: no; scroll: yes;");	
}
function showCandidate(id)
{
	l=parseInt(window.screen.availWidth)/2-380;
	t=parseInt(window.screen.availHeight)/2-266;
	open("../candidate/candidate_detail.php?candidate_id="+id, "", "top="+t+",left="+l+",toolbar=no, status=no, scrollbars=yes, height=560,width=760");	
}
function showVacancy(id)
{
	l=parseInt(window.screen.availWidth)/2-380;
	t=parseInt(window.screen.availHeight)/2-266;
	open("../vacancy/vacancy_detail.php?vacancy_id="+id, "", "top="+t+",left="+l+",toolbar=no, status=no, scrollbars=yes,height=560,width=760");	
}
function image_open(image_loc,img)
{
  HTML = "<html><title>Zoom out image</title><style>body{margin:0px 0px 0px 0px}</style><body onBlur='top.close()'><img src='"+ image_loc +"' border=0 name=load_image onLoad='window.resizeTo(document.load_image.width+10,document.load_image.height+30);window.moveTo(parseInt(window.screen.availWidth)/2-parseInt(document.load_image.width+10)/2,parseInt(window.screen.availHeight)/2-parseInt(document.load_image.height+30)/2)'></body></html>";
  popupImage = window.open('','_blank','toolbar=no,scrollbars=no');
  popupImage.document.open();
  popupImage.document.write(HTML);
  popupImage.document.close();
}
function doMark(id)
{
	st=eval('document.all.'+id);
	if(st.className=='cellcheck')
		st.className='celluncheck';
	else
		st.className='cellcheck';
}
function doOpen(file,field,show)
{
	open(file+'?return='+field+'&show='+show,'','width=350,height=350,top=0,left=0,scrollbars,status,resize');
	return false;
}
function doOpenWindow(file,width,height,top,left)
{
	if(width=="")
		width=460;
	if(height=="")
		height=460;
	if(top=="")
		top=0;
	if(left=="")
		left=0;
	open(file,'','width='+width+',height='+height+',top='+top+',left='+top+',scrollbars,status,resize');
	return false;
}

function openImage(vLink, vHeight, vWidth)
{
	var sLink = (typeof(vLink.href) == 'undefined') ? vLink : vLink.href;

	if (sLink == '')
	{
		return false;
	}

	winDef = 'status=no,resizable=no,scrollbars=no,toolbar=no,location=no,fullscreen=no,titlebar=yes,height='.concat(vHeight).concat(',').concat('width=').concat(vWidth).concat(',');
	winDef = winDef.concat('top=').concat((screen.height - vHeight)/2).concat(',');
	winDef = winDef.concat('left=').concat((screen.width - vWidth)/2);
	newwin = open('', '_blank', winDef);

	newwin.document.writeln('<body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0">');
	newwin.document.writeln('<a href="" onClick="window.close(); return false;"><img src="', sLink, '" alt="', 'Dong lai', '" border=0></a>');
	newwin.document.writeln('</body>');

	if (typeof(vLink.href) != 'undefined')
	{
		return false;
	}
}
function openCenter(vLink,vWidth,vHeight)
{
	l=parseInt(window.screen.availWidth)/2-parseInt(vWidth)/2;
	t=parseInt(window.screen.availHeight)/2-parseInt(vHeight)/2;	
	open(vLink,'','top='+t+',left='+l+',scrollbars,width='+vWidth+',height='+vHeight);	
}

function moveFromTo(the_form,IDRemoveOut,IDAddIn)
{
 	ListAddIn = document.forms[the_form].elements[IDAddIn];;
 	ListRemoveOut = document.forms[the_form].elements[IDRemoveOut];
	for (i = ListRemoveOut.length - 1;i >= 0;i--)
	{
		if (ListRemoveOut.options[i].selected == true)
		{
			objTemp = new Option(ListRemoveOut.options[i].text,ListRemoveOut.options[i].value);
			ListAddIn.add(objTemp);
			ListRemoveOut.remove(i);
		}				
	}
   i = 0;
   lenListAddIn=ListAddIn.length;
	while(i<lenListAddIn)
	{
		for(j=0;j<ListAddIn.length;j++)
		{
			if((j!=i)&&(ListAddIn.options[j].value==ListAddIn.options[i].value))
			{
				ListAddIn.remove(i);
				break;
			}
		}
		i++;
		lenListAddIn=ListAddIn.length;
	}	
}