
function initCatNav(){
	iwCatNavOff();
	Event.observe('iwCatNavOut', 'mouseover', iwCatNavOff, false);
	Event.observe('iwCatNavOut1', 'mouseover', iwCatNavOff, false);
	Event.observe('iwCatNavA', 'mouseover', iwCatNavOn, false);
}

function iwCatNavOn() {
	$('iwCatNav').show();
	$('iwCatNavOut').show();
	$('iwCatNavOut1').show();
}

function iwCatNavOff() {
	$('iwCatNav').hide();
	$('iwCatNavOut').hide();
	$('iwCatNavOut1').hide();
}

function iwConnectHelp(controlName) {
	iwHelpCollapse();
	controlName=controlName+'_help';
	if($(controlName)) {
		$(controlName).show();
	}
}

function iwHelpToggle(obj) {
	$(obj).toggle();
}

function iwHelpCollapse() {
	for (i=0;i<iwHelpPanelList.length;i++) {
		$(iwHelpPanelList[i]).hide();
	}	
}

var lastAjaxResponse = '';

function iwRequest(serverMethod,objectName,params) {
	if(params===undefined) {
		params='';
	}
	var url = '/js/iwAjax.php';
	var pars = 'serverMethod='+serverMethod+'&'+'objectName='+objectName+'&'+'objectValue='+escape($F(objectName))+'&params='+escape(params);
	var myAjax = new Ajax.Request(url, {asynchronous: false, method: 'get', parameters: pars, onComplete: captureResponse});
}

function captureResponse(originalRequest) {
	lastAjaxResponse=originalRequest.responseText;
}

function iwAjaxBlur(serverMethod,objectName,targetElement){
	var url = '/js/iwAjax.php';
	var pars = 'serverMethod='+serverMethod+'&'+'objectName='+objectName+'&'+'objectValue='+escape($F(objectName))+'&mode=4';
	var myAjax = new Ajax.Updater(targetElement, url, {method: 'get', parameters: pars, evalScripts: true});
}

function iwAjax(serverMethod,objectName,targetElement,params){
	if(params===undefined) {
		params='';
	}
	var url = '/js/iwAjax.php';
	var pars = 'serverMethod='+serverMethod+'&'+'objectName='+objectName+'&'+'objectValue='+escape($F(objectName))+'&params='+escape(params);
	var myAjax = new Ajax.Updater(targetElement, url, {method: 'get', parameters: pars, evalScripts: true});
}

function fill_ajax_input(listControl,inputControl,codeControl) {
	var idx = $(listControl).selectedIndex;
	var selected_text = $(listControl).options[idx].text;
	var ajaxElement = 'ajax_'+inputControl;
	$(inputControl).value = selected_text;
	$(codeControl).value = $F(listControl);
	$(ajaxElement).innerHTML = '<!-- -->';
}

function match_ajax_input(codeControl,keyVal) {
	$(codeControl).value = keyVal;
}

function getMT() {
	var d = new Date().getTime();
	return(d);
}

