function jqueryDefaultAjax(url,params,target,show,type,resultType,additionalFunction)
{

	if(is_array(params) || is_object(params))
		params['ajax'] = 1;
	else
		params = params + '&ajax=1';

	if(type == 'post')
		jQuery.post(url, params, function(data){jqueryDefaultAjaxReturn(data,target,show,resultType,additionalFunction)});
	else
		jQuery.get(url, params, function(data){jqueryDefaultAjaxReturn(data,target,show,resultType,additionalFunction)});
}

function jqueryDefaultAjaxReturn(data,target,show,resultType,additionalFunction)
{
	if(checkSessionExpire(data) == true)
	{ 
		jQuery(location).attr('href',defaultUrl);
		return;
	}
	
	if(checkAjaxError(data) == false)
	{
		if(resultType == 'default')
			jQuery(target).html(data);
		if(show == 1)
			jQuery(target).show();
		if(additionalFunction)
			additionalFunction();
	}
	else
		alert(general_ajax_error);
}

function is_array(obj) {
    if (obj.constructor.toString().indexOf("Array") == -1)
        return false;
    else
        return true;
}

function is_object(obj) {
    if (obj.constructor.toString().indexOf("Object") == -1)
        return false;
    else
        return true;
}

function explode(string,exploder)
{
	string = string + exploder;
	return string.split(exploder);
}

function multipleOne(content,id)
{
	content = explode(content,",");
	if(id != "")
		jQuery(id).val(content[0]);
	return content[0];
}

var popupWindowVar;
function popupWindow(url,name,features){
	if(popupWindowVar&&!popupWindowVar.closed){
		popupWindowVar.close();
	}
	var breite=features.substring(6,features.indexOf(","));
	//alert(breite);
	var hoehe=features.substring(features.indexOf("height=")+7,features.length);
	//alert(hoehe);
	var links=(screen.availWidth/2-breite/2);
	var oben=(screen.availHeight/2-hoehe/2);
	features+=",top="+oben+",left="+links;
	//alert(features);
	popupWindowVar=window.open(url,name,features);

}

