var basePath = 'http://www.thesite.co.il'	;

/***************************** jquery version ********************/
function updateSubList(controller) {
	idx = $('#mainCat').get(0).selectedIndex;
	chosenCat = $('#mainCat').get(0).options[idx].value
	url = basePath +   '/' + controller + '/updateSubList/' + chosenCat;
	$.get(url,
			function(req){
				sel = $('#secCat').get(0)
				sel.options.length = 0
				var op = req.split('~')
				for(j = 0; j < op.length; j++) {
					if(op[j].length > 1) {
						inf = op[j].split('^');
						sel[j] = new Option(inf[1], inf[0], false)
					}
				} 
				sel.selectedIndex = 0;
			}
	);
}
/*
function startValidation(formName)
{
	var v = new Validation(formName, {stopOnFirst:true, immediate:true});
}
*/	
