var slider=function(){
	var array=[];
	var speed=2;
	var timer=2;
	return{
		init:function(t,c,p){
			var s,ds,l,i,part=0;
			var part_ar=[];
			s=document.getElementById(t); ds=s.getElementsByTagName('div'); l=ds.length;
			i=0; j=0;
			for(i=0;i<l;i++){
			  var d,did,dia=[];
			  d=ds[i]; did=d.id; dia=did.split("_");
			  if(did.indexOf("header")!=-1){
					d.onclick=new Function("slider.process(this)");
			   }else if(did.indexOf("content")!=-1){
					array.push(dia[1]);
					d.maxh=d.offsetHeight;
					if(c==dia[1]){
					     document.getElementById("header_"+c).className="now";
					     d.style.display='block';
					     part=d.parentNode.id.split("_")[1];
					}else{
						 //d.style.height='0px';
						 d.style.display='none';
					}
			   }else if(did.indexOf("partdiv")!=-1){
			        part_ar.push(dia[1]);
			   }
			}
			for (var i=0;i<part_ar.length;i++){
				 document.getElementById("partdiv_"+part_ar[i]).style.display='none';
		         this.showP(part_ar[i]);
		    }
		    /*
		    if((p)&&(!part)) part=p;
		    this.showP(part);
		    */
		},
		process:function(d){
			var cl,i; cl=array.length; i=0;
			for(i;i<cl;i++){
				var s,h,c,cd;
				s=array[i]; h=document.getElementById('header_'+s);
				c='content_'+s; cd=document.getElementById(c);
				clearInterval(cd.timer);
				h.className=(h==d)?"now":"header";
				if(h==d&&cd.style.display=='none'){
					cd.style.display='block';
					this.islide(c,1);
				}else if(cd.style.display=='block'){this.islide(c,-1);}
			}
		},
		showP:function(p){
              var el=document.getElementById("partdiv_"+p);
              if(!el) return;
              var cs=(el.style.display=="block")?"1":"-1";
              var ncs=""+(-1)*parseInt(cs);
              el.style.display=ar_st[ncs];
              var re=new RegExp('_'+ar_st[cs],"gi");
              if(document.getElementById("level_"+p+"_div")){var img=document.getElementById("level_"+p+"_div").getElementsByTagName("img")[0];
              if(img)img.src=img.src.replace(re,"_"+ar_st[ncs]);}
          return true;
        },

		islide:function(i,d){
			var c,m; c=document.getElementById(i); m=c.maxh; c.direction=d;
			c.timer=setInterval("slider.slide('"+i +"')",timer);
		},
		slide:function(i){
			var c,m,h,dist; c=document.getElementById(i); m=c.maxh; h=parseInt(c.offsetHeight);
			dist=(c.direction==1)?Math.round((m-h)/speed):Math.round(h/speed);
			if(dist<=1){dist=1}
			c.style.height=h+(dist*c.direction)+'px';
			c.style.opacity=h/c.maxh;
			c.style.filter='alpha(opacity='+(h*100/c.maxh)+')';
			if(h<2&&c.direction!=1){
				c.style.display='none';
				clearInterval(c.timer);
			}else if(h>(m-2)&&c.direction==1){clearInterval(c.timer)}
		}
	};
}();
var ar_st={'-1':'none','1':'block'};

function newchk_prc(el){
var sig=Array("$", "&euro;", "&pound;");
var icur=el.value;
document.getElementById('sgn').innerHTML=sig[icur]+" "+el.getAttribute("prc");
s=document.getElementById('buy').href;
icur++;
if(s.lastIndexOf("curid=")>0) {s=s.replace(/curid=\d/,"curid="+icur);}
else {s=s+"&curid="+icur;}
document.getElementById('buy').href=s;
}

function name_swin_open(url,wh,hei, wname) {
nwin=window.open(url, 'wname', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width='+wh+',height='+hei+',left = 362,top = 10');
nwin.focus();
}
function swin_open(url,wh,hei) {
nwin=window.open(url, 'letter', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width='+wh+',height='+hei+',left = 362,top = 10');
nwin.focus();
}