
function checkSubmit(theform) {
	
	
	var inputs=theform.getElementsByTagName("input");
	var textareas=theform.getElementsByTagName("textarea");
	var check=true;
	var falsecheck=[];
	var falsecheckstring="";
	for(var i = 0; i<inputs.length ; i++) {
		if(inputs[i].type=="text"){
			if(inputs[i].id){
			if(!inputs[i].value){
			check=false;
			falsecheck.push(inputs[i].id);

			}
			}
		}
	}
		for(var i = 0; i<textareas.length ; i++) {
		if(textareas[i].id){
		if(!textareas[i].value){
		check=false;
		falsecheck.push(textareas[i].id);

		}
		}
	}
	if(check){	
		
		submitForm(theform);

	}
	else{
	for(var i = 0; i<falsecheck.length ; i++) {
		if(i!=falsecheck.length-1){
		falsecheckstring += falsecheck[i]+", ";
		} 
		else
			falsecheckstring += falsecheck[i];

		}

		$get("confirm").style.display='block';
				$get("loading").style.display='none';
		$get("response").innerHTML="Lütfen gerekli yerleri doldurunuz:\n"+falsecheckstring;
	modal.set_CloseControlID("ok");
		modal.initialize();

		modal.show();

	}


}
	
function submitForm(theform) {
	var status = AjaxRequest.submit(
		theform,{
	'onLoading':function() {
		$get("loadtext").innerHTML='gonderiliyor..';
			$get("confirm").style.display='none';
				$get("loading").style.display='block';
	
	modal.set_CloseControlID("ok");
		modal.initialize();

		modal.show();
	
		}
	,'onSuccess':function(req){
		
			
					$get("response").innerHTML=req.responseText;
						$get("confirm").style.display='block';
				$get("loading").style.display='none';
	
			
			
		}
	}
	);

}
				



	
	

Sys={};
Samples={};
Sys.Location={};
Sys.Animation={};
Sys.Style={};
Sys.Browser = {};

Sys.Browser.InternetExplorer = {};
Sys.Browser.Firefox = {};
Sys.Browser.Safari = {};
Sys.Browser.Opera = {};

Sys.Browser.agent = null;
Sys.Browser.hasDebuggerStatement = false;
Sys.Browser.name = navigator.appName;
Sys.Browser.version = parseFloat(navigator.appVersion);

if (navigator.userAgent.indexOf(' MSIE ') > -1) {
    Sys.Browser.agent = Sys.Browser.InternetExplorer;
    Sys.Browser.version = parseFloat(navigator.userAgent.match(/MSIE (\d+\.\d+)/)[1]);
    Sys.Browser.hasDebuggerStatement = true;
}
else if (navigator.userAgent.indexOf(' Firefox/') > -1) {
    Sys.Browser.agent = Sys.Browser.Firefox;
    Sys.Browser.version = parseFloat(navigator.userAgent.match(/ Firefox\/(\d+\.\d+)/)[1]);
    Sys.Browser.name = 'Firefox';
    Sys.Browser.hasDebuggerStatement = true;
}
else if (navigator.userAgent.indexOf(' Safari/') > -1) {
    Sys.Browser.agent = Sys.Browser.Safari;
    Sys.Browser.version = parseFloat(navigator.userAgent.match(/ Safari\/(\d+\.\d+)/)[1]);
    Sys.Browser.name = 'Safari';
}
else if (navigator.userAgent.indexOf('Opera/') > -1) {
    Sys.Browser.agent = Sys.Browser.Opera;
}
var getClientBounds=function() {

        var clientWidth;
        var clientHeight;
        switch(Sys.Browser.agent) {
            case Sys.Browser.InternetExplorer:
                clientWidth = (document.documentElement.clientWidth ? document.documentElement.clientWidth:document.body.clientWidth);
                clientHeight = (document.documentElement.clientHeight ? document.documentElement.clientHeight:document.body.clientHeight);
                break;
            case Sys.Browser.Safari:
                clientWidth = window.innerWidth;
                clientHeight = window.innerHeight;
                break;
            case Sys.Browser.Opera:
                clientWidth = Math.min(window.innerWidth, document.body.clientWidth);
                clientHeight = Math.min(window.innerHeight, document.body.clientHeight);
                break;
            default:  // Sys.Browser.Firefox, etc.
                clientWidth = Math.min(window.innerWidth, document.documentElement.clientWidth);
				//only this application -80
                clientHeight = Math.min(window.innerHeight, document.documentElement.clientHeight);
                break;
        }
        return {width: clientWidth, height: clientHeight };
    }

var $createDelegate = function (instance, method) {            
    return function() {
        return method.apply(instance, arguments);
    }
}
var $addHandler =  function (element, eventName, handler) {
	if(window.addEventListener){ // Mozilla, Netscape, Firefox
	element.addEventListener(eventName,handler, false);
	} else { // IE
	element.attachEvent('on' + eventName, handler);	
}

}

var $removeHandler =function (element, eventName, handler) {
    if(window.addEventListener){ // Mozilla, Netscape, Firefox
	element.removeEventListener(eventName,handler, false);
	} else { // IE
	element.detachEvent('on' + eventName, handler);	
}
}
var $get = function (id) {
   return document.getElementById(id);
}

var $interpolate = function(start, end, percentage) {
  	return start + (end - start) * (percentage / 100);   	
    	
	}
Samples={};
Sys.Animation={};
//Length animation
Sys.Animation.LengthAnimation = function(startValue, endValue, percentage, unit) {
    
    var _unit = (unit != null) ? unit : 'px';
	var value = $interpolate(startValue, endValue, percentage);
        return Math.round(value) +_unit;
}





Samples.ModalPopup=function(popupControlId,targetElementId,popupDragHandleControlId){
	this._targetElement=$get(targetElementId);
	this._popupControlID=popupControlId;
	if(popupDragHandleControlId) this._popupDragHandleElement=$get(popupDragHandleControlId);
	this._backgroundCssClass = null;
   	
    	this._Drag = false;    
    	this._CloseControlID = null;
    	this._xCoordinate =-1;
    	this._yCoordinate =-1;

	// Variables
    this._backgroundElement = null;
    this._foregroundElement = null;
    this._popupElement = null;
    this._dragHandleElement = null;
    this._showHandler = null;
    this._CloseHandler = null;
    this._scrollHandler = null;
    this._resizeHandler = null;
    this._windowHandlersAttached = false;
    this._dragBehavior = null;
	
}
Samples.ModalPopup.prototype = {
		
		initialize : function(){
		this._popupControlElement=$get(this._popupControlID);
        
            	this._foregroundElement = $get(this._popupControlID);
        	this._backgroundElement = document.createElement('div');
        	this._backgroundElement.style.display = 'none';
        	this._backgroundElement.style.position = 'absolute';
        	this._backgroundElement.style.left = '0px';
        	this._backgroundElement.style.top = '0px';
        	this._backgroundElement.style.zIndex = 10000;
        	if (this._backgroundCssClass) {
            	this._backgroundElement.className = this._backgroundCssClass;
        	}
        	this._foregroundElement.parentNode.appendChild(this._backgroundElement);

        	this._foregroundElement.style.display = 'none';
        	this._foregroundElement.style.position = 'absolute';
        	this._foregroundElement.style.zIndex = 10001;
        
        	this._showHandler = $createDelegate(this, this._onShow);
			if(this._targetElement)
        	$addHandler(this._targetElement, 'click', this._showHandler);
	

        	if (this._CloseControlID) {
            	this._CloseHandler = $createDelegate(this, this._onClose);
            	$addHandler($get(this._CloseControlID), 'click', this._CloseHandler);
        	}

        	this._scrollHandler = $createDelegate(this, this._onLayout);
        	this._resizeHandler = $createDelegate(this, this._onLayout);

    	},
	
	 dispose : function() {
        /// <summary>
        /// Dispose the behavior
        /// </summary>
        this._detachPopup();

        this._scrollHandler = null;
        this._resizeHandler = null;
        if (this._CloseHandler  && $get(this._CloseControlID)) {
            $removeHandler($get(this._CloseControlID), 'click', this._CloseHandler);
            this._CloseHandler  = null;
        }
        
        if (this._showHandler) {
				if(this._targetElement)
            $removeHandler(this._targetElement, 'click', this._showHandler);
            this._showHandler = null;
        }
        
    },

    _attachPopup : function() {
        /// <summary>
        /// Attach the event handlers for the popup
        /// </summary>

        //if (this._dragHandleElement && !this._dragBehavior) {
           //drag
        //}        
        $addHandler(window, 'resize', this._resizeHandler);
        $addHandler(window, 'scroll', this._scrollHandler);
        this._windowHandlersAttached = true;
    },

    _detachPopup : function() {
        /// <summary>
        /// Detach the event handlers for the popup
        /// </summary>

        if (this._windowHandlersAttached) {
            if (this._scrollHandler) {
                $removeHandler(window, 'scroll', this._scrollHandler);
            }

            if (this._resizeHandler) {
                $removeHandler(window, 'resize', this._resizeHandler);
            }
            this._windowHandlersAttached = false;
        }
        
        //if (this._dragBehavior) {
            //this._dragBehavior.dispose();
          //  this._dragBehavior = null;
        //}       
   
   	 },
	 _onShow : function(e) {
        

        
            this.show();
           
            return false;
       
    	},
	_onClose : function(e) {

        var element = $get(this._CloseControlID);
        if (element && !element.disabled) {
            this.hide();
            
           
            return false;
        }
    },

    _onLayout : function() {
       
        this._layout();
    },

    show : function() {
       

        this._attachPopup();
		
        this._backgroundElement.style.display = '';
        this._foregroundElement.style.display = 'block';
        this._popupControlElement.style.display = 'block';

        

        this._layout();
        // On pages that don't need scrollbars, Firefox and Safari act like
        // one or both are present the first time the layout code runs which
        // obviously leads to display issues - run the layout code a second
        // time to work around this problem
        this._layout();
      
    },
	hide : function() {
	
		
			
        this._backgroundElement.style.display = 'none';
        this._foregroundElement.style.display = 'none';	
        this._detachPopup();
      
    },

    _layout : function() {
        /// <summary>
        /// Position the modal dialog in the center of the screen
        /// </summary>
	
        var scrollLeft = (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : 

document.body.scrollLeft);
        var scrollTop = (document.documentElement.scrollTop ? document.documentElement.scrollTop : 

document.body.scrollTop);
          var clientBounds = this.getClientBounds();
        var clientWidth = clientBounds.width;
        var clientHeight = clientBounds.height;
       
	
        this._backgroundElement.style.width = Math.max(Math.max(document.documentElement.scrollWidth, 

document.body.scrollWidth), clientWidth)+'px';
        this._backgroundElement.style.height = Math.max(Math.max(document.documentElement.scrollHeight, 

document.body.scrollHeight), clientHeight)+'px';

        
        if(this._xCoordinate < 0)
        {	
		
            this._foregroundElement.style.left = 

scrollLeft+((clientWidth-this._foregroundElement.offsetWidth)/2)+'px';
        }
        
        if(this._yCoordinate < 0)
        {
            this._foregroundElement.style.top = 

scrollTop+((clientHeight-this._foregroundElement.offsetHeight)/2)+'px';
        }
       
        
        
    },
	
	getClientBounds : function() {

        var clientWidth;
        var clientHeight;
        switch(Sys.Browser.agent) {
            case Sys.Browser.InternetExplorer:
                clientWidth = (document.documentElement.clientWidth ? 

document.documentElement.clientWidth:document.body.clientWidth);
                clientHeight = (document.documentElement.clientHeight ? 

document.documentElement.clientHeight:document.body.clientHeight);
                break;
            case Sys.Browser.Safari:
                clientWidth = window.innerWidth;
                clientHeight = window.innerHeight;
                break;
            case Sys.Browser.Opera:
                clientWidth = Math.min(window.innerWidth, document.body.clientWidth);
                clientHeight = Math.min(window.innerHeight, document.body.clientHeight);
                break;
            default:  // Sys.Browser.Firefox, etc.
                clientWidth = Math.min(window.innerWidth, document.documentElement.clientWidth);
				//only this application -80
                clientHeight = Math.min(window.innerHeight, document.documentElement.clientHeight);
                break;
        }
        return {width: clientWidth, height: clientHeight };
    },
   

		set_backgroundCssClass : function(value) {
        	if (this._backgroundCssClass !== value) {
           	 this._backgroundCssClass = value;
        	    
        	}
        	},
		set_Drag : function(value) {
        	if (this._Drag !== value) {
           	 this._Drag = value;
        	    
        	}
        	},
		
		set_CloseControlID : function(value) {
        	if (this._CloseControlID !== value) {
           	 this._CloseControlID = value;
        	    
        	}
        	},
		set_elementFinalHeight : function(value) {
        	if (this._elementFinalHeight !== value) {
           	 this._elementFinalHeight = value;
        	    
        	}
        	},
		set_duration : function(value) {
        	if (this._duration !== value) {
           	 this._duration = value;
        	    
        	}
        	},
		set_elementFinalWidth : function(value) {
        	if (this._elementFinalWidth  !== value) {
           	 this._elementFinalWidth = value;
        	    
        	}
        	}

}
	var	modal=new Samples.ModalPopup("okconfirm");
	
	modal.set_backgroundCssClass("modalBackground");

Samples.ModalPopup1=function(targetElementId,popupControlId,popupDragHandleControlId){
	this._targetElement=$get(targetElementId);
	this._popupControlID=popupControlId;
	if(popupDragHandleControlId) this._popupDragHandleElement=$get(popupDragHandleControlId);
	this._backgroundCssClass = null;
   	
    	this._Drag = false;    
    	this._CloseControlID = null;
    	this._xCoordinate =-1;
    	this._yCoordinate =-1;

	// Variables
    this._backgroundElement = null;
    this._foregroundElement = null;
    this._popupElement = null;
    this._dragHandleElement = null;
    this._showHandler = null;
    this._CloseHandler = null;
    this._scrollHandler = null;
    this._resizeHandler = null;
    this._windowHandlersAttached = false;
    this._dragBehavior = null;

	this._elementFinalHeight=474;
	this._elementFinalWidth=584;	


}
Samples.ModalPopup1.prototype = {
		
		initialize : function(){
		this._popupControlElement=$get(this._popupControlID);
        
            	this._foregroundElement = $get(this._popupControlID);
        	this._backgroundElement = document.createElement('div');
        	this._backgroundElement.style.display = 'none';
        	this._backgroundElement.style.position = 'absolute';
        	this._backgroundElement.style.left = '0px';
        	this._backgroundElement.style.top = '0px';
        	this._backgroundElement.style.zIndex = 10000;
        	if (this._backgroundCssClass) {
            	this._backgroundElement.className = this._backgroundCssClass;
        	}
        	this._foregroundElement.parentNode.appendChild(this._backgroundElement);

        	this._foregroundElement.style.display = 'none';
        	this._foregroundElement.style.position = 'absolute';
        	this._foregroundElement.style.zIndex = 1005555555;
        
        	this._showHandler = $createDelegate(this, this._onShow);
        	$addHandler(this._targetElement, 'click', this._showHandler);
	

        	if (this._CloseControlID) {
            	this._CloseHandler = $createDelegate(this, this._onClose);
            	$addHandler($get(this._CloseControlID), 'click', this._CloseHandler);
        	}

        	this._scrollHandler = $createDelegate(this, this._onLayout);
        	this._resizeHandler = $createDelegate(this, this._onLayout);

    	},
	
	 dispose : function() {
        /// <summary>
        /// Dispose the behavior
        /// </summary>
        this._detachPopup();

        this._scrollHandler = null;
        this._resizeHandler = null;
        if (this._CloseHandler  && $get(this._CloseControlID)) {
            $removeHandler($get(this._CloseControlID), 'click', this._CloseHandler);
            this._CloseHandler  = null;
        }
        
        if (this._showHandler) {
            $removeHandler(this._targetElement, 'click', this._showHandler);
            this._showHandler = null;
        }
        
    },

    _attachPopup : function() {
        /// <summary>
        /// Attach the event handlers for the popup
        /// </summary>

        //if (this._dragHandleElement && !this._dragBehavior) {
           //drag
        //}        
        $addHandler(window, 'resize', this._resizeHandler);
        $addHandler(window, 'scroll', this._scrollHandler);
        this._windowHandlersAttached = true;
    },

    _detachPopup : function() {
        /// <summary>
        /// Detach the event handlers for the popup
        /// </summary>

        if (this._windowHandlersAttached) {
            if (this._scrollHandler) {
                $removeHandler(window, 'scroll', this._scrollHandler);
            }

            if (this._resizeHandler) {
                $removeHandler(window, 'resize', this._resizeHandler);
            }
            this._windowHandlersAttached = false;
        }
        
        //if (this._dragBehavior) {
            //this._dragBehavior.dispose();
          //  this._dragBehavior = null;
        //}       
   
   	 },
	 _onShow : function(e) {
        

        if (!this._targetElement.disabled) {
            this.show();
           
            return false;
        }
    	},
	_onClose : function(e) {

        var element = $get(this._CloseControlID);
        if (element && !element.disabled) {
            this.hide();
            
           
            return false;
        }
    },

    _onLayout : function() {
       
        this._layout();
    },

    show : function() {
       

        this._attachPopup();

        this._backgroundElement.style.display = '';
        this._foregroundElement.style.display = '';
        this._popupControlElement.style.display = '';

        

        this._layout1();
        // On pages that don't need scrollbars, Firefox and Safari act like
        // one or both are present the first time the layout code runs which
        // obviously leads to display issues - run the layout code a second
        // time to work around this problem
        this._layout1();
      
    },
	hide : function() {
        
        this._backgroundElement.style.display = 'none';
        this._foregroundElement.style.display = 'none';
	this._foregroundElement.style.left="930px";
	this._foregroundElement.style.top="530px";
	this._foregroundElement.style.width="0px";
	this._foregroundElement.style.height="0px";
        this._detachPopup();
      
    },

    _layout : function() {
        /// <summary>
        /// Position the modal dialog in the center of the screen
        /// </summary>
	
        var scrollLeft = (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft);
        var scrollTop = (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop);
          var clientBounds = this.getClientBounds();
        var clientWidth = clientBounds.width;
        var clientHeight = clientBounds.height;
       
	
        this._backgroundElement.style.width = Math.max(Math.max(document.documentElement.scrollWidth, document.body.scrollWidth), clientWidth)+'px';
        this._backgroundElement.style.height = Math.max(Math.max(document.documentElement.scrollHeight, document.body.scrollHeight), clientHeight)+'px';

        
        if(this._xCoordinate < 0)
        {	
		
            this._foregroundElement.style.left = scrollLeft+((clientWidth-this._foregroundElement.offsetWidth)/2)+'px';
        }
        
        if(this._yCoordinate < 0)
        {
            this._foregroundElement.style.top = scrollTop+((clientHeight-this._foregroundElement.offsetHeight)/2)+'px';
        }
       
        
        
    },
	_layout1 : function() {
        /// <summary>
        /// Position the modal dialog in the center of the screen
        /// </summary>
	
        var scrollLeft = (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft);
        var scrollTop = (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop);
          var clientBounds = this.getClientBounds();
        var clientWidth = clientBounds.width;
        var clientHeight = clientBounds.height;
       
	
        this._backgroundElement.style.width = Math.max(Math.max(document.documentElement.scrollWidth, document.body.scrollWidth), clientWidth)+'px';
        this._backgroundElement.style.height = Math.max(Math.max(document.documentElement.scrollHeight, document.body.scrollHeight), clientHeight)+'px';
        if(this._xCoordinate < 0)
        {	
		
            var leftposition = scrollLeft+((clientWidth-this._elementFinalWidth)/2);
        }
        
        if(this._yCoordinate < 0)
        {
            var topposition = scrollTop+((clientHeight-this._elementFinalHeight)/2);
        }
      
	if(Sys.Browser.agent===Sys.Browser.FireFox){
	   var move=new Sys.Animation.MoveAnimation( this._foregroundElement,0.1,300,930,530,leftposition, topposition);
	var resize=new Sys.Animation.ResizeAnimation( this._foregroundElement,0.1,300,0,0,this._elementFinalWidth,this._elementFinalHeight);
        move.play();
	resize.play();
        
	}
	else{
 var move=new Sys.Animation.MoveAnimation( this._foregroundElement,0.1,150,930,530,leftposition, topposition);
	var resize=new Sys.Animation.ResizeAnimation( this._foregroundElement,0.1,150,0,0,this._elementFinalWidth,this._elementFinalHeight);
        move.play();
	resize.play();

	}



	
    },
	getClientBounds : function() {

        var clientWidth;
        var clientHeight;
        switch(Sys.Browser.agent) {
            case Sys.Browser.InternetExplorer:
                clientWidth = (document.documentElement.clientWidth ? document.documentElement.clientWidth:document.body.clientWidth);
                clientHeight = (document.documentElement.clientHeight ? document.documentElement.clientHeight:document.body.clientHeight);
                break;
            case Sys.Browser.Safari:
                clientWidth = window.innerWidth;
                clientHeight = window.innerHeight;
                break;
            case Sys.Browser.Opera:
                clientWidth = Math.min(window.innerWidth, document.body.clientWidth);
                clientHeight = Math.min(window.innerHeight, document.body.clientHeight);
                break;
            default:  // Sys.Browser.Firefox, etc.
                clientWidth = Math.min(window.innerWidth, document.documentElement.clientWidth);
				//only this application -80
                clientHeight = Math.min(window.innerHeight, document.documentElement.clientHeight);
                break;
        }
        return {width: clientWidth, height: clientHeight };
    },
   

		set_backgroundCssClass : function(value) {
        	if (this._backgroundCssClass !== value) {
           	 this._backgroundCssClass = value;
        	    
        	}
        	},
		set_Drag : function(value) {
        	if (this._Drag !== value) {
           	 this._Drag = value;
        	    
        	}
        	},
		
		set_CloseControlID : function(value) {
        	if (this._CloseControlID !== value) {
           	 this._CloseControlID = value;
        	    
        	}
        	},
		set_elementFinalHeight : function(value) {
        	if (this._elementFinalHeight !== value) {
           	 this._elementFinalHeight = value;
        	    
        	}
        	},
		set_duration : function(value) {
        	if (this._duration !== value) {
           	 this._duration = value;
        	    
        	}
        	},
		set_elementFinalWidth : function(value) {
        	if (this._elementFinalWidth  !== value) {
           	 this._elementFinalWidth = value;
        	    
        	}
        	}

}
var resizeProgress=false;
//Resize Animation
Sys.Animation.ResizeAnimation=function(element,duration,frameps,startwidth,startheight,width, height, unit,paralel){
	this.element=element;
	this.duration=(duration !== undefined) ? duration : 1;
	this.frameps=(frameps !== undefined) ? frameps : 30;
	this._Animation=$createDelegate(this,this.Animation);
	this._width =(width !== null && width !== undefined) ? width : this.element.offsetWidth ;
    	this._height = (height !== null && height !== undefined) ? height : this.element.offsetHeight;
	this.startWidth=(startwidth !== null && startwidth !== undefined) ? startwidth : this.element.offsetWidth;
	this.startHeight=(startheight !== null && startheight !== undefined) ? startheight : this.element.offsetHeight;
	this.interval="";
	this._percentDelta = Math.ceil(100 / (duration * frameps));
	this._percentComplete=0;
	this.paralel=(paralel !== undefined) ? paralel : false;
	this.unit=unit;
}
Sys.Animation.ResizeAnimation.prototype = { 
	play:function(){
	if(!(this.startWidth==this._width && this.startHeight==this._height)){
		if(!resizeProgress && !this.paralel){
		resizeProgress=true;
		this.interval= window.setInterval(this._Animation, (1000 / this.frameps));
		}
		else{
		this.interval= window.setInterval(this._Animation, (1000 / this.frameps));
		}
	}
	},
	Animation:function(){
        	
          this.element.style.width= Sys.Animation.LengthAnimation(this.startWidth, this._width, this._percentComplete,this.unit) ;
       
            this.element.style.height=Sys.Animation.LengthAnimation(this.startHeight, this._height, this._percentComplete,this.unit);
                	 
        	this._updatePercentComplete(this._percentComplete+this._percentDelta);
	
  	
	},
	
	_updatePercentComplete : function(percentComplete) {
	 if (percentComplete >= 100) {
           	 percentComplete = 100;
        	}
        
       	 this._percentComplete = percentComplete;
        	 if (percentComplete === 100 ) {
		 this.element.style.width=this._width;
			this.element.style.height=this._height;
			this.stop();
			
			resizeProgress=false;
		}
    	},


	
	stop:function(){
	
	window.clearInterval(this.interval);
	this.interval=null;
	}
       
}

var moveProgress=false;
//Move Animation
Sys.Animation.MoveAnimation=function(element,duration,frameps,startleft,starttop,left, top,relative,unit,paralel){
	this.element=element;
	this.duration=(duration !== undefined) ? duration : 1;
	this.frameps=(frameps !== undefined) ? frameps : 30;
	this._Animation=$createDelegate(this,this.Animation);
	this._left =(left !== null && left!== undefined) ? left : 0 ;
    	this._top = (top !== null && top !== undefined) ? top : 0;
	this.startLeft=startleft;
	this.startTop=starttop;
	this.interval="";
	this._percentDelta =Math.ceil(100 / (duration * frameps));
	this._percentComplete=0;
	this.paralel=(paralel !== undefined) ? paralel : false;
	this.unit=unit ;
	this.relative=(relative === undefined) ? true : relative;
}
Sys.Animation.MoveAnimation.prototype = { 
	play:function(){
	if(!(this.startLeft==this._left && this.startTop==this._top)){
		if(!moveProgress && !this.paralel){
		moveProgress=true;
		this.interval= window.setInterval(this._Animation, (1000 / this.frameps));
		}
		else{
		this.interval= window.setInterval(this._Animation, (1000 / this.frameps));
		}
	}
	},
	Animation:function(){
        	
       this.element.style.left= Sys.Animation.LengthAnimation(this.startLeft, this._left, this._percentComplete,this.unit);
       
            this.element.style.top=Sys.Animation.LengthAnimation(this.startTop, this._top, this._percentComplete,this.unit);
                	 
        	this._updatePercentComplete(this._percentComplete+this._percentDelta);
	
  	
	},
	
	_updatePercentComplete : function(percentComplete) {
	 if (percentComplete >= 100) {
           	 percentComplete = 100;
        	}
        
       	 this._percentComplete = percentComplete;
        	 if (percentComplete === 100 ) {
		 this.element.style.left=this._left;
			this.element.style.top=this._top;
			this.stop();
			
			 moveProgress=false;
		}
    	},


	
	stop:function(){
	
	window.clearInterval(this.interval);
	this.interval=null;

	}
       
}
