
ie=document.all?1:0
n=document.layers?1:0

var numberOfMenus=4
//The width on the menus (set the width in the stylesheet as well)
var mwidth=185
//Pixels between the menus
var pxBetween=30
//The first menus left position
var fromLeft=100
//The top position of the menus
var fromTop=100
//The bgColor of the bottom mouseover div
var bgColor=''
//The bgColor to change to
var bgColorChangeTo=''
//The position the mouseover line div will stop at when going up!
var imageHeight=23
//#AFAA96
var pos=1
var suma=0

tab=new Array(4);
tab[0]=false
tab[1]=false
tab[2]=false
tab[3]=false

//----------------------------------------------------------------------------------------------
function makeNewsMenu(obj,nest){
	//nest=(!nest) ? '':'document.'+nest+'.'
	nest=(!nest) ? '':'document.getElementById('+nest+').'
	//this.css=(n) ? eval(nest+'document.'+obj):eval('document.all.'+obj+'.style')
	this.style=document.getElementById(obj).style;
	//this.scrollHeight=n?this.css.document.height:eval('document.all.'+obj+'.offsetHeight')
	this.scrollHeight=document.getElementById(obj).offsetHeight;
	
	this.moveIt=b_moveIt;
	this.slideUp=b_slideUp;
	this.slideDown=b_slideDown;
	this.clipTo=b_clipTo;
	this.obj = obj + "Object"; eval(this.obj + "=this")
}
//----------------------------------------------------------------------------------------------
function b_moveIt(x,y){
	this.x=x;
	this.y=y;
	this.style.left=this.x;
	this.style.top=this.y
}
//----------------------------------------------------------------------------------------------
function b_clipTo(t,r,b,l){
	if(n){
		this.style.clip.top=t;
		this.style.clip.right=r;
		this.style.clip.bottom=b;
		this.style.clip.left=l
	}
	else
		this.style.clip="rect("+t+"px,"+r+"px,"+b+"px,"+l+"px)";
}
//----------------------------------------------------------------------------------------------
function b_slideUp(num,ystop,moveby,speed,fn,wh){
	pos=0;
	if(!this.slideactive){
		if(this.y>ystop){
			this.moveIt(this.x,this.y-5);
			eval(wh)
			setTimeout(this.obj+".slideUp("+num+","+ystop+","+moveby+","+speed+",'"+fn+"','"+wh+"')",speed)
		}
		else{
			this.slideactive=false;
			this.moveIt(0,ystop);
			eval(fn);
			//alert('zamknieto');
			pos=1;
		}
	}
	//tab[num]=false;
}
//----------------------------------------------------------------------------------------------
function b_slideDown(num,ystop,moveby,speed,fn,wh){
	//alert(num);
	pos=0;
	if(!this.slideactive){
		if(this.y<ystop){
			this.moveIt(this.x,this.y+5);
			eval(wh)
			setTimeout(this.obj+".slideDown("+num+","+ystop+","+moveby+","+speed+",'"+fn+"','"+wh+"')",speed)
		}
		else{
			this.slideactive=false;
			this.moveIt(0,ystop);
			eval(fn);
			pos=1;
			//alert('otwarto');
			
		}
	}
	tab[num]=true;
}
//----------------------------------------------------------------------------------------------
function newsMenuInit(){
	oTopMenu=new Array()
	for(i=0;i<=numberOfMenus;i++){
		oTopMenu[i]=new Array()
		oTopMenu[i][0]=new makeNewsMenu('divTopMenu'+i)
		oTopMenu[i][1]=new makeNewsMenu('divTopMenuBottom'+i,'divTopMenu'+i)
		oTopMenu[i][2]=new makeNewsMenu('divTopMenuText'+i,'divTopMenu'+i)
		oTopMenu[i][1].moveIt(0,imageHeight)
		oTopMenu[i][0].clipTo(0,mwidth,imageHeight+3,0)
		oTopMenu[i][0].moveIt(i*mwidth+fromLeft+(i*pxBetween)+'px',fromTop+'px')
		oTopMenu[i][0].style.visibility="visible"
	}
}
//----------------------------------------------------------------------------------------------
function topMenu(num){
	
		
		
		if(pos>0){
			//
			if(tab[num]==false){	
				//tab[num]=true;
				
				if(oTopMenu[num][1].y==imageHeight)
					oTopMenu[num][1].slideDown(num,oTopMenu[num][2].scrollHeight+20,10,0,'oTopMenu['+num+'][0].clipTo(0,mwidth,oTopMenu['+num+'][1].y+3,0)',
					'oTopMenu['+num+'][0].clipTo(0,mwidth,oTopMenu['+num+'][1].y+3,0)')
				else if(oTopMenu[num][1].y==oTopMenu[num][2].scrollHeight+20)
					oTopMenu[num][1].slideUp(num,imageHeight,10,0,'oTopMenu['+num+'][0].clipTo(0,mwidth,oTopMenu['+num+'][1].y+3,0)',
				'oTopMenu['+num+'][0].clipTo(0,mwidth,oTopMenu['+num+'][1].y+3,0)')
				
				for(var k=0;k<4;++k){
					
					if(tab[k]==true && k!=num) {//&& k!=num
						tab[k]=false;
						if(oTopMenu[k][1].y==imageHeight)
							oTopMenu[k][1].slideDown(k,oTopMenu[k][2].scrollHeight+20,10,0,'oTopMenu['+k+'][0].clipTo(0,mwidth,oTopMenu['+k+'][1].y+3,0)',
							'oTopMenu['+k+'][0].clipTo(0,mwidth,oTopMenu['+k+'][1].y+3,0)')
						else if(oTopMenu[k][1].y==oTopMenu[k][2].scrollHeight+20)
							oTopMenu[k][1].slideUp(k,imageHeight,10,0,'oTopMenu['+k+'][0].clipTo(0,mwidth,oTopMenu['+k+'][1].y+3,0)',
							'oTopMenu['+k+'][0].clipTo(0,mwidth,oTopMenu['+k+'][1].y+3,0)')
						
					}
				}
			
			
			
			}
			else{
				//alert(num);
				for(var k=0;k<4;++k){
					if(k!=num){
						if(tab[k]==true) {//&& k!=num
							tab[k]=false;
							if(oTopMenu[k][1].y==imageHeight)
								oTopMenu[k][1].slideDown(k,oTopMenu[k][2].scrollHeight+20,10,0,'oTopMenu['+k+'][0].clipTo(0,mwidth,oTopMenu['+k+'][1].y+3,0)',
							'oTopMenu['+k+'][0].clipTo(0,mwidth,oTopMenu['+k+'][1].y+3,0)')
							else if(oTopMenu[k][1].y==oTopMenu[k][2].scrollHeight+20)
								oTopMenu[k][1].slideUp(k,imageHeight,10,0,'oTopMenu['+k+'][0].clipTo(0,mwidth,oTopMenu['+k+'][1].y+3,0)',
							'oTopMenu['+k+'][0].clipTo(0,mwidth,oTopMenu['+k+'][1].y+3,0)')
						
						}
					}
				}
				
				
			
			}
		}
				
		//setTimeout(hide,10000);
	
}
//----------------------------------------------------------------------------------------------
function hide(){
	for(var p=0;p<4;++p){
		if(tab[p]==true){
			tab[p]=false;
				if(oTopMenu[p][1].y==imageHeight)
					oTopMenu[p][1].slideDown(p,oTopMenu[p][2].scrollHeight+20,10,0,'oTopMenu['+p+'][0].clipTo(0,mwidth,oTopMenu['+p+'][1].y+3,0)',
					'oTopMenu['+p+'][0].clipTo(0,mwidth,oTopMenu['+p+'][1].y+3,0)')
				else if(oTopMenu[p][1].y==oTopMenu[p][2].scrollHeight+20)
					oTopMenu[p][1].slideUp(p,imageHeight,10,0,'oTopMenu['+p+'][0].clipTo(0,mwidth,oTopMenu['+p+'][1].y+3,0)',
					'oTopMenu['+p+'][0].clipTo(0,mwidth,oTopMenu['+p+'][1].y+3,0)')
		}
			
	}
}


//----------------------------------------------------------------------------------------------
onload=newsMenuInit;
//----------------------------------------------------------------------------------------------
function background_point(num){
	if(num==2 || num==4 || num==6){
		document.getElementById(num).src='../img/point_act_.gif'
	}
	else{
		document.getElementById(num).src='../img/point_.gif'
	}
}
//----------------------------------------------------------------------------------------------
function background_point_back(num){
	if(num==2 || num==4 || num==6){
		document.getElementById(num).src='../img/point_act.gif'
	}
	else{
		document.getElementById(num).src='../img/point.gif'
	}
}
//----------------------------------------------------------------------------------------------
function background_point1(num){
	if(num==2){
		document.getElementById(num).src='../../img/point_act_.gif'
	}
	else{
		document.getElementById(num).src='../../img/point_.gif'
	}
}
//----------------------------------------------------------------------------------------------
function background_point_back1(num){
	if(num==2){
		document.getElementById(num).src='../../img/point_act.gif'
	}
	else{
		document.getElementById(num).src='../../img/point.gif'
	}
}
//----------------------------------------------------------------------------------------------
function loader(){
	setTimeout(schow,15000);
}
//----------------------------------------------------------------------------------------------
function schow(){
	location.replace('http://www.mariage.net.pl/imprezy/index.html')
}
//----------------------------------------------------------------------------------------------
function bgcolor(num){
	document.getElementById("imie").style.backgroundColor = "#FFFFFF";
	document.getElementById("nazwisko").style.backgroundColor = "#FFFFFF";
	document.getElementById("firma").style.backgroundColor = "#FFFFFF";
	document.getElementById("telefon").style.backgroundColor = "#FFFFFF";
	document.getElementById("fax").style.backgroundColor = "#FFFFFF";
	document.getElementById("email").style.backgroundColor = "#FFFFFF";
	document.getElementById("impreza_od").style.backgroundColor = "#FFFFFF";
	document.getElementById("impreza_do").style.backgroundColor = "#FFFFFF";
	document.getElementById("ile").style.backgroundColor = "#FFFFFF";
	document.getElementById("dodatkowe").style.backgroundColor = "#FFFFFF";

	document.getElementById(num).style.backgroundColor = "#FFFFCC";
}
//----------------------------------------------------------------------------------------------
function iepath() {
	if(navigator.appName=="Microsoft Internet Explorer") {
		return true;
	} else {
		return false;
	}
}
//----------------------------------------------------------------------------------------------
var speed=2;
var scrollSpeed=2;
var isScrolling=true;
function mouseOver(direction) {
		isScrolling=true;
		startScroll(direction);
}
function startScroll(direction) {
				
	if(direction=='up') {
		window.centerframe.scrollBy(0, -scrollSpeed);
	}
	else if (direction=='down'){
		window.centerframe.scrollBy(0, +scrollSpeed);
	}
	if(document.layer) {
		document.all['scrollLayer'].style.left=0;
		document.all['scrollLayer'].style.top=document.body.scrollTop;
	}
	if(isScrolling) {
		setTimeout("startScroll('" + direction + "')", speed);
	}
}
function stopScroll() {
	isScrolling = false;
}

//-----------------------------------------------------------------------------------------------
function bgcolor2(num){
	document.getElementById("imie").style.backgroundColor = "#FFFFFF";
	document.getElementById("nazwisko").style.backgroundColor = "#FFFFFF";
	document.getElementById("telefon").style.backgroundColor = "#FFFFFF";
	document.getElementById("email").style.backgroundColor = "#FFFFFF";
	document.getElementById("data").style.backgroundColor = "#FFFFFF";
	document.getElementById("ile").style.backgroundColor = "#FFFFFF";
	document.getElementById("dodatkowe").style.backgroundColor = "#FFFFFF";

	document.getElementById(num).style.backgroundColor = "#FFFFCC";
}
//-----------------------------------------------------------------------------------------------
function bgcolor3(num){
	document.getElementById("1os").style.backgroundColor = "#FFFFFF";
	document.getElementById("2os").style.backgroundColor = "#FFFFFF";
	document.getElementById("3os").style.backgroundColor = "#FFFFFF";
	document.getElementById("4os").style.backgroundColor = "#FFFFFF";
	document.getElementById("5os").style.backgroundColor = "#FFFFFF";
	document.getElementById("imie").style.backgroundColor = "#FFFFFF";
	document.getElementById("nazwisko").style.backgroundColor = "#FFFFFF";
	document.getElementById("telefon").style.backgroundColor = "#FFFFFF";
	document.getElementById("email").style.backgroundColor = "#FFFFFF";
	document.getElementById("fax").style.backgroundColor = "#FFFFFF";
	document.getElementById("od").style.backgroundColor = "#FFFFFF";
	document.getElementById("do").style.backgroundColor = "#FFFFFF";
	document.getElementById("dodatkowe").style.backgroundColor = "#FFFFFF";

	document.getElementById(num).style.backgroundColor = "#FFFFCC";
}