// JavaScript Document

function upload_photo(){
	ColdFusion.Window.show('photo_upload');
	document.getElementById('photo_upload_process').style.display = 'none';
	document.getElementById('photo_upload_form').style.display = '';
}

function upload_cv(){
	ColdFusion.Window.show('cv_upload');
	document.getElementById('cv_upload_process').style.display = 'none';
	document.getElementById('cv_upload_form').style.display = '';
	document.getElementById('cv_dispaly_value_right').innerHTML =' ';
}

function startphotoUpload(){
	var photo_chk=document.getElementById('photofile').value;
	if(photo_chk==''){
		document.getElementById('spn_photo_upload').innerHTML ='Select Photo';
		return false;	
	}else{
		document.getElementById('photo_upload_process').style.display = '';
		document.getElementById('photo_upload_form').style.display = 'none';
		return true;
	}
}

function stopphotoUpload(success,candphoto){
	var result = '';
	if (success == 1){
		result = '<span id="spn_photo_upload" class="frm_top_lbl">The file was uploaded successfully!<\/span><br/><br/>';
		document.getElementById('reg_photo').value=1;
		document.getElementById('reg_cand_photo_img').innerHTML = '<img src="candidate_photo\/'+candphoto+'" height="100" width="85"/><br/>';
	}else if (success == 2){
		result = '<span class="photo_file_type">Upload image file!<\/span><br/>';
		document.getElementById('reg_cand_photo_img').innerHTML = '<img src="candidate_photo\/nophoto.jpg" height="100" width="85"/><br/>';
		document.getElementById('reg_photo').value="";
	}else if (success == 3){
		result = '<span class="photo_file_type">JPG file only!<\/span><br/><br/>';
		document.getElementById('reg_cand_photo_img').innerHTML = '<img src="candidate_photo\/nophoto.jpg" height="100" width="85"/><br/>';
		document.getElementById('reg_photo').value="";
	}
	
	document.getElementById('photo_upload_process').style.display = 'none';
	document.getElementById('photo_upload_form').innerHTML = result + '<label class="frm_top_lbl">Photo: <input name="photofile" type="file" size="25"/><\/label><br\/><br\/><label><input type="submit" name="photosubmitBtn" class="sbtn" value="Upload" /><\/label>';
	document.getElementById('photo_upload_form').style.display = '';
	return true;
}

function startcvUpload(){
	var cv_chk=document.getElementById('cvfile').value;
	if(cv_chk==''){
		document.getElementById('cv_dispaly_value_right').innerHTML ='Select CV';
		return false;	
	}else{
		document.getElementById('cv_upload_process').style.display = '';
		document.getElementById('cv_upload_form').style.display = 'none';
		return true;
	}
}

function stopcvUpload(success,cvoutput){
	var result = '';
	if (success == 1){
		result = '<span id="spn_cv_upload" class="frm_top_lbl">The file was uploaded successfully!<\/span><br/><br/>';
	}
	else if(success==2){
		result = '<span id="spn_cv_upload" class="frm_top_lbl">Upload Microsft Word 2000/2003 .DOC file!<\/span><br/><br/>';
	}
	document.getElementById('cv_upload_process').style.display = 'none';
	document.getElementById('cv_upload_form').innerHTML = result + '<label class="frm_top_lbl">File: <input name="cvfile" type="file" size="25" /><\/label><br\/><br\/><label><input type="submit" name="cvsubmitBtn" class="sbtn" value="Upload" /><\/label>';
	document.getElementById('cv_upload_form').style.display = '';
	document.getElementById('reg_cvfile_content').value=cvoutput;
	return true;
}