parser

Написать ответ на текущее сообщение

 

 
   команды управления поиском

даю код и ссылки

Altero 19.12.2005 15:58

прошу прощения. привожу все коды и ссылки.

Код из auto.p:
...

@main[] 
^header[]
^body[] 

@menu1[]
<!-- HEAD START HERE -->
<script language="JavaScript" type="text/javascript">
/**********************************************************************************   
SlideMenu 
*   Copyright (C) 2001 Thomas Brattli
*   This script was released at WOscripts.com
*   Visit for more great scripts!
*   This may be used and changed freely as long as this msg is intact!
*   We will also appreciate any links you could give us.
*********************************************************************************/

function lib_bwcheck(){ //Browsercheck (needed)
	this.ver=navigator.appVersion
	this.agent=navigator.userAgent
	this.dom=document.getElementById?1:0
	this.opera5=this.agent.indexOf("Opera 5")>-1
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0; 
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
	this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
	this.ie=this.ie4||this.ie5||this.ie6
	this.mac=this.agent.indexOf("Mac")>-1
	this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)
	return this
}
var bw=new lib_bwcheck()


//Opera didn't seem to like the padding in the layers, it messes up the background-images, so here's a version without it.
if(bw.opera5) document.write("<style>DIV.clSlide{padding:0px; background-image:url(' ')}\nDIV.clSlideSub{padding:0px; background-image:url(' ')}\nDIV.clSlideSub2{padding:0px; background-image:url(' ')}</style>")

/************************************************************************************
Making cross-browser objects
************************************************************************************/
function makeMenuObj(obj,nest){
	nest=(!nest) ? "":'document.'+nest+'.'										
   	this.css=bw.dom? document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+"document.layers." +obj):0;		
	this.el=bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0;	
	this.ref=bw.dom || bw.ie4? document:bw.ns4?eval(nest+"document.layers." +obj+".document"):0;		
	this.x=(bw.ns4 || bw.ns5)? this.css.left:this.css.offsetLeft;
	this.y=(bw.ns4 || bw.ns5)? this.css.top:this.css.offsetTop;		
	this.hideIt=b_hideIt; this.showIt=b_showIt; this.movey=b_movey
	this.moveIt=b_moveIt; this.moveBy=b_moveBy; this.status=0; 
	this.bgImg=b_bgImg;	this.obj = obj + "Object"; eval(this.obj + "=this"); 
	this.clipTo=b_clipTo;
	return this
}
function b_showIt(){this.css.visibility="visible"; this.status=1}
function b_hideIt(){this.css.visibility="hidden"; this.status=0}
function b_movey(y){this.y=y; this.css.top=this.y}	
function b_moveIt(x,y){this.x=x; this.y=y; this.css.left=this.x;this.css.top=this.y}
function b_moveBy(x,y){this.x=this.x+x; this.y=this.y+y; this.css.left=this.x;this.css.top=this.y}
function b_bgImg(img){if(bw.ie||bw.dom)this.css.backgroundImage="url('"+img+"')"
else this.css.background.src=img
}
function b_clipTo(t,r,b,l,w){if(bw.ns4){this.css.clip.top=t;this.css.clip.right=r
this.css.clip.bottom=b;this.css.clip.left=l
}else{this.css.clip="rect("+t+","+r+","+b+","+l+")"; if(w){this.css.width=r; this.css.height=b}}}
/********************************************************************************
Initiating page, making objects..
********************************************************************************/
function SlideMenuInit(){
	oSlideMenu=new makeMenuObj('divSlideCont')
	oSlideMenu.moveIt(menux,menuy)
	oSlide=new Array()
	for(i=0;i<menus.length;i++){
		oSlide[i]=new makeMenuObj('divSlide'+i,'divSlideCont')
		oSlide[i].subs=menus[i].subs
		oSlide[i].sub=new Array()
		oSlide[i].moveIt(0,mainheight*i)
		oSlide[i].starty=oSlide[i].y
    if(bw.opera) oSlide[i].css.paddingLeft="10px"
		if(!menus[i].seperator) oSlide[i].bgImg(level0_regular)
		for(j=0;j<oSlide[i].subs;j++){
			oSlide[i].sub[j]=new makeMenuObj('divSlideSub'+i+"_"+j,'divSlideCont')
			oSlide[i].sub[j].moveIt(10,oSlide[i].y+subheight*j+between)
			oSlide[i].sub[j].starty=oSlide[i].sub[j].y
			oSlide[i][j]=new Array()
			oSlide[i][j].subs=menus[i][j].subs
			oSlide[i][j].sub=new Array()
			img=level1_round
			if(oSlide[i][j].subs!=0){
				if(j!=oSlide[i].subs-1) img=level1_sub
				else img=level1_sub_round
				oSlide[i].sub[j].css.color="white"
			}else{
				if(j!=oSlide[i].subs-1)img=level1_regular
			}
			oSlide[i].sub[j].origimg=img
			oSlide[i].sub[j].bgImg(img)
			for(a=0;a<oSlide[i][j].subs;a++){
				oSlide[i][j].sub[a]=new makeMenuObj('divSlideSub'+i+"_"+j+"_"+a,'divSlideCont')
				oSlide[i][j].sub[a].moveIt(20,oSlide[i].sub[j].y+subheight*a+between-2)
				oSlide[i][j].sub[a].starty=oSlide[i][j].sub[a].y			
				oSlide[i][j][a]=new Array()
				oSlide[i][j][a].subs=menus[i][j][a].subs
				oSlide[i][j][a].sub=new Array()
				if(a!=oSlide[i][j].subs-1) img=level2_regular
				else img=level2_round
				oSlide[i][j].sub[a].origimg=img
				oSlide[i][j].sub[a].bgImg(img)
			}
		}
	}
	oSlideMenu.showIt()
}
/********************************************************************************
Variables
********************************************************************************/
var active=-1;var going;var isthere; var sactive=-1; var sisthere=-1; var s2active=-1; var s2isthere=-1
/********************************************************************************
Switch menu function.
********************************************************************************/
function swmenu(num,snum,s2num){
	if(snum!=-1){
		if(oSlide[num][snum].subs==0) return
	}
	if(s2num!=-1){
		if(oSlide[num][snum][s2num].subs==0) return
	}
	if((num!=active || snum!=sactive || s2num!=s2active) && !going){going=true;isthere=0;sisthere=0;moveUp(num,snum,s2num)}
}
/********************************************************************************
Moving the menus upward to their original position.
********************************************************************************/
function moveUp(num,snum){
	if(snum==-1){
		for(i=0;i<oSlide.length;i++){
			if(oSlide[i].y>oSlide[i].starty+pxspeed && active!=i) oSlide[i].moveBy(0,-pxspeed)
			else{if(active!=i) oSlide[i].moveIt(oSlide[i].x,oSlide[i].starty); isthere=i}
		}
		
		if(isthere<oSlide.length-1) setTimeout("moveUp("+num+","+snum+")",timspeed)
		else swmenu2(num,snum)
	}else{
		if(num==oSlide.length-1) isthere=num
	
		if(sactive!=-1){ //Is out!
			//Slide subs
			j=0
			for(i=sactive+1;i<oSlide[num].sub.length;i++){
				j++
				if(oSlide[num].sub[i].y>oSlide[num].sub[i].starty+pxspeed) oSlide[num].sub[i].moveBy(0,-pxspeed)
				else{oSlide[num].sub[i].moveIt(oSlide[num].sub[i].x,oSlide[num].sub[i].starty); sisthere=i}
			}
			//Slide main
			for(i=num+1;i<oSlide.length;i++){
				if(oSlide[i].y>oSlide[i].starty + oSlide[num].sub[sactive].y +subheight*j )  oSlide[i].moveBy(0,-pxspeed)
				else{oSlide[i].moveIt(oSlide[i].x,oSlide[i].starty + oSlide[num].sub[sactive].y +subheight*j ); isthere=i}
			}
		}else{ //Slide to the one clicked
			for(i=num+1;i<oSlide.length;i++){
				if(oSlide[i].y>oSlide[i].starty + snum*between+between)  oSlide[i].moveBy(0,-pxspeed)
				else{oSlide[i].moveIt(oSlide[i].x,oSlide[i].starty + snum*between+between); isthere=i}
			}
		}
		if(isthere<oSlide.length-1 || (sactive!=-1 && sisthere<oSlide[num].sub.length-1 && sactive!=oSlide[num].sub.length-1)) setTimeout("moveUp("+num+","+snum+")",timspeed)
		else swmenu2(num,snum)
	}
}
/********************************************************************************
Switch menu 2, stuff that happens before the menus are moved down again.
********************************************************************************/
function swmenu2(num,snum){
	isthere=0;
	sisthere=0;
	if(active>-1 && snum==-1){
		//Hiding submenus
		for(j=0;j<oSlide[active].subs;j++){oSlide[active].sub[j].hideIt()}
		oSlide[active].bgImg(level0_regular)
		oSlide[active].moveIt(0,oSlide[active].starty)
	}
	if(sactive>-1){
		//Hiding submenus
		for(j=0;j<oSlide[active][sactive].sub.length;j++){oSlide[active][sactive].sub[j].hideIt()}
		oSlide[active].sub[sactive].bgImg(oSlide[active].sub[sactive].origimg)
		oSlide[active].sub[sactive].moveIt(10,oSlide[active].sub[sactive].starty)
		//Move back to place
		for(i=sactive+1;i<oSlide[active].sub.length;i++){
			oSlide[active].sub[i].moveIt(oSlide[active].sub[i].x,oSlide[active].sub[i].starty)
		}
	}
	active=num
	//Showing submenus
	if(snum>-1){
		sactive=snum
		for(j=0;j<oSlide[num][snum].sub.length;j++){oSlide[num][snum].sub[j].showIt()}
		oSlide[num].sub[snum].moveBy(10,3)
		oSlide[num].sub[snum].bgImg(level1_round2)
	}else{
		sactive=-1
		for(j=0;j<oSlide[active].subs;j++){oSlide[active].sub[j].showIt()}
		oSlide[num].moveBy(10,3)
		oSlide[num].bgImg(level0_round)
	}
	if(num!=oSlide.length-1) moveDown(num,snum)
	else{
		isthere=num
		moveDown(num,snum)
	}
}
/********************************************************************************
Moving the menus down
********************************************************************************/
function moveDown(num,snum){
	//if(num==oSlide.length-1) isthere=num
	for(i=num+1;i<oSlide.length;i++){
		if(snum==-1){
			if(oSlide[i].y<(oSlide[num].subs-1)*subheight+oSlide[i].starty+between-pxspeed) oSlide[i].moveBy(0,pxspeed)
			else{oSlide[i].moveIt(oSlide[i].x,(oSlide[num].subs-1)*subheight+oSlide[i].starty+between); isthere=i}
		}else{
			if(oSlide[i].y<(oSlide[num].subs-1)*subheight+oSlide[i].starty+between-pxspeed + (oSlide[num][snum].subs-1)*subheight+between)  oSlide[i].moveBy(0,pxspeed)
			else{oSlide[i].moveIt(oSlide[i].x,(oSlide[num].subs-1)*subheight+oSlide[i].starty+between  + (oSlide[num][snum].subs-1)*subheight+between); isthere=i}
		}
	}
	if(snum!=-1){
		for(i=snum+1;i<oSlide[num].sub.length;i++){		
			if(oSlide[num].sub[i].y<(oSlide[num][snum].subs-1)*subheight+oSlide[num].sub[i].starty+between-pxspeed) oSlide[num].sub[i].moveBy(0,pxspeed)
			else{oSlide[num].sub[i].moveIt(oSlide[num].sub[i].x,(oSlide[num][snum].subs-1)*subheight+oSlide[num].sub[i].starty+between); sisthere=i}
		}
	}
	if(snum==-1){
		if(isthere<oSlide.length-1) setTimeout("moveDown("+num+","+snum+")",timspeed)
		else going=false
	}else{
		if(isthere<oSlide.length-1 || (sisthere<oSlide[num].sub.length-1 && snum!=oSlide[num].sub.length-1)) setTimeout("moveDown("+num+","+snum+")",timspeed)
		else going=false
	}
}
var test=0
/********************************************************************************
Functions to write out the layers...
********************************************************************************/
menus=new Array(); var a=0; var b=0; var c=0; var d=0
function makeMenu(type,text,lnk,target,end){
	str=""; tg="";
  if(target) tg='target="'+target+'"'
  if(!lnk) lnk="#"
  self.status=lnk
	if(a==0) str='<div id="divSlideCont">\n'
	if(type=="top"){
		menus[a]=new Array();
		if(text=="seperator"){
			str+='\t<div id="divSlide'+a+'" class="clSlide"></div>\n'
			menus[a].seperator=1
		}else{
      str+='\t<div id="divSlide'+a+'" class="clSlide"><a href="'+lnk+'" '+tg+' onclick="swmenu('+a+',-1,-1); if(bw.ie || bw.ns6) this.blur(); '
      if(lnk=="#") str+='return false'
      str+='" class="clSlideLinks"> '+text+'</a><br></div>\n'
		}
    menus[a].subs=0; a++; b=0
	}else if(type=="sub"){
		str+='\t\t<div id="divSlideSub'+(a-1)+'_'+(b)+'" class="clSlideSub"><a '+tg+' onclick="swmenu('+(a-1)+','+b+',-1); if(bw.ie || bw.ns6) this.blur(); '
    if(lnk=="#") str+='return false'
    str+='" href="'+lnk+'" class="clSlideSubLinks">  '+text+'</a><br></div>\n'
		b++; menus[a-1].subs=b; menus[a-1][b-1]=new Array(); c=0; menus[a-1][b-1].subs=0
	}else if(type=="sub2"){
		str+='\t\t<div id="divSlideSub'+(a-1)+'_'+(b-1)+'_'+c+'" class="clSlideSub2"><a '+tg+' href="'+lnk+'" class="clSlideSub2Links">  '+text+'</a><br></div>\n'
		c++; menus[a-1][b-1].subs=c; menus[a-1][b-1][c-1]=new Array(); d=0; menus[a-1][b-1][c-1].subs=0
	}
	if(end) str+="</div>"
	document.write(str)
}
function preLoadBackgrounds(){
  for(i=0;i<arguments.length;i++){
    this[i]=new Image()
    this[i].src=arguments[i]
  }
  return this
}
</script>
<!-- HEAD END HERE -->

@menu2[]
<!-- BODY START HERE -->
<script>
//Variables to set
between=59 //The pixel between the menus and the submenus
mainheight=65 //The height of the mainmenus
subheight=22 //The height of the submenus
pxspeed=13 //The pixel speed of the animation
timspeed=15 //The timer speed of the animation
menuy=243 //The top placement of the menu.
menux=14 //The left placement of the menu
//Images - Play with these
level0_regular="level0_regular3.gif"
level0_round="level0_regular3.gif"
level1_regular="level1_regular4.gif"
level1_round="level1_round4.gif"
level1_sub="level1_sub.gif"
level1_sub_round="level1_sub_round.gif"
level1_round2="level1_round2_4.gif"
level2_regular="level2_regular.gif"
level2_round="level2_round.gif"
//Leave this line
preLoadBackgrounds(level0_regular,level0_round,level1_regular,level1_round,level1_sub,level1_sub_round,level1_round2,level2_regular,level2_round)
//There are 3 different types of menus you can make
//top = Main menus
//sub = Sub menus
//sub2 = SubSub menus
//You control the look of the menus in the stylesheet
//makeMenu('TYPE','TEXT','LINK','TARGET', 'END (THE LAST MENU)')
//Menu 0 
makeMenu('top','&#207;&#240;&#224;&#231;&#228;&#237;&#232;&#247;&#237;&#251;&#229; &#242;&#243;&#240;&#251;','/celebratory_tours/index.htm')
//Menu 1
makeMenu('top','&#202;&#238;&#240;&#239;&#238;&#240;&#224;&#242;&#232;&#226;&#237;&#251;&#236; &#234;&#235;&#232;&#229;&#237;&#242;&#224;&#236;','/corporate_clients.htm')
//Menu 2    
makeMenu('top','&#209;&#239;&#229;&#246;&#239;&#240;&#229;&#228;&#235;&#238;&#230;&#229;&#237;&#232;&#255;','/special_offers.htm')
 //Menu 3
makeMenu('top','&#206;&#242;&#228;&#251;&#245; &#226; &#208;&#238;&#241;&#241;&#232;&#232;')
  makeMenu('sub','&#207;&#238;&#228;&#236;&#238;&#241;&#234;&#238;&#226;&#252;&#229;','/russiantours/undermoscow/index.htm')
  makeMenu('sub','&#209;&#224;&#237;&#224;&#242;&#238;&#240;&#232;&#232;','/russiantours/sanatoriums/index.htm')
  makeMenu('sub','&#208;&#229;&#247;&#237;&#251;&#229; &#234;&#240;&#243;&#232;&#231;&#251;','/russiantours/river_cruises.htm')
  makeMenu('sub','&#192;&#235;&#242;&#224;&#233;&#241;&#234;&#232;&#233; &#234;&#240;&#224;&#233;','/russiantours/altay/index.htm')
  makeMenu('sub','&#202;&#224;&#240;&#229;&#235;&#232;&#255;','/russiantours/karelia.htm')
  makeMenu('sub','&#202;&#240;&#251;&#236;','/russiantours/krim.htm')
  makeMenu('sub','&#209;&#238;&#247;&#232;-&#202;&#240;&#224;&#241;&#237;&#238;&#228;.&#234;&#240;&#224;&#233;','/russiantours/krasnodar/index.htm')
  makeMenu('sub','&#202;&#224;&#226;&#204;&#232;&#237;&#194;&#238;&#228;&#251;','/russiantours/kavminvodi/index.htm')
  makeMenu('sub','&#193;&#229;&#235;&#227;&#238;&#240;&#238;&#228;','/russiantours/belgorod.htm')
//Menu 4
makeMenu('top','&#221;&#234;&#241;&#234;&#243;&#240;&#241;&#232;&#238;&#237;&#237;&#251;&#229; &#242;&#243;&#240;&#251;')
  makeMenu('sub','&#199;&#238;&#235;&#238;&#242;&#238;&#229; &#234;&#238;&#235;&#252;&#246;&#238;','/excursion_tours/goldenring/index.htm')
  makeMenu('sub','&#206;&#228;&#237;&#238;&#228;&#237;&#229;&#226;.&#253;&#234;&#241;&#234;&#243;&#240;&#241;&#232;&#232;','/excursion_tours/oneday.htm')
  makeMenu('sub','&#208;&#229;&#247;&#237;&#251;&#229; &#234;&#240;&#243;&#232;&#231;&#251;','/excursion_tours/river_cruises.htm')
  makeMenu('sub','&#209;&#224;&#237;&#234;&#242;-&#207;&#229;&#242;&#229;&#240;&#225;&#243;&#240;&#227;','/excursion_tours/saint_petersburg/index.htm')
//Menu 5  
makeMenu('top','&#204;&#229;&#230;&#228;&#243;&#237;&#224;&#240;&#238;&#228;&#237;&#251;&#229; &#242;&#243;&#240;&#251;','/worldtours/index.htm')
//Menu 6
makeMenu('top','&#207;&#240;&#232;&#225;&#224;&#235;&#242;&#232;&#234;&#224;')
  makeMenu('sub','&#221;&#241;&#242;&#238;&#237;&#232;&#255;','/baltic/estonia/index.htm')
  makeMenu('sub','&#203;&#224;&#242;&#226;&#232;&#255;','/baltic/latvia/index.htm')
  makeMenu('sub','&#203;&#232;&#242;&#226;&#224;','/baltic/lithuania/index.htm')
//Menu 7
makeMenu('top','&#202;&#235;&#243;&#225;&#237;&#251;&#233; &#238;&#242;&#228;&#251;&#245;')
  makeMenu('sub','&#200;&#241;&#239;&#224;&#237;&#232;&#255;(&#236;&#224;&#242;&#229;&#240;&#232;&#234;)','/clubrest/spain/index.htm')
  makeMenu('sub','&#202;&#224;&#237;&#224;&#240;&#241;&#234;&#232;&#229; &#238;-&#226;&#224;','/clubrest/canary/index.htm')
  makeMenu('sub','&#210;&#224;&#233;&#235;&#224;&#237;&#228;','/clubrest/thailand/index.htm')
  makeMenu('sub','&#200;&#237;&#228;&#232;&#255;(&#195;&#206;&#192;)','/clubrest/india/index.htm')
  makeMenu('sub','&#195;&#240;&#229;&#246;&#232;&#255;(&#238;.&#202;&#240;&#232;&#242;)','/clubrest/greece/index.htm')
  makeMenu('sub','&#207;&#238;&#240;&#242;&#243;&#227;&#224;&#235;&#232;&#255;','/clubrest/portugal/index.htm')
//Menu 8  
makeMenu('top','&#199;&#224;&#227;&#240;&#224;&#237;&#239;&#224;&#241;&#239;&#238;&#240;&#242;&#224;')
  makeMenu('sub','&#214;&#229;&#237;&#251;','/passports/price.htm')
  makeMenu('sub','&#196;&#238;&#234;&#243;&#236;&#229;&#237;&#242;&#251;','/passports/documents.htm')
  makeMenu('sub','&#192;&#237;&#234;&#229;&#242;&#224;','passports/anketa.htm',"",1)
  makeMenu('END')
//Starting the menu
onload=SlideMenuInit;
</script>

<!-- BODY END HERE -->

@header[] 
<html>
<head>
<meta http-equiv="Content-Language" content="ru">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<title>&#210;&#243;&#240;&#232;&#241;&#242;&#232;&#247;&#229;&#241;&#234;&#224;&#255; &#234;&#238;&#236;&#239;&#224;&#237;&#232;&#255; "&#193;&#253;&#240;&#234;&#235;&#232;&#241;"</title>

<!-- HEAD START HERE -->
<style type="text/css"><!--
DIV.clSlide{position:absolute;  ;z-index:10; left:0; width:171; height:48; clip:rect(0,171,48,0); padding:3px;}
DIV.clSlideSub{position:absolute; ;z-index:10; padding:2px; clip:rect(0,151,20,0); width:151; height:20; left:12; visibility:hidden}
DIV.clSlideSub2{position:absolute; ;z-index:10; padding:2px; clip:rect(0,141,20,0); width:141; height:20; left:8; visibility:hidden}
#divSlideCont{position:absolute; z-index:10; left:0; top:100; height:600; width:170; visibility:hidden}
A.clSlideLinks{font-family:Arial; font-size:16px; font-weight:bold; text-decoration:none; color:#FEE600}
A.clSlideSubLinks{font-family:Arial; font-size:16px; text-decoration:none; color:#004000}
A.clSlideSub2Links{font-family:Arial; font-size:14px; text-decoration:none; color:#FEE600}  

A:link {color:#006600}
A:visited {color:#006600}

-->
</style>

^taint[as-is][^menu1[]]

</head>


@body[] 

...
    
^taint[as-is][^menu2[]
нужное нам меню, работающее

нужное нам меню, не работающее (под парсером, код выше)