// easing equations copyright www.robertpenner.com
var easings={"back":{"InOut":function(t,b,c,d,s){ if(!s)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; }},"quart":{"InOut":function(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; },"In":function(t,b,c,d){ return c*(t/=d)*t*t*t + b; },"Out":function(t,b,c,d){ return -c*((t=t/d-1)*t*t*t-1)+b; }},"quint":{"InOut":function(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; }}};

function Slider(el,tp1,tp2,tp3,aX,oX,dur){
	this.el=el; this.b=aX; this.c=oX; this.tp1=tp1; this.tp2=tp2; this.d=dur; this.css=tp3; this.calc=easings[tp1][tp2]; this.off=0;
	
	this.setMove=function(){
		switch(this.css){
			case "clipLeft": this.move=function(x){ this.el.style['clip']="rect(0 auto auto "+x+"px)"; }; break;
			case "clipRight": this.move=function(x){ this.el.style['clip']="rect(0 "+x+"px auto 0)"; }; break;
			case "scrollTop": this.move=function(x){ window.scrollTo(0,x); }; break;
			default: this.move=function(x){ this.el.style[this.css]=x+"px"; if(this.css2)this.el.style[this.css2]=(this.b2+(x-this.b)*this.rel)+"px"; }
		}
	}
	this.setMove();
	this.setTypes=function(tp1,tp2,tp3){ this.calc=easings[tp1][tp2]; this.css=tp3;	this.setMove(); }
	this.setValues=function(aX,oX,dur){ this.b=aX; this.c=oX; this.d=dur; }
	this.setDur=function(dur){ this.d=dur; }
	this.setCss=function(tp3,aX,oX){ this.css2=tp3; this.b2=aX; this.rel=oX/this.c; }
	this.reset=function(){
		switch(this.css){
			case "clipRight": case "clipLeft": this.el.style['clip']="rect(auto auto auto auto)"; break;
			case "scrollTop": window.scrollTo(0,this.b); break;
			default: this.el.style[this.css]=this.b+"px";
		}
	}
	this.setCmd=function(cmd){ this.cmd=cmd; }
	this.setCall=function(call){ this.call=call; }
	this.setOff=function(off){ this.off=off; }
	this.getSecs=function(){ return new Date().getTime(); }
	this.go=function(rev){
		this.rev=rev;
		if(this.to)clearTimeout(this.to);
		if(this.tp2!="InOut")this.setTypes(this.tp1,this.tp2.match(/In/)?(this.rev?"Out":"In"):(this.rev?"In":"Out"),this.css);
		this.startT=this.getSecs()-this.off; this.maxX=this.rev?this.b:this.b+this.c;
		if(this.call){
			this.call.slider.startT=this.startT;
			this.call.slider.rev=rev; this.call.slider.setDur(this.d);
			this.call.slider.maxX=this.rev?this.call.slider.b:this.call.slider.b+this.call.slider.c;
		}
		this.ease();
	}
	this.ease=function(callee){
		if(callee)this.nt=callee; else{ this.nt=(this.getSecs()-this.startT)/10; if(!this.nt)this.nt=0.1; if(this.rev)this.nt=this.d-this.nt; }
		this.tmpX=this.calc(this.nt,this.b,this.c,this.d);
		if(this.nt>0 && this.nt<this.d){
			if(!callee)this.to=setTimeout("get('"+this.el.id+"').slider.ease()"
				+(this.call?("; get('"+this.call.id+"').slider.ease("+this.nt+")"):""),10);
		}else{
			clearTimeout(this.to); this.startT=0; this.tmpX=this.maxX;
			this.to=this.cmd?setTimeout(this.cmd,10):0;
		}
		this.move(this.tmpX);
	}
}



function base(){
	var agent=navigator.userAgent.toLowerCase(), mimes=navigator.mimeTypes;
	this.wp=window.parent;
	this.wt=window.top;
	this.op=window.opera;
	this.oldop=this.op&&agent.match(/opera\W?[34567]/);
	this.ie=agent.match(/msie/)&&!this.op;
	this.saf=0;//agent.match(/safari/);
	this.mac=agent.match(/mac/);
	this.ie5=this.ie&&agent.match(/msie\s5/);
	this.ie50=this.ie&&agent.match(/msie\s5\.0/);
	this.ie55=(this.ie5 && agent.match(/msie\s5\.5/));
	this.moz=agent.match(/gecko/);
	this.oldmoz=agent.match(/rv\:1\.[01234](\.\d)?\)\Wgecko/);
	this.ns6=agent.match(/netscape\D?6/);
	this.osx=this.mac&&(this.saf||agent.match(/5\.22|os\s?x/));
	this.fox=agent.match(/firefox/);
	this.ief=this.ie&&!this.ie50;
	this.isn=this.ie50||this.saf||this.ns6||this.op;
	this.cantscroll=(this.mac&&!this.osx||this.mac&&this.ie);
	this.oldsaf=this.saf&&agent.match(/safari\W8/i);
	this.server=this.wt.location.href.match(/(.*)\/([^\/]+)?$/);
	this.local=new RegExp(this.server[1].replace(/([\.\/\\])/g,"\$1"));
	this.email=new RegExp("^[a-z0-9\.\_\!\#\$\%\&\'\`\*\+\/=\?\^\_\{\|\}\~\-]+\@([a-z0-9\-]+[\.])+[a-z]{2,}$","i");
	this.loaded=0;
	this.oscrT=0;
}
var bw=new base(),curr={"z":5,"box":0}, e=0, dMenu=0, mTo=0;
if(bw.ie5&&bw.mac||bw.oldop)bw.text=1;

document.write('<style type="text/css">.box,.postit{visibility:hidden}</style>');

if(bw.ns6)document.write('<style type="text/css">.r{float:right !important} #box2{width:295px !important} #box10{width:599px !important}</style>');

function showDIV(el,tp){ el.style.visibility=tp?"visible":"hidden"; }
function get(el){ return document.getElementById(el); }
function gets(el,par){ return par.getElementsByTagName(el); }
function make(el){ return document.createElement(el); }
function blurit(){ this.blur(); }
function px(nr){ return nr+"px"; }
function getWinSize(){
	if(typeof(window.innerWidth)=='number'){ bw.winW=window.innerWidth; bw.winH=window.innerHeight; }
	else{ winel=bw.dd&&bw.dd.clientWidth?bw.dd:bw.db; bw.winW=winel.clientWidth; bw.winH=winel.clientHeight; }
}
function getScrollTop(){
	var x=0, y=0;
	if(bw.dd && bw.dd.scrollTop){ x=bw.dd.scrollLeft; y=bw.dd.scrollTop; }else if(bw.db && bw.db.scrollTop){ x=bw.db.scrollLeft; y=bw.db.scrollTop; }else if(window.pageYOffset){ x=self.pageXOffset; y=self.pageYOffset; }else if(window.scrollY){ x=window.scrollX; y=window.scrollY; }
	bw.scrL=x; bw.scrT=y;
}

//=====================================================drag
zI=8; popT=popL=0; 
popDown=function(e){
	this.style.zIndex=++zI;
	trg=e?e.target:event.srcElement;
	showDIV(get("DIVdrag"),0); this.onmousemove=this.onmouseout=null; bw.drag=1;
	if(!trg.tagName.match(/a/i)){
		getScrollTop(); bw.pop=this;
		popT=popL=0; popMouse(e); popL=popX-parseInt(this.offsetLeft); popT=popY-parseInt(this.offsetTop);
		document.onmousemove=popMove; document.onmouseup=popUp; _Vdrag=true; return false;
	}
}
popMove=function(e){
	popMouse(e); bw.pop.style.top=px(popY); bw.pop.style.left=px(popX>0?popX:0); if(document.all)return false;
}
popUp=function(){
	nX=nY=0;
	if(popX<-255)nX=-255; /*if(popY<0)nY=1;*/ //if(popX>winX-80)nX=winX-90;
	if(nY)bw.pop.style.top=px(nY); if(nX)bw.pop.style.left=px(nX);
	document.onmousemove=document.onmouseup=function(){return false}; _Vdrag=false; return true;
}
popMouse=new Function("e","popY=("+(document.all?"event.clientY+bw.scrT":"e.pageY")+")-popT; popX=("+(document.all?"event.clientX+bw.scrT":"e.pageX")+")-popL");
clickNdrag=function(e){
	if(bw.drag)return; popMouse(e); showDIV(get("DIVdrag"),1); get("DIVdrag").style.left=px(popX+10); get("DIVdrag").style.top=px(popY+20); if(document.all)return false;
}

ipat=/imgs\/[^\.]+\.\w{3}/; apat=/([^\/]+)\.html/; conts=[]; cl=["t","l","img","r","b","b2"]; prts={'10':1,'20':1,'21':3,'22':3,'23':5,'30':1,'40':1,'50':1,'60':3,'61':2,'62':2,'63':2,'70':3,'80':1,'90':1,'210':3,'220':3,'230':5};
pgs={'10':3,'210':3,'220':1,'230':2,'30':62,'40':3,'50':3,'60':1,'61':11,'62':9,'63':11,'70':3,'80':35,'90':4,'308':2}; pos={'1':[470,7],'2':[220,290],'3':[460,360],'4':[610,200],'5':[610,55],'6':[380,80],'7':[290,180],'8':[100,280],'9':[135,160],'10':[135,0],'20':[0,0],'21':[210,-250],'22':[0,-300],'23':[-220,-250],'30':[0,0],'40':[0,0],'50':[-7,-2],'60':[1,-1],'61':[-169,-81],'62':[-66,-70],'63':[-129,-47],'70':[219,-5],'80':[0,0],'90':[0,0],'210':[7,-9],'220':[7,-9],'230':[7,-9],'301':[0,0],'302':[0,0],'303':[0,0],'304':[0,0],'305':[0,0],'306':[0,0],'307':[0,0],'308':[0,0],'309':[0,0]}; sliders=[];
btypes=[]; boxs=[];



cats={"10":'inspiration',"20":'product',"21":'africa',"22":'bruised',"23":'japanese',"210":'africa',"220":'bruised',"230":'japanese',"30":'press',"40":'store',"50":'contact',"60":'collection',"70":'prps',"80":'who',"90":'prps_noir'};
ii=-1; IMGpre=[];
preBox=[1,2,3,5,6,7,8,9,10,20,21,22,23,30,50,60,61,62,63,70,80,90,210,220,230,301,302,303,304,305,306,307,308,309];
labels={"30":['.. loading ..','InStyle','Times','Liberty Magazine','Men&rsquo;s Health','GQ','GQ','GQ','GQ','GQ','Esquire','Streetwear','Maxi','Maxi','Men&rsquo;s Health','FHM','Vanity Fair','Clash','Shortlist','InStyle','Sportswear International','J&rsquo;n&rsquo;C','The Times','FHM','Vogue','Dazed','Vogue','Sunday Times Style','Men&rsquo;s Health','Look','GQ','GQ','GQ','GQ','GQ','GQ','Express','Elle','Elle','Elle','Elle','Intersection','Faces','Daily Mail','Pig Magazine','Pig Magazine','Pig Magazine','GQ','GQ','Madame','Cosmopolitan','The Times','Sunday Times Style','Grazia','Grazia','Grazia','Woman','Blonde','Zeit Magazin','Gala','Welt Kompakt','Welt Kompakt','Glamour','Men&rsquo;s Health USA','InStyle','Vogue UK','Redbook USA','Life &amp; Style Weeklly USA','Glamour Mag USA','GQ','Tw Magazine','The Guardian Weekend UK','Shortlist','Grazia','GQ','GQ','Glamour','FHM','FHM','Elle','Antenna USA','Zoo','WWD','Selectism','Intersection','InStyle','Intersection','HT','Times Magazine','Men&rsquo;s Health','Grazia','FHM','GQ','FHM','FHM','You','Marie Claire','GQ','InStyle','New','InStyle','Grazia','Glamour','Myself','Faces'],"80":['.. loading ..','Brad Pitt','Johnny Depp','David Beckham','Antonio Banderas','Jude Law','Tom Cruise','Keanu Reaves','Bruce Willis','Gerard Bulter','Christian Bale','Tom Brady','Jamie Dornan','Jay Z','Scott Speedman','Dominic Cooper','Jamie Oliver','Gavin Rossdale','Tinie Tempah','Gorillaz','Kate Moss','Elle McPherson','Megan Fox','Katie Holmes','Sandra Bullock','Keira Knightley','Laetitia Casta','Julia Restoin Roitfeld','Halle Berry','Sienna Miller','Bar Rafaeli','Victoria Beckham','Lindsey Lohan','Cheryl Cole','Rosie Huntington Whiteley','Christina Aguilera']};

for(b=0;b<preBox.length;b++){
	boxnr=preBox[b];
	card=boxnr>60&&boxnr<70; sub=boxnr>20&&boxnr<30;
	for(i=0;i<(boxnr==60?6:5);i++){
		parts=cl[i]=="img"&&(sub||(boxnr>9&&boxnr<300))?prts[boxnr]:1;
		tp=boxnr<10||sub?cats[boxnr*10]:(card?"card"+(boxnr-60):cats[boxnr]);
		if(boxnr>300)tp="goods"+(boxnr-300);
		for(p=1;p<=parts;p++){
			if(cl[i]=="img"||(boxnr<62||boxnr>63))IMGpre[++ii]=(card&&cl[i]!="img"?"card":tp)+(card?"_":(boxnr<10||sub?"_cl_":(boxnr>300?"_":"_op_")))+cl[i]+(cl[i]=="img"&&boxnr>9&&!sub?("_"+p):"")+(cl[i]=="img"?".jpg":".png");
			//if(boxnr>307)alert((card&&cl[i]!="img"?"card":tp)+(card?"_":(boxnr<10||sub?"_cl_":(boxnr>300?"_":"_op_")))+cl[i]+(cl[i]=="img"&&boxnr>9&&!sub?("_"+p):"")+(cl[i]=="img"?".jpg":".png"))
		}
	}
}

newIMGs=["menu_prps.png","menu_noir.png","menu_goods.png","bg_noir.jpg","bg_goods.jpg"];
for(b=0;b<newIMGs.length;b++){
	IMGpre[++ii]=newIMGs[b];
}
//alert(IMGpre[ii])
IMGnr=IMGes=IMGpre.length;//+(bw.ief?7:0);
iimg=[];


function Box(boxnr,tp){ 
	this.id="box"+boxnr; this.nr=boxnr;
	this.el=get(this.id); this.el.onmousedown=popDown;
	this.slt=this.el.offsetTop; this.sll=this.el.offsetLeft;
	this.height=this.el.offsetHeight;
	this.width=this.el.offsetWidth;
	if(tp){
		this.type=tp; 
		if(this.type=="card"){
			this.card=1; this.parentBox=boxs[60];
			this.slt=this.parentBox.slt-pos[boxnr][1];
			this.el.style.left=px(this.parentBox.sll-pos[boxnr][0]);
		}else if(this.type=="sub"){
			this.sub=1; this.parentBox=boxs[20];
			this.slt=this.parentBox.slt-pos[boxnr][1]; //if(this.nr==20)alert(this.slt)
			this.el.style.left=px(this.parentBox.sll-pos[boxnr][0]);
		}else{
			this.parentBox=boxs[boxnr/10];
			this.slt=boxnr.toString().match(/10|20|30|40|50|60|80/)?this.parentBox.slt:(bw.winH-this.width)/2;
			this.openBox=1;
		}
		if(this.slt<0)this.slt=20;
		this.el.style.zIndex=++zI;
		this.pages=pgs[boxnr];
		if(this.pages>1)this.currPage=1;
	}else{
		if(boxnr>300){ this.type="goods"; this.pages=pgs[boxnr]; this.currPage=1; }
		this.el.onmousemove=clickNdrag;
		this.el.onmouseout=function(){ showDIV(get("DIVdrag"),0); }
	}
	this.el.slider=new Slider(this.el,"quart","InOut","top",-500-this.height,this.slt+this.height+500,this.openBox||this.card||this.sub?0:70);
	this.el.style.top=px(-this.height-50);
	
	this.link=this.doLinks(gets("A",this.el));
	btypes[boxnr]=this.type;
	this.imgs=[]; this.to=0; this.inr=((boxnr==60?6:5))+(this.openBox||this.card?prts[boxnr]-1:0);
	this.zI=this.el.style.zIndex;
	this.divs=[];
	for(i=0;i<(boxnr==60?6:5);i++){
		this.divs[i]=make("div"); this.divs[i].className=cl[i];
		this.el.appendChild(this.divs[i]);
		if(cl[i]=="img")this.idiv=this.divs[i];
		parts=cl[i]=="img"&&(this.openBox||this.card)?prts[boxnr]:1;
		for(p=1;p<=parts;p++){
			if(this.type=="goods")
				this.Image([this.type+(boxnr-300)+"_"+cl[i]+(cl[i]=="img"?("_"+p+".jpg"):".png")],cl[i],this.divs[i]);
			else
				this.Image([(this.card&&cl[i]!="img"?"card":this.type)+(this.card||boxnr>300?"_":(this.nr<10||this.sub?"_cl_":"_op_"))+cl[i]
				+(cl[i]=="img"&&(this.openBox||this.card)?("_"+p):"")
				+(cl[i]=="img"?".jpg":".png")],cl[i],this.divs[i]);
		}
	}
}
Box.prototype.doLinks=function(as,tp){
	for(l=0;l<as.length;l++){
		a=as[l];
		a.box=this;
		a.onfocus=blurit;
		switch(a.className){
			case "email": break;
			case "close": a.onclick=closePage; break;
			case "turn": a.onclick=turnPage; break;
			case "more": a.onclick=readMore; break;
			case "switch": if(a.id.match(/scroll/))a.onmouseover=a.onmouseout=scrollTBL; else a.onclick=switchPage; break;
			default:
				a.onclick=menu; this.lnk=a;
				lnk=a.href.match(apat);
				conts[lnk[1]]=this.nr;
				this.type=lnk[1];
		}
	}
}
Box.prototype.Image=function(src,tp,elp){
	if(bw.op){
		elp.innerHTML='<img src="imgs/'+(src[0].match(/\.png|_op|card/)?"saf/":"")+src[0]+'" onload="safLoaded('+this.nr+')">';
		return elp.firstChild;
	}else{
		png=bw.ief&&src[0].match(/\.png$/);
		bsrc="imgs/"+(bw.saf&&src[0].match(/\.png/)?"saf/":"")+(bw.ie50?src[0].replace(/\.png/,".gif"):src[0]);
		if(!iimg[bsrc])alert(bsrc); bimg=iimg[bsrc];
		if(png)elp.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="imgs/'+bsrc.replace(/^([^\/]+\/)/,"")+'")';
		else{
			elp.appendChild(this.card && src[0].match(/\.png/)?bimg.cloneNode(false):bimg);
		}
		this.bloading();
		return bimg;
	}
}
safLoaded=function(snr){  boxs[snr].bloading(); this.onload="return false"; }
Box.prototype.imageLoaded=function(snr){
	this.box.bloading(); this.onload=""; 
	if(this.png)this.parent.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="imgs/'+this.nsrc.replace(/^([^\/]+\/)/,"")+'")';
}
Box.prototype.bloading=function(){
	this.inr--;
	if(this.inr<1){
		this.loaded=1;
		this.el.slider.setCmd(0)
		if(this.openBox||this.card||this.sub){
			if(this.sub||this.card||this.nr.toString().match(/^(10|20|30|50|60|80|90)$/)){
				if(this.sub||this.nr==60||this.nr==50||this.nr==10||this.nr==20||this.nr==90){
					this.slt=this.parentBox.el.offsetTop; this.el.style.top=px(this.slt);
				}	
				this.el.style.left=px(this.parentBox.el.offsetLeft-pos[this.nr][0]);
				if(this.nr.toString().match(/^(20|30|60|80|90)$/))this.el.slider.setValues(-500-this.height,this.slt+this.height+500,0);
				if(this.nr.toString().match(/^(30|80)$/))setLabel(this.nr,1);
			}else{
				nW=this.parentBox.el.offsetLeft+this.parentBox.width/2-this.width/2; this.el.style.left=px(nW>0?nW:0);
			}
			this.el.style.zIndex=++zI;
			if(!this.card&&!this.sub)this.el.slider.setCmd("showDIV(boxs["+this.parentBox.nr+"].el,0)");
		}
		this.next=this.nr==3?this.nr+2:this.nr+1; //remove box 4
		showDIV(this.el,1);
		if(bw.section=="goods"||(bw.section=="prps"&&this.next!=9)){
			if(boxs[this.next])boxs[this.next].bloading();
			else if(get("box"+this.next))this.to=setTimeout("boxs["+this.next+"]=new Box("+this.next+(this.next>60&&this.next<70?",'card'":(this.next>20&&this.next<30?",'sub'":""))+")",100);
		}
		if(bw.loaded)this.el.slider.go(0); else preLoaded();
	}
}
function startIE(){
	bw.ieloaded=1;
	for(y=1;y<9;y++)setTimeout("boxs["+y+"].el.slider.go(0)",y*150);
}

function closePage(evt,bnr){
	if(bnr)this.box=boxs[bnr];
	this.box.parentBox.el.style.zIndex=zI;
	if(this.box.nr=="60"){
		for(c=61;c<64;c++){ boxs[c].el.style.top=px(-1000); showDIV(boxs[c].el,0); }
	}else if(this.box.nr=="20"){
		for(c=21;c<24;c++){ boxs[c].el.style.top=px(-1000); showDIV(boxs[c].el,0); if(boxs[c*10]){ boxs[c*10].el.style.top=px(-1000); showDIV(boxs[c*10].el,0); } }
	}
	showDIV(this.box.parentBox.el,1);
	this.box.el.slider.setCmd(0);
	this.box.el.slider.go(-1);
	return false;
}
function turnPage(){
	cPage=this.box.currPage;
	nPage=cPage==this.box.pages?1:cPage+1;
	switch(prts[this.box.nr]){
		case 1: case 2: prt=0; break; case 3: prt=1; break; case 5: prt=2; break; default: prt=0;
	}
	pimg=this.box.idiv.childNodes[prt]; if(!pimg.onload)pimg.onload=new Function("this.ploading=0");
        if(!pimg.ploading){
            pimg.src=pimg.src.replace(cPage==1?/\.jpg/:/_\d+\w?\.jpg/,(nPage>1?("_"+nPage):"")+".jpg");
            pimg.ploading=1;
            if(pimg.src.match(/who_op|press_op/)){
                pimg.tmo=setTimeout("setLabel("+this.box.nr+",0)",500);
                pimg.onload=new Function("this.ploading=0; clearTimeout(this.tmo); setLabel("+this.box.nr+","+nPage+");");
            }
            this.box.el.className="box page"+nPage;
            this.box.currPage=nPage;
        }
	return false;
}
function setLabel(bnr,wnr){
	get("D"+bnr+"name").innerHTML="<b>"+labels[bnr][wnr]+"</b>";
}
function readMore(){
	more=this.href.match(/(\d\w?)\.html/i);
	switch(prts[this.box.nr]){
		case 1: prt=0; break; case 3: prt=1; break; case 5: prt=2; break;
	}
	pimg=this.box.idiv.childNodes[prt];
	
	if(this.box.more){
		pimg.src=this.box.more[0]; this.box.el.className=this.box.more[1];
		this.box.more=0;
	}else{
		this.box.more=[pimg.src,this.box.el.className]; this.box.el.className+=" "+more[1].replace(/\d/,"");
		pimg.src=pimg.src.replace(/_\d\w?\.jpg/,"_"+more[1]+".jpg");
	}
	return false;
}
function switchPage(){
	if(!this.box.el.oldClass)this.box.el.oldClass=this.box.el.className;
	this.box.el.className=this.box.el.oldClass+" "+this.id;
	return false;
}
function scrollTBL(){
	this.screl=get(this.box.el.className.match(/2/)?"twomen":"tmen"); this.screl.scrdir=this.id.match(/1/);
	if(!this.screl.h){ this.screl.t=0; this.screl.h=this.screl.offsetHeight-191; }
	if(!this.screl.int)this.screl.int=setInterval("scrollGO(get('"+this.screl.id+"'))",20); else{ clearInterval(this.screl.int); this.screl.int=0; }
}
function scrollGO(el){
	el.t+=2*(el.scrdir?1:-1);
	if(el.t>=0)el.t=0; else if(el.t<=-el.h)el.t=-el.h;
	el.style.top=px(el.t);
}

function menu(){
	opnr=this.box.onr=this.box.nr*10;
	if(boxs[opnr])boxs[opnr].bloading();
	else boxs[opnr]=new Box(opnr,this.box.type);
	return false;
}
function rover(el,tp){
	if(!el.onmouseout)el.onmouseout=new Function("rover(this,0)");
	el.className=tp?"lihover":"";
}
scct=0;
function showSection(sc){
	if(sc==bw.section)return false;
	if(sc!="home"||bw.section=="prps")for(i=1;i<4;i++){
		tags[i].slider.setValues(-400,400,70);
		tags[i].slider.setCmd(0); tags[i].slider.setCall(0); 
	}
	if(boxs[1])boxs[1].el.slider.setCmd(0);
	if(boxs[305])boxs[305].el.slider.setCmd(0);
	switch(sc){
		case "home":
			cmd="for(i=1;i<4;i++)setTimeout('tags['+i+'].slider.go(0)',(i-1)*150)";
			nr=0;
			break;
		case "noir":
			tags[2].slider.setCall(get('BGnoir'));
			tags[2].slider.setValues(0,1024,70);
			if(boxs[9])boxs[9].el.slider.setCmd(0);
			nr=2;
			cmd=(boxs[9]?"showDIV(boxs[9].el,1); boxs[9].el.slider.go(0)":"boxs[9]=new Box(9)")+"; setTimeout('showDIV(nlink[0],1)',1000)";
			break;
		case "goods":
			tags[3].slider.setCall(get('BGgoods'));
			tags[3].slider.setValues(0,1024,70);
			cmd=boxs[301]?"for(i=301;i<310;i++)if(boxs[i])setTimeout('boxs['+i+'].el.slider.go(0)',(i-301)*150)":"boxs[301]=new Box(301)";
			cmd+="; setTimeout('showDIV(glink[0],1)',2000)";
			nr=3;
			break;
		case "prps":
			cmd=boxs[1]?"for(i=1;i<9;i++)if(boxs[i])setTimeout('boxs['+i+'].el.slider.go(0)',(i-1)*150)":"boxs[1]=new Box(1)";
			cmd+="; setTimeout('showDIV(plink,1)',2000)";
			break;
	}
	switch(bw.section){
		case "home":
			tags[3].slider.setCmd(cmd);
			for(i=1;i<4;i++)sc=="prps"?setTimeout('tags['+i+'].slider.go(-1)',(i-1)*100):tags[i].slider.go(i==nr?0:-1);
			break;
		case "noir":
			showDIV(nlink[0],0);
			if(boxs[90])closePage(0,90);
			tags[3].slider.setCmd(0);
			boxs[9].el.slider.setCmd("for(i=1;i<4;i++)tags[i].slider.go(i!=2?0:-1)");
			boxs[9].el.slider.go(-1);
			break;
		case "goods":
			showDIV(glink[0],0);
			tags[3].slider.setCmd(0);
			boxs[305].el.slider.setCmd("for(i=1;i<4;i++)tags[i].slider.go(i!=3?0:-1)");
			for(i=301;i<310;i++)setTimeout('boxs['+i+'].el.slider.go(-1)',(9-(i-301))*90);
			break;
		case "prps":
			showDIV(plink,0);
			for(i=10;i<231;i++)if(boxs[i])closePage(0,i);
			boxs[1].el.slider.setCmd(cmd);
			for(i=1;i<9;i++)setTimeout('boxs['+i+'].el.slider.go(-1)',(10-(i-1))*90);
			break;
		default: showDIV(get("DIVloading"),0); //setTimeout(cmd,10);
	}
	bw.section=sc;
}
function preLoaded(){
	IMGnr--;
	perc=Math.round(100-IMGnr*100/IMGes);
	currNr=perc.toString();
	this.onload=null;
	//if(perc==93&&bw.ief)boxs=[0,new Box(1)];
	if(perc>99){
		get("DIVloading").className="done";
		if(!tags[1])for(i=1;i<4;i++){
			tags[i]=get("tag"+i);
			bsrc="imgs/menu_"+tags[0][i-1]+".png";
			bimg=iimg[bsrc];
			if(bw.ief)tags[i].style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="imgs/'+bsrc.replace(/^([^\/]+\/)/,"")+'")';
			else tags[i].appendChild(bimg);
			tags[i].onclick=new Function("showSection('"+tags[0][i-1]+"')");
			tags[i].slider=new Slider(tags[i],"quart","InOut","top",-400,400,70);
			setTimeout("tags["+i+"].slider.go(0)",(i-1)*100);
		}
		get("BGnoir").style.backgroundImage="url(imgs/bg_noir.jpg)"; get("BGgoods").style.backgroundImage="url(imgs/bg_goods.jpg)";
		get("BGnoir").slider=new Slider(get("BGnoir"),"quart","InOut","top",bw.ie?-1025:-1024,1024,70);
		get("BGgoods").slider=new Slider(get("BGgoods"),"quart","InOut","top",bw.ie?-1025:-1024,1024,70);
		nlink=gets("a",get("BGnoir")); glink=gets("a",get("BGgoods")); plink=get("pLnk");
		nlink[0].onclick=glink[0].onclick=plink.onclick=new Function("showSection('home'); return false");
		bw.loaded=1;
		showSection("home");
	}else{
		nr1.className=perc>9?"nr"+currNr.substr(0,1):"";
		nr2.className="nr"+currNr.substr(perc>9?1:0,1);
	}
}
function preLoadIMGs(nr){ 
	iisrc="imgs/"+(IMGpre[nr].match(/\.png/)?(bw.ie?"":(bw.saf?"saf/":"")):"")+(bw.ie50?IMGpre[nr].replace(/\.png/,".gif"):IMGpre[nr]);
	iimg[iisrc]=make("IMG");
	iimg[iisrc].onload=preLoaded; iimg[iisrc].src=iisrc; 
	loadBin.appendChild(iimg[iisrc]);
}
function init(){
	bw.db=document.body; bw.dd=document.documentElement; bw.section=0; getWinSize(); getScrollTop();
	nr1=get("DIVnr1"); nr2=get("DIVnr2"); loadBin=get("DIVbin"); tags=[["prps","noir","goods"]]; boxs=[];
	for(i in IMGpre)preLoadIMGs(i);
}
window.onload=init;
window.onresize=getWinSize;

