var ruk_rstid=23726
var auto_dishlist=1
var dishlist_visibility = 1

var fcount = 0
function CloseLinkWindow()
{
	NewWindow.close();
}
function AddDish(cposx)
{
	cposx = cposx + 0.001
	cposy = 1 - 0.001
	if(fcount==0)
	{
	NewWindow=window.open('http://www.restaurantuk.com/web_wishlist.asp?action=ADDDISH&toppos=' + cposx + '&rightpos=' + cposy + '&skin=' + 2 + '&ID=' + ruk_rstid + '&temp=' + fcount,'newWin','location=no,status=no,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=30,top=190,width=80 0,height=80');
	NewWindow.focus();
	}
//	document.frames['iframe4'].location.href = 'http://www.restaurantuk.com/web_wishlist.asp?action=ADDDISH&toppos=' + cposx + '&rightpos=' + cposy + '&skin=' + 2 + '&ID=' + ruk_rstid + '&temp=' + fcount;
	top.frames['iframe4'].location.replace('http://www.restaurantuk.com/web_wishlist.asp?action=ADDDISH&toppos=' + cposx + '&rightpos=' + cposy + '&skin=' + 2 + '&ID=' + ruk_rstid + '&temp=' + fcount);
	fcount = fcount+1
	setTimeout("CloseLinkWindow()",1000)

	if(!dishlist_visibility && auto_dishlist)
		{
		on_dishlist();
		}
}
function ConnectWindow()
{
//	NewWindow=window.open('http://www.restaurantuk.com/web_wishlist.asp?RstID=50319','newWin','width=0,height=0,left=-20,top=20');  NewWindow.focus(); void(0);  
}

function toggle_dishlist()
{
	if(dishlist_visibility==1)
		{
		document.getElementById('PopUpDiv').style.visibility='hidden';
//		dishlist_visibility = 0
		}
	else
		{
		document.getElementById('PopUpDiv').style.visibility='visible';
//		dishlist_visibility = 1
		}
	dishlist_visibility=Math.abs(dishlist_visibility-1)
}

function off_dishlist()
{
	document.getElementById('PopUpDiv').style.visibility='hidden';
	dishlist_visibility=0
}

function on_dishlist()
{
	document.getElementById('PopUpDiv').style.visibility='visible';
	document.getElementById('minPopUpDiv').style.visibility='hidden';
	dishlist_visibility=1
}

function min_dishlist()
{
	document.getElementById('PopUpDiv').style.visibility='hidden';
	document.getElementById('minPopUpDiv').style.visibility='visible';
	dishlist_visibility=0
}

function rst_dishlist()
{
	document.getElementById('PopUpDiv').style.visibility='visible';
	document.getElementById('minPopUpDiv').style.visibility='hidden';
	dishlist_visibility=1
}

function changeCellBG(el, myColor) {
	el.style.background=myColor;
}

var ns = (navigator.appName.indexOf("Netscape") != -1);
var d = document;
var pX, pY;
//var el;
//var px;
var firstTime = 0;
var glob_sy;
var menu_height = 980;
var dishes_height = 500;

function FloatDiv(id, sx, sx_off, sy)
{
glob_sy=sy;

//	if(document.getElementById(id).style.visibility == 'visible')
//		{
//		alert(document.getElementById(id).style.visibility)
//		}

	if(sx_off == 0)
		{
//		sx = 0 - document.documentElement.clientWidth;
		sx = 0;
		}
	else
		{
		sx=0 - document.documentElement.clientWidth/2 - sx_off;
		}

//	alert(document.getElementById(id).height)
//	alert(document.getElementById(id).style.height)

	var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
	var px = document.layers ? "" : "px";
	window[id + "_obj"] = el;
	if(d.layers)el.style=el;
	el.cx = el.sx = sx;el.cy = el.sy = sy;
	el.sP=function(x,y){this.style.left=x+px;this.style.top=y+px;};

	el.floatIt=function()
	{
//	alert( 'Width = ' + document.documentElement.clientWidth );
//sx=0 - document.documentElement.clientWidth/2 - 315;
//this.sx=0 - document.documentElement.clientWidth/2 - 315;
//	alert( 'this.cx = ' + this.cx );
//	alert( 'this.sx = ' + this.sx );
//	this.cx = -700
//	this.cx = 100;
	if(sx_off == 0)
		{
		this.cx=0;
		}
	else
		{
		this.cx=document.documentElement.clientWidth/2 - sx_off;
		}
//	this.cx=document.documentElement.clientWidth/2 - sx_off;
//	alert( 'new Width = ' + this.cx );
		pX = (this.sx >= 0) ? 0 : ns ? innerWidth : 
		document.documentElement && document.documentElement.clientWidth ? 
		document.documentElement.clientWidth : document.body.clientWidth;
		pY = ns ? pageYOffset : document.documentElement && document.documentElement.scrollTop ? 
		document.documentElement.scrollTop : document.body.scrollTop;
		if(this.sy<0) 

//		pY += ns ? innerHeight : document.documentElement && document.documentElement.clientHeight ? 
//		document.documentElement.clientHeight : document.body.clientHeight;
		this.cx += (pX + this.sx - this.cx)/8;
//		this.cy += (pY + this.sy - this.cy)/8;
		this.cy += (pY - this.cy)/8;
			

		if(this.cy < sy)
			{
//			alert('glob_sy: ' + glob_sy)
			this.cy=sy;
			}
//		if(this.cy > menu_height + glob_sy - dishes_height) this.cy=glob_sy + menu_height - dishes_height;
		if(this.cy > menu_height + sy - document.getElementById(id).style.height) this.cy=sy + menu_height - document.getElementById(id).style.height;

		if(firstTime ==0)
			{
			firstTime = 1;
			this.cx = this.sx + pX;
			this.cy = this.sy + pY;
			this.sP(this.cx, this.cy);
			this.style.visibility = "visible";
			}
		else
			{
			if(this.style.visibility == "visible")
			{
//			if(document.documentElement.scrollTop > glob_sy)
//				{
				this.sP(this.cx, this.cy);

//				}
//			else
//				{
//				this.cy=500;
//				this.sP(this.cx, this.cy);
//				}
//
			}
			}
		scrolltime=setTimeout(this.id + "_obj.floatIt()", 0);
	}
	return el;
}


function FloatDivNew(id, sx, sy)
{
	var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
	var px = document.layers ? "" : "px";
	window[id + "_obj"] = el;
	if(d.layers)el.style=el;
	el.cx = el.sx = sx;el.cy = el.sy = sy;
	el.sP=function(x,y){this.style.left=x+px;this.style.top=y+px;};

	el.floatIt=function()
	{
//		if(document.documentElement.scrollTop > 500 || firstTime == 0)
//		{
		pX = (this.sx >= 0) ? 0 : ns ? innerWidth : 
		document.documentElement && document.documentElement.clientWidth ? 
		document.documentElement.clientWidth : document.body.clientWidth;
		pY = ns ? pageYOffset : document.documentElement && document.documentElement.scrollTop ? 
		document.documentElement.scrollTop : document.body.scrollTop;
		if(this.sy<0) 
		pY += ns ? innerHeight : document.documentElement && document.documentElement.clientHeight ? 
		document.documentElement.clientHeight : document.body.clientHeight;
		if(firstTime ==0)
			{
			firstTime = 1;
			this.cx = this.sx + pX;
			this.cy = this.sy + pY;
			}
		else
			{
			this.cx += (pX + this.sx - this.cx)/8;this.cy += (pY + this.sy - this.cy)/8;
//			alert(this.cy)
//			this.cy = this.cy - document.documentElement.scrollTop;
			if(document.documentElement.scrollTop > 500)
				{
				this.cy = this.sy + pY;
//				this.cy=document.documentElement.scrollTop
				}
			else
				{
				this.cy=500;
				}

			}

		this.sP(this.cx, this.cy);
//		}
		scrolltime=setTimeout(this.id + "_obj.floatIt()", 0);
	}
	return el;
}

function posDiv(id,sx,sy)
{
//	alert('Hello')
	var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
	var px = document.layers ? "" : "px";
	window[id + "_obj"] = el;
	if(d.layers)el.style=el;
	el.cx = el.sx = sx;el.cy = el.sy = sy;
	el.sP2=function(x,y){this.style.left=x+px;this.style.top=y+px;};


	el.floatIt2=function()
	{
		pX = (this.sx >= 0) ? 0 : ns ? innerWidth : 
		document.documentElement && document.documentElement.clientWidth ? 
		document.documentElement.clientWidth : document.body.clientWidth;
		pY = ns ? pageYOffset : document.documentElement && document.documentElement.scrollTop ? 
		document.documentElement.scrollTop : document.body.scrollTop;
		if(this.sy<0) 
		pY += ns ? innerHeight : document.documentElement && document.documentElement.clientHeight ? 
		document.documentElement.clientHeight : document.body.clientHeight;
//

//	alert(document.documentElement.scrollTop)

	
	this.cx = this.sx + pX;
	this.cy = this.sy + pY;
	
//	if(document.documentElement.scrollTop > 100)
//	{
	this.sP2(this.cx, this.cy);
//	}
//	else
//	{
//	alert('cx: ' + this.cx)
//	alert('cy: ' + this.cy)
//	this.cx = 100;
//	this.cy = this.sy - 380;
//	}
//	scrolltime=setTimeout(this.id + "_obj.floatIt2()", 0);
	}
	return el;
}

var mdivpos=1

function MoveDiv(id)
{
	clearTimeout(scrolltime)
	mdivpos+=1
	if(mdivpos>2){ mdivpos=1 }
	
//	if(mdivpos==1){ FloatDiv(id,10,10).floatIt();}
//	if(mdivpos==1){ posDiv(id,-300,300).floatIt2();}
//	if(mdivpos==2){ posDiv(id,-300,-380).floatIt2();}
//	if(mdivpos==4){ FloatDiv(id,10,-380).floatIt();}
}






var ViewingMenuPages = 0
var lastCell

//var	lastnewimage;

function changeButton(cellno)
{
//	alert('Change Button')
	
	if(document.getElementById('but' + cellno)!=lastCell)
		{
		document.getElementById('but' + cellno).style.background='url(images/button2.jpg)'
		if(lastCell)
			{
			lastCell.style.background='url(images/button1.jpg)'
			}
		lastCell=document.getElementById('but' + cellno);
		}
}

function changeCellBG(el, myColor) {
	el.style.background=myColor;
}

function changeTextCol(el, myColor) {
	el.style.text=myColor;
}

function zoomtotest()
{
	alert('Got Here')
}



