var xOp7Up,xOp6Dn,xIE4Up,xIE4,xIE5,xNN4,xUA=navigator.userAgent.toLowerCase();
if(window.opera){
var i=xUA.indexOf("opera");
if(i!=-1){
var v=parseInt(xUA.charAt(i+6));
xOp7Up=v>=7;
xOp6Dn=v<7;
}
}else{
if(navigator.vendor!="KDE"&&document.all&&xUA.indexOf("msie")!=-1){
xIE4Up=parseFloat(navigator.appVersion)>=4;
xIE4=xUA.indexOf("msie 4")!=-1;
xIE5=xUA.indexOf("msie 5")!=-1;
}else{
if(document.layers){
xNN4=true;
}
}
}
if(xUA.indexOf("gecko")){
xIE4Up=1;
}
xMac=xUA.indexOf("mac")!=-1;
function xAddEventListener(e,eT,eL,_4){
if(!(e=xGetElementById(e))){
return;
}
eT=eT.toLowerCase();
var eh="e.on"+eT+"=eL";
if(e.addEventListener){
e.addEventListener(eT,eL,_4);
}else{
if(e.attachEvent){
e.attachEvent("on"+eT,eL);
}else{
eval(eh);
}
}
}
function xClientWidth(){
var w=0;
if(xOp6Dn){
w=window.innerWidth;
}else{
if(document.compatMode=="CSS1Compat"&&!window.opera&&document.documentElement&&document.documentElement.clientWidth){
w=document.documentElement.clientWidth;
}else{
if(document.body&&document.body.clientWidth){
w=document.body.clientWidth;
}else{
if(xDef(window.innerWidth,window.innerHeight,document.height)){
w=window.innerWidth;
if(document.height>window.innerHeight){
w-=16;
}
}
}
}
}
return w;
}
function xDef(){
for(var i=0;i<arguments.length;++i){
if(typeof (arguments[i])=="undefined"){
return false;
}
}
return true;
}
function xDisplay(e,s){
if(!(e=xGetElementById(e))){
return null;
}
if(e.style&&xDef(e.style.display)){
if(xStr(s)){
e.style.display=s;
}
return e.style.display;
}
return null;
}
function xGetElementById(e){
if(typeof (e)!="string"){
return e;
}
if(document.getElementById){
e=document.getElementById(e);
}else{
if(document.all){
e=document.all[e];
}else{
e=null;
}
}
return e;
}
function xNum(){
for(var i=0;i<arguments.length;++i){
if(isNaN(arguments[i])||typeof (arguments[i])!="number"){
return false;
}
}
return true;
}
function xOffsetLeft(e){
if(!(e=xGetElementById(e))){
return 0;
}
if(xDef(e.offsetLeft)){
return e.offsetLeft;
}else{
return 0;
}
}
function xStr(s){
for(var i=0;i<arguments.length;++i){
if(typeof (arguments[i])!="string"){
return false;
}
}
return true;
}
function xWidth(e,w){
if(!(e=xGetElementById(e))){
return 0;
}
if(xNum(w)){
if(w<0){
w=0;
}else{
w=Math.round(w);
}
}else{
w=-1;
}
var css=xDef(e.style);
if(e==document||e.tagName.toLowerCase()=="html"||e.tagName.toLowerCase()=="body"){
w=xClientWidth();
}else{
if(css&&xDef(e.offsetWidth)&&xStr(e.style.width)){
if(w>=0){
var pl=0,pr=0,bl=0,br=0;
if(document.compatMode=="CSS1Compat"){
var gcs=xGetComputedStyle;
pl=gcs(e,"padding-left",1);
if(pl!==null){
pr=gcs(e,"padding-right",1);
bl=gcs(e,"border-left-width",1);
br=gcs(e,"border-right-width",1);
}else{
if(xDef(e.offsetWidth,e.style.width)){
e.style.width=w+"px";
pl=e.offsetWidth-w;
}
}
}
w-=(pl+pr+bl+br);
if(isNaN(w)||w<0){
return;
}else{
e.style.width=w+"px";
}
}
w=e.offsetWidth;
}else{
if(css&&xDef(e.style.pixelWidth)){
if(w>=0){
e.style.pixelWidth=w;
}
w=e.style.pixelWidth;
}
}
}
return w;
}
function ieBody(){
return (document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body;
}
var FilmScroller=function(){
this.restArea=60;
this.maxSpeed=4;
this.arrowSpeed=6;
this.scrollSpeed=0;
this.moveState="";
this.actualWidth=0;
this.sCon1;
this.sCon2;
this.sCon3;
this.nsScroll;
this.showingTitle;
this.loaded=false;
this.lastProduct;
this.leftTime;
this.rightTime;
var _18=this;
this.getPosOffset=function(_19,_1a){
var _1b=(_1a=="left")?_19.offsetLeft:_19.offsetTop;
var _1c=_19.offsetParent;
while(_1c!=null){
_1b=(_1a=="left")?_1b+_1c.offsetLeft:_1b+_1c.offsetTop;
_1c=_1c.offsetParent;
}
return _1b;
};
this.scrollMotionEvent=function(e){
var _1e=(window.pageXOffset)?pageXOffset:ieBody().scrollLeft;
var _1f=(window.pageYOffset)?pageYOffset:ieBody().scrollTop;
var _20=window.event?event.clientX:e.clientX?e.clientX:"";
var _21=(this.menuWidth-this.restArea)/2;
var _22=(this.menuWidth+this.restArea)/2;
_20-=this.mainObjOffset-_1e;
if(_20>_22){
this.scrollSpeed=(_20-_22)/((this.menuWidth-this.restArea)/2)*this.maxSpeed;
if(this.rightTime){
clearTimeout(this.rightTime);
}
if(this.moveState!="left"){
this.moveRight();
}
}else{
if(_20<_21){
this.scrollSpeed=(_21-_20)/((this.menuWidth-this.restArea)/2)*this.maxSpeed;
if(this.leftTime){
clearTimeout(this.leftTime);
}
if(this.moveState!="right"){
this.moveLeft();
}
}else{
this.scrollSpeed=0;
}
}
};
this.stopMotionEvent=function(e){
if((window.event&&!this.sCon1.contains(event.toElement))||(e&&e.currentTarget&&e.currentTarget!=e.relatedTarget&&!this.containsNS6(e.currentTarget,e.relatedTarget))){
this.stopMotion();
}
};
this.moveRight=function(_24){
if(!this.loaded){
return;
}
if(_24){
this.scrollSpeed=this.arrowSpeed;
}
this.moveState="left";
if(parseInt(this.sCon2.style.left)>(this.menuWidth-this.actualWidth)){
this.sCon2.style.left=parseInt(this.sCon2.style.left)-this.scrollSpeed+"px";
}
this.leftTime=setTimeout(function(){
_18.moveRight();
},this.scrollSpeed);
};
this.moveLeft=function(_25){
if(!this.loaded){return;} 
if(_25){this.scrollSpeed=this.arrowSpeed;}
this.moveState="right";
if(parseInt(this.sCon2.style.left)<0){
this.sCon2.style.left=parseInt(this.sCon2.style.left)+this.scrollSpeed+"px";
}
this.rightTime=setTimeout(function(){
_18.moveLeft();
},this.scrollSpeed);
};
this.stopMotion=function(){
if(this.leftTime){
clearTimeout(this.leftTime);
}
if(this.rightTime){
clearTimeout(this.rightTime);
}
this.moveState="";
};
this.resetPos=function(xske){if(!this.loaded){return;}
this.stopMotion();
if(xske=="right"){this.sCon2.style.left=(this.menuWidth-this.actualWidth)+"px";}else{this.sCon2.style.left="0px";}
};
this.showProduct=function(xid){
if(this.lastProduct){
this.lastProduct.className="ScrollPicHide";
xDisplay(this.lastDetail,"none");
}
this.lastProduct=xGetElementById("ScrollPic"+xid);
this.lastProduct.className="ScrollPicShow";
this.lastDetail=xGetElementById("ScrollInfo"+xid);
xDisplay(this.lastDetail,"");
};
this.containsNS6=function(a,b){
if(!a||!b){
return true;
}
while(b.parentNode){
if((b=b.parentNode)==a){
return true;
}
}
return false;
};
this.resetSize=function(){
if(xWidth(this.sCon1)<xWidth(this.sCon3)){
xDisplay(this.showingTitle,"");
xDisplay(this.leftCon,"");
xDisplay(this.rightCon,"");
var _2a=this;
this.sCon1.onmousemove=function(e){
_2a.scrollMotionEvent(e);
};
this.sCon1.onmouseout=function(e){
_2a.stopMotionEvent(e);
};
this.loaded=true;
}else{
xDisplay(this.showingTitle,"none");
xDisplay(this.leftCon,"none");
xDisplay(this.rightCon,"none");
this.sCon1.onmouseout=null;
this.sCon1.onmousemove=null;
this.loaded=false;
}
this.mainObjOffset=xOffsetLeft(this.sCon1);
this.menuWidth=xWidth(this.sCon1);
this.actualWidth=xWidth(this.sCon3);
this.sCon2.style.left="0px";
this.scrollSpeed=0;
this.moveState="";
};
this.init=function(){
if(this.showingTitle){
}
this.sCon1=xGetElementById("ScrollArea1");
this.sCon2=xGetElementById("ScrollArea2");
this.sCon3=xGetElementById("ScrollArea3");
this.leftCon=xGetElementById("ScrollLeft");
this.rightCon=xGetElementById("ScrollRight");
this.lastProduct=xGetElementById("ScrollPic1");
this.lastDetail=xGetElementById("ScrollInfo1");
this.resetSize();
xAddEventListener(window, "load", function(){
_18.resetSize();
});
xAddEventListener(window, "resize", function(){
_18.resetSize();
});
}; 
this.init();
return this;
};




