/*
'======================================================
' Parodia Internet Recruitment Software			
' ©1998-2008 Cactusoft Ltd. www.parodia.net		
'======================================================
' All rights reserved.							
' Use of this code is covered by the terms and	
' conditions in the license agreement. No		
' unauthorized duplication or distribution is	
' permitted. Cactusoft's copyright notices must	
' remain in the ASP sections of the code.

'Created by Dean Carslake @ Cactusoft Ltd - 02/10/2008
'======================================================
*/

//<![CDATA[	   
switch(strArea){
	case "lang":
		//Only run this if we're editing
		if(numRecordID!=0 || blnErrorOccurred) {
			if(blnDoT2 > 0){$("select#REG_T2").doChainedSelects('REG',2)};
			if(blnDoT3 > 0){setTimeout(function(){$("select#REG_T3").doChainedSelects('REG',3)},1000)};
			setTimeout(function(){$("select#CAT_T2").doChainedSelects('CAT',2)},1000)
		}
		
		/* Handles on change events, nothing to do with onload, this is handled above */
		$("select#REG_T1").change(function(){
			blnChanged = true
			$(this).doChainedSelects('REG',2)
		});
		$("select#REG_T2").change(function(){
			blnChanged = true
			$(this).doChainedSelects('REG',3)
		});
		$("select#CAT_T1").change(function(){
			blnChanged = true
			$(this).doChainedSelects('CAT',2)
		});
		break;
		
	case "cv":		
		$("select#REG_T1").change(function(){
			$(this).doChainedSelects_cv('REG',2);
		});
		$("select#REG_T2").change(function(){
			$(this).doChainedSelects_cv('REG',3);
		});
		$("select#CAT_T1").change(function(){
			$(this).doChainedSelects('CAT',2)
		});
		break;
		
	case "search":	
		//Enable the first dropdowns
		$("select#REG_T1").removeAttr("disabled");
		$("select#CAT_T1").removeAttr("disabled");
		
		if(getFieldVal('LAST_REG_T2') > 0){$("select#REG_T2").doChainedSelects('REG',2)};
		if(getFieldVal('LAST_REG_T2') > 0){setTimeout(function(){$("select#REG_T3").doChainedSelects('REG',3)},1000)};
		
		if(getFieldVal('LAST_CAT_T1') > 0){$("select#CAT_T2").doChainedSelects('CAT',2)};
		
		/* Handles on change events, nothing to do with onload, this is handled above */
		$("select#REG_T1").change(function(){
			blnChanged = true
			$(this).doChainedSelects('REG',2);
		});
		$("select#REG_T2").change(function(){
			blnChanged = true
			$(this).doChainedSelects('REG',3);
		});
		$("select#CAT_T1").change(function(){
			blnChanged = true							   
			$(this).doChainedSelects('CAT',2);
		});
		break;
		
	case "cand":	
		//Enable the first dropdowns
		$("select#REG_T1").removeAttr("disabled");
		$("select#CAT_T1").removeAttr("disabled");
		
		if(getFieldVal('LAST_REG_T2') > 0){$("select#REG_T2").doChainedSelects('REG',2)};
		if(getFieldVal('LAST_REG_T2') > 0){setTimeout(function(){$("select#REG_T3").doChainedSelects('REG',3)},1000)};
		
		if(getFieldVal('LAST_CAT_T1') > 0){$("select#CAT_T2").doChainedSelects('CAT',2)};

		
		/* Handles on change events, nothing to do with onload, this is handled above */
		$("select#REG_T1").change(function(){
			blnChanged = true
			$(this).doChainedSelects('REG',2);
		});
		$("select#REG_T2").change(function(){
			blnChanged = true
			$(this).doChainedSelects('REG',3);
		});
		$("select#CAT_T1").change(function(){
			blnChanged = true							   
			$(this).doChainedSelects('CAT',2);
		});
		break;
		
	default:
		//Only run this if we're editing
		if(numRecordID!=0 || blnErrorOccurred){
			$("select#REG_T2").doChainedSelects('REG',2)
			setTimeout(function(){$("select#REG_T3").doChainedSelects('REG',3)},1000)
			setTimeout(function(){$("select#CAT_T2").doChainedSelects('CAT',2)},1000)
		}
		
		/* Handles on change events, nothing to do with onload, this is handled above */
		$("select#REG_T1").change(function(){
			blnChanged = true
			$(this).doChainedSelects('REG',2)
		});
		$("select#REG_T2").change(function(){
			blnChanged = true
			$(this).doChainedSelects('REG',3)
		});
		$("select#CAT_T1").change(function(){
			blnChanged = true
			$(this).doChainedSelects('CAT',2)
		});
	break;
}
//]]>
