/**
*基础js控制工具
*/
var Base={
	config:{
		path:'/',
		idSeed:0
	},
	Msg:{
		emptyText:'<span style="color:red;">不能为空</span>',
		numberOnly:'<span style="color:red;">只能输入数字</span>',
		urlOnly:'<span style="color:red;">不合法的URL</span>',
		right:'<span style="color:green;">输入正确</span>'
	},
	/**
	 * 改变el背景，边框等颜色#FFFFCE
	 *验证成功,背景:#DDFFDD，浅绿色,边框:#009900,重绿色
     *警告:背景:#FFFFCE,浅黄色,边框:#F0C000,重黄色
     *工业蓝边框及背景：边框:#3C78B5,背景:#D8E4F1
     *红色警报:边框:#CC0000,背景:#FFCCCC
	 */
	Color:{
		config:{
			success:{'background-image':'url("/images/icons/accept.png")',
                   'background-repeat':'no-repeat',
                   'background-position': '5px',
                   'text-indent':'25px',
                   'background-color':'#DDFFDD',
                   'border-color':'#009900'
                    },
			error:{'background-image':'url("/images/icons/exclamation.png")',
                   'background-repeat':'no-repeat',
                   'background-position': '5px',
                   'text-indent':'25px',
                   'background-color':'#FFCCCC',
                   'border-color':'#CC0000'
                    },
			tip:{'background-image':'url("/images/icons/error_delete.png")',
                   'background-repeat':'no-repeat',
                   'background-position': '5px',
                   'text-indent':'25px',
                   'background-color':'#FFFFCE',
                   'border-color':'#F0C000'
                    },
			factory:{'background-image':'url("/images/icons/accept.png")',
                   'background-repeat':'no-repeat',
                   'background-position': '5px',
                   'text-indent':'25px',
                   'background-color':'#D8E4F1',
                   'border-color':'#3C78B5'
                    }
		},
		change:function(el,type){
			if(type && type!=null && type!=''){
				if(type==='success'){
					Base.Color.success(el);
				}else if(type==='error'){
					Base.Color.error(el);
				}else if(type==='tip'){
					Base.Color.tip(el);
				}else if(type==='factory'){
					Base.Color.factory(el);
				}
			}
		},
		/**
		 * 成功,浅绿色
		 */
		success:function(el){
			$(el).css(Base.Color.config.success);
		},
		/**
		 * 失败，浅红色，警告
		 */
		error:function(el){
			$(el).css(Base.Color.config.error);
		},
		/**
		 * 提示,浅黄色
		 */
		tip:function(el){
			$(el).css(Base.Color.config.tip);
		},
		/**
		 * 工业色：蓝色
		 */
		 factory:function(el){
		 	$(el).css(Base.Color.config.factory);
		 }
	},
	Browser:{
		getPageSize:function() {
			var xScroll, yScroll;
			if (window.innerHeight && window.scrollMaxY) {	
				xScroll = window.innerWidth + window.scrollMaxX;
				yScroll = window.innerHeight + window.scrollMaxY;
			} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
				xScroll = document.body.scrollWidth;
				yScroll = document.body.scrollHeight;
			} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
				xScroll = document.body.offsetWidth;
				yScroll = document.body.offsetHeight;
			}
			var windowWidth, windowHeight;
			if (self.innerHeight) {	// all except Explorer
				if(document.documentElement.clientWidth){
					windowWidth = document.documentElement.clientWidth; 
				} else {
					windowWidth = self.innerWidth;
				}
				windowHeight = self.innerHeight;
			} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
				windowWidth = document.documentElement.clientWidth;
				windowHeight = document.documentElement.clientHeight;
			} else if (document.body) { // other Explorers
				windowWidth = document.body.clientWidth;
				windowHeight = document.body.clientHeight;
			}	
			// for small pages with total height less then height of the viewport
			if(yScroll < windowHeight){
				pageHeight = windowHeight;
			} else { 
				pageHeight = yScroll;
			}
			// for small pages with total width less then width of the viewport
			if(xScroll < windowWidth){	
				pageWidth = xScroll;		
			} else {
				pageWidth = windowWidth;
			}
			arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight);
			return arrayPageSize;
		},
	 /**
      * 取得屏幕可用工作区域宽度
      */
      getScreenAvailWidth:function(){
      	return window.screen.availWidth;
      },
      /**
       * 取得屏幕可用工作区域高度
       */
      getScreenAvailHeight:function(){
      	return window.screen.availHeight;
      },
      /*
       * 取得网页可见区域宽
       */
      getClientWidth:function(){
      	 return document.body.clientWidth;
      },
      /**
       * 取得网页可见区域高
       */
       getClientHeight:function(){
       	  return document.body.clientHeight;
       },
       /**
        * 取得网页可见区域宽(包括边线 )
        */
        getOffsetWidth:function(){
        	return document.body.offsetWidth;
        },
        /**
         * 取得网页可见区域高(包括边线)
         */
         getOffsetHeight:function(){
         	return document.body.offsetHeight;
         },
         /**
          * 取得正文全文宽度
          */
          getBodyScrollWidth:function(){
          	 return document.body.scrollWidth;
          },
          /**
           * 全文高度
           */
          getBodyScrollHeight:function(){
      	     return document.body.scrollHeight;
          },
           /**
            * 取得网页被卷去的高
            */
           getScrollTop:function(){
          	return document.body.scrollTop;
           },
           /**
            * 取得网页被卷去的左
            */
           getScrollLeft:function(){
        	 return document.body.scrollLeft;
           },
           /**
            * 网页正文部分上
            */
           getScreenTop:function(){
         	 return window.screenTop;
           },
            /**
             * 网页正文部分左
            */
           getScreenLeft:function(){
          	 return window.screenLeft;
           },
          /**
           * 屏幕分辨率宽
           */
           getScreenWidth:function(){
           	return window.screen.width;
           },
           /**
            * 屏幕分辨率高
            */
            getScreenHeight:function(){
            	return window.screen.height;
            },
            openNewWin:function(url,title,width,height){
            	if(!width){
            		width=Base.Browser.getScreenAvailWidth()*0.618;
            	}
            	if(!height){
            		height=Base.Browser.getScreenAvailHeight()*0.618;
            	}
            	if(width>Base.Browser.getScreenAvailWidth()){
            		width=Base.Browser.getScreenAvailWidth()*0.8;
            	}
            	if(height>Base.Browser.getScreenAvailHeight()){
            		height=Base.Browser.getScreenAvailHeight()*0.8;
            	}
            	var top=0;
		        var left=0;
		        var screenHeight= window.screen.availHeight;
	            var scrollTop=document.body.scrollTop;
	           var winHeight=height;
	           if(top===0){
	    	     if(screenHeight>=winHeight){
	        	   top=scrollTop+(screenHeight-winHeight)*(1-0.618)*0.5;
	            }else{
	        	  top=scrollTop+screenHeight/4*(1-0.618);
	             }
	           }
	        if(left===0){
	    	  var windowWidth =  window.screen.availWidth;
	    	  if(windowWidth>width){
	    		left=(windowWidth-width)*0.5;
	    	  }else{
	    		left=0;
	    	   }
	          }
//            	var config='top='+top+',left='+left+',width='+width+',height='+height+',scrollbars=no,resizable=no,location=no,toolbar=no,status=no';
                var win=window.open(url,'','top='+top+',left='+left+',width='+width+',height='+height+',scrollbars=no,resizable=yes,location=no,toolbar=no,status=no');
//            	var wintt=window.open('http://sohu.com','sohu',"top=" + (screen.height-width)/2 + ",left=" + (screen.width-width)/2 + ",width=" + width + ",height=" + height + ",scrollbars=yes,resizable=yes,location=no,toolbar=no,status=no");
            	win.focus();
            	
            },
         openAllNewWin:function(url,title,width,height,scrollbars,resizable){
            	if(!width){
            		width=Base.Browser.getScreenAvailWidth()*0.618;
            	}
            	if(!height){
            		height=Base.Browser.getScreenAvailHeight()*0.618;
            	}
            	if(width>Base.Browser.getScreenAvailWidth()){
            		width=Base.Browser.getScreenAvailWidth()*0.8;
            	}
            	if(height>Base.Browser.getScreenAvailHeight()){
            		height=Base.Browser.getScreenAvailHeight()*0.8;
            	}
            	var top=0;
		        var left=0;
		        var screenHeight= window.screen.availHeight;
	            var scrollTop=document.body.scrollTop;
	           var winHeight=height;
	           if(top===0){
	    	     if(screenHeight>=winHeight){
	        	   top=scrollTop+(screenHeight-winHeight)*(1-0.618)*0.5;
	            }else{
	        	  top=scrollTop+screenHeight/4*(1-0.618);
	             }
	           }
	        if(left===0){
	    	  var windowWidth =  window.screen.availWidth;
	    	  if(windowWidth>width){
	    		left=(windowWidth-width)*0.5;
	    	  }else{
	    		left=0;
	    	   }
	          }
            	//var config=',scrollbars='+scrollbars+',resizable='+resizable+',location=no,toolbar=no,status=no';
            	//alert(config);
                var win=window.open(url,'','top='+top+',left='+left+',width='+width+',height='+height+',scrollbars='+scrollbars+',resizable='+resizable+',location=no,toolbar=no,status=no');
//            	var wintt=window.open('http://sohu.com','sohu',"top=" + (screen.height-width)/2 + ",left=" + (screen.width-width)/2 + ",width=" + width + ",height=" + height + ",scrollbars=yes,resizable=yes,location=no,toolbar=no,status=no");
            	win.focus();
            	
            }
	},
	validate:{
		isEmpty:function(arg0){
			
		}
	},
	Tools:{
		/**
          * 生成随机整数
          */
         random:function(min,max){
         	var range=max-min;
         	var rand=Math.random();
         	return (min+Math.round(rand*range));
         },
         /**
          * 生成随机节点ID
          */
          id:function(prefix){
            var id='';
            if(prefix!='undefined' && prefix!=null &&prefix!=''){
              id=prefix+'-';
            }else{
              id='FaceYe-';
            }
          	var randNum=Base.Tools.random(100,999);
          	id+=randNum;
          	id+='-';
          	id+=++Base.config.idSeed;
          	return id;
          }
	},
	/**
	*基于ajax 的安全控制
	*/
	Security:function(data,callback){
		data=$.parseJSON(data);
       if(data){
		 if(data[0]){
         if(data[0].isAllow===false){
           var msg=new Msg({msg:'嘿,伙计,你没有权限使用本功能,请联系管理员.<br/>E_mail:ecsun_song@staff.easou.com',isFadeOut:false,width:200,height:100});
		   msg.show();
		 }
		 }
		   if(callback!=null){
            callback();
	       }
	      return false;
	   }
	   return true;
	}
};
 /**
	 * 构造StringBuffer 对像,解决字符串相加效率低下.
	 */
 var StringBuffer=function(arg0){
 	 this.data=new Array();
 	 if(''!=arg0&&null!=arg0){
 	 	this.data.push(arg0);
 	 }
 };
 StringBuffer.prototype={
 	append:function(arg0){
 	 this.data.push(arg0);
 	 return this;
   },
   toString:function(){
 	 return this.data.join("");
   }
 };
    /**
	 * 弹窗
	 */
var Win=function(config){
	 this.conf={};
	 this.mask=null;
	 this.init(config);
	};
Win.prototype={
	 conf:{},
	 mask:{},
	 initConf:function(){
	 	var _conf={
	 	id:'',
	 	width:'200',
	 	height:'100',
	 	modal:false,
	 	autoHeight:false,
	 	autoWidth:false,
	 	top:'',
	 	left:'',
	 	title:'',
	 	header:true,
	 	titleContainerId:'win-title-id',
	 	contentBodyId:'win-content-id',
	 	closeButtonId:'win-colose-button',
	 	contentCss:'',
	 	titleCss:'',
	 	containerCss:''
	   };
	   $.extend(this.conf,_conf);
	 },
	 init:function(config){
	 	this.initConf();
	 	if(config){
	 	 $.extend(this.conf,config);
	 	}
	 	if(this.getId()){
	 		$('#'+this.getId()).remove();
	 	}
	 	this._init();
	 	this.addListeners();
	 },
	_init:function(){
		var html=new StringBuffer();
		html.append('<div id="'+this.getId()+'">');
		if(this.isHeader()){
			html.append('<div id="'+this.getTitleContainerId()+'">');
			html.append('<div class="left" style="margin-left:5px;">');
			html.append(this.getTitle());
			html.append('</div>');
			html.append('<div class="right" id="'+this.getCloseButtonId()+'" style="cursor:pointer;text-align:center;width:20px;heigth:20px;color:red;">');
			html.append('X');
			html.append('</div>')
			html.append('</div>');
		}
		html.append('<div id="'+this.getContentContainerId()+'"></div>');
		html.append('</div>');
		$(document.body).append(html.toString());
		this.initDefaultCss();
		this.appendExtendsCss();
	},
	
	/**
	 * 设置win默认样式
	 */
	initDefaultCss:function(){
		var container=this.getContainer();
		var titleContainer=this.getTitleContainer();
		var contentContainer=this.getContentContainer();
		container.css({
			           overflow:'hidden',
			           position: 'absolute',
			           display:'none',
			           width:this.getWidth(),
			           height:this.getHeight(),
			           top:this.getTop(),
			           left:this.getLeft(),
			           border:'1px solid #90ABC4',
			           'z-index':'1000',
			           'background-color':'#F1F6FB',
			           'font-family':'verdana,Arial,tahoma,宋体,helvetica'
			           });
	   titleContainer.css({
	   	  'text-align': 'left',
	      'font-size': '12px',
	       height: '22px',
	      'line-height': '20px',
	       color: '#3D5376',
	       valign: 'middle',
	      'font-weight': 'bold',
	      'background-color':'#F1F6FB',
	      'border-bottom': '1px solid #90ABC4'
	   });
	   contentContainer.css({
	   	  overflow:'hidden',
	      'text-align': 'left',
	      padding:'5 5 5 5',
	      'font-size':'12px',
	      'word-wrap':'break-word',
	      'background-color':'white',
 	      'word-break':'break-all'
	   });
	},
	appendExtendsCss:function(){
		if(this.getContainerCss()!=''){
			this.getContainer().css(this.getContainerCss());
		}
		if(this.getTitleCss()!=''){
			this.getTitleContainer().css(this.getTitleCss());
		}
		if(this.getContentCss()!=''){
			this.getContentContainer().css(this.getContentCss());
		}
	},
	/**
	 * 添加监听
	 */
	addListeners:function(){
		this.getTitleContainer().find('#'+this.getCloseButtonId()).bind('click',function(){
		   $(this).parent().parent().remove();
//		   win.remove();
		});
	},
	getContainer:function(){
		return $('#'+this.getId());
	},
	getContentContainer:function(){
		return this.getContainer().find('#'+this.getContentContainerId());
	},
	getTitleContainer:function(){
		return this.getContainer().find('#'+this.getTitleContainerId());
	},
	/**
	 * 展现
	 */
	show:function(offset,callback){
		var top,left;
		if(offset){
			if(offset.top){
				this.conf.top=offset.top;
			}
			if(offset.left){
				this.conf.left=offset.left;
			}
		}
		top=this.conf.top;
		left=this.conf.left;
		var screenHeight= window.screen.availHeight;
	    var scrollTop=document.body.scrollTop;
	    var winHeight=this.getHeight();
	    if(top===''){
	    	if(screenHeight>=winHeight){
	        	top=scrollTop+(screenHeight-winHeight)*(1-0.618)*0.5;
	        }else{
	        	top=scrollTop+screenHeight/4*(1-0.618);
	        }
	        this.conf.top=top;
	    }
	    if(left===''){
	    	var windowWidth =  window.screen.availWidth;
	    	if(windowWidth>this.getWidth()){
	    		left=(windowWidth-this.getWidth())*0.5;
	    	}else{
	    		left=0;
	    	}
	    	this.conf.left=left;
	    }
		var c=this.getContainer();
		c.css({
			top:this.getTop(),
			left:this.getLeft()
		});
		if(this.isModal()){
			this.getMask().show();
			c.show('fast',callback)
		}else{
		  c.show('fast',callback);
		}
	},
	/**
	 * 添加内容
	 */
	addContent:function(content){
		this.getContentContainer().append(content);
	},
	/**
	*清空内容
	*/
	empty:function(){
	  this.getContentContainer().empty();
	},
	/**
	 * 销毁
	 */
	remove:function(){
		if(this.isModal()){
			this.getMask().remove();
		}
		this.getContainer().remove();
	},
	getId:function(){
		if(this.conf.id===''){
			this.conf.id=Base.Tools.id('win');
		}
		return this.conf.id;
	},
	getTitleContainerId:function(){
		return this.conf.titleContainerId;
	},
	getContentContainerId:function(){
		return this.conf.contentBodyId;
	},
	getWidth:function(){
		if(this.isAutoWidth()){
			return 'auto';
		}else{
		   return this.conf.width;
		}
	},
	getHeight:function(){
		if(this.isAutoHeight()){
		  return 'auto';
		}else{
		  return this.conf.height;
		}
	},
	isModal:function(){
		return this.conf.modal;
	},
	getTop:function(){
		return this.conf.top;
	},
	getLeft:function(){
		return this.conf.left;
	},
	getTitle:function(){
		return this.conf.title;
	},
	getContainerCss:function(){
		return this.conf.containerCss;
	},
	getTitleCss:function(){
		return this.conf.titleCss;
	},
	getContentCss:function(){
		return this.conf.contentCss;
	},
	getCloseButtonId:function(){
		return this.conf.closeButtonId;
	},
	getMask:function(){
		if(this.mask===null){
			this.mask=new Mask();
		}
		return this.mask;
	},
	isHeader:function(){
		return this.conf.header;
	},
	isAutoHeight:function(){
		if(this.conf.autoHeight){
			return true;
		}else{
			return false;
		}
	},
	isAutoWidth:function(){
		if(this.conf.autoWidth){
			return true;
		}else{
			return false;
		}
	}
};
/**
 * 遮罩
 */
var Mask=function(config){
	this.conf={};
	this.init();
};
Mask.prototype={
	conf:{},
	initConf:function(){
		var _conf={
	       	id:''
	      };
	    $.extend(this.conf,_conf);
	},
	init:function(){
		this.initConf();
		var html=new StringBuffer();
		html.append('<div id="'+this.getId()+'">');
		html.append('</div>');
		$(document.body).append(html.toString());
	},
	show:function(callback){
		this.getEl().css({
			'background-color':'#666666',
 	     	position: 'absolute',
 	     	top:0,
 	     	left:0,
 	     	height:Base.Browser.getBodyScrollHeight(),
 	     	width:Base.Browser.getScreenAvailWidth(),
 	     	opacity:0.3
		});
		this.getEl().fadeIn('fast',callback);
	},
	remove:function(callback){
		this.getEl().fadeOut('fast',function(){
			$(this).remove();
			if(callback){
			   callback();
		      }
		  });
		
	},
	getEl:function(){
		return $('#'+this.getId());
	},
	getId:function(){
		var id=this.conf.id;
		if(id===''){
			id=Base.Tools.id('mask');
			this.conf.id=id;
		}
		return id;
	}
};
/**
*消息提示
*/
var Msg=function(config){
	this.conf={};
	this.init(config);
};
Msg.prototype={
	conf:{},
	initConf:function(config){
		var _conf={
	       	id:'',
			width:150,
			height:80
	      };
	    $.extend(this.conf,config);
	},
	init:function(config){
		this.initConf(config);
		
//		$(document.body).append(html.toString());
	},
	getId:function(){
		var id='EASOU-MSG-SHOW-ID';
		if(this.conf && this.conf.id){
			id=this.conf.id;
		}
		return id;
	},
	getWidth:function(){
		var width;
       if(this.conf && this.conf.width){
          width=this.conf.width;
	   }else{
          width:150;
	   }
	   return width;
	},
	getHeight:function(){
       var height=80;
	   if(this.conf && this.conf.height){
         height=this.conf.height;
	   }
	   return height;
	},
	isFadeOut:function(){
      var isFadeOut=true;
	  if(this.conf.isFadeOut!==undefined && this.conf.isFadeOut!==null && this.conf.isFadeOut!=='' && !this.conf.isFadeOut){
        isFadeOut=false;
	  }
	  return isFadeOut;
	},
	show:function(offset){
		var html=new StringBuffer();
		html.append('<div class="content">');
		html.append(this.conf.msg);
		html.append('</div>');
		var height=this.getHeight();
		var width=this.getWidth();
		var id=this.getId();
		var win=new Win({
			    id:id,
				width:width,
				height:height,
				title:'提示',
				containerCss:{
					border:'1px solid #F0C000',
					'background-color':'#FFFFCE'
				},
				titleCss:{
				    'border-bottom': '1px solid #F0C000',
					'background-color':'#FFFFCE'
				}
			});
		win.addContent(html.toString());
		if(this.isFadeOut()){
		  win.show(offset,function(){$('#'+win.getId()).fadeOut(20000);});
		}else{
          win.show(offset,null);
		}
	}
};
 /**
	 * 数据校验
	 */
 var V={
 /**
	 * 长度校验 arg0:待校验字符串 [arg1]:最小长度
	 */
    minLength:function(arg0,arg1){
     var result=false;
     if(''!=arg0&&null!=arg0&&arg0!='undefined'){
       var length=arg0.length;
       if(null!=arg1&&''!=arg1&&arg1!='undefined'){
         if(length>=arg1){
           result=true;
         }
       }
     }
      return result;
    },
    length:function(arg0){
      var length=0;
      if(V.isNotEmpty(arg0)){
    	 length=arg0.length;  
      }
      return length;
    },
    /**
	 * 最大长度校验 arg0:待校验字符串 arg1:最大长度
	 */
    maxLength:function(arg0,arg1){
       var result=true;
       if(''!=arg0&&null!=arg0&&arg0!='undefined'){
         var length=arg0.length;
         if(null!=arg1 && ''!=arg1 && arg1!='undefined'){
           if(length>arg1){
             result=false;
           }
         }
       }
       return result;
    },
    isEmpty:function(arg0){
      var result=false;
      if(!arg0||null===arg0||''===arg0||'undefined'===arg0||undefined===arg0){
        result=true;
        }
      return result;
    },
    isNotEmpty:function(arg0){
      var result=false;
      if(arg0&&''!=arg0&&null!=arg0&&'undefined'!=arg0&&undefined!=arg0){
        result=true;
      }
      return result;
    },
    filter:function(arg0,arg1){
    	if(''!=arg0 && null!=arg0 && 'undefined'!=arg0&''!=arg1&&null!=arg1&&'undefined'!=arg1){
    	return arg1.test(arg0);
    	}else{
    		return false;
    	}
    },
    mail:function(arg0){
    	var result=false;
    	if(null!=arg0&&null!=arg0&&'undefined'!=arg0){
    		var filter=/^([-_A-Za-z0-9\.]+)@([_A-Za-z0-9]+\.)+[A-Za-z0-9]{2,3}$/;
    		result=V.filter(arg0,filter);
    	}
    	return result;
    },
    num:function(arg0){
    	var result=false;
    	if(null!=arg0&&null!=arg0&&'undefined'!=arg0){
    		var filter= /^\d*\.?\d{0,2}$/;
    		result=V.filter(arg0,filter);
    	}
    	return result;
    },
    /**
     * 最大长度校验,如果失败返回字串.
     */
    vMaxLengthMsg:function(value,length,msg){
    	var result=V.maxLength(value,length);
    	if(!result){
    		return msg;
    	}else{
    		return '';
    	}
    },
    /**
     * 最小长度校验,如果失败返回字串.
     */
    vMinLengthMsg:function(value,length,msg){
    	var result=V.minLength(value,length);
    	if(!result){
    		return msg;
    	}else{
    		return '';
    	}
    },
    checkIp:function(ip){
      var regexp=/^([0-9]|1[0-9]{2}|[1-9][0-9]|2[0-4][0-9]|25[0-5])\.([0-9]|1[0-9]{2}|[1-9][0-9]|2[0-4][0-9]|25[0-5])\.([0-9]|1[0-9]{2}|[1-9][0-9]|2[0-4][0-9]|25[0-5])\.([0-9]|1[0-9]{2}|[1-9][0-9]|2[0-4][0-9]|25[0-5])$/;
      return V.filter(ip,regexp);
    }
 };
$(document).ready(function(){
	$.ajaxSetup({
	  type:'post'
	});
	$(document).ajaxSend(function(event,request,settings){
	   request.setRequestHeader('test','test-ajax');
	   var sb='';
	   var url=settings.url;
	   if(settings && settings!==undefined && settings!==null){
	    if(settings.data && settings.data!==undefined &&settings.data!==null){
	     if(settings.data.indexOf('ajaxRequest')===-1){
	      settings.data+='&ajaxRequest=ajax-action-request';
	     }
	    }
	   }
	   if(url.indexOf('?')===-1){
           //url+='?ajaxRequest=ajax-action-request';
	   }else{
           //url+='&ajaxRequest=ajax-action-request';
	   }
	   //url+='&test=1';
	   //settings.url=url;
	});
	$(document).ajaxComplete(function(event,request,settings){
	    var responseText=request.responseText;
		 Base.Security(responseText,null);
		//alert(responseText);
	});

	$('#refresh').click(function(){
		window.location.reload();
	});
	if($('.no-blur').length===0){
	$('.content table tr').each(function(i){
		if($(this).attr('class')!=='table-header'){
			$(this).mouseover(function(){
				$(this).css({
					background:'#FFFFCE'
				});
			});
			$(this).mouseout(function(){
				$(this).css({
					background:'white'
				});
			});
		}
	});
	}
});

