﻿function ddlCv_onchange(val) {
        if(val == 0){
            hideCvOptions();
	    }
	    if(val == 1){
	        hideUploadCv();
	        showOnlineSet();
	    }
	    if(val == 2){
	        showUploadCv();
	        hideOnlineSet();
	    }
}
function ddlJob_onchange(val){
    if(val == 3){
        showJob();
    }else{
        hideJob();
    }  
}
function hideUploadCv(){
	        document.getElementById("uploadcv-wrapper").className = "uploadcv-hide";
}
function showUploadCv(){
	        document.getElementById("uploadcv-wrapper").className = "uploadcv-show";
}
function hideOnlineSet(){
	        var div = document.getElementById("left-wide");
	        var innerDivs = div.getElementsByTagName('DIV');
	        for(i=0; i < innerDivs.length; i++){
	            if(innerDivs[i].className == "onlineset-show"){
	                innerDivs[i].className = "onlineset-hide";
	            }
	        }
	        fillFields();
}
function showOnlineSet(){
	        var div = document.getElementById("left-wide");
	        var innerDivs = div.getElementsByTagName('DIV');
	        for(i=0; i < innerDivs.length; i++){
	            if(innerDivs[i].className == "onlineset-hide"){
	                innerDivs[i].className = "onlineset-show";
	            }
	        }
	        emptyFields();
}
function emptyFields(){
        var textAreas = document.getElementsByTagName('TEXTAREA');
        var count = 0;
        for(i=0; i < textAreas.length; i++){
            if(textAreas[i].className != "txtWant")
            {
              textAreas[i].value = "";
            }
        } 
}
function fillFields(){
        var textAreas = document.getElementsByTagName('TEXTAREA');
        var count = 0;
        for(i=0; i < textAreas.length; i++){
            if(textAreas[i].className != "txtWant")
            {
              textAreas[i].value = "N/A";
            }
        }
}
function hideJob(){
        var target = document.getElementById("txtJob");
        target.parentNode.className = "hide";
        target.value = "N/A";
}
function showJob(){
        var target = document.getElementById("txtJob");
        target.parentNode.className = "show";
        target.value = "";
}

function hideCvOptions(){
      hideUploadCv();
      hideOnlineSet();
      hideJob();
}