addLoadEvent = function(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
};
delConfirm = function(msg){
	var msg = msg || '确认要删除该记录';
	if(!confirm(msg)){
		return false;
	}else{
		return true;
	}
};
if(typeof($) == 'undefined'){
	$ = function(id){
		if(typeof (id) == 'object'){
			return id;
		}else{
			return document.getElementById(id);
		}
	}
}
getSelect = function(selectName){
	var select = $(selectName), len = select.options.length, i = 0;
	for(i; i < len; i++){
		if(select.options[i].selected){
			return select.options[i].value;
		}
	}
};
array_search = function(arr, value){
	var len = arr.length, i = 0, index = 0;
	for(i; i<len; i++){
		if(value == arr[i]){
			index = i;
			break;
		}
	}
	return index;
};
getPosition = function(id){
	var industry = id || parseInt(getSelect('industry'), 10);
	var pselect = $('position');
	pselect.options.length = 1;
	if(isNaN(industry)){
		return false;
	}
	var index = array_search(ITLONG.key, industry),
	position = ITLONG.cat[index]._child,
	len = position.length,
	i = 0,
	opt;
	for(i; i<len; i++){
		var opt = document.createElement("option");
		opt.value = position[i].id;
		opt.text  = position[i].name;
		pselect.options.add(opt);
	}
};
jump = function(obj){
	var opt = obj.options, len = opt.length, i = 0;
	for(i; i < len; i++){
		if(opt[i].selected){
			window.location.href = window.location.href + '?&p='+ opt[i].value;
		}
	}
};
openwinx = function (url,name,w,h)
{
	window.open(url,name,"top=100,left=400,width=" + w + ",height=" + h + ",toolbar=no,menubar=no,scrollbars=yes,resizable=no,location=no,status=no")
};