function change_action(id){
		var  fsm = $(id);
		if(fsm && !(typeof productAddToCartForm == 'undefined')){						
			productAddToCartForm.submit = function(button, url) {
				if (this.validator.validate()) {
					var form = this.form;
					var oldUrl = form.action;
					if (url) {
					   form.action = url;
					}
					var e = null;
					try {
						//this.form.submit();
					} catch (e) {
					}
					this.form.action = oldUrl;
					if (e) {
						throw e;
					}
					if (button && button != 'undefined') {
						button.disabled = false;
					}
				}
			}.bind(productAddToCartForm);
		
				
		fsm.attr('action', fsm.attr('action').replace(checkouturl, urladdajaxcart));
		$('button', fsm).click(function(e){
				var checkrq = true;
				var superpd = $('#super-product-table');
				if(superpd.size() > 0){
					var rq = true;
					$('input', superpd).each(function(index, element) {
                       if($(this).val() > 0) rq = false; else $(this).addClass('validation-failed');
                    });
					if(rq) return;
				}
				$('.required-entry', fsm).each(function() {
                    if(!$(this).val()) checkrq = false;
                });
				if(checkrq){
					$(".ajaxcartanimate").css('top', $(this).offset().top + 'px');
					$(".ajaxcartanimate").css('left', e.clientX + 'px');
					$('img#image').eq(0).clone().appendTo($(".ajaxcartanimate").html(''));
					tryFly();
					ldajaxcart.css('display', 'block');
					ldajaxcart.css('top', (e.clientY - ldajaxcart.height() / 2) + "px");
					ldajaxcart.css('left', (e.clientX - ldajaxcart.width() / 2) + "px");
				
					$.ajax({
						url: urladdajaxcart + "?" + fsm.serialize(),
						cache: false
					}).done(function( data ) {
						ldajaxcart.css('display', 'none');
						ajaxallct.css('display', 'none');
						
						var getData = $.parseJSON(data);
						if(getData.ajaxSummaryCount) linkcart.html(getData.ajaxSummaryCount);
						if(getData.ajaxCountItem) $('div#ajaxscicon > span').html(getData.ajaxCountItem);
						if(getData.ajaxsidebar) $('.sidebar .block-cart').html(getData.ajaxsidebar);
						if(getData.ajaxcart) $("#ajaxcart").html(ajopacity + getData.ajaxcart);
						//$(window).scrollTop(50);
						
							if(getData.ajaxcontinue){
								ajmsgc.html(getData.ajaxcontinue);
								ajaxallct.css('display', 'block');
								ajaxallct.addClass('ajaxcontinue');
								autoct(ajaxcartmsg);
								$('button.closemsg').click(function(){ ajaxallct.hide(); });
								ajaxallct.delay(4500).fadeOut(200, function() {
									ajaxallct.removeClass('ajaxcontinue');
								});
							}	
						AjReloadAll();
						aj_s2();
					});
				}
				return false;
			});
			fsm.submit(function(){ return false; });
		}
	}
//change action, and create action again when load data sucecced.

change action, and create action again when load data sucecced.
change action and create action again when load data sucecced .
function change_action(id){
		var  fsm = $(id);
		if(fsm && !(typeof productAddToCartForm == 'undefined')){						
			productAddToCartForm.submit = function(button, url) {
				if (this.validator.validate()) {
					var form = this.form;
					var oldUrl = form.action;
					if (url) {
					   form.action = url;
					}
					var e = null;
					try {
					} catch (e) {
					}
					this.form.action = oldUrl;
					if (e) {
						throw e;
					}
					if (button && button != 'undefined') {
						button.disabled = false;
					}
				}
			}.bind(productAddToCartForm);
		fsm.attr('action', fsm.attr('action').replace(checkouturl, urladdajaxcart));
		$('button', fsm).click(function(e){
				var checkrq = true;
				var superpd = $('#super-product-table');
				if(superpd.size() > 0){
					var rq = true;
					$('input', superpd).each(function(index, element) {
                       if($(this).val() > 0) rq = false; else $(this).addClass('validation-failed');
                    });
					if(rq) return;
				}
				$('.required-entry', fsm).each(function() {
                    if(!$(this).val()) checkrq = false;
                });
				if(checkrq){
					$(".ajaxcartanimate").css('top', $(this).offset().top + 'px');
					$(".ajaxcartanimate").css('left', e.clientX + 'px');
					$('img#image').eq(0).clone().appendTo($(".ajaxcartanimate").html(''));
					tryFly();
					ldajaxcart.css('display', 'block');
					ldajaxcart.css('top', (e.clientY - ldajaxcart.height() / 2) + "px");
					ldajaxcart.css('left', (e.clientX - ldajaxcart.width() / 2) + "px");
					$.ajax({
						url: urladdajaxcart + "?" + fsm.serialize(),
						cache: false
					}).done(function( data ) {
						ldajaxcart.css('display', 'none');
						ajaxallct.css('display', 'none');
						var getData = $.parseJSON(data);
						if(getData.ajaxSummaryCount) linkcart.html(getData.ajaxSummaryCount);
						if(getData.ajaxCountItem) $('div#ajaxscicon > span').html(getData.ajaxCountItem);
						if(getData.ajaxsidebar) $('.sidebar .block-cart').html(getData.ajaxsidebar);
						if(getData.ajaxcart) $("#ajaxcart").html(ajopacity + getData.ajaxcart);
							if(getData.ajaxcontinue){
								ajmsgc.html(getData.ajaxcontinue);
								ajaxallct.css('display', 'block');
								ajaxallct.addClass('ajaxcontinue');
								autoct(ajaxcartmsg);
								$('button.closemsg').click(function(){ ajaxallct.hide(); });
								ajaxallct.delay(4500).fadeOut(200, function() {
									ajaxallct.removeClass('ajaxcontinue');
								});
							}	
						AjReloadAll();
						aj_s2();
					});
				}
				return false;
			});
			fsm.submit(function(){ return false; });
		}
	}
function change_action ( id ) { var fsm = $ ( id ) ; if ( fsm && ! ( typeof productAddToCartForm == 'undefined' ) ) { productAddToCartForm . submit = function ( button , url ) { if ( this . validator . validate ( ) ) { var form = this . form ; var oldUrl = form . action ; if ( url ) { form . action = url ; } var e = null ; try { } catch ( e ) { } this . form . action = oldUrl ; if ( e ) { throw e ; } if ( button && button != 'undefined' ) { button . disabled = false ; } } } . bind ( productAddToCartForm ) ; fsm . attr ( 'action' , fsm . attr ( 'action' ) . replace ( checkouturl , urladdajaxcart ) ) ; $ ( 'button' , fsm ) . click ( function ( e ) { var checkrq = true ; var superpd = $ ( '#super-product-table' ) ; if ( superpd . size ( ) > 0 ) { var rq = true ; $ ( 'input' , superpd ) . each ( function ( index , element ) { if ( $ ( this ) . val ( ) > 0 ) rq = false ; else $ ( this ) . addClass ( 'validation-failed' ) ; } ) ; if ( rq ) return ; } $ ( '.required-entry' , fsm ) . each ( function ( ) { if ( ! $ ( this ) . val ( ) ) checkrq = false ; } ) ; if ( checkrq ) { $ ( ".ajaxcartanimate" ) . css ( 'top' , $ ( this ) . offset ( ) . top + 'px' ) ; $ ( ".ajaxcartanimate" ) . css ( 'left' , e . clientX + 'px' ) ; $ ( 'img#image' ) . eq ( 0 ) . clone ( ) . appendTo ( $ ( ".ajaxcartanimate" ) . html ( '' ) ) ; tryFly ( ) ; ldajaxcart . css ( 'display' , 'block' ) ; ldajaxcart . css ( 'top' , ( e . clientY - ldajaxcart . height ( ) / 2 ) + "px" ) ; ldajaxcart . css ( 'left' , ( e . clientX - ldajaxcart . width ( ) / 2 ) + "px" ) ; $ . ajax ( { url : urladdajaxcart + "?" + fsm . serialize ( ) , cache : false } ) . done ( function ( data ) { ldajaxcart . css ( 'display' , 'none' ) ; ajaxallct . css ( 'display' , 'none' ) ; var getData = $ . parseJSON ( data ) ; if ( getData . ajaxSummaryCount ) linkcart . html ( getData . ajaxSummaryCount ) ; if ( getData . ajaxCountItem ) $ ( 'div#ajaxscicon > span' ) . html ( getData . ajaxCountItem ) ; if ( getData . ajaxsidebar ) $ ( '.sidebar .block-cart' ) . html ( getData . ajaxsidebar ) ; if ( getData . ajaxcart ) $ ( "#ajaxcart" ) . html ( ajopacity + getData . ajaxcart ) ; if ( getData . ajaxcontinue ) { ajmsgc . html ( getData . ajaxcontinue ) ; ajaxallct . css ( 'display' , 'block' ) ; ajaxallct . addClass ( 'ajaxcontinue' ) ; autoct ( ajaxcartmsg ) ; $ ( 'button.closemsg' ) . click ( function ( ) { ajaxallct . hide ( ) ; } ) ; ajaxallct . delay ( 4500 ) . fadeOut ( 200 , function ( ) { ajaxallct . removeClass ( 'ajaxcontinue' ) ; } ) ; } AjReloadAll ( ) ; aj_s2 ( ) ; } ) ; } return false ; } ) ; fsm . submit ( function ( ) { return false ; } ) ; } }
change action, and create action again when load data sucecced.
change action and create action again when load data sucecced .
//this.form.submit();
 //$(window).scrollTop(50);
