////////////////////////////////////
// main
////////////////////////////////////

$(function() {

    // default easing
    //jQuery.easing.def = "easeOutExpo";
    
    slideShow = new SlideShow({
        data:   "./js/slideshow/slideData.xml"
    });
	
	$('<div id="flash_external"></div>').appendTo('#imageMovie');
	
	
	if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPad/i)) || (navigator.userAgent.match(/iPod/i))){
        
		var tag = '<video id="video1" autobuffer width="204" height="115" poster="images/image_movie_inner.jpg" controls><source src="swf/utoco.mp4"></video>';
		$("#imageMovieInner")
            .html(tag)
	} else {
		
		//var playerVersion = swfobject.getFlashPlayerVersion();
		var params = {};
		params.wmode = "opaque";
		params.allowScriptAccess = "always";
		params.allowfullscreen = "true";
		var attributes = {};
		attributes.id = "flash_external";
		attributes.name = "flash_external";
		var flashvars = {};
		path = "swf/utoco.flv";
		swfobject.embedSWF("swf/movie.swf", "flash_external", "204", "115", "9", null, flashvars, params, attributes);
	}
});

var isIE = navigator.userAgent.toLowerCase().match(/msie/i) != null;

function trace(arg) {
	if(typeof console != 'undefined' && console.log) {
		console.log(arg);	
	}
}


////////////////////////////////////
// SlideShow
////////////////////////////////////
var SlideShow = function( settings ) {
    this.currentIndex = 0;
	this.naviIndex = 0;
    this.settings = settings;
	this.total = 0;
	this.naviTotal = 0;
	this.data;
	this.timer;
	this.naviTimer;
	this.list = [];
	this.slidePosList = [];
    this.naviItems = [];
    this.naviPosList = [];
    this.naviSlideDirection;
    this.enterFrame;
    this.diff = 0;
    this.dx = 0;
    this.di = 0;
    this.initialize.apply(this, arguments);
	
	this.naviLock = false;
}
SlideShow.prototype = {

    initialize: function( settings ) {
        this._init();
    },
    
    _init: function() {
		$('#slideArea')
			.html('<div id="centerRect"></div>');
		this.enterFrame = new EnterFrame(18);
        this._jsonLoad();
    },
    
    _jsonLoad: function() {
    
        var self = this;
        
        /*
        $.getJSON( this.settings.data, null, function(data, status) {
            self.data = data;
            if( self.data.slides.length < 4 ) self.data.slides = self.data.slides.concat(self.data.slides);
			self.total = data.slides.length;
			self.naviTotal = data.navi.length;
			self._imageLoad();
        });*/
        
        $.ajax({
            type: "GET",
            url:this.settings.data,
            dataType:"xml",
            success: function(xml){
                self._parse(xml);
            }
        });
    },
    
    _parse: function(xml) {
        var self = this;
        self.data = {};
        self.data.slides = [];
        self.data.navi = [];
        $(xml).find("slides image").each(function() {
            self.data.slides.push($(this).text());
        })
        $(xml).find("navi item").each(function() {
           self.data.navi.push({
                "image": $("image",this).text(),
                "url": $("url",this).text(),
                "target": $("target",this).text(),
                "title": $("title",this).text()
            });
        })
        if( self.data.slides.length < 4 ) self.data.slides = self.data.slides.concat(self.data.slides);
        self.total = self.data.slides.length;
        self.naviTotal = self.data.navi.length;
        self._imageLoad();
    },
	
	_imageLoad: function() {
		
		this.createSelectNavi();
		
		var loaded = 0, loaded2 = 0, num, self = this;
		
		
            for (i in this.data.slides) {
                var path = this.data.slides[i];
				num = parseInt(i) + 1;
				self.list.push(num-1);
				self.slidePosList.push((i*960)-480);
				$('<a></a>')
					.attr({
						id:		"slide-" + num,
						className:	"slide-item"
                    })
					.css({
						position: "absolute",
						top: "0",
						left: ((i*960)-480).toString() + "px",
						cursor: "default"
					})
					.appendTo('#centerRect')
					
                $('<img />')
                    .attr({
						src:	path
					})
					.css({
						display: "none",
						opacity: "0"
					})
                    .load(function(){
                        loaded += 1;
						trace($(this).parent().attr("id"));
						var slideId = $(this).parent().attr("id");
						if( slideId == "slide-1") {
							$(this)
								.css({display:"block"})
								.animate({opacity:"1.0"}, 2000); 
						} else if( slideId == "slide-2" || slideId == "slide-3" ) {
							$(this)
								.css({display:"block"})
								.animate({opacity:"0.1"}, 2000); 
						} else {
							$(this)
								.css({opacity:"0.1", display:"block"})
						}
                        if( loaded == self.total && loaded2 == self.naviTotal ) {
                            self._loaded();
                        }
                    })
					.appendTo('#slide-' + num)
            }
			
			for (i in this.data.navi) {
				var nd = this.data.navi[i];
				num = parseInt(i) + 1;
				$('<img />')
                    .attr({
						src:	nd.image,
						alt:	nd.title
					})
                    .load(function(){
                        loaded2 += 1;
                        if( loaded == self.total && loaded2 == self.naviTotal ) {
                            self._loaded();
                        }
                    })
					.insertBefore('#slide-select-' + num + ' a span')
			}
	},
	
	createSelectNavi: function() {
		
		//$('<div id="slideFooter"></div>').appendTo('#ajaxAreaInner')
		//$('<div id="imageMovie"><img src="images/image_movie.png" width="" height="" alt="Image Movie" /></div>').appendTo('#slideFooter')
		//$('<div id="slideSelectNavi"></div>').appendTo('#slideFooter')
		$('<ul></ul>').appendTo('#slideSelectNavi')
			
		var self = this;
		
		for( i=0; i<this.naviTotal; i++ ) {
			var _title = self.data.navi[i].title;
			_title = _title.length > 10 ? _title.substring(0, 10) + "..." : _title;
			$('<li><a><img src="images/slideshow_select_bg_over.gif" class="over" width="125" height="109" alt="" /><span>' + _title + '</span></a></li>')
				.attr({
					id: "slide-select-" + (i+1).toString()	  
				})
				.css({
					left: (i*135+25).toString() + "px",
					top: (200).toString() + "px",
					cursor: "pointer"
				})
				.appendTo('#slideSelectNavi ul')
				.click(function() {
					//self.currentIndex = $('#slideSelectNavi ul li').index(this);
					//self.setPosition(self.currentIndex);
				})
				
				
			var lo = $("#slide-select-" + (i+1).toString() + " a");
			$("#slide-select-" + (i+1).toString() + " .over").css({opacity:"0"})
			$(lo)
				.attr({
					href: self.data.navi[i].url,
					title: self.data.navi[i].title,
					target: self.data.navi[i].target
				})
				.hover(function() {
					var target = $(this).find(".over")
					$(target).stop();
					//$(target).css({ opacity: 1.0 });
					$(target).animate({ opacity: 1.0 }, 100);
				},
				function() {
					var target = $(this).find(".over")
					$(target).stop();
					$(target).animate({ opacity: 0 }, 500);
				})
		}
		
		$('<p id="slideNaviLeftBtn"><img src="images/slidenavi_left_btn.png" width="25" height="129" alt="" /><img class="over" src="images/slidenavi_left_btn_over.gif" width="20" height="129" alt="" /></p>').insertAfter('#slideSelectNavi')
		$('<p id="slideNaviRightBtn"><img src="images/slidenavi_right_btn.png" width="25" height="129" alt="" /><img class="over" src="images/slidenavi_right_btn_over.gif" width="20" height="129" alt="" /></p>').insertAfter('#slideSelectNavi')
		
		$('#slideNaviLeftBtn').css({
			cursor: "pointer"
		});
		
		$('#slideNaviRightBtn').css({
			cursor: "pointer"
		});
		
		var lo = $('#slideNaviLeftBtn .over').get(0);
		$('#slideNaviLeftBtn').hover(function() {
			if( !self.naviLock ) {						
				$(lo).stop();
				$(lo).css({display:"block", opacity:"0"});
				$(lo).animate({
					opacity: 1.0
				}, 300);
			}
		},
		function() {
			$(lo).stop();
			$(lo).animate({
				opacity: 0
			}, 300);
		})
		.click(function() {
			if( !self.naviLock ) self.prevThumbnail();
		})
		
		var ro = $('#slideNaviRightBtn .over').get(0);
		$('#slideNaviRightBtn').hover(function() {
			if( !self.naviLock ) {
				$(ro).stop();
				$(ro).css({display:"block", opacity:"0"});
				$(ro).animate({
					opacity: 1.0
				}, 300);
			}
		},
		function() {
			$(ro).stop();
			$(ro).animate({
				opacity: 0
			}, 300);
		})
		.click(function() {
			if( !self.naviLock ) self.nextThumbnail(700);
		})
		
		if(navigator.appVersion.indexOf("MSIE 6") != -1) { DD_belatedPNG.fix('#slideNaviLeftBtn img, #slideNaviRightBtn img') };
	},
    
    _loaded: function() {
		
		trace("load complete");
		
		/*$('<div id="slideshow-cover-left"></div>')
			.appendTo('#centerRect')
			.css({opacity: "0.7"})
		$('<div id="slideshow-cover-right"></div>')
			.appendTo('#centerRect')
			.css({opacity: "0.7"})*/
			
		this._intro();
    },
	
	_intro: function() {
		
		var self = this;
		
		var cnt = 0;
		$('#slideSelectNavi ul li').each(function() {
            self.naviItems.push(this);
            self.naviPosList.push(0);
			if( cnt < 5 ) {
				$(this).delay(cnt*100+1000).animate({
					top: "20px"
				}, 1000, "easeOutQuart");
			} else {
				$(this).css({
					top: "20px"
				});
			}
			cnt += 1;
		});
		
        this.enterFrame.add(function(){
            self.render();
        })
        
        var t = setTimeout(function() {
            clearTimeout(t);
            self.enterFrame.start();
        }, 3000);
		
		self.timer = setInterval( function() {
			//$(self).trigger('slideStart');
			self.currentIndex += 1;
			if( self.currentIndex == self.total ) self.currentIndex = 0;
			self.setPosition(self.currentIndex);
		}, 10000 );
        
        
	},
	
	setPosition: function( index ) {
		
		//trace("setPosition:" + index);
        
		var self = this, num, currentPos, nextPos, half = self.getWidth()/2;
		
		var beforeIndex = index-1;
		if( beforeIndex < 0 ) beforeIndex = self.total-1;
		self.fadeOutImage(beforeIndex+1);
        
		for (i in this.data.slides) {
			num = parseInt(i) + 1;
			$("#slide-" + num).stop();
			
			//currentPos = parseInt($("#slide-" + num).css("left"));
            currentPos = self.slidePosList[i];
			if( currentPos < -2000 ) {
				currentPos += this.total * 960;
				$("#slide-" + num).css({ left: currentPos + "px" });
				self.list.push(self.list.shift());
			}
			nextPos = currentPos - 960;
            
            if( nextPos <= half ) {
                //trace("move: slide-" +num); 
                if( parseInt($("#slide-" + num).css("left")) > currentPos ) $("#slide-" + num).css({left:currentPos.toString()+"px"})
                $("#slide-" + num).animate({
                    left: nextPos + "px"
                }, 2000, "easeInOutQuart", function() {
                    if( $(this).attr("id") == "slide-"+(index+1) ) self.fadeInImage(index+1);
                });
            }
            
            self.slidePosList[i] = nextPos;
		}
	},
	
	fadeInImage: function(num) {
		$("#slide-"+num + " img")
			.animate({opacity:"1.0"}, 800); 
	},
	
	fadeOutImage: function(num) {
		$("#slide-"+num + " img")
			.animate({opacity:"0.1"}, 800); 
	},
    
    render: function() {
    
    
        
        if( this.naviLock ) {
            var d1 = 0, d2 = 0;
            if( this.di != 0 ) d1 = this.dx * this.diff;
            this.dx = jQuery.easing.easeOutQuart(null, this.di, 0, 1, 14);
            d2 = Math.floor(this.dx * this.diff - d1);
            if( this.di < 14 ) {
                for (i=0; i<this.naviTotal; i++) {
                    var target = this.naviItems[i], p;
                    p = parseInt($(target).css("left"));
                    if(this.naviSlideDirection ) {
                        if( p <= -110 ) {
                            p += this.naviTotal * 135;
                        }
                    } else {
                        if( p >= 700 ) {
                            p -= this.naviTotal * 135;
                        }
                    }
                    $(target).css({left:(p+d2)+"px"});
                }
                this.di += 1;                
            }
            
        } else {
            for (i=0; i<this.naviTotal; i++) {
                var target = this.naviItems[i], p;
                p = parseInt($(target).css("left"));
                if( p <= -110 ) {
                    p += this.naviTotal * 135;
                }
                $(target).css({left:(p-1)+"px"});
            }
        }
    },
	
	nextThumbnail: function(time) {
		this.naviIndex += 1;
		if( this.naviIndex >= this.naviTotal ) this.naviIndex = 0;
		this.setThumbnailPosition(true, time);
	},
	prevThumbnail: function() {
		this.naviIndex -= 1;
		if( this.naviIndex < 0 ) this.naviIndex = this.naviTotal;
		this.setThumbnailPosition(false, 700);
	},
	setThumbnailPosition: function( direction, time ) {
		
		var self = this;
        
        clearTimeout(self.naviTimer);
        
        self.di = 0;
        self.diff = direction ? -135 : 135;
		self.naviSlideDirection = direction;
		self.naviLock = true;
        
        self.naviTimer = setTimeout(function(){
            clearTimeout(self.naviTimer);
            self.naviLock = false;
        }, 700)
	},
	
	getWidth: function() {
		var w = window.innerWidth;
		if( isIE ) w = document.body.clientWidth;
		return w > 960 ? w : 960;
	}
}
    












/*
 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
 *
 * Uses the built in easing capabilities added In jQuery 1.1
 * to offer multiple easing options
 *
 * TERMS OF USE - jQuery Easing
 * 
 * Open source under the BSD License. 
 * 
 * Copyright ﾂｩ 2008 George McGinley Smith
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without modification, 
 * are permitted provided that the following conditions are met:
 * 
 * Redistributions of source code must retain the above copyright notice, this list of 
 * conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list 
 * of conditions and the following disclaimer in the documentation and/or other materials 
 * provided with the distribution.
 * 
 * Neither the name of the author nor the names of contributors may be used to endorse 
 * or promote products derived from this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
 * OF THE POSSIBILITY OF SUCH DAMAGE. 
 *
*/

// t: current time, b: begInnIng value, c: change In value, d: duration
jQuery.easing['jswing']=jQuery.easing['swing'];jQuery.extend(jQuery.easing,{def:'easeOutQuad',swing:function(x,t,b,c,d){return jQuery.easing[jQuery.easing.def](x,t,b,c,d)},easeInQuad:function(x,t,b,c,d){return c*(t/=d)*t+b},easeOutQuad:function(x,t,b,c,d){return-c*(t/=d)*(t-2)+b},easeInOutQuad:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t+b;return-c/2*((--t)*(t-2)-1)+b},easeInCubic:function(x,t,b,c,d){return c*(t/=d)*t*t+b},easeOutCubic:function(x,t,b,c,d){return c*((t=t/d-1)*t*t+1)+b},easeInOutCubic:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t+b;return c/2*((t-=2)*t*t+2)+b},easeInQuart:function(x,t,b,c,d){return c*(t/=d)*t*t*t+b},easeOutQuart:function(x,t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b},easeInOutQuart:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t+b;return-c/2*((t-=2)*t*t*t-2)+b},easeInQuint:function(x,t,b,c,d){return c*(t/=d)*t*t*t*t+b},easeOutQuint:function(x,t,b,c,d){return c*((t=t/d-1)*t*t*t*t+1)+b},easeInOutQuint:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t*t+b;return c/2*((t-=2)*t*t*t*t+2)+b},easeInSine:function(x,t,b,c,d){return-c*Math.cos(t/d*(Math.PI/2))+c+b},easeOutSine:function(x,t,b,c,d){return c*Math.sin(t/d*(Math.PI/2))+b},easeInOutSine:function(x,t,b,c,d){return-c/2*(Math.cos(Math.PI*t/d)-1)+b},easeInExpo:function(x,t,b,c,d){return(t==0)?b:c*Math.pow(2,10*(t/d-1))+b},easeOutExpo:function(x,t,b,c,d){return(t==d)?b+c:c*(-Math.pow(2,-10*t/d)+1)+b},easeInOutExpo:function(x,t,b,c,d){if(t==0)return b;if(t==d)return b+c;if((t/=d/2)<1)return c/2*Math.pow(2,10*(t-1))+b;return c/2*(-Math.pow(2,-10*--t)+2)+b},easeInCirc:function(x,t,b,c,d){return-c*(Math.sqrt(1-(t/=d)*t)-1)+b},easeOutCirc:function(x,t,b,c,d){return c*Math.sqrt(1-(t=t/d-1)*t)+b},easeInOutCirc:function(x,t,b,c,d){if((t/=d/2)<1)return-c/2*(Math.sqrt(1-t*t)-1)+b;return c/2*(Math.sqrt(1-(t-=2)*t)+1)+b},easeInElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4}else var s=p/(2*Math.PI)*Math.asin(c/a);return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b},easeOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4}else var s=p/(2*Math.PI)*Math.asin(c/a);return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b},easeInOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d/2)==2)return b+c;if(!p)p=d*(.3*1.5);if(a<Math.abs(c)){a=c;var s=p/4}else var s=p/(2*Math.PI)*Math.asin(c/a);if(t<1)return-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b},easeInBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*(t/=d)*t*((s+1)*t-s)+b},easeOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},easeInOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;if((t/=d/2)<1)return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b},easeInBounce:function(x,t,b,c,d){return c-jQuery.easing.easeOutBounce(x,d-t,0,c,d)+b},easeOutBounce:function(x,t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b}else{return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b}},easeInOutBounce:function(x,t,b,c,d){if(t<d/2)return jQuery.easing.easeInBounce(x,t*2,0,c,d)*.5+b;return jQuery.easing.easeOutBounce(x,t*2-d,0,c,d)*.5+c*.5+b}});

/*
 *
 * TERMS OF USE - EASING EQUATIONS
 * 
 * Open source under the BSD License. 
 * 
 * Copyright ﾂｩ 2001 Robert Penner
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without modification, 
 * are permitted provided that the following conditions are met:
 * 
 * Redistributions of source code must retain the above copyright notice, this list of 
 * conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list 
 * of conditions and the following disclaimer in the documentation and/or other materials 
 * provided with the distribution.
 * 
 * Neither the name of the author nor the names of contributors may be used to endorse 
 * or promote products derived from this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
 * OF THE POSSIBILITY OF SUCH DAMAGE. 
 *
 */
 
 
 
 
 /*
 * EnterFrame.js
 * Copyright (c) Matsukaze. All Rights Reserved.
 * @version 1.0
 * @author mach3
 * @require jQuery
 */
var EnterFrame=function(a){this.config(a)};EnterFrame.prototype={option:{fps:30},active:true,funcs:[],tid:null,config:function(a){this.option=$.extend({},this.option,a);return this},start:function(){this.active=true;this._enterFrame();return this},_enterFrame:function(){if(this.active){$.each(this.funcs,function(a,b){b()});this.tid=setTimeout($.proxy(this._enterFrame,this),Math.floor(1000/this.option.fps))}},stop:function(){this.active=false;clearTimeout(this.tid);return this},add:function(a){this.funcs.push(a);return this},remove:function(a){this.funcs=$.grep(this.funcs,function(c,b){return(a!==c)});return this}};
