//Includes Javascript for TOJIRO:Net
function exMenu(tName)
	{
	tMenu = document.getElementById(tName).style;
	if (tMenu.display == 'none') tMenu.display = "block"; else tMenu.display = "none";
	}

/* 

  ================================================
  PVII Accordian Panel scripts
  Copyright (c) 2007 Project Seven Development
  www.projectseven.com
  Version: 1.0.8 -build version 28
  ================================================
 
*/

var p7AB=false;
var p7ABi=false;
function P7_setAB(){
	if(!document.getElementById){
		return;
	}
	var h,tA=navigator.userAgent.toLowerCase();
	if(window.opera){
		if(tA.indexOf("opera 5")>-1 || tA.indexOf("opera 6")>-1){
			return;
		}
	}
	h=String.fromCharCode(60,115,116,121,108,101,32,116,121,112,101,61,34,116,101,120,116,47,99,115,115,34,62,46,112,55,65,66,99,111,110,116,101,110,116,123,100,105,115,112,108,97,121,58,110,111,110,101,59,125,60,47,115,116,121,108,101,62);
	h+='\n'+String.fromCharCode(60,33,45,45,91,105,102,32,108,116,101,32,73,69,32,55,93,62,60,115,116,121,108,101,62,46,112,55,65,66,44,46,112,55,65,66,32,100,105,118,123,122,111,111,109,58,49,48,48,37,59,125,60,47,115,116,121,108,101,62,60,33,91,101,110,100,105,102,93,45,45,62);
	h+='\n'+String.fromCharCode(60,33,45,45,91,105,102,32,108,116,101,32,73,69,32,54,93,62,60,115,116,121,108,101,62,46,112,55,65,66,44,46,112,55,65,66,99,111,110,116,101,110,116,44,46,112,55,65,66,116,114,105,103,32,97,123,104,101,105,103,104,116,58,49,37,59,125,60,47,115,116,121,108,101,62,60,33,91,101,110,100,105,102,93,45,45,62);
	document.write(h);
}
P7_setAB();
function P7_opAB(){
	var x,c,tC,ab,tB;
	if(document.getElementById){
		ab='p7ABW'+arguments[0];
		tB=document.getElementById(ab);
		tB.p7Aba=arguments;
		x=arguments[3];
		if(x>0&&x<11){
			c='p7ABc'+arguments[0]+'_'+x;
			tC=document.getElementById(c);
			if(tC){
				tC.style.display='block';
			}
		}
		if(!p7ABi){
			p7ABi=true;
			if(window.addEventListener){
				window.addEventListener("load",P7_initAB,false);
			}
			else if(document.addEventListener){
				document.addEventListener("load",P7_initAB,false);
			}
			else if(window.attachEvent){
				window.attachEvent("onload",P7_initAB);
			}
			else if(typeof window.onload=='function'){
				var p7loadit=onload;
				window.onload=function(){
					p7loadit();
					P7_initAB();
				};
			}
			else{
				window.onload=P7_initAB;
			}
		}
	}
}
function P7_initAB(){
	var i,j,ab,tB,tD,tA,op,ob,tg;
	if(!document.getElementById){
		return;
	}
	for(i=10;i>0;i--){
		ab='p7ABW'+i;
		tB=document.getElementById(ab);
		if(tB){
			tA=tB.getElementsByTagName("A");
			tg='p7ABt'+i;
			for(j=0;j<tA.length;j++){
				if(tA[j].id && tA[j].id.indexOf(tg)==0){
					tA[j].onclick=function(){
						return P7_ABtrig(this);
					};
					tA[j].p7ABstate=0;
					tA[j].p7ABpr=ab;
				}
			}
			ob=i+'_'+tB.p7Aba[3];
			P7_ABopen(ob);
		}
	}
	p7AB=true;
	P7_ABurl();
	P7_ABauto();
}
function P7_ABopen(s){
	var a,g,d='p7ABt'+s;
	a=document.getElementById(d);
	g=s.split("_");
	if(g&&g.length>1&&g[1]==99){
		a=P7_randAB(g[0]);
	}
	if(g&&g.length>1&&g[1]=='a'){
		P7_ABall(s);
	}
	else{
		if(a&&a.p7ABpr){
			if(a.p7ABstate==0){
				P7_ABtrig(a);
			}
		}
	}
}
function P7_ABclose(s){
	var a,d='p7ABt'+s;
	a=document.getElementById(d);
	if(a&&a.p7ABpr){
		if(a.p7ABstate==1){
			P7_ABtrig(a);
		}
	}
}
function P7_ABclick(s){
	var a,d='p7ABt'+s;
	a=document.getElementById(d);
	if(a&&a.p7ABpr){
		P7_ABtrig(a);
	}
}
function P7_randAB(r){
	var i,k,j=0,d,dd,tA,a,rD=new Array();
	dd='p7ABW'+r;
	d=document.getElementById(dd);
	if(d){
		tA=d.getElementsByTagName("A");
		for(i=0;i<tA.length;i++){
			if(tA[i].p7ABpr && tA[i].p7ABpr==dd){
				rD[j]=tA[i].id;
				j++;
			}
		}
		if(j>0){
			k=Math.floor(Math.random()*j);
			a=document.getElementById(rD[k]);
		}
	}
	return a;
}
function P7_ABall(s){
	var i,m,d,dd,st,et,tA,g=s.split("_");
	if(g&&g.length==2){
		st=parseInt(g[0]);
		if(st){
			et=st+1;
		}
		else{
			st=1;
			et=11;
		}
		m=p7AB;
		p7AB=false;
		for(i=st;i<et;i++){
			dd='p7ABW'+i;
			d=document.getElementById(dd);
			if(d){
				tA=d.getElementsByTagName("A");
				for(j=0;j<tA.length;j++){
					if(tA[j].p7ABpr && tA[j].p7ABpr==dd){
						if(g[1]=='a' && tA[j].p7ABstate==0){
							P7_ABtrig(tA[j]);
						}
						else if(g[1]=='c' && tA[j].p7ABstate==1){
							P7_ABtrig(tA[j]);
						}
					}
				}
			}
		}
		p7AB=m;
	}
}
function P7_ABurl(){
	var i,h,s,x,d='pab';
	if(document.getElementById){
		h=document.location.search;
		if(h){
			h=h.replace('?','');
			s=h.split(/[=&]/g);
			if(s&&s.length){
				for(i=0;i<s.length;i+=2){
					if(s[i]==d){
						x=s[i+1];
						if(x){
							P7_ABopen(x);
						}
					}
				}
			}
		}
		h=document.location.hash;
		if(h){
			x=h.substring(1,h.length);
			if(x && x.indexOf("pab")==0){
				P7_ABopen(x.substring(3));
			}
		}
	}
}
function P7_ABtrig(a){
	var i,j=null,op,pD,ad,aT,m=true,cp='p7ABc'+a.p7ABpr.substring(a.p7ABpr.length-1);
	var iD=a.id.replace('t','c'),tD=document.getElementById(iD);
	if(tD){
		m=false;
		pD=document.getElementById(a.p7ABpr);
		op=pD.p7Aba;
		if(op[4]==1&&op[1]==1&&a.p7ABstate==1){
			return m;
		}
		tD=pD.getElementsByTagName("DIV");
		for(i=0;i<tD.length;i++){
			if( tD[i].id && tD[i].id.indexOf(cp)>-1 ){
				if(tD[i].id==iD){
					j=i;
					if( a.className=="p7ABtrig_down"){
						a.p7ABstate=0;
						a.className='';
						P7_ABhide(tD[j],op);
					}
					else{
						a.p7ABstate=1;
						a.className="p7ABtrig_down";
						P7_ABshow(tD[j],op);
					}
				}
				else{
					if(op[1]==1){
						ad=tD[i].id.replace('c','t');
						aT=document.getElementById(ad);
						aT.className='';
						aT.p7ABstate=0;
						P7_ABhide(tD[i],op);
					}
				}
			}
		}
	}
	P7_checkEQH();
	return m;
}
function P7_checkEQH(){
	if(typeof(P7_colH2)=='function'){
		P7_colH2();
	}
	if(typeof(P7_colH)=='function'){
		P7_colH();
	}
}
function P7_ABshow(d,op){
	var h,wd,wP,isIE5=(navigator.appVersion.indexOf("MSIE 5")>-1);
	if(p7AB&&op[2]==3){
		d.style.display='block';
		P7_ABfadeIn(d.id,0);
	}
	else if( (p7AB&&op[2]==1||p7AB&&op[2]==2) && !isIE5 ){
		wd=d.id.replace("c","w");
		wP=document.getElementById(wd);
		if(P7_hasOverflow(d)||P7_hasOverflow(wP)){
			d.style.display='block';
			return;
		}
		wP.style.overflow="hidden";
		wP.style.height="1px";
		d.style.display='block';
		h=d.offsetHeight;
		P7_ABglide(wd,1,h,op[2]);
	}
	else{
		d.style.display='block';
	}
}
function P7_ABhide(d,op){
	var h,wd,wP,isIE5=(navigator.appVersion.indexOf("MSIE 5")>-1);
	if((p7AB&&op[2]==1||p7AB&&op[2]==2)&&!isIE5){
		wd=d.id.replace("c","w");
		wP=document.getElementById(wd);
		if(d.style.display!="none"){
			if(P7_hasOverflow(d)||P7_hasOverflow(wP)){
				d.style.display='none';
				return;
			}
			h=wP.offsetHeight;
			wP.style.overflow="hidden";
			P7_ABglide(wd,h,0,op[2]);
		}
	}
	else{
		d.style.display='none';
	}
}
function P7_hasOverflow(ob){
	var s,m;
	if(navigator.userAgent.toLowerCase().indexOf('gecko')>-1){
		s=ob.style.overflow;
		if(!s){
			if(ob.currentStyle){
				s=ob.currentStyle.overflow;
			}
			else if(document.defaultView.getComputedStyle(ob,"")){
				s=document.defaultView.getComputedStyle(ob,"").getPropertyValue("overflow");
			}
		}
	}
	m=(s&&s=='auto')?true:false;
	return m;
}
function P7_ABfadeIn(id,op){
	var d=document.getElementById(id);
	op+=.05;
	op=(op>=1)?1:op;
	if((navigator.appVersion.indexOf("MSIE")>-1)){
		d.style.filter='alpha(opacity='+op*100+')';
	}
	else{
		d.style.opacity=op;
	}
	if(op<1){
		setTimeout("P7_ABfadeIn('"+id+"',"+op+")",40);
	}
}
function P7_ABglide(dd,ch,th,p){
	var w,m,d,wd,wC,tt,dy=10,inc=10,pc=.15;
	d=document.getElementById(dd);
	m=(ch<=th)?0:1;
	if(p==1){
		tt=Math.abs( parseInt( Math.abs(th)-Math.abs(ch) ) );
		inc=(tt*pc<1)?1:tt*pc;
	}
	inc=(m==1)?inc*-1:inc;
	d.style.height=ch+"px";
	if(ch==th){
		if(th==0){
			wd=d.id.replace("w","c");
			wC=document.getElementById(wd);
			wC.style.display="none";
			d.style.height="auto";
		}
		else{
			d.style.height="auto";
		}
		P7_checkEQH();
	}
	else{
		ch+=inc;
		if(m==0){
			ch=(ch>=th)?th:ch;
		}
		else{
			ch=(ch<=th)?th:ch;
		}
		if(d.p7abG){
			clearTimeout(d.p7abG);
		}
		d.p7abG=setTimeout("P7_ABglide('"+dd+"',"+ch+","+th+","+p+")",dy);
	}
}
function P7_ABauto(){
	var i,k,ab,tB,wH,tr,pp;
	wH=window.location.href;
	for(k=1;k<11;k++){
		tr=null;
		ab='p7ABW'+k;
		tB=document.getElementById(ab);
		if(tB&&tB.p7Aba[5]&&tB.p7Aba[5]==1){
			tA=tB.getElementsByTagName('A');
			if(tA){
				for(i=0;i<tA.length;i++){
					if(tA[i].href==wH){
						if(tA[i].p7ABpr){
							tr=tA[i].id.replace('p7ABt','');
							break;
						}
						else{
							tA[i].className="p7ap_currentmark";
							pp=tA[i].parentNode;
							while(pp){
								if(pp.id&&pp.id.indexOf('p7ABc')==0){
									tr=pp.id.replace('p7ABc','');
									break;
								}
								pp=pp.parentNode;
							}
							break;
						}
					}
				}
				if(tr){
					P7_ABopen(tr);
				}
				else{
					if(typeof(p7ABcm)!='undefined'&&p7ABcm.length){
						for(i=0;i<p7ABcm.length;i++){
							if(p7ABcm[i]&&p7ABcm[i].length>0){
								if(k==p7ABcm[i].charAt(0)){
									P7_ABopen(p7ABcm[i]);
								}
							}
						}
					}
				}
			}
		}
	}
}

/*
 ================================================
  PVII Horizontal Gallery scripts
  Copyright (c) 2006 Project Seven Development
  www.projectseven.com
  Version: 2.0.8
  ================================================
  
*/
var p7gsiem=(navigator.appVersion.indexOf("MSIE 5")>-1&&navigator.userAgent.indexOf("Mac")>-1)?true:false;
var p7gsca,p7gsa=new Array(),p7gsplot=new Array(),p7gstmb = new Array();
function P7_setHGS(){ //v1.0.9 by PVII-www.projectseven.com
 var i,d='',tA,h="<sty"+"le type=\"text/css\">";if(!document.getElementById){return;}
 tA=navigator.userAgent.toLowerCase();if(window.opera){
 if(tA.indexOf("opera 5")>-1 || tA.indexOf("opera 6")>-1){return;}}
 h+="#p7GS{visibility:hidden;}";h+="<"+"/sty"+"le>";document.write(h);
}
P7_setHGS();
function P7_HGSinit(){ //v1.0.9 by PVII-www.projectseven.com
 var i,x,s,vp,sc,ul,li,h,hh=0,w,ww=0,uw,n,nn,im,a,nv,hv,bh,bw,ed,eh,ew,cv,j,kw,tA;
 if(!document.getElementById){return;}tA=navigator.userAgent.toLowerCase();
 if(window.opera){if(tA.indexOf("opera 5")>-1 || tA.indexOf("opera 6")>-1){return;}}
 p7gsa=arguments;if(p7gsiem||tA.indexOf('scape6/6')>-1){p7gsa[1]=0;}vp=document.getElementById('p7GSvp');
 sc=document.getElementById('p7GSsc');li=sc.getElementsByTagName('LI');im=sc.getElementsByTagName('IMG');
 for(i=0;i<im.length;i++){im[i].style.display='block';}for(i=0;i<li.length;i++){
 li[i].style.position='absolute';h=li[i].offsetHeight;w=li[i].offsetWidth;hh=(h>hh)?h:hh;
 ww=(w>ww)?w:ww;}for(i=0;i<li.length;i++){li[i].style.height=hh+'px';li[i].style.width=ww+'px';}
 for(i=0;i<li.length;i++){h=li[i].offsetHeight;w=li[i].offsetWidth;if(h>hh){n=hh-(h-hh);
 li[i].style.height=n+'px';}if(w>ww){n=ww-(w-ww);li[i].style.width=n+'px';}}ul=sc.getElementsByTagName('UL');
 ww=0;for(i=0;i<ul.length;i++){li=ul[i].getElementsByTagName('LI');	kw=0;for(j=0;j<li.length;j++){
 w=li[j].offsetWidth;h=li[j].offsetHeight;li[j].style.left=kw+'px';kw+=w;ww=(kw>ww)?kw:ww;}
 ul[i].style.position='relative';ul[i].style.height=h+'px';}if(ul.length==1){
 document.getElementById('p7GSnv').style.display='none';}sc.style.position='absolute';sc.style.top='0px';
 sc.style.left='0px';vp.style.height=h+'px';vp.style.width=ww+'px';vp.style.overflow='hidden';
 if(p7gsa[0]==1){li=sc.getElementsByTagName('LI');for(i=0;i<li.length;i++){im=li[i].getElementsByTagName('IMG')[0];
 h=im.offsetHeight;w=im.offsetWidth;hh=parseInt(li[i].style.height);ww=parseInt(li[i].style.width);
 n=parseInt((hh-h)/2);nn=parseInt((ww-w)/2);if(n>0){im.style.marginTop=n+'px';}if(nn>0){
 im.style.marginLeft=nn+'px';}}}document.p7gspre=new Array();a=sc.getElementsByTagName('A');x=0;
 for(i=0;i<a.length;i++){if(a[i].parentNode.nodeName=='LI'){a[i].onmouseover=function(){P7_HGSover(this);};
 a[i].onfocus=function(){P7_HGSover(this);};a[i].onmouseout=function(){P7_HGSout(this);};
 a[i].onclick= function(){return P7_HGSshow(this);};document.p7gspre[x]=new Image();document.p7gspre[x].cmp=false;
 document.p7gspre[x].onload=function (){this.cmp=true;};a[i].p7gsindex=x;p7gstmb[x]=a[i];x++;}}
 nv=document.getElementById('p7GSnv');x=0;if(nv){hv=nv.innerHTML;ul=sc.getElementsByTagName('UL');
 for(i=0;i<ul.length;i++){s=(i==0)?'':' <span>|</span> ';x=i+1;
 hv+=s+'<a id="p7gsn'+x+'" href="javascript:;" title="View Thumbnail Panel '+x+'">'+x+'</a>';}
 nv.innerHTML=hv;a=nv.getElementsByTagName('A');for(i=0;i<a.length;i++){a[i].onclick= function(){
 return P7_HGSnvs(this);};}}document.getElementById('p7GS').style.visibility="visible";h=p7gsa[4];
 if(!P7_HGSurl()){if(h>0){P7_HGStrig(h-1,9);}}
}
function P7_HGSover(a){ //v1.0.9 by PVII-www.projectseven.com
 var im=a.getElementsByTagName('IMG')[0];if(im.className!='p7GSon'){im.className='p7GSover';}
}
function P7_HGSout(a){ //v1.0.9 by PVII-www.projectseven.com
 var im=a.getElementsByTagName('IMG')[0];if(im.className!='p7GSon'){im.className='';}
}
function P7_HGSnvs(a,g){ //v1.0.9 by PVII-www.projectseven.com
 var p,ta;p=parseInt(a.id.replace('p7gsn',''));g=(g)?g:0;
 ta=document.getElementById('p7GSnv').getElementsByTagName('A');for(i=0;i<ta.length;i++){
 if(ta[i].className){ta[i].className='';}}a.className='p7GSnvon';P7_HGSmove(p,g);return false;
}
function P7_HGSmove(p,g){ //v1.0.9 by PVII-www.projectseven.com
 var i,h,sc,t,c,m;sc=document.getElementById('p7GSsc');h=sc.getElementsByTagName('LI')[0].offsetHeight;
 t=((h*p)-h)*-1;c=parseInt(sc.style.top);c=(c)?c:0;m=(c<t)?1:0;P7_HGSvon();if(p7gsa[5]==1&&g!=9&&g!=6){
 P7_HGSscr(t,m);}else{sc.style.top=t+'px';P7_HGSvoff();}
}
function P7_HGSvoff(){ //v1.0.9 by PVII-www.projectseven.com
 var i,j,ul,m=false;ta=document.getElementById('p7GSnv').getElementsByTagName('A');
 for(i=0;i<ta.length;i++){if(ta[i].className=='p7GSnvon'){m=true;break;}}if(m){
 ul=document.getElementById('p7GSsc').getElementsByTagName('UL');for(j=0;j<ul.length;j++){
 if(j==i){ul[j].style.visibility='visible';}else{ul[j].style.visibility='hidden';}}}
}
function P7_HGSvon(){ //v1.0.9 by PVII-www.projectseven.com
 var i,ul=document.getElementById('p7GSsc').getElementsByTagName('UL');
 for(i=0;i<ul.length;i++){ul[i].style.visibility='visible';}
}
function P7_HGSscr(t,m){ //v1.0.9 by PVII-www.projectseven.com
 var d,r,y=30;d=document.getElementById('p7GSsc');c=parseInt(d.style.top);r=P7_HGSrate(c,t);
 c+=(m==1)?r:r*-1;if(m==1){c=(c>=t)?t:c;}else{c=(c<=t)?t:c;}d.style.top=c+"px";if(c!=t){
 d.p7hgsan=setTimeout("P7_HGSscr("+t+","+m+")",y);}else{P7_HGSvoff();}
}
function P7_HGSrate(c,t){ //v1.0.9 by PVII-www.projectseven.com
 var tt=Math.abs(t-c),i=parseInt(tt*.08);i=(i<=20)?20:i;return i;
}
function P7_HGStrig(n,ug){ //v1.0.9 by PVII-www.projectseven.com
 var i,sc,a,f;ug=(ug)?ug:0;a=p7gstmb[n];if(a){P7_HGStrigp(a,ug);f=P7_HGSshow(a,ug);}
}
function P7_HGStrigp(a,ug){ //v1.0.9 by PVII-www.projectseven.com
 var i,nv,ul,pp,f;nv=document.getElementById('p7GSnv').getElementsByTagName('A');
 ul=document.getElementById('p7GSsc').getElementsByTagName('UL');pp=a.parentNode;
 while(pp){if(pp.nodeName=='UL'){break;}pp=pp.parentNode;}for(i=0;i<ul.length;i++){
 if(ul[i]==pp){break;}}f=P7_HGSnvs(nv[i],ug);
}
function P7_HGSurl(){ //v1.0.9 by PVII-www.projectseven.com
 var i,h,s,x,m=false,p='pic';if(document.getElementById){h=document.location.search;if(h){
 h=h.replace('?','');s=h.split('=');if(s&&s.length){for(i=0;i<s.length;i+=2){if(s[i]==p){
 x=parseInt(s[i+1]);if(x){P7_HGStrig(x,9);m=true;break;}}}}}h=document.location.hash;
 if(h){x=parseInt(h.substring(1,h.length));if(x&&x>0){m=true;}}}if(m){x--;
 P7_HGStrig(x,9);}return m;
}
function P7_HGSshow(a,ug){ //v1.0.9 by PVII-www.projectseven.com
 var i,ti,im,fM,pM,dM,cM,dD,ds,h,w;ug=(ug)?ug:0;im=a.getElementsByTagName('IMG')[0];
 ti=document.getElementById('p7GSvp').getElementsByTagName('IMG');if(p7gsca){
 if(p7gsca==a){return false;}}for(i=0;i<ti.length;i++){ti[i].className='';}im.className='p7GSon';
 dM=document.getElementById('p7GSfs');fM=dM.getElementsByTagName('IMG')[0];
 pM=document.p7gspre[a.p7gsindex];if(document.p7gswait){clearTimeout(document.p7gswait);}
 p7gsca=a;if(!pM.cmp){P7_GSpbs(fM);pM.src=a.href;P7_GSwait(a.p7gsindex,ug);}else{
 P7_GSfin(pM,ug);}return false;
}
function P7_GSpbs(im,ug){ //v1.0.9 by PVII-www.projectseven.com
 var i,l,t,p,pb,pw,ph,ih,iw;pb=document.getElementById('p7GSpb');pw=pb.offsetWidth;
 ph=pb.offsetHeight;if(im){ih=(p7gsiem)?im.height:im.offsetHeight;
 iw=(p7gsiem)?im.width:im.offsetWidth;t=(ih-ph)/2;l=(iw-pw)/2;p=P7_getPos(im);l+=p[0];t+=p[1];
 pb.style.left=l+'px';pb.style.top=t+'px';pb.style.visibility="visible";}
}
function P7_getPos(im){ //v1.0.9 by PVII-www.projectseven.com
 var p,pp,l=0,t=0,r=new Array(2);pp=im;while(pp){l+=(pp.offsetLeft)?pp.offsetLeft:0;
 t+=(pp.offsetTop)?pp.offsetTop:0;if(window.opera||navigator.userAgent.indexOf("Safari")>-1){
 if(pp.nodeName=="BODY"){l-=(pp.offsetLeft)?pp.offsetLeft:0;t-=(pp.offsetTop)?pp.offsetTop:0;}}
 pp=pp.offsetParent;}if(p7gsiem){l+=parseInt(document.body.currentStyle.marginLeft);
 t+=parseInt(document.body.currentStyle.marginTop);}r[0]=l;r[1]=t;return r;
}
function P7_GSwait(ix,ug){ //v1.0.9 by PVII-www.projectseven.com
 var im=document.p7gspre[ix];if(im.cmp || (!document.all&&im.height>1)){im.cmp=true;
 document.getElementById('p7GSpb').style.visibility='hidden';P7_GSfin(im,ug);
 }else{document.p7gswait=setTimeout("P7_GSwait("+ix+","+ug+")",200);}
}
function P7_GSfin(im,ug){ //v1.0.9 by PVII-www.projectseven.com
 var dM,fM,cM,aL,cD,ds,dT='',tH='',aC,fS,an,st='',h,h1,h2,ti,ci,ct,cn;an=p7gsa[1];if(an>0){
 st=' style="visibility:hidden"';}fS=document.getElementById('p7GSfs');dM=document.getElementById('p7GSfs');
 fM=dM.getElementsByTagName('IMG')[0];tB=p7gsca.getElementsByTagName('IMG')[0];
 tH+='<table class="p7GSfst" align="center" cellpadding="0" cellspacing="0">';
 aL=tB.getAttribute("alt");ci=P7GSgi();ci[4]+=1;ct=p7gstmb.length;cn='';if(p7gsa[7]==1){
 cn=' <span class="p7GScounter">('+ci[4]+' of '+ct+')</span>';}aC='<tr><td class="p7GSfsc"><p>'+aL+cn+'</p></td></tr>';
 ds=p7gsca.parentNode.getElementsByTagName('DIV');if(ds&&ds[0]){dT=ds[0].innerHTML;}if(p7gsa[2]==1){
 if(aL&&aL.length>0){tH+=aC;}}tH+='<tr><td class="p7GSfsi"><img src="'+im.src+'" alt="'+aL+'"'+st+'></td></tr>';
 if(p7gsa[2]==2){if(aL&&aL.length>0){tH+=aC;}}if(p7gsa[3]==1){if(dT.length>0){
 tH+='<tr><td class="p7GSfsd"><div>'+dT+'</div></td></tr>';}}tH+='</table>';dM.innerHTML=tH;
 if(fS){fS.style.display='block';}if(ug<7){if(an==1||an==2){P7_GSfan();}else if(an>2){P7_GSfie();}
 }else{document.getElementById('p7GSfs').getElementsByTagName('IMG')[0].style.visibility='visible';}
}
function P7GSgi(){ //v1.0.9 by PVII-www.projectseven.com
 var i,x,a,gi=new Array();x=p7gstmb.length-1;for(i=0;i<p7gstmb.length;i++){
 if(p7gstmb[i]==p7gsca){break;}}gi[0]=0;gi[1]=(i>0)?i-1:0;gi[2]=(i<x)?i+1:x;gi[3]=x;gi[4]=i;return gi;
}
function P7_GSfie(){ //v1.0.9 by PVII-www.projectseven.com
 var i,d,im,f,ff,pim,g=new Array(),an=p7gsa[1];
 im=document.getElementById('p7GSfs').getElementsByTagName('IMG')[0];pim=im.parentNode;
 if(!im.parentNode.filters){p7gsa[1]=2;P7_GSfan();return;}f='progid:DXImageTransform.Microsoft.';
 d=' Duration=1';g[0]='Fade';g[1]='Fade';g[2]='Fade';g[3]='Fade';
g[4]='Iris(irisstyle="SQUARE", motion="in"'+d+')';g[5]='Iris(irisstyle="SQUARE", motion="out"'+d+')';
g[6]='Iris(irisstyle="CIRCLE", motion="in"'+d+')';g[7]='Iris(irisstyle="CIRCLE", motion="out"'+d+')';
g[8]='Blinds(direction="up", bands=1'+d+')';g[9]='Blinds(direction="down", bands=1'+d+')';
g[10]='Blinds(direction="right", bands=1'+d+')';g[11]='Blinds(direction="left", bands=1'+d+')';
g[12]='Blinds(direction="right"'+d+')';g[13]='Blinds(direction="down"'+d+')';
g[14]='CheckerBoard(direction="right"'+d+')';g[15]='CheckerBoard(direction="down"'+d+')';
g[16]='RandomDissolve('+d+')';g[17]='Barn(orientation="vertical", motion="in"'+d+')';
g[18]='Barn(orientation="vertical", motion="out"'+d+')';g[19]='Barn(orientation="horizontal", motion="in"'+d+')'
g[20]='Barn(orientation="horizontal", motion="out"'+d+')';g[21]='Strips(motion="leftdown"'+d+')';
g[22]='Strips(motion="leftup"'+d+')';g[23]='Strips(motion="rightdown"'+d+')';
g[24]='Strips(motion="rightup"'+d+')';g[25]='RandomBars(orientation="horizontal"'+d+')';
g[26]='RandomBars(orientation="vertical"'+d+')';g[27]='Wipe(GradientSize=1.0, wipeStyle=0, motion="forward"'+d+')';
g[28]='Inset()';g[29]='Pixelate(MaxSquare=50,Duration=1,Enabled=false'+d+')';
g[30]='RadialWipe(wipeStyle="clock"'+d+')';g[31]='RadialWipe(wipeStyle="wedge"'+d+')';
g[32]='RadialWipe(wipeStyle="radial"'+d+')';g[33]='Slide(slideStyle="PUSH", bands=1'+d+')';
g[34]='Slide(slideStyle="SWAP", bands=5'+d+')';g[35]='Slide(slideStyle="HIDE", bands=2'+d+')';
g[36]='Spiral(GridSizeX=16, GridSizeY=16'+d+')';g[37]='Stretch(stretchStyle="hide"'+d+')';
g[38]='Stretch(stretchStyle="spin"'+d+')';g[39]='Stretch(stretchStyle="push"'+d+')';
g[40]='Wheel(spokes=4'+d+')';g[41]='Wheel(spokes=16'+d+')';g[42]='zigzag(GridSizeX=8, GridSizeY=8'+d+')';
 an=(an>g.length)?3:an;f+=g[an];pim.style.filter=f;if(pim.filters.length<1){p7gsa[1]=1;P7_GSfan();
 return;}pim.filters[0].Apply();im.style.visibility='visible';pim.filters[0].Play();
}
function P7_GSfan(){ //v1.0.9 by PVII-www.projectseven.com
 var im,fh,fw,tB,tF,tL,l,t,dt,dl,df,fr,dn,pl,an,c=10,i,ih,iw,ih2,iw2,l2,t2,lm=false,tm=false,ch=c,cw=c;
 an=p7gsa[1];im=document.getElementById('p7GSfs').getElementsByTagName('IMG')[0];tF=P7_getPos(im);
 fh=im.offsetHeight;fw=im.offsetWidth;tB=p7gsca.getElementsByTagName('IMG')[0];tD=P7_getPos(tB);
 if(an==1){l=parseInt((tB.offsetWidth/2))-5+tD[0];t=parseInt((tB.offsetHeight/2))-5+tD[1];
 }else{l=parseInt((fw/2))-5+tF[0];t=parseInt((fh/2))-5+tF[1];}tL=document.getElementById('p7GSah');
 tL.innerHTML='<img src="'+im.src+'" height="'+c+'" width="'+c+'">';tL.style.left=l+'px';tL.style.top=t+'px';
 dt=tF[1]-t;dl=tF[0]-l;fr=20;p7gsplot.length=0;ih=fh-c;iw=fw-c;if(ih>iw){dn=parseInt(ih/fr)+1;ih2=fr;
 iw2=parseInt(iw/dn)+1;}else{dn=parseInt(iw/fr)+1;iw2=fr;ih2=parseInt(ih/dn)+1;}l2=parseInt( Math.abs(dl)/dn)+1;
 if(dl<0){l2=l2*-1;lm=true;}t2=parseInt( Math.abs(dt)/dn)+1;if(dt<0){t2=t2*-1;tm=true;}for(i=1;i<dn+1;i++){
 t+=t2;if(tm){t=(t<=tF[1])?tF[1]:t;}else{t=(t>=tF[1])?tF[1]:t;}l+=l2;if(lm){l=(l<=tF[0])?tF[0]:l;}else{
 l=(l>=tF[0])?tF[0]:l;}cw+=iw2;cw=(cw>=fw)?fw:cw;ch+=ih2;ch=(ch>=fh)?fh:ch;
 p7gsplot[i-1]=t+','+l+','+cw+','+ch;}tL.style.visibility="visible";P7_GSfanim(0);
}
function P7_GSfanim(p){ //v1.0.9 by PVII-www.projectseven.com
 var i,pl,dy=10,tL=document.getElementById('p7GSah'),im=tL.getElementsByTagName('IMG')[0];
 if(p<p7gsplot.length){pl=p7gsplot[p].split(',');tL.style.top=pl[0]+'px';tL.style.left=pl[1]+'px';
 im.style.width=pl[2]+'px';im.style.height=pl[3]+'px';p++;setTimeout("P7_GSfanim("+p+")",dy);}
 else{document.getElementById('p7GSfs').getElementsByTagName('IMG')[0].style.visibility='visible';
 tL.style.visibility='hidden';}
}
<!--
//フラッシュをJava経由で読み込むスクリプト
function showFlash(url,width,height){
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="'+width+'" height="'+height+'">');
	document.write('<param name="movie" value="'+url+'">');
	document.write('<param name="quality" value="high">');
	document.write('<embed src="'+url+'" quality="high" pluginspage="http://www.macromedia.com/jp/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="'+width+'" height="'+height+'">');
	document.write('</embed>');
	document.write('</object>');
}

//大きいバナーイメージ(又はフラッシュ)を定義
//※小さいバナーと同じ数だけ用意してください。
var mainimage = new Array(
	'<a href="/jp/products/knives_w_senkou.html"><img src="/jp/images/main_knives_w_senkou.jpg" alt="藤次郎 閃光シリーズ" style="width: 860px;height: 330px;"></a>',
	'<a href="/jp/products/knives_j_waurushi.html"><img src="/jp/images/main_knives_j_waurushi.jpg" alt="藤次郎 和漆シリーズ" style="width: 860px;height: 330px;"></a>',
	'<a href="/jp/products/knives_j_shippu.html"><img src="/jp/images/main_knives_j_shippu.jpg" alt="藤次郎 疾風シリーズ" style="width: 860px;height: 330px;"></a>',
	'<a href="/jp/products/knives_j_zen.html"><img src="/jp/images/main_knives_j_zen.jpg" alt="藤次郎 禅シリーズ" style="width: 860px;height: 330px;"></a>',
	'<a href="/jp/products/knives_w_cobalt_c.html"><img src="/jp/images/main_knives_w_cobalt_p.jpg" alt="藤次郎 DPコバルト合金鋼シリーズ" style="width: 860px;height: 330px;"></a>',
	'<a href="/jp/products/asknives_pro_63.html"><img src="/jp/images/main_asknives_pro_63.jpg" alt="Tojiro-Pro ニッケルダマスカス鋼シリーズ" style="width: 860px;height: 330px;"></a>',
	'<a href="/jp/products/asknives_pro_3.html"><img src="/jp/images/main_asknives_pro_3.jpg" alt="Tojiro-Pro DPコバルト合金鋼割込シリーズ" style="width: 860px;height: 330px;"></a>',
	'<a href="/jp/products/asknives_pro_2.html"><img src="/jp/images/main_asknives_pro_2.jpg" alt="Tojiro-Pro 和包丁シリーズ" style="width: 860px;height: 330px;"></a>',
	'<a href="/jp/products/asknives_supreme_3.html"><img src="/jp/images/main_asknives_supreme_3.jpg" alt="Tojiro Supreme*** ニッケルダマスカス鋼シリーズ" style="width: 860px;height: 330px;"></a>',
	'<a href="/jp/products/asknives_supreme_2.html"><img src="/jp/images/main_asknives_supreme_2.jpg" alt="Tojiro Supreme** 霞流し鋼シリーズ" style="width: 860px;height: 330px;"></a>',
	'<a href="/jp/products/sharp_whetstone.html"><img src="/jp/images/main_sharp_whetstone.jpg" alt="藤次郎 砥石シリーズ" style="width: 860px;height: 330px;"></a>',
	'<a href="/jp/training/index.html"><img src="/jp/images/main_training.jpg" alt="包丁の使い方トレーニング" style="width: 860px;height: 330px;"></a>',
	'<a href="/jp/guide/index.html"><img src="/jp/images/main_guide.jpg" alt="包丁の豆知識" style="width: 860px;height: 330px;"></a>');

//小さいバナーイメージ(又はフラッシュ)を定義
//※大きいバナーと同じ数だけ用意してください。
var subimages = new Array(
	'<a href="/jp/products/asknives_supreme_3.html"><img src="/jp/images/banner_asknives_supreme_3.jpg" class="random_banner" alt="01" style="width: 189px;height: 72px;"></a>',
	'<a href="/jp/products/asknives_supreme_2.html"><img src="/jp/images/banner_asknives_supreme_2.jpg" class="random_banner" alt="02" style="width: 189px;height: 72px;"></a>',
	'<a href="/jp/products/asknives_pro_63.html"><img src="/jp/images/banner_asknives_pro_63.jpg" class="random_banner" alt="03" style="width: 189px;height: 72px;"></a>',
	'<a href="/jp/products/asknives_pro_37.html"><img src="/jp/images/banner_asknives_pro_37.jpg" class="random_banner" alt="04" style="width: 189px;height: 72px;"></a>',
	'<a href="/jp/products/asknives_pro_3.html"><img src="/jp/images/banner_asknives_pro_3.jpg" class="random_banner" alt="05" style="width: 189px;height: 72px;"></a>',
	'<a href="/jp/products/asknives_pro_2.html"><img src="/jp/images/banner_asknives_pro_2.jpg" class="random_banner" alt="06" style="width: 189px;height: 72px;"></a>',
	'<a href="/jp/products/knives_j_waurushi.html"><img src="/jp/images/banner_knives_j_waurushi.jpg" class="random_banner" alt="07" style="width: 189px;height: 72px;"></a>',
	'<a href="/jp/products/knives_j_shippu.html"><img src="/jp/images/banner_knives_j_shippu.jpg" class="random_banner" alt="07" style="width: 189px;height: 72px;"></a>',
	'<a href="/jp/products/knives_j_zen.html"><img src="/jp/images/banner_knives_j_zen.jpg" class="random_banner" alt="07" style="width: 189px;height: 72px;"></a>',
	'<a href="/jp/products/knives_w_senkou.html"><img src="/jp/images/banner_knives_w_senkou.jpg" class="random_banner" alt="08" style="width: 189px;height: 72px;"></a>',
	'<a href="/jp/products/knives_w_cobalt_p.html"><img src="/jp/images/banner_knives_w_cobalt_p.jpg" class="random_banner" alt="09" style="width: 189px;height: 72px;"></a>',
	'<a href="/jp/products/sharp_whetstone.html"><img src="/jp/images/banner_sharp_whetstone.jpg" class="random_banner" alt="09" style="width: 189px;height: 72px;"></a>',
	'<a href="/jp/products/knives_j_aokasumi.html"><img src="/jp/images/banner_knives_j_kasumi.jpg" class="random_banner" alt="10" style="width: 189px;height: 72px;"></a>');

//フラッシュをバナーに組み込む場合は最上段のshowFlash関数を利用します。
//記述方法は下記の通り。※scriptタグの多重定義のみ気をつけてください。
//	'<scr'+'ipt language="javascript" type="text/javascript">showFlash("flashname.swf","width","height");</scr'+'ipt>',

//バナーの数を調べます。
var figure = subimages.length;

for (i=0; i<100; i++) //　100はシャッフルする回数
{
	n1 = Math.floor(Math.random() * figure);
	n2 = Math.floor(Math.random() * figure);
	n = subimages[n1];
	m = mainimage[n1]
	subimages[n1] = subimages[n2];
	mainimage[n1] = mainimage[n2];
	subimages[n2] = n;
	mainimage[n2] = m;
}

//小さいバナーイメージを呼び出す関数
function putsubimage(cnt){
	document.write(subimages[cnt]);
}

//大きいバナーイメージを呼び出す関数
function putmainimage(cnt){
	document.write(mainimage[cnt]);
}

//-->
/* 
  ------------------------------------------------
  TabBar Magic menu scripts
  Copyright (c) 2005-2006 Project Seven Development
  www.projectseven.com
  Version: 1.0.2 
  ------------------------------------------------
*/

var p7tbma=new Array();
var p7tbmt=new Array();

function P7_initTBM(){ //v1.0.2 by PVII-www.projectseven.com
 //define over and down image suffix
 var Iv = "_f2";
 var Id = "_f3";
 var i,j,x,k,d,nV,tB,tbs,iM,im,ts,tA,sA,nA=new Array();
 document.p7tbmsw=new Array();p7tbma=arguments;
 if(!document.getElementById||document.p7tbmf){return;}
 tb=document.getElementById('p7TBM');if(!tb){return;}tb.onmouseout=P7_TBMclose;
 tB=document.getElementById('p7TBM');nV=document.getElementById('p7TBMroot');
 if(!nV||!tB){return;}tA=nV.getElementsByTagName('A');j=0;for(i=0;i<tA.length;i++){
 p7tbmt[j]=tA[i].id;j++;d='p7TBMsub'+tA[i].id.replace('p7TBMt','');
 tbs=document.getElementById(d);if(tbs){tbs.onmouseover=function(){P7_TBMsub(this);};}
 p7tbmt[j]=(tbs)?tbs.id:false;tA[i].hasSub=p7tbmt[j];j++;tA[i].isRoot=true;
 tA[i].onclick=function(){return P7_TBMtrig(this);};
 tA[i].onmouseover=function(){P7_TBMovr(this);};tA[i].p7state=0;tA[i].hasIm=false;
 iM=tA[i].getElementsByTagName('IMG');if(iM&&iM[0]){im=iM[0];ts=im.getAttribute("src");
 x=ts.lastIndexOf(".");nA[0]=ts.substring(0,x);nA[1]='.'+ts.substring(x+1);
 im.p7mimg=new Array();im.p7mimg[0]=ts;if(p7tbma[1]>1){ts=nA[0]+Iv+nA[1];
 P7_TBMpl(ts);}im.p7mimg[1]=ts;if(p7tbma[1]==3){im.p7mimg[2]=ts;}
 if(p7tbma[1]==1||p7tbma[1]==2){ts=nA[0]+Id+nA[1];P7_TBMpl(ts);if(p7tbma[1]==1){
 im.p7mimg[1]=ts;}}im.p7mimg[2]=ts;im.p7state=0;tA[i].hasIm=true;}}
 document.p7tbmf=true;P7_TBMopen();
}

function P7_TBMpl(ims){ //v1.0.2 by PVII-www.projectseven.com
 var x=document.p7tbmsw.length;document.p7tbmsw[x]=new Image();document.p7tbmsw[x].src=ims;
}

function P7_TBMovr(a){ //v1.0.2 by PVII-www.projectseven.com
 if(!document.p7tbmf){return;}if(document.p7TBMtm){clearTimeout(document.p7TBMtm);}P7_TBMswp(a);
 if(p7tbma[0]==1){document.p7TBMtm=setTimeout("P7_TBMshow('"+a.id+"')",p7tbma[4]);
 }else{P7_TBMshow(a.id);}}

function P7_TBMswp(d){ //v1.0.2 by PVII-www.projectseven.com
 var i,cl,a;for(i=0;i<p7tbmt.length;i+=2){a=document.getElementById(p7tbmt[i]);
 cl=a.className;if(p7tbmt[i]!=d.id){if(a.p7state<2){if(cl.indexOf("p7TBMon")>-1){
 a.className=cl.replace("p7TBMon",'');}if(a.hasIm){im=a.getElementsByTagName('IMG')[0];
 if(im.p7state<2){im.src=im.p7mimg[0];}}}}else{if(a.p7state!=2){if(cl.indexOf("p7TBMon")==-1){
 a.className=(cl&&cl.length>0)?cl+" p7TBMon":"p7TBMon";}if(a.hasIm){
 im=a.getElementsByTagName('IMG')[0];if(im.p7state<2){im.src=im.p7mimg[1];}}}}}
}

function P7_TBMshow(d){ //v1.0.2 by PVII-www.projectseven.com
 var a,i,im,cl;a=document.getElementById(d);if(a.hasIm){im=a.getElementsByTagName('IMG')[0];
 if(im.p7state==0){im.src=im.p7mimg[1];im.p7state=1;}}if(a.hasSub){if(a.p7state!=2){
 a.p7state=1;cl=a.className;if(cl.indexOf("p7TBMon")==-1){
 a.className=(cl&&cl.length>0)?cl+" p7TBMon":"p7TBMon";}}
 document.getElementById(a.hasSub).style.visibility="visible";P7_TBMtg(a);}
}

function P7_TBMtg(d){ //v1.0.2 by PVII-www.projectseven.com
 var i,im,s,cl;for(i=0;i<p7tbmt.length;i+=2){if(!d||p7tbmt[i]!=d.id){
 a=document.getElementById(p7tbmt[i]);if(a.hasIm){im=a.getElementsByTagName('IMG')[0];
 if(im.p7state<2){im.src=im.p7mimg[0];im.p7state=0;}}if(a.p7state!=2){a.p7state=0;
 cl=a.className;if(cl.indexOf("p7TBMon")>-1){a.className=cl.replace("p7TBMon",'');}}
 s=document.getElementById(p7tbmt[i+1]);if(s){s.style.visibility="hidden";}}}
}

function P7_TBMtrig(a){ //v1.0.2 by PVII-www.projectseven.com
 var h,hh,ret=false;P7_TBMdown(a);h=a.href;hh='javascript:; javascript:void(0)';
 if(p7tbma[3]==1){if(h.charAt(h.length-1)=='#'||document.location.href==h){
 ret=false;}else{ret=(hh.indexOf(h)>-1)?false:true;}}else{ret=false;}return ret;
}

function P7_TBMdown(a){ //v1.0.2 by PVII-www.projectseven.com
 var i,aa,im,cl;for(i=0;i<p7tbmt.length;i+=2){aa=document.getElementById(p7tbmt[i]);
 aa.p7state=0;aa.className=P7_trim(aa.className.replace("p7TBMdown",''));if(aa.hasIm){
 im=aa.getElementsByTagName('IMG')[0];im.p7state=0;}}a.p7state=2;if(a.hasIm){
 im=a.getElementsByTagName('IMG')[0];im.p7state=2;im.src=im.p7mimg[2];}else{cl=a.className;
 a.className=(cl&&cl.length>0)?cl+" p7TBMdown":"p7TBMdown";}P7_TBMshow(a.id);
}
function P7_trim(t){ //v1.0.2 by PVII-www.projectseven.com
 t=t.replace(/^\s/,'');t=t.replace(/\s$/,'');return t;
}

function P7_TBMclose(evt){ //v1.0.2 by PVII-www.projectseven.com
 var i,pp,tS,d,p,f,m=true;evt=(evt)?evt:((event)?event:null);if(evt){
 tS=(evt.relatedTarget)?evt.relatedTarget:evt.toElement;if(tS){pp=tS;
 while(pp){if(pp.id){d=pp.id;if(pp.id.indexOf("p7TBM")>-1){m=false;break;}}
 pp=pp.parentNode;}if(m){f='P7_TBMtg()';if(p7tbma[2]==1){for(i=0;i<p7tbmt.length;i+=2){
 p=document.getElementById(p7tbmt[i]);if(p.p7state==2){f="P7_TBMshow('"+p.id+"')";}}}
 if(p7tbma[0]==1){eval('document.p7TBMtm=setTimeout("'+f+'",'+parseInt(p7tbma[4]+50)+')');
 }else{eval(f);}}}}
}

function P7_TBMsub(s){ //v1.0.2 by PVII-www.projectseven.com
 if(document.p7TBMtm){clearTimeout(document.p7TBMtm);}
 var d=s.id.replace("p7TBMsub","p7TBMt"),a=document.getElementById(d);
 P7_TBMswp(a);
}

function P7_TBMmark(){document.p7TBMop=arguments;}

function P7_TBMopen(){ //v1.0.2 by PVII-www.projectseven.com modified from Support BBS 
var x,i,j,k,kk,wH,tM,tA,pp,cl,a,nd,op,r1,aU;wH=window.location.href;
var mt = new Array(1,'','');if(document.p7TBMop){mt=document.p7TBMop;}op=mt[0];
if(op<1){return;}r1=/index\.[\S]*/i;k=-1,kk=-1;tM=document.getElementById('p7TBM');
tA=tM.getElementsByTagName("A");for(j=0;j<tA.length;j++){aU=tA[j].href.replace(r1,'');
if(op>0){if(tA[j].href==wH||aU==wH){k=j;kk=-1;
// tweak to allow last link found
//break;
//end tweak
}}if(op==2){if(tA[j].firstChild){
if(tA[j].firstChild.nodeValue==mt[1]){kk=j;}}}if(op==3 && tA[j].href.indexOf(mt[1])>-1){
kk=j;}if(op==4){for(x=1;x<mt.length;x+=2){if(wH.indexOf(mt[x])>-1){
if(tA[j].firstChild&&tA[j].firstChild.nodeValue){if(tA[j].firstChild.nodeValue==mt[x+1]){
kk=j;}}}}}}k=(kk>k)?kk:k;if(k>-1){a=false;if(!tA[k].hasIm&&!tA[k].isRoot){cl=tA[k].className;
tA[k].className=(cl&&cl.length>0)?cl+" p7TBMmark":"p7TBMmark";}pp=tA[k].parentNode;
while(pp){if(pp.id&&pp.id=='p7TBMroot'){a=tA[k];break;}if(pp.id&&pp.id.indexOf('p7TBMsub')>-1){
 nd='p7TBMt'+pp.id.replace('p7TBMsub','');a=document.getElementById(nd);break;}
pp=pp.parentNode;}if(a){P7_TBMdown(a);}}
}

/* 

  ================================================
  PVII Horizontal Gallery scripts
  Copyright (c) 2006 Project Seven Development
  www.projectseven.com
  Version: 2.0.8
  ================================================
  
*/
var p7gsiem=(navigator.appVersion.indexOf("MSIE 5")>-1&&navigator.userAgent.indexOf("Mac")>-1)?true:false;
var p7gsca,p7gsa=new Array(),p7gsplot=new Array(),p7gstmb = new Array();
function P7_setHGS(){ //v1.0.9 by PVII-www.projectseven.com
 var i,d='',tA,h="<sty"+"le type=\"text/css\">";if(!document.getElementById){return;}
 tA=navigator.userAgent.toLowerCase();if(window.opera){
 if(tA.indexOf("opera 5")>-1 || tA.indexOf("opera 6")>-1){return;}}
 h+="#p7GS{visibility:hidden;}";h+="<"+"/sty"+"le>";document.write(h);
}
P7_setHGS();
function P7_HGSinit(){ //v1.0.9 by PVII-www.projectseven.com
 var i,x,s,vp,sc,ul,li,h,hh=0,w,ww=0,uw,n,nn,im,a,nv,hv,bh,bw,ed,eh,ew,cv,j,kw,tA;
 if(!document.getElementById){return;}tA=navigator.userAgent.toLowerCase();
 if(window.opera){if(tA.indexOf("opera 5")>-1 || tA.indexOf("opera 6")>-1){return;}}
 p7gsa=arguments;if(p7gsiem||tA.indexOf('scape6/6')>-1){p7gsa[1]=0;}vp=document.getElementById('p7GSvp');
 sc=document.getElementById('p7GSsc');li=sc.getElementsByTagName('LI');im=sc.getElementsByTagName('IMG');
 for(i=0;i<im.length;i++){im[i].style.display='block';}for(i=0;i<li.length;i++){
 li[i].style.position='absolute';h=li[i].offsetHeight;w=li[i].offsetWidth;hh=(h>hh)?h:hh;
 ww=(w>ww)?w:ww;}for(i=0;i<li.length;i++){li[i].style.height=hh+'px';li[i].style.width=ww+'px';}
 for(i=0;i<li.length;i++){h=li[i].offsetHeight;w=li[i].offsetWidth;if(h>hh){n=hh-(h-hh);
 li[i].style.height=n+'px';}if(w>ww){n=ww-(w-ww);li[i].style.width=n+'px';}}ul=sc.getElementsByTagName('UL');
 ww=0;for(i=0;i<ul.length;i++){li=ul[i].getElementsByTagName('LI');	kw=0;for(j=0;j<li.length;j++){
 w=li[j].offsetWidth;h=li[j].offsetHeight;li[j].style.left=kw+'px';kw+=w;ww=(kw>ww)?kw:ww;}
 ul[i].style.position='relative';ul[i].style.height=h+'px';}if(ul.length==1){
 document.getElementById('p7GSnv').style.display='none';}sc.style.position='absolute';sc.style.top='0px';
 sc.style.left='0px';vp.style.height=h+'px';vp.style.width=ww+'px';vp.style.overflow='hidden';
 if(p7gsa[0]==1){li=sc.getElementsByTagName('LI');for(i=0;i<li.length;i++){im=li[i].getElementsByTagName('IMG')[0];
 h=im.offsetHeight;w=im.offsetWidth;hh=parseInt(li[i].style.height);ww=parseInt(li[i].style.width);
 n=parseInt((hh-h)/2);nn=parseInt((ww-w)/2);if(n>0){im.style.marginTop=n+'px';}if(nn>0){
 im.style.marginLeft=nn+'px';}}}document.p7gspre=new Array();a=sc.getElementsByTagName('A');x=0;
 for(i=0;i<a.length;i++){if(a[i].parentNode.nodeName=='LI'){a[i].onmouseover=function(){P7_HGSover(this);};
 a[i].onfocus=function(){P7_HGSover(this);};a[i].onmouseout=function(){P7_HGSout(this);};
 a[i].onclick= function(){return P7_HGSshow(this);};document.p7gspre[x]=new Image();document.p7gspre[x].cmp=false;
 document.p7gspre[x].onload=function (){this.cmp=true;};a[i].p7gsindex=x;p7gstmb[x]=a[i];x++;}}
 nv=document.getElementById('p7GSnv');x=0;if(nv){hv=nv.innerHTML;ul=sc.getElementsByTagName('UL');
 for(i=0;i<ul.length;i++){s=(i==0)?'':' <span>|</span> ';x=i+1;
 hv+=s+'<a id="p7gsn'+x+'" href="javascript:;" title="View Thumbnail Panel '+x+'">'+x+'</a>';}
 nv.innerHTML=hv;a=nv.getElementsByTagName('A');for(i=0;i<a.length;i++){a[i].onclick= function(){
 return P7_HGSnvs(this);};}}document.getElementById('p7GS').style.visibility="visible";h=p7gsa[4];
 if(!P7_HGSurl()){if(h>0){P7_HGStrig(h-1,9);}}
}
function P7_HGSover(a){ //v1.0.9 by PVII-www.projectseven.com
 var im=a.getElementsByTagName('IMG')[0];if(im.className!='p7GSon'){im.className='p7GSover';}
}
function P7_HGSout(a){ //v1.0.9 by PVII-www.projectseven.com
 var im=a.getElementsByTagName('IMG')[0];if(im.className!='p7GSon'){im.className='';}
}
function P7_HGSnvs(a,g){ //v1.0.9 by PVII-www.projectseven.com
 var p,ta;p=parseInt(a.id.replace('p7gsn',''));g=(g)?g:0;
 ta=document.getElementById('p7GSnv').getElementsByTagName('A');for(i=0;i<ta.length;i++){
 if(ta[i].className){ta[i].className='';}}a.className='p7GSnvon';P7_HGSmove(p,g);return false;
}
function P7_HGSmove(p,g){ //v1.0.9 by PVII-www.projectseven.com
 var i,h,sc,t,c,m;sc=document.getElementById('p7GSsc');h=sc.getElementsByTagName('LI')[0].offsetHeight;
 t=((h*p)-h)*-1;c=parseInt(sc.style.top);c=(c)?c:0;m=(c<t)?1:0;P7_HGSvon();if(p7gsa[5]==1&&g!=9&&g!=6){
 P7_HGSscr(t,m);}else{sc.style.top=t+'px';P7_HGSvoff();}
}
function P7_HGSvoff(){ //v1.0.9 by PVII-www.projectseven.com
 var i,j,ul,m=false;ta=document.getElementById('p7GSnv').getElementsByTagName('A');
 for(i=0;i<ta.length;i++){if(ta[i].className=='p7GSnvon'){m=true;break;}}if(m){
 ul=document.getElementById('p7GSsc').getElementsByTagName('UL');for(j=0;j<ul.length;j++){
 if(j==i){ul[j].style.visibility='visible';}else{ul[j].style.visibility='hidden';}}}
}
function P7_HGSvon(){ //v1.0.9 by PVII-www.projectseven.com
 var i,ul=document.getElementById('p7GSsc').getElementsByTagName('UL');
 for(i=0;i<ul.length;i++){ul[i].style.visibility='visible';}
}
function P7_HGSscr(t,m){ //v1.0.9 by PVII-www.projectseven.com
 var d,r,y=30;d=document.getElementById('p7GSsc');c=parseInt(d.style.top);r=P7_HGSrate(c,t);
 c+=(m==1)?r:r*-1;if(m==1){c=(c>=t)?t:c;}else{c=(c<=t)?t:c;}d.style.top=c+"px";if(c!=t){
 d.p7hgsan=setTimeout("P7_HGSscr("+t+","+m+")",y);}else{P7_HGSvoff();}
}
function P7_HGSrate(c,t){ //v1.0.9 by PVII-www.projectseven.com
 var tt=Math.abs(t-c),i=parseInt(tt*.08);i=(i<=20)?20:i;return i;
}
function P7_HGStrig(n,ug){ //v1.0.9 by PVII-www.projectseven.com
 var i,sc,a,f;ug=(ug)?ug:0;a=p7gstmb[n];if(a){P7_HGStrigp(a,ug);f=P7_HGSshow(a,ug);}
}
function P7_HGStrigp(a,ug){ //v1.0.9 by PVII-www.projectseven.com
 var i,nv,ul,pp,f;nv=document.getElementById('p7GSnv').getElementsByTagName('A');
 ul=document.getElementById('p7GSsc').getElementsByTagName('UL');pp=a.parentNode;
 while(pp){if(pp.nodeName=='UL'){break;}pp=pp.parentNode;}for(i=0;i<ul.length;i++){
 if(ul[i]==pp){break;}}f=P7_HGSnvs(nv[i],ug);
}
function P7_HGSurl(){ //v1.0.9 by PVII-www.projectseven.com
 var i,h,s,x,m=false,p='pic';if(document.getElementById){h=document.location.search;if(h){
 h=h.replace('?','');s=h.split('=');if(s&&s.length){for(i=0;i<s.length;i+=2){if(s[i]==p){
 x=parseInt(s[i+1]);if(x){P7_HGStrig(x,9);m=true;break;}}}}}h=document.location.hash;
 if(h){x=parseInt(h.substring(1,h.length));if(x&&x>0){m=true;}}}if(m){x--;
 P7_HGStrig(x,9);}return m;
}
function P7_HGSshow(a,ug){ //v1.0.9 by PVII-www.projectseven.com
 var i,ti,im,fM,pM,dM,cM,dD,ds,h,w;ug=(ug)?ug:0;im=a.getElementsByTagName('IMG')[0];
 ti=document.getElementById('p7GSvp').getElementsByTagName('IMG');if(p7gsca){
 if(p7gsca==a){return false;}}for(i=0;i<ti.length;i++){ti[i].className='';}im.className='p7GSon';
 dM=document.getElementById('p7GSfs');fM=dM.getElementsByTagName('IMG')[0];
 pM=document.p7gspre[a.p7gsindex];if(document.p7gswait){clearTimeout(document.p7gswait);}
 p7gsca=a;if(!pM.cmp){P7_GSpbs(fM);pM.src=a.href;P7_GSwait(a.p7gsindex,ug);}else{
 P7_GSfin(pM,ug);}return false;
}
function P7_GSpbs(im,ug){ //v1.0.9 by PVII-www.projectseven.com
 var i,l,t,p,pb,pw,ph,ih,iw;pb=document.getElementById('p7GSpb');pw=pb.offsetWidth;
 ph=pb.offsetHeight;if(im){ih=(p7gsiem)?im.height:im.offsetHeight;
 iw=(p7gsiem)?im.width:im.offsetWidth;t=(ih-ph)/2;l=(iw-pw)/2;p=P7_getPos(im);l+=p[0];t+=p[1];
 pb.style.left=l+'px';pb.style.top=t+'px';pb.style.visibility="visible";}
}
function P7_getPos(im){ //v1.0.9 by PVII-www.projectseven.com
 var p,pp,l=0,t=0,r=new Array(2);pp=im;while(pp){l+=(pp.offsetLeft)?pp.offsetLeft:0;
 t+=(pp.offsetTop)?pp.offsetTop:0;if(window.opera||navigator.userAgent.indexOf("Safari")>-1){
 if(pp.nodeName=="BODY"){l-=(pp.offsetLeft)?pp.offsetLeft:0;t-=(pp.offsetTop)?pp.offsetTop:0;}}
 pp=pp.offsetParent;}if(p7gsiem){l+=parseInt(document.body.currentStyle.marginLeft);
 t+=parseInt(document.body.currentStyle.marginTop);}r[0]=l;r[1]=t;return r;
}
function P7_GSwait(ix,ug){ //v1.0.9 by PVII-www.projectseven.com
 var im=document.p7gspre[ix];if(im.cmp || (!document.all&&im.height>1)){im.cmp=true;
 document.getElementById('p7GSpb').style.visibility='hidden';P7_GSfin(im,ug);
 }else{document.p7gswait=setTimeout("P7_GSwait("+ix+","+ug+")",200);}
}
function P7_GSfin(im,ug){ //v1.0.9 by PVII-www.projectseven.com
 var dM,fM,cM,aL,cD,ds,dT='',tH='',aC,fS,an,st='',h,h1,h2,ti,ci,ct,cn;an=p7gsa[1];if(an>0){
 st=' style="visibility:hidden"';}fS=document.getElementById('p7GSfs');dM=document.getElementById('p7GSfs');
 fM=dM.getElementsByTagName('IMG')[0];tB=p7gsca.getElementsByTagName('IMG')[0];
 tH+='<table class="p7GSfst" align="center" cellpadding="0" cellspacing="0">';
 aL=tB.getAttribute("alt");ci=P7GSgi();ci[4]+=1;ct=p7gstmb.length;cn='';if(p7gsa[7]==1){
 cn=' <span class="p7GScounter">('+ci[4]+' of '+ct+')</span>';}aC='<tr><td class="p7GSfsc"><p>'+aL+cn+'</p></td></tr>';
 ds=p7gsca.parentNode.getElementsByTagName('DIV');if(ds&&ds[0]){dT=ds[0].innerHTML;}if(p7gsa[2]==1){
 if(aL&&aL.length>0){tH+=aC;}}tH+='<tr><td class="p7GSfsi"><img src="'+im.src+'" alt="'+aL+'"'+st+'></td></tr>';
 if(p7gsa[2]==2){if(aL&&aL.length>0){tH+=aC;}}if(p7gsa[3]==1){if(dT.length>0){
 tH+='<tr><td class="p7GSfsd"><div>'+dT+'</div></td></tr>';}}tH+='</table>';dM.innerHTML=tH;
 if(fS){fS.style.display='block';}if(ug<7){if(an==1||an==2){P7_GSfan();}else if(an>2){P7_GSfie();}
 }else{document.getElementById('p7GSfs').getElementsByTagName('IMG')[0].style.visibility='visible';}
}
function P7GSgi(){ //v1.0.9 by PVII-www.projectseven.com
 var i,x,a,gi=new Array();x=p7gstmb.length-1;for(i=0;i<p7gstmb.length;i++){
 if(p7gstmb[i]==p7gsca){break;}}gi[0]=0;gi[1]=(i>0)?i-1:0;gi[2]=(i<x)?i+1:x;gi[3]=x;gi[4]=i;return gi;
}
function P7_GSfie(){ //v1.0.9 by PVII-www.projectseven.com
 var i,d,im,f,ff,pim,g=new Array(),an=p7gsa[1];
 im=document.getElementById('p7GSfs').getElementsByTagName('IMG')[0];pim=im.parentNode;
 if(!im.parentNode.filters){p7gsa[1]=2;P7_GSfan();return;}f='progid:DXImageTransform.Microsoft.';
 d=' Duration=1';g[0]='Fade';g[1]='Fade';g[2]='Fade';g[3]='Fade';
g[4]='Iris(irisstyle="SQUARE", motion="in"'+d+')';g[5]='Iris(irisstyle="SQUARE", motion="out"'+d+')';
g[6]='Iris(irisstyle="CIRCLE", motion="in"'+d+')';g[7]='Iris(irisstyle="CIRCLE", motion="out"'+d+')';
g[8]='Blinds(direction="up", bands=1'+d+')';g[9]='Blinds(direction="down", bands=1'+d+')';
g[10]='Blinds(direction="right", bands=1'+d+')';g[11]='Blinds(direction="left", bands=1'+d+')';
g[12]='Blinds(direction="right"'+d+')';g[13]='Blinds(direction="down"'+d+')';
g[14]='CheckerBoard(direction="right"'+d+')';g[15]='CheckerBoard(direction="down"'+d+')';
g[16]='RandomDissolve('+d+')';g[17]='Barn(orientation="vertical", motion="in"'+d+')';
g[18]='Barn(orientation="vertical", motion="out"'+d+')';g[19]='Barn(orientation="horizontal", motion="in"'+d+')'
g[20]='Barn(orientation="horizontal", motion="out"'+d+')';g[21]='Strips(motion="leftdown"'+d+')';
g[22]='Strips(motion="leftup"'+d+')';g[23]='Strips(motion="rightdown"'+d+')';
g[24]='Strips(motion="rightup"'+d+')';g[25]='RandomBars(orientation="horizontal"'+d+')';
g[26]='RandomBars(orientation="vertical"'+d+')';g[27]='Wipe(GradientSize=1.0, wipeStyle=0, motion="forward"'+d+')';
g[28]='Inset()';g[29]='Pixelate(MaxSquare=50,Duration=1,Enabled=false'+d+')';
g[30]='RadialWipe(wipeStyle="clock"'+d+')';g[31]='RadialWipe(wipeStyle="wedge"'+d+')';
g[32]='RadialWipe(wipeStyle="radial"'+d+')';g[33]='Slide(slideStyle="PUSH", bands=1'+d+')';
g[34]='Slide(slideStyle="SWAP", bands=5'+d+')';g[35]='Slide(slideStyle="HIDE", bands=2'+d+')';
g[36]='Spiral(GridSizeX=16, GridSizeY=16'+d+')';g[37]='Stretch(stretchStyle="hide"'+d+')';
g[38]='Stretch(stretchStyle="spin"'+d+')';g[39]='Stretch(stretchStyle="push"'+d+')';
g[40]='Wheel(spokes=4'+d+')';g[41]='Wheel(spokes=16'+d+')';g[42]='zigzag(GridSizeX=8, GridSizeY=8'+d+')';
 an=(an>g.length)?3:an;f+=g[an];pim.style.filter=f;if(pim.filters.length<1){p7gsa[1]=1;P7_GSfan();
 return;}pim.filters[0].Apply();im.style.visibility='visible';pim.filters[0].Play();
}
function P7_GSfan(){ //v1.0.9 by PVII-www.projectseven.com
 var im,fh,fw,tB,tF,tL,l,t,dt,dl,df,fr,dn,pl,an,c=10,i,ih,iw,ih2,iw2,l2,t2,lm=false,tm=false,ch=c,cw=c;
 an=p7gsa[1];im=document.getElementById('p7GSfs').getElementsByTagName('IMG')[0];tF=P7_getPos(im);
 fh=im.offsetHeight;fw=im.offsetWidth;tB=p7gsca.getElementsByTagName('IMG')[0];tD=P7_getPos(tB);
 if(an==1){l=parseInt((tB.offsetWidth/2))-5+tD[0];t=parseInt((tB.offsetHeight/2))-5+tD[1];
 }else{l=parseInt((fw/2))-5+tF[0];t=parseInt((fh/2))-5+tF[1];}tL=document.getElementById('p7GSah');
 tL.innerHTML='<img src="'+im.src+'" height="'+c+'" width="'+c+'">';tL.style.left=l+'px';tL.style.top=t+'px';
 dt=tF[1]-t;dl=tF[0]-l;fr=20;p7gsplot.length=0;ih=fh-c;iw=fw-c;if(ih>iw){dn=parseInt(ih/fr)+1;ih2=fr;
 iw2=parseInt(iw/dn)+1;}else{dn=parseInt(iw/fr)+1;iw2=fr;ih2=parseInt(ih/dn)+1;}l2=parseInt( Math.abs(dl)/dn)+1;
 if(dl<0){l2=l2*-1;lm=true;}t2=parseInt( Math.abs(dt)/dn)+1;if(dt<0){t2=t2*-1;tm=true;}for(i=1;i<dn+1;i++){
 t+=t2;if(tm){t=(t<=tF[1])?tF[1]:t;}else{t=(t>=tF[1])?tF[1]:t;}l+=l2;if(lm){l=(l<=tF[0])?tF[0]:l;}else{
 l=(l>=tF[0])?tF[0]:l;}cw+=iw2;cw=(cw>=fw)?fw:cw;ch+=ih2;ch=(ch>=fh)?fh:ch;
 p7gsplot[i-1]=t+','+l+','+cw+','+ch;}tL.style.visibility="visible";P7_GSfanim(0);
}
function P7_GSfanim(p){ //v1.0.9 by PVII-www.projectseven.com
 var i,pl,dy=10,tL=document.getElementById('p7GSah'),im=tL.getElementsByTagName('IMG')[0];
 if(p<p7gsplot.length){pl=p7gsplot[p].split(',');tL.style.top=pl[0]+'px';tL.style.left=pl[1]+'px';
 im.style.width=pl[2]+'px';im.style.height=pl[3]+'px';p++;setTimeout("P7_GSfanim("+p+")",dy);}
 else{document.getElementById('p7GSfs').getElementsByTagName('IMG')[0].style.visibility='visible';
 tL.style.visibility='hidden';}
}

/* 

  ================================================
  PVII TabPanel scripts
  Copyright (c) 2006 Project Seven Development
  www.projectseven.com
  Version: 1.0.8
  ================================================
  
*/

var p7tpa=new Array();
var isIE5=(navigator.appVersion.indexOf("MSIE 5")>-1);
function P7_setTP(){ //v1.0.8 by PVII-www.projectseven.com
 var i,h="<sty"+"le type=\"text/css\">\n";h+=".p7TP_tabs{display: block;}.p7TPcontent div{display:none;}\n";
 h+=".p7TPcontent div div{display:block;}\n";if(document.getElementById){for(i=1;i<11;i++){
 h+="#p7tpc"+i+"_1 {display:block;}\n";}h+="\n<"+"/sty"+"le>";document.write(h);}
}
P7_setTP();
function P7_initTP(){ //v1.0.8 by PVII-www.projectseven.com
 var i,j,tb,tD,tP,tA,pb="p7TP";if(!document.getElementById){return;};p7tpa=arguments;
 for(i=1;i<11;i++){tb=pb+i;tP=document.getElementById(tb);if(tP){tD=tP.getElementsByTagName("DIV");
 if(tD){for(j=0;j<tD.length;j++){if(tD[j].id&&tD[j].id.indexOf("p7tpb")==0){
 tA=tD[j].getElementsByTagName("A");if(tA[0]){tA[0].p7tpn=new Array(i,tD[j].id);
 tA[0].onclick=function(){return P7_TPtrig(this);};}}}}}}
}
function P7_TPtrig(a){ //v1.0.8 by PVII-www.projectseven.com
 var i,tD,tA,tC,c,d,sb,an=p7tpa[1],wP,h,cP,ch,hD,hh;if(typeof(a)!='object'){c=a.replace("p7tpc","p7tpb");
 d=document.getElementById(c);if(d){a=d.getElementsByTagName("A")[0];}}if(a.p7tpn){
 tD=document.getElementById(a.p7tpn[1]);if(tD){tA=tD.parentNode.getElementsByTagName("A");
 if(an==29&&!isIE5){wP=P7_getCD(a);h=P7_getPH(wP);cP=getTPc(a);ch=P7_getPH(cP);hD=h-ch;
 if(window.opera){P7_setPW(wP);}wP.style.height=h+"px";wP.style.overflow="hidden";}
 for(i=0;i<tA.length;i++){if(tA[i].p7tpn){sb=tA[i].p7tpn[1].replace("p7tpb","p7tpc");
 tC=document.getElementById(sb);if(tA[i]==a){tA[i].className="down";
 document.getElementById(tA[i].p7tpn[1]).className="down";if(tC){if(an>0&&an!=29){
 tC.style.visibility="hidden";tC.style.display="block";setTimeout("P7_TPanim('"+tC.id+"')",100);}
 else{tC.style.display="block";}if(an==29&&!isIE5){hh=P7_getPH(tC);P7_TPglide(tC.id,h,hh+hD);}}}
 else{tA[i].className='';document.getElementById(tA[i].p7tpn[1]).className='';if(tC){
 tC.style.display="none";}}}}}}if(typeof(P7_colH2)=='function'){P7_colH2();}
 if(typeof(P7_colH)=='function'){P7_colH();}return false;
}
function P7_TPanim(iD){ //v1.0.8 by PVII-www.projectseven.com
 var i,f,tC,g=new Array(),an=p7tpa[1],ob=document.getElementById(iD);tC=ob.parentNode;
 if(!tC.filters){ob.style.opacity="0.10";ob.style.visibility='visible';
 P7_TPfadeIn(ob.id,0.00);return;}f='progid:DXImageTransform.Microsoft.';d=' Duration=1';
g[0]='Fade';
g[1]='Fade';
g[2]='Wipe(GradientSize=0.5, wipeStyle=0, motion="forward"'+d+')';
g[3]='Pixelate(MaxSquare=50,Duration=1,Enabled=false'+d+')';
g[4]='RandomDissolve('+d+')';
g[5]='Iris(irisstyle="SQUARE", motion="in"'+d+')';
g[6]='Iris(irisstyle="SQUARE", motion="out"'+d+')';
g[7]='Iris(irisstyle="CIRCLE", motion="in"'+d+')';
g[8]='Iris(irisstyle="CIRCLE", motion="out"'+d+')';
g[9]='Blinds(direction="up", bands=1'+d+')';
g[10]='Blinds(direction="down", bands=1'+d+')';
g[11]='Blinds(direction="right", bands=1'+d+')';
g[12]='Blinds(direction="left", bands=1'+d+')';
g[13]='Barn(orientation="vertical", motion="in"'+d+')';
g[14]='Barn(orientation="vertical", motion="out"'+d+')';
g[15]='Barn(orientation="horizontal", motion="in"'+d+')'
g[16]='Barn(orientation="horizontal", motion="out"'+d+')'
g[17]='Strips(motion="leftdown"'+d+')';
g[18]='Strips(motion="leftup"'+d+')';
g[19]='Strips(motion="rightdown"'+d+')';
g[20]='Strips(motion="rightup"'+d+')';
g[21]='RadialWipe(wipeStyle="clock"'+d+')';
g[22]='RadialWipe(wipeStyle="wedge"'+d+')';
g[23]='RadialWipe(wipeStyle="radial"'+d+')';
g[24]='Slide(slideStyle="PUSH", bands=1'+d+')';
g[25]='Slide(slideStyle="SWAP", bands=5'+d+')';
g[26]='Slide(slideStyle="HIDE", bands=1'+d+')';
g[27]='Wheel(spokes=4'+d+')';
g[28]='Wheel(spokes=16'+d+')';
 an=(an>g.length)?3:an;f+=g[an];tC.style.filter=f;if(tC.filters.length<1){
 p7tpa[1]=0;ob.style.visibility='visible';return;}tC.filters[0].Apply();
 ob.style.visibility='visible';tC.filters[0].Play();
}
function P7_TPfadeIn(id,op){ //v1.0.8 by PVII-www.projectseven.com
 var d=document.getElementById(id);op+=.05;op=(op>=1)?1:op;d.style.opacity=op;
 if(op<1){setTimeout("P7_TPfadeIn('"+id+"',"+op+")",60);}
}
function P7_getPH(d){ //v1.0.8 by PVII-www.projectseven.com
 var h,nh,dh,oh;d.style.height="auto";oh=d.offsetHeight;d.style.height=oh+"px";
 nh=d.offsetHeight;if(oh!=nh){nh=(oh-(nh-oh));}d.style.height="auto";return nh;
}
function P7_setPW(d){ //v1.0.8 by PVII-www.projectseven.com
 var w,nw,dw,ow;d.style.width="auto";ow=d.offsetWidth;d.style.width=ow+"px";
 nw=d.offsetWidth;if(ow!=nw){nw=(ow-(nw-ow));}d.style.width=nw+"px";
}
function P7_getCD(a){ //v1.0.8 by PVII-www.projectseven.com
 var g,tP=a.p7tpn[1].replace("p7tpb","p7tpc");g=document.getElementById(tP);return g.parentNode;
}
function getTPc(a){ //v1.0.8 by PVII-www.projectseven.com
 var i,tA,cD,tC=null;tA=a.parentNode.parentNode.getElementsByTagName("A");
 for(i=0;i<tA.length;i++){if(tA[i].className && tA[i].className=="down"){
 cD=tA[i].p7tpn[1].replace("p7tpb","p7tpc");tC=document.getElementById(cD);break;}}
 return tC;
}
function P7_TPglide(pn,ch,th){ //v1.0.8 by PVII-www.projectseven.com
 var tt,inc,dy=10,w,m;w=document.getElementById(pn).parentNode;m=(ch<=th)?0:1;
 tt=Math.abs(parseInt(Math.abs(th)-Math.abs(ch)));inc=(tt*.15<1)?1:tt*.15;
 inc=(m==1)?inc*-1:inc;w.style.height=ch+"px";
 if(ch==th){w.style.height="auto";w.style.overflow="visible";}else{ch+=inc;
 if(m==0){ch=(ch>=th)?th:ch;}else{ch=(ch<=th)?th:ch;}if(w.p7tpG){clearTimeout(w.p7tpG);}
 w.p7tpG=setTimeout("P7_TPglide('"+pn+"',"+ch+","+th+")",dy);}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
// TMT Varidator
/** 
* Copyright 2005-2006 massimocorner.com
* @author      Massimo Foti (massimo@massimocorner.com)
* @version     1.3.1, 2006-07-22
 */

// Create all the validator objects required inside the document
function tmt_validatorInit(){
	var formNodes = document.getElementsByTagName("form");
	for(var i=0; i<formNodes.length; i++){
		if(formNodes[i].getAttribute("tmt:validate") == "true"){
			// Attach a validator object to each form that requires it
			formNodes[i].tmt_validator = new tmt_formValidator(formNodes[i]);
			// Set the form node's onsubmit event 
			// We use a gigantic hack to preserve exiting calls attached to the onsubmit event (most likely validation routines)
			if(typeof formNodes[i].onsubmit != "function"){
				formNodes[i].onsubmit = function(){
					return tmt_validateForm(this);
				}
			}
			else{
				// Store a reference to the old function
				formNodes[i].tmt_oldSubmit = formNodes[i].onsubmit;
				formNodes[i].onsubmit = function(){
					// If the existing function return true, send the form
					if(this.tmt_oldSubmit()){
						return tmt_validateForm(this);
					}
					return false;
				}
			}
		}
	}
}

// Perform the validation
function tmt_validateForm(formNode){
	var errorMsg = "";
	var formValidator = formNode.tmt_validator;
	// Be sure the form contains a validator object
	if(formValidator){
		var focusGiven = false;
		// This array will store all the field validators that contains errors
		// They may be required by the callback
		var invalidFields = new Array();
		// Validate all the fields
		for(var i=0; i<formValidator.validators.length; i++){
			if(formValidator.validators[i].validate()){
				// Append to the global error string
				errorMsg += formValidator.validators[i].message + "\n";
				invalidFields[invalidFields.length] = formValidator.validators[i];
				// Give focus to the first invalid text/textarea field
				if(!focusGiven && (formValidator.validators[i].type == "text")){
					formValidator.validators[i].getFocus();
					focusGiven = true;
				}
			}
		}
		if(errorMsg != ""){
			// We have errors, display them
			if(!formValidator.callback){
				// We don't have callbacks, just display an alert
				alert(errorMsg);
			}
			else{
				// Invoke the callbak, it will take care of displaying the errors
				eval(formValidator.callback + "(formNode, invalidFields)");
			}
		}
		else{
			// Everything is fine, disable form submission to avoid multiple submits
			formValidator.blockSubmit();
		}
	}
	return errorMsg.length == 0; 
}

/* Object constructors */

// Form validator
function tmt_formValidator(formNode){
	// Store all the validator objects inside an array
	this.validators = new Array();
	// Add the specified callback only if the function is currently defined
	if(formNode.getAttribute("tmt:callback") && window[formNode.getAttribute("tmt:callback")]){
		this.callback = formNode.getAttribute("tmt:callback");
	}
	var fieldsArray = tmt_getTextfieldNodes(formNode);
	for(var i=0; i<fieldsArray.length; i++){
		// Create a validator for each text field
		this.validators[this.validators.length] = tmt_textValidatorFactory(fieldsArray[i]);
		
		if(fieldsArray[i].getAttribute("type")){
			// Set the onchange event for each image upload validation
			if((fieldsArray[i].getAttribute("type").toLowerCase() == "file") &&	(fieldsArray[i].getAttribute("tmt:image") == "true")){
				fieldsArray[i].onchange = function(){
					tmt_validateImg(this);
				}
			}
		}
		if(fieldsArray[i].getAttribute("tmt:filters")){
			// Call the filters on the onkeyup and onblur events
			addEvent(fieldsArray[i], "keyup", function(){tmt_filterField(this);});
			addEvent(fieldsArray[i], "blur", function(){tmt_filterField(this);});
		}
	}
	var selectNodes = formNode.getElementsByTagName("select");
	for(var j=0; j<selectNodes.length; j++){
		// Create a validator for each select element
		this.validators[this.validators.length] = tmt_selectValidatorFactory(selectNodes[j]);
	}
	var boxTable = tmt_getNodesTable(formNode, "checkbox");
	for(var boxName in boxTable){
		// Create a validator for each group of checkboxes
		this.validators[this.validators.length] = tmt_boxValidatorFactory(boxTable[boxName]);
	}
	var radioTable = tmt_getNodesTable(formNode, "radio");
	for(var radioName in radioTable){
		// Create a validator for each group of radios
		this.validators[this.validators.length] = tmt_radioValidatorFactory(radioTable[radioName]);
	}
	// Store all the submit buttons
	this.buttons = tmt_getSubmitNodes(formNode);
	// Define a method that can block multiple submits
	this.blockSubmit = function(){
		// Check to see if we want to disable submit buttons
		if(!formNode.getAttribute("tmt:blocksubmit") && !(formNode.getAttribute("tmt:blocksubmit") == "false")){
			// Disable each submit button
			for(var i=0; i<this.buttons.length; i++){
				if(this.buttons[i].getAttribute("tmt:waitmessage")){
					this.buttons[i].value = this.buttons[i].getAttribute("tmt:waitmessage");
				}
				this.buttons[i].disabled = true;
			}
		}
	}
}

// Abstract field validator constructor
function tmt_abstractValidator(fieldNode){
	this.message = "";
	this.name = fieldNode.name;
	if(fieldNode.getAttribute("tmt:message")){
		this.message = fieldNode.getAttribute("tmt:message");
	}
	var errorClass = "";
	if(fieldNode.getAttribute("tmt:errorclass")){
		errorClass = fieldNode.getAttribute("tmt:errorclass");
	}
	this.flagInvalid = function(){
		// Append the CSS class to the existing one
		if(errorClass){
			// Flag only if it's not already flagged
			if(fieldNode.className.indexOf(errorClass) == -1){
				fieldNode.className = fieldNode.className + " " + errorClass;
			}
		}
		// Set the title attribute in order to show a tootip
		fieldNode.setAttribute("title", this.message);
	}
	this.flagValid = function(){
		// Remove the CSS class
		if(errorClass){
			var regClass = new RegExp("\\b" + errorClass);
			fieldNode.className = fieldNode.className.replace(regClass, "");
		}
		fieldNode.removeAttribute("title");
	}
	this.validate = function(){
		// If the field contains error, flag it as invalid and return the error message
		// Be careful, this method contains multiple exit points!!!
		if(fieldNode.disabled){
			// Disabled fields are always valid
			this.flagValid();
			return false;
		}
		if(!this.isValid()){
			this.flagInvalid();
			return true;
		}
		else{
			this.flagValid();
			return false;
		}
	}
}

// Create a validator for text and texarea fields
function tmt_textValidatorFactory(fieldNode){
	// Create a generic validator, than add specific properties and methods as needed
	var obj = new tmt_abstractValidator(fieldNode);
	obj.type = "text";
	var required = false;
	if(fieldNode.getAttribute("tmt:required")){
		required = fieldNode.getAttribute("tmt:required");
	}
	// Put focus and cursor inside the field
	obj.getFocus = function(){
		// This try block is required to solve an obscure issue with IE and hidden fields
		try{
			fieldNode.focus();
			fieldNode.select();
		}
		catch(exception){
		}
	}
	// Check if the field is empty
	obj.isEmpty = function(){
		return fieldNode.value == "";
	}
	// Check if the field is required
	obj.isRequired = function(){
		return required;
	}
	// Check if the field satisfy the rules associated with it
	// Be careful, this method contains multiple exit points!!!
	obj.isValid = function(){
		// The tmt:required="conditional" attribute has a special meaning. 
		// The field isn't strictly required, so it may sometimes be empty, 
		// but before we let it go, we need to check any rule that may apply to it
		if(obj.isEmpty() && (required != "conditional")){
			if(obj.isRequired()){
				return false;
			}
			else{
				return true;
			}
		}
		else{
			// Loop over all the available rules
			for(var rule in tmt_globalRules){
				// Check if the current rule is required for the field
				if(fieldNode.getAttribute("tmt:" + rule)){
					// Invoke the rule
					if(!eval("tmt_globalRules." + rule + "(fieldNode)")){
						return false;
					}
				}
			}
		}
		return true;
	}
	return obj;
}

// Create a validator for <select> fields
function tmt_selectValidatorFactory(selectNode){
	// Create a generic validator, than add specific properties and methods as needed
	var obj = new tmt_abstractValidator(selectNode);
	obj.type = "select";
	var required = false;
	var invalidIndex;
	if(selectNode.getAttribute("tmt:invalidindex")){
		invalidIndex = selectNode.getAttribute("tmt:invalidindex");
	}
	var invalidValue;
	if(selectNode.getAttribute("tmt:invalidvalue") != null){
		invalidValue = selectNode.getAttribute("tmt:invalidvalue");
	}
	// Check if the field is required
	obj.isRequired = function(){
		return required;
	}
	// Check if the field satisfy the rules associated with it
	// Be careful, this method contains multiple exit points!!!	// Check if the select validate
	obj.isValid = function(){
		// Check for index
		if(selectNode.selectedIndex == invalidIndex){
			return false;
		}
		// Check for value
		if(selectNode.value == invalidValue){
			return false;
		}
		// Loop over all the available rules
		for(var rule in tmt_globalRules){
			// Check if the current rule is required for the field
			if(selectNode.getAttribute("tmt:" + rule)){
				// Invoke the rule
				if(!eval("tmt_globalRules." + rule + "(selectNode)")){
					return false;
				}
			}
		}
		return true;
	}
	return obj;
}

// Generic validator for grouped fields (radio and checkboxes)
function tmt_groupValidatorFactory(buttonGroup){
	this.name = buttonGroup.name;
	this.message = "";
	this.errorClass = "";
	// Since fields from the same group can have conflicting attribute values, the last one win
	for(var i=0; i<buttonGroup.elements.length; i++){
		if(buttonGroup.elements[i].getAttribute("tmt:message")){
			this.message = buttonGroup.elements[i].getAttribute("tmt:message");
		}
		if(buttonGroup.elements[i].getAttribute("tmt:errorclass")){
			this.errorClass = buttonGroup.elements[i].getAttribute("tmt:errorclass");
		}
	}
	this.flagInvalid = function(){
		// Append the CSS class to the existing one
		if(this.errorClass){
			for(var i=0; i<buttonGroup.elements.length; i++){
				// Flag only if it's not already flagged
				if(buttonGroup.elements[i].className.indexOf(this.errorClass) == -1){
					buttonGroup.elements[i].className = buttonGroup.elements[i].className + " " + this.errorClass;
				}
				buttonGroup.elements[i].setAttribute("title", this.message);
			}
		}
	}
	this.flagValid = function(){
		// Remove the CSS class
		if(this.errorClass){
			var regClass = new RegExp("\\b" + this.errorClass);
			for(var i=0; i<buttonGroup.elements.length; i++){
				buttonGroup.elements[i].className = buttonGroup.elements[i].className.replace(regClass, "");
				buttonGroup.elements[i].removeAttribute("title");
			}
		}
	}
	this.validate = function(){
		var errorMsg = "";
		// If the field group contains error, flag it as invalid and return the error message
		if(!this.isValid()){
			errorMsg += this.message;
			this.flagInvalid();
		}
		else{
			this.flagValid();
		}
		return errorMsg;
	}
}

// Checkbox validator (one for each group of boxes sharing the same name)
function tmt_boxValidatorFactory(boxGroup){
	var obj = new tmt_groupValidatorFactory(boxGroup);
	obj.type = "box";
	var minchecked = 0;
	var maxchecked = boxGroup.elements.length;
	// Since checkboxes from the same group can have conflicting attribute values, the last one win
	for(var i=0; i<boxGroup.elements.length; i++){
		if(boxGroup.elements[i].getAttribute("tmt:minchecked")){
			minchecked = boxGroup.elements[i].getAttribute("tmt:minchecked");
		}
		if(boxGroup.elements[i].getAttribute("tmt:maxchecked")){
			maxchecked = boxGroup.elements[i].getAttribute("tmt:maxchecked");
		}
	}
	// Check if the boxes validate
	obj.isValid = function(){
		var checkCounter = 0;
		for(var i=0; i<boxGroup.elements.length; i++){
		    // For each checked box, increase the counter
			if(boxGroup.elements[i].checked){
				checkCounter++;
			}
		}
		return (checkCounter >=  minchecked) && (checkCounter <= maxchecked);
	}
	return obj;
}

// Radio validator (one for each group of radios sharing the same name)
function tmt_radioValidatorFactory(radioGroup){
	var obj = new tmt_groupValidatorFactory(radioGroup);
	obj.type = "radio";

	obj.isRequired = function(){
		var requiredFlag = false;
		// Since radios from the same group can have conflicting attribute values, the last one win
		for(var i=0; i<radioGroup.elements.length; i++){
			if(radioGroup.elements[i].disabled == false){
				if(radioGroup.elements[i].getAttribute("tmt:required")){
					requiredFlag = radioGroup.elements[i].getAttribute("tmt:required");
				}
			}
		}
		return requiredFlag;
	}
	
	// Check if the radio validate
	obj.isValid = function(){
		if(obj.isRequired()){
			for(var i=0; i<radioGroup.elements.length; i++){
				// As soon as one is checked, we are fine
				if(radioGroup.elements[i].checked){
					return true;
				}
			}
			return false;
		}
		// It's not required, so it's fine
		else{
			return true;
		}	
	}
	return obj;
}

// This global objects store all the validation rules
// Every rule is stored as a method that accepts the field node as argument and return a boolean
var tmt_globalRules = new Object;
tmt_globalRules.datepattern = function(fieldNode){
	var globalObj = tmt_globalDatePatterns[fieldNode.getAttribute("tmt:datepattern")];
	if(globalObj){
		// Split the date into 3 different bits using the separator
		var dateBits = fieldNode.value.split(globalObj.s);
		// First try to create a new date out of the bits
		var testDate = new Date(dateBits[globalObj.y], (dateBits[globalObj.m]-1), dateBits[globalObj.d]);
		// Make sure values match after conversion
		var isDate = (testDate.getFullYear() == dateBits[globalObj.y])
				 && (testDate.getMonth() == dateBits[globalObj.m]-1)
				 && (testDate.getDate() == dateBits[globalObj.d]);
		// If it's a date and it matches the RegExp, it's a go
		return isDate && globalObj.rex.test(fieldNode.value);
	}
}
tmt_globalRules.equalto = function(fieldNode){
	var twinNode = document.getElementById(fieldNode.getAttribute("tmt:equalto"));
	return twinNode.value == fieldNode.value;
}
tmt_globalRules.maxlength = function(fieldNode){
	if(fieldNode.value.length > fieldNode.getAttribute("tmt:maxlength")){
		return false;
	}
	return true;
}
tmt_globalRules.maxnumber = function(fieldNode){
	if(parseFloat(fieldNode.value) > fieldNode.getAttribute("tmt:maxnumber")){
		return false;
	}
	return true;
}
tmt_globalRules.minlength = function(fieldNode){
	if(fieldNode.value.length < fieldNode.getAttribute("tmt:minlength")){
		return false;
	}
	return true;
}
tmt_globalRules.minnumber = function(fieldNode){
	if(parseFloat(fieldNode.value) < fieldNode.getAttribute("tmt:minnumber")){
		return false;
	}
	return true;
}
tmt_globalRules.pattern = function(fieldNode){
	var reg = tmt_globalPatterns[fieldNode.getAttribute("tmt:pattern")];
	if(reg){
		return reg.test(fieldNode.value);
	}
	else{
		// If the pattern is missing, skip it
		return true;	
	}
}

/* Image upload validation */

tmt_globalRules.image = function(fieldNode){
	// If the flag isn't defined we assume things are fine
	if(!fieldNode.isValidImg){
		fieldNode.isValidImg = "true";
	}
	return fieldNode.isValidImg == "true";
}

// Check the currently selected image and set a validity flag
function tmt_validateImg(fieldNode){
	var imgURL = "file:///" + fieldNode.value;
	var img = new Image();
	img.maxSize =  fieldNode.getAttribute("tmt:imagemaxsize");
	img.maxWidth = fieldNode.getAttribute("tmt:imagemaxwidth");
	img.minWidth = fieldNode.getAttribute("tmt:imageminwidth");
	img.maxHeight = fieldNode.getAttribute("tmt:imagemaxheight");
	img.minHeight = fieldNode.getAttribute("tmt:imageminheight");
	// Store a reference to the input field
	img.fieldNode = fieldNode;
	// The image's data can be read only after loading. That's why we need a callback
	img.onload = tmt_validateImgCallback;
	img.src = imgURL;
}

function tmt_validateImgCallback(){
	var errorsCount = 0;
	// Check every constrain and increment the error counter accordingly
	if(this.fileSize && this.maxSize && (this.fileSize/1024) > this.maxSize){
		errorsCount ++;
	}
	if(this.maxWidth && (this.width > this.maxWidth)){
		errorsCount ++;
	}
	if(this.minWidth && (this.width < this.minWidth)){
		errorsCount ++;
	}
	if(this.maxHeight && (this.height > this.maxHeight)){
		errorsCount ++;
	}
	if(this.minHeight && (this.height < this.minHeight)){
		errorsCount ++;
	}
	// Store the valid flag inside the DOM node itself
	this.fieldNode.isValidImg = (errorsCount != 0) ? "false" : "true";
}

// This global objects store all the RegExp patterns for strings
var tmt_globalPatterns = new Object;
tmt_globalPatterns.email = new RegExp("^[\\w\\.=-]+@[\\w\\.-]+\\.[\\w\\.-]{2,4}$");
tmt_globalPatterns.lettersonly = new RegExp("^[a-zA-Z]*$");
tmt_globalPatterns.alphanumeric = new RegExp("^\\w*$");
tmt_globalPatterns.integer = new RegExp("^-?\\d\\d*$");
tmt_globalPatterns.positiveinteger = new RegExp("^\\d\\d*$");
tmt_globalPatterns.number = new RegExp("^-?(\\d\\d*\\.\\d*$)|(^-?\\d\\d*$)|(^-?\\.\\d\\d*$)");
tmt_globalPatterns.zenkana = new RegExp("^[ 　]*[ァ-ヶ]*[ 　]*$");
tmt_globalPatterns.filepath_pdf = new RegExp("\\\\[\\w_]*\\.([pP][dD][fF])$");
tmt_globalPatterns.filepath_jpg_gif = new RegExp("\\\\[\\w_]*\\.([gG][iI][fF])|([jJ][pP][eE]?[gG])$");
tmt_globalPatterns.filepath_jpg = new RegExp("\\\\[\\w_]*\\.([jJ][pP][eE]?[gG])$");
tmt_globalPatterns.filepath_zip = new RegExp("\\\\[\\w_]*\\.([zZ][iI][pP])$");
tmt_globalPatterns.filepath = new RegExp("\\\\[\\w_]*\\.\\w{3}$");

// This global objects store all the info required for date validation
var tmt_globalDatePatterns = new Object;
tmt_globalDatePatterns["YYYY-MM-DD"] = tmt_dateInfo("^\([0-9]{4}\)\\-\([0-1][0-9]\)\\-\([0-3][0-9]\)$", 0, 1, 2, "-");
tmt_globalDatePatterns["YYYY-M-D"] = tmt_dateInfo("^\([0-9]{4}\)\\-\([0-1]?[0-9]\)\\-\([0-3]?[0-9]\)$", 0, 1, 2, "-");
tmt_globalDatePatterns["MM.DD.YYYY"] = tmt_dateInfo("^\([0-1][0-9]\)\\.\([0-3][0-9]\)\\.\([0-9]{4}\)$", 2, 0, 1, ".");
tmt_globalDatePatterns["M.D.YYYY"] = tmt_dateInfo("^\([0-1]?[0-9]\)\\.\([0-3]?[0-9]\)\\.\([0-9]{4}\)$", 2, 0, 1, ".");
tmt_globalDatePatterns["MM/DD/YYYY"] = tmt_dateInfo("^\([0-1][0-9]\)\/\([0-3][0-9]\)\/\([0-9]{4}\)$", 2, 0, 1, "/");
tmt_globalDatePatterns["M/D/YYYY"] = tmt_dateInfo("^\([0-1]?[0-9]\)\/\([0-3]?[0-9]\)\/\([0-9]{4}\)$", 2, 0, 1, "/");
tmt_globalDatePatterns["MM-DD-YYYY"] = tmt_dateInfo("^\([0-21][0-9]\)\\-\([0-3][0-9]\)\\-\([0-9]{4}\)$", 2, 0, 1, "-");
tmt_globalDatePatterns["M-D-YYYY"] = tmt_dateInfo("^\([0-1]?[0-9]\)\\-\([0-3]?[0-9]\)\\-\([0-9]{4}\)$", 2, 0, 1, "-");
tmt_globalDatePatterns["DD.MM.YYYY"] = tmt_dateInfo("^\([0-3][0-9]\)\\.\([0-1][0-9]\)\\.\([0-9]{4}\)$", 2, 1, 0, ".");
tmt_globalDatePatterns["D.M.YYYY"] = tmt_dateInfo("^\([0-3]?[0-9]\)\\.\([0-1]?[0-9]\)\\.\([0-9]{4}\)$", 2, 1, 0, ".");
tmt_globalDatePatterns["DD/MM/YYYY"] = tmt_dateInfo("^\([0-3][0-9]\)\/\([0-1][0-9]\)\/\([0-9]{4}\)$", 2, 1, 0, "/");
tmt_globalDatePatterns["D/M/YYYY"] = tmt_dateInfo("^\([0-3]?[0-9]\)\/\([0-1]?[0-9]\)\/\([0-9]{4}\)$", 2, 1, 0, "/");
tmt_globalDatePatterns["DD-MM-YYYY"] = tmt_dateInfo("^\([0-3][0-9]\)\\-\([0-1][0-9]\)\\-\([0-9]{4}\)$", 2, 1, 0, "-");
tmt_globalDatePatterns["D-M-YYYY"] = tmt_dateInfo("^\([0-3]?[0-9]\)\\-\([0-1]?[0-9]\)\\-\([0-9]{4}\)$", 2, 1, 0, "-");

// Create an object that stores date validation's info
function tmt_dateInfo(rex, year, month, day, separator){
	var infoObj = new Object;
	infoObj.rex = new RegExp(rex);
	infoObj.y = year;
	infoObj.m = month;
	infoObj.d = day;
	infoObj.s = separator;
	return infoObj;
}

/* Filters */

// This global objects store all the info required for filters
var tmt_globalFilters = new Object;
tmt_globalFilters.ltrim = tmt_filterInfo("^(\\s*)(\\b[\\w\\W]*)$", "$2");
tmt_globalFilters.rtrim = tmt_filterInfo("^([\\w\\W]*)(\\b\\s*)$", "$1");
tmt_globalFilters.nospaces = tmt_filterInfo("\\s*", "");
tmt_globalFilters.nocommas = tmt_filterInfo(",", "");
tmt_globalFilters.nodots = tmt_filterInfo("\\.", "");
tmt_globalFilters.noquotes = tmt_filterInfo("'", "");
tmt_globalFilters.nodoublequotes = tmt_filterInfo('"', "");
tmt_globalFilters.nohtml = tmt_filterInfo("<[^>]*>", "");
tmt_globalFilters.alphanumericonly = tmt_filterInfo("[^\\w]", "");
tmt_globalFilters.numbersonly = tmt_filterInfo("[^\\d]", "");
tmt_globalFilters.lettersonly = tmt_filterInfo("[^a-zA-Z]", "");
tmt_globalFilters.commastodots = tmt_filterInfo(",", ".");
tmt_globalFilters.dotstocommas = tmt_filterInfo("\\.", ",");
tmt_globalFilters.numberscommas = tmt_filterInfo("[^\\d,]", "");
tmt_globalFilters.numbersdots = tmt_filterInfo("[^\\d\\.]", "");

// Create an object that stores filters's info
function tmt_filterInfo(rex, replaceStr){
	var infoObj = new Object;
	infoObj.rex = new RegExp(rex, "g");
	infoObj.str = replaceStr;
	return infoObj;
}

// Clean up the field based on filter's info
function tmt_filterField(fieldNode){
	var filtersArray = fieldNode.getAttribute("tmt:filters").split(",");
	for(var i=0; i<filtersArray.length; i++){
		var filtObj = tmt_globalFilters[filtersArray[i]];
		// Be sure we have the filter's data, then clean up
		if(filtObj){
			fieldNode.value = fieldNode.value.replace(filtObj.rex, filtObj.str)
		}
		// We handle demoroziner as a special case
		if(filtersArray[i] == "demoronizer"){
			fieldNode.value = tmt_filterDemoronizer(fieldNode.value);
		}
	}
}

// Replace MS Word's non-ISO characters with plausible substitutes
function tmt_filterDemoronizer(str){
	str = str.replace(new RegExp(String.fromCharCode(710), "g"), "^");
	str = str.replace(new RegExp(String.fromCharCode(732), "g"), "~");
	// Evil "smarty" quotes
	str = str.replace(new RegExp(String.fromCharCode(8216), "g"), "'");
	str = str.replace(new RegExp(String.fromCharCode(8217), "g"), "'");
	str = str.replace(new RegExp(String.fromCharCode(8220), "g"), '"');
	str = str.replace(new RegExp(String.fromCharCode(8221), "g"), '"');
	// More MS Word's garbage
	str = str.replace(new RegExp(String.fromCharCode(8211), "g"), "-");
	str = str.replace(new RegExp(String.fromCharCode(8212), "g"), "--");
	str = str.replace(new RegExp(String.fromCharCode(8218), "g"), ",");
	str = str.replace(new RegExp(String.fromCharCode(8222), "g"), ",,");
	str = str.replace(new RegExp(String.fromCharCode(8226), "g"), "*");
	str = str.replace(new RegExp(String.fromCharCode(8230), "g"), "...");
	str = str.replace(new RegExp(String.fromCharCode(8364), "g"), "");
	return str;
}

/* Helper functions */

// Get an array of submit button nodes contained inside a given node
function tmt_getSubmitNodes(startNode){
	var submitArray = new Array();
	var inputNodes = startNode.getElementsByTagName("input");
	// Get an array of submit nodes
	for(var i=0; i<inputNodes.length; i++){
		if(inputNodes[i].getAttribute("type").toLowerCase() == "submit"){
			submitArray[submitArray.length] = inputNodes[i];
		}
	}
	return submitArray;
}

// Get an array of input and textarea nodes contained inside a given node
function tmt_getTextfieldNodes(startNode){
	var inputsArray = new Array();
	var inputNodes = startNode.getElementsByTagName("input");
	var areaNodes = startNode.getElementsByTagName("textarea");
	// Get an array of text, password and file nodes
	for(var i=0; i<inputNodes.length; i++){
		if(!inputNodes[i].getAttribute("type")){
			inputNodes[i].setAttribute("type", "text");
		}
		var fieldType = inputNodes[i].getAttribute("type").toLowerCase();
		if((fieldType == "text") || (fieldType == "password") || (fieldType == "file") || (fieldType == "hidden")){
			inputsArray[inputsArray.length] = inputNodes[i];
		}
	}
	// Append textarea nodes too
	for(var j=0; j<areaNodes.length; j++){
	    inputsArray[inputsArray.length] = areaNodes[j];
	}
	return inputsArray;
}

// Return an object (sort of an hashtable) containing checkboxes/radios data
// The returned object has two properties:
// name: the group name
// boxes: an array containing the DOM node of each checkbox/radio that share the same name
function tmt_getNodesTable(formNode, type){
	// This object will store data fields, just as an hash table
	var boxHolder = new Object;
	var boxNodes = formNode.getElementsByTagName("input");
	for(var i=0; i<boxNodes.length; i++){
		if(boxNodes[i].getAttribute("type") && (boxNodes[i].getAttribute("type").toLowerCase() == type)){
			// Store the reference to make it easier to read the code
			var boxName = boxNodes[i].name;
			if(boxHolder[boxName]){
				// We already have an entry with the same name
				// Append the DOM node to the relevant entry inside the object
				boxHolder[boxName].elements[boxHolder[boxName].elements.length] = boxNodes[i];
			}
			else{
				// Create a brand new entry inside the object
				boxHolder[boxName] = new Object;
				boxHolder[boxName].name = boxName;
				// Initialize the array that will store all the DOM nodes that share the same name
				boxHolder[boxName].elements = new Array;
				boxHolder[boxName].elements[0] = boxNodes[i];
			}
		}
	}
	return boxHolder;
}

// The function below was developed by John Resig
// For additional info see:
// http://ejohn.org/projects/flexible-javascript-events
// http://www.quirksmode.org/blog/archives/2005/10/_and_the_winner_1.html

function addEvent(obj, type, fn){
	if(obj.addEventListener){
		obj.addEventListener(type, fn, false);
	}
	else if(obj.attachEvent){
		obj["e" + type + fn] = fn;
		obj[type + fn] = function(){
				obj["e" + type + fn](window.event);
			}
		obj.attachEvent("on" +type, obj[type+fn]);
	}
}

addEvent(window, "load", tmt_validatorInit);

function displayError(formNode, validators){
	// Create a <div> that will act as an error display
	var displayNode = document.createElement("div");
	// Create an id that will identify the errors who belongs to this specific form and assign it to the <div>
	var errorId = formNode.id + "displayError";
	displayNode.setAttribute("id", errorId);
	var listNode = document.createElement("ul");
	// Append an entry to the <ul> for each error
	for(var i=0;i<validators.length;i++){
	var listentryNode = document.createElement("li");
		var emNode = document.createElement("em");
		emNode.appendChild(document.createTextNode(validators[i].name));
		listentryNode.appendChild(emNode);
		listentryNode.appendChild(document.createTextNode(": " + validators[i].message));
		listNode.appendChild(listentryNode);
	}
	displayNode.appendChild(listNode);
	var oldDisplay = document.getElementById(errorId);
	// If an error display is already there, we replace it, if not, we create one from scratch 
	if(oldDisplay){
		formNode.parentNode.replaceChild(displayNode, oldDisplay); 
	}
	else{
		formNode.parentNode.insertBefore(displayNode, formNode);
	}
}

/*Ballon Validator*/
function displayError(formNode, validators){
   BaloonValidator.closeAll();

   for(var elm, i = 0; elm = validators[i]; i++) {
      var node = formNode[elm.name];
      if(node[0]) node = node[0];
      BaloonValidator.open(node, elm.message);
   }
}

var BaloonValidator = {
   index: 0,
   lists: new Array,

   closeAll: function() {
      for(var field, i = 0; obj = this.lists[i]; i++)
         obj.close();
   },

   open: function(field, msg) {
      if(!field._validbaloon) {
         var obj = new this.element(field);
         obj.create();
         field._validbaloon = obj;
         this.lists.push(obj);
      }

      field._validbaloon.show(msg);
   },

   element: function() {
      this.initialize.apply(this, arguments);
   }
};

BaloonValidator.element.prototype = {
   initialize: function(field) {
      this.parent = BaloonValidator;
      this.field = field;
   },

   create: function() {
      var field  = this.field;

      var box = document.createElement('div');
      box.className = 'baloon';

      var offset = this.parent.Position.offset(field);
      var top  = offset.y - 30;
      var left = offset.x - 40 + field.offsetWidth;
      box.style.top  = top +'px';
      box.style.left = left+'px';

      var self = this;
      addEvent(box, 'click', function() { self.toTop(); });

      var link = document.createElement('a');
      link.appendChild(document.createTextNode('X'));
      link.setAttribute('href', 'javascript:void(0);');
      addEvent(link, 'click', function() { self.close(); });

      var msg = document.createElement('span');
      var div = document.createElement('div');
      div.appendChild(link);
      div.appendChild(msg);
      box.appendChild(div);
      document.body.appendChild(box);

      this.box = box;
      this.msg = msg;
   },

   show: function(msg) {
      this.msg.innerHTML  = msg;

      this.box.style.display = '';
      this.toTop();
   },

   close: function() {
      this.box.style.display = 'none';
   },

   toTop: function() {
      this.box.style.zIndex = ++ this.parent.index;
   }
};

BaloonValidator.Position = {
   offset: function(elm) {
      var pos = {};
      pos.x = this.getOffset('Left', elm);
      pos.y = this.getOffset('Top', elm);
      return pos;
   },

   getOffset: function(prop, el) {
      if(!el.offsetParent || el.offsetParent.tagName.toLowerCase() == "body")
         return el['offset'+prop];
      else
         return el['offset'+prop]+ this.getOffset(prop, el.offsetParent);
   }
};

addEvent(window, 'load', function() {
   // preload image
   var obj = new BaloonValidator.element(document.body);
   obj.create();
   document.body.removeChild(obj.box);
});

<!--送料計算表示用
function priceculc(form)
{
        price = document.getElementById("form_price").pref.options[document.getElementById("form_price").pref.selectedIndex].value;
         val = Number(price)+0;
        document.getElementById("form_price").price.value = val;
        return true;
}
//--->


<!-- カートCGI用JS Zen-Cart導入時に削除すること
function CartOpen(subURL){
	subURL="/jp/shoppingcart/list-up.cgi?MODE=0&DEF=cartadd&FILE=cartadd&CLASS="+subURL;
	subWin = window.open(subURL,"カートに入れる",'status=yes,scrollbars=yes,width=440,height=600');
	}
//-->

<!-- カートCGI用JS Zen-Cart導入時に削除すること
function CartLook(subURL){
	subURL="/jp/shoppingcart/"+subURL;
	subWin = window.open(subURL,"カートを見る",'status=yes,scrollbars=yes,width=440,height=600');
	}
//-->
