/***********************************************
* CMotion Image Gallery- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* Visit http://www.dynamicDrive.com for source code
* Last updated Mar 15th, 04'. Added "End of Gallery" message.
* This copyright notice must stay intact for legal use
***********************************************/

var restwidth=100 //1) width of the "neutral" area in the center of the gallery in px
var restheight=50
var maxspeed=50 //2) top scroll speed in pixels. Script auto creates a range from 0 to top speed.
var maxspeed2= 30

var endofgallerymsg="<span style='font-size: 11px'>End of Menus</span>" //3) message to show at end of gallery. Enter "" to disable message.

function enlargeimage(path, optWidth, optHeight){ //function to enlarge image. Change as desired.
var actualWidth=typeof optWidth!="undefined" ? optWidth : "600px" //set 600px to default width
var actualHeight=typeof optHeight!="undefined" ? optHeight : "500px" //set 500px to  default height
var winattributes="width="+actualWidth+",height="+actualHeight+",resizable=yes"
window.open(path,"", winattributes)
}

var iedom=document.all||document.getElementById
var scrollspeed=0
var scrollspeed2=0
var movestate=""
var movestate2=""

var actualwidth=''
var actualheight=''
//var singlemenuwidth=''
var cross_scroll, ns_scroll, cross_scroll2
var loadedyes=0

var scrollmenutoggle=1

var leftratio
var leftoffset1
var leftoffset2
var newoffset
var topoffset1
var topoffset2

var MouseChanged=1
var MouseLeft=0
var MouseUp=0
var MouseRight=1
var MouseDown=0

var mtype
var cpos

var MaxHeight
var ZoomMode = 1

function SetMouseType()
{
mtype='pointer'
}

function MouseChange(){

if (iedom)
{
if (document.getElementById("motioncontainer"))
{
	document.getElementById('motioncontainer').style.cursor = mtype;
}
}
}


function zoompage(pgNo,NumPgs){
var PageWidth
var ScollChange

	PageWidth = actualwidth/NumPgs
	ScrollChange = (menuwidth/2 - PageWidth/2) - (PageWidth * (pgNo-1))
	if(ScrollChange > 0)
		{
		ScrollChange=0
		}

	if(ScrollChange<menuwidth-actualwidth)
		{
		ScrollChange=menuwidth - actualwidth
		}
	cross_scroll.style.left = ScrollChange
}

function zoompoint(){

//alert('cross.scroll left: ' + parseInt(cross_scroll.style.left) + '\nactualwidth: ' + actualwidth + '\nactualheight: ' + actualheight + '\ncposy: ' + cposy)

leftoffset1 = cposy * actualwidth
MaxWidth = (MaxHeight/actualheight) * actualwidth

leftoffset2 = (MaxWidth/actualwidth) * leftoffset1
newoffset = leftoffset2 - leftoffset1
document.getElementById('motiongallery').style.left=parseInt(document.getElementById('motiongallery').style.left)-newoffset+"px"


topoffset1 = cposx * actualheight
topoffset2 = (MaxHeight/actualheight) * topoffset1
newoffset = topoffset2-topoffset1
document.getElementById('motiongallery').style.top=parseInt(document.getElementById('motiongallery').style.top)-newoffset+"px"




actualheight = MaxHeight
actualwidth = MaxWidth

//document.getElementById('motiongallery').style.left=0-newoffset+"px"

ZoomMode = 1
//actualheight = 1158


if (iedom&&parseInt(cross_scroll.style.left)<(menuwidth-actualwidth)){
	cross_scroll.style.left=menuwidth-actualwidth
	MouseRight=0
}

if (iedom&&parseInt(cross_scroll.style.left)>0){
	cross_scroll.style.left=0
	MouseLeft=0
}

//actualwidth=1680
//actualheight=579

if (document.getElementById('tc1')) { document.getElementById('tc1').height=actualheight }
if (document.getElementById('tc2')) {document.getElementById('tc2').height=actualheight }
if (document.getElementById('tc3')) { document.getElementById('tc3').height=actualheight }
if (document.getElementById('tc4')) { document.getElementById('tc4').height=actualheight }
if (document.getElementById('tc5')) { document.getElementById('tc5').height=actualheight }
if (document.getElementById('tc6')) { document.getElementById('tc6').height=actualheight }
if (document.getElementById('tc7')) { document.getElementById('tc7').height=actualheight }
if (document.getElementById('tc8')) { document.getElementById('tc8').height=actualheight }
//if (document.getElementById('tc1')) { document.getElementById('tc1').height+=0 }

if(MouseRight==0 && parseInt(cross_scroll.style.left)-menuwidth > 0-actualwidth-1){
MouseRight=1
}

MouseLeft=0
MouseUp=0
MouseDown=0
MouseChanged=1

//maxspeed=200

	stopmotion()
}

function speedchange(val)
{
	maxspeed = val

	maxspeed2 = val * 0.75
}

function zoomfit(){


//alert('Top2: ' + document.getElementById('showpin').style.top + '\nLeft: ' + document.getElementById('showpin').style.left)

if (ZoomMode == 1){
ZoomMode = 0

document.getElementById('showpin').style.top=parseInt(document.getElementById('showpin').style.top) * (menuheight / actualheight) - 12 + "px"
document.getElementById('showpin').style.left=parseInt(document.getElementById('showpin').style.left) * (menuheight / actualheight) - 5 + "px"

leftoffset1=menuwidth/2-parseInt(document.getElementById('motiongallery').style.left)
leftratio=leftoffset1/actualwidth

//actualwidth = document.getElementById('trueContainer').offsetWidth
actualwidth = menuheight / actualheight * actualwidth

leftoffset2=leftratio*actualwidth


//alert(document.getElementById('showpin').style.top)

newoffset=leftoffset2-menuwidth/2

//actualheight=document.getElementById('trueContainer').offsetHeight

document.getElementById('motiongallery').style.left=0-newoffset+"px"
document.getElementById('motiongallery').style.top=0+"px"

//widthratio = actualheight / menuheight

//actualwidth = menuheight / actualheight * actualwidth
//document.getElementById('motiongallery').style.left = parseInt(document.getElementById('motiongallery').style.left) * (menuheight / actualheight)
actualheight = menuheight
}
else
{
document.getElementById('showpin').style.top=parseInt(document.getElementById('showpin').style.top) * (MaxHeight / actualheight) + 26 + "px"
document.getElementById('showpin').style.left=parseInt(document.getElementById('showpin').style.left) * (MaxHeight / actualheight) + 15 + "px"

leftoffset1=menuwidth/2-parseInt(document.getElementById('motiongallery').style.left)
leftratio=leftoffset1/actualwidth

actualwidth = ((MaxHeight)/actualheight) * actualwidth
leftoffset2=leftratio*actualwidth

newoffset=leftoffset2-menuwidth/2
//actualwidth=actualwidth + 0.7
actualheight = MaxHeight

document.getElementById('motiongallery').style.left=0-newoffset+"px"

ZoomMode = 1
//actualheight = 1158
}

if (iedom&&parseInt(cross_scroll.style.left)<(menuwidth-actualwidth)){
	cross_scroll.style.left=menuwidth-actualwidth
	MouseRight=0
}

if (iedom&&parseInt(cross_scroll.style.left)>0){
	cross_scroll.style.left=0
	MouseLeft=0
}

//actualwidth=1680
//actualheight=579

if (document.getElementById('tc1')) { document.getElementById('tc1').height=actualheight }
if (document.getElementById('tc2')) {document.getElementById('tc2').height=actualheight }
if (document.getElementById('tc3')) { document.getElementById('tc3').height=actualheight }
if (document.getElementById('tc4')) { document.getElementById('tc4').height=actualheight }
if (document.getElementById('tc5')) { document.getElementById('tc5').height=actualheight }
if (document.getElementById('tc6')) { document.getElementById('tc6').height=actualheight }
if (document.getElementById('tc7')) { document.getElementById('tc7').height=actualheight }
if (document.getElementById('tc8')) { document.getElementById('tc8').height=actualheight }
//if (document.getElementById('tc1')) { document.getElementById('tc1').height+=0 }

if(MouseRight==0 && parseInt(cross_scroll.style.left)-menuwidth > 0-actualwidth-1){
MouseRight=1
}

MouseLeft=0
MouseUp=0
MouseDown=0
MouseChanged=1

//maxspeed=200

//document.getElementById('showpin').style.top=parseInt(document.getElementById('showpin').style.top) * (menuheight / actualheight) + "px"
//document.getElementById('showpin').style.left=parseInt(document.getElementById('showpin').style.left) * (menuheight / actualheight) + "px"

//alert('Top2: ' + document.getElementById('showpin').style.top + '\nLeft: ' + document.getElementById('showpin').style.left)

}

function zoomin(){

if (iedom){
crossmain=document.getElementById? document.getElementById("motioncontainer") : document.all.motioncontainer

leftoffset1=menuwidth/2-parseInt(document.getElementById('motiongallery').style.left)
leftratio=leftoffset1/actualwidth

actualwidth = ((actualheight+50)/actualheight) * actualwidth
leftoffset2=leftratio*actualwidth

newoffset=leftoffset2-menuwidth/2
actualwidth=actualwidth + 0.7
actualheight = actualheight + 50

document.getElementById('motiongallery').style.left=0-newoffset+"px"

if (document.getElementById('tc1')) { document.getElementById('tc1').height+=50 }
if (document.getElementById('tc2')) { document.getElementById('tc2').height+=50 }
if (document.getElementById('tc3')) { document.getElementById('tc3').height+=50 }
if (document.getElementById('tc4')) { document.getElementById('tc4').height+=50 }
if (document.getElementById('tc5')) { document.getElementById('tc5').height+=50 }
if (document.getElementById('tc6')) { document.getElementById('tc6').height+=50 }
if (document.getElementById('tc7')) { document.getElementById('tc7').height+=50 }
if (document.getElementById('tc8')) { document.getElementById('tc8').height+=50 }
if (document.getElementById('tc1')) { document.getElementById('tc1').height+=0 }

if(MouseLeft==0 && newoffset>0){
MouseLeft=1
MouseChanged=1
}

if(MouseRight==0 && parseInt(cross_scroll.style.left)-menuwidth > 0-actualwidth-1){
MouseRight=1
MouseChanged=1
}

if(MouseDown==0 && actualheight>menuheight){
MouseDown=1
MouseChanged=1
}

//showhidediv("visible")

}
}

function zoomout(){

if (iedom){
crossmain=document.getElementById? document.getElementById("motioncontainer") : document.all.motioncontainer

leftoffset1=menuwidth/2-parseInt(document.getElementById('motiongallery').style.left)
leftratio=leftoffset1/actualwidth
actualwidth = ((actualheight-50)/actualheight) * actualwidth
leftoffset2=leftratio*actualwidth
newoffset=leftoffset2-menuwidth/2
actualwidth=actualwidth - 1
actualheight = actualheight - 50

document.getElementById('motiongallery').style.left=0-newoffset+"px"

if (document.getElementById('tc1')) { document.getElementById('tc1').height-=50 }
if (document.getElementById('tc2')) { document.getElementById('tc2').height-=50 }
if (document.getElementById('tc3')) { document.getElementById('tc3').height-=50 }
if (document.getElementById('tc4')) { document.getElementById('tc4').height-=50 }
if (document.getElementById('tc5')) { document.getElementById('tc5').height-=50 }
if (document.getElementById('tc6')) { document.getElementById('tc6').height-=50 }
if (document.getElementById('tc7')) { document.getElementById('tc7').height-=50 }
if (document.getElementById('tc8')) { document.getElementById('tc8').height-=50 }
if (document.getElementById('tc1')) { document.getElementById('tc1').height-=0 }

if(MouseLeft==1 && newoffset<=0){
MouseLeft=0
MouseChanged=1
//alert('Zoom Out Move Left')
}

//alert('Width: ' + parseInt(cross_scroll.style.left))
//alert('MenuWidth: ' + menuwidth)
//alert('ActualWidth: ' + actualwidth)

if(MouseRight==1 && parseInt(cross_scroll.style.left)-menuwidth <= 0-actualwidth+1){
MouseRight=0
MouseChanged=1
//alert('Zoom Out Move Right')
}

if(MouseDown==1 && actualheight<=menuheight){
MouseDown=0
MouseChanged=1
//alert('Zoom Out Move Down')
}

//showhidediv("visible")

}
}

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

//function creatediv(){
//statusdiv=document.createElement("div")
//statusdiv.setAttribute("id","statusdiv")
//document.body.appendChild(statusdiv)
//statusdiv=document.getElementById("statusdiv")
//statusdiv.innerHTML=endofgallerymsg
//}

function positiondiv(){
//statusdiv.style.left=mainobjoffset+(menuwidth/2)-(statusdiv.offsetWidth/2)+"px"
//statusdiv.style.top=mainobjoffset2+(menuheight/2)-(statusdiv.offsetHeight/2)+"px"
//statusdiv.style.top=-500+"px"
}

//function showhidediv(what){


//if (endofgallerymsg!="")
//statusdiv.style.visibility=what
//}

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft: what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}

function moveleft(){
//if (loadedyes){
//movestate="left"
//if (iedom&&parseInt(cross_scroll.style.left)-scrollspeed>(menuwidth-actualwidth)){
//cross_scroll.style.left=parseInt(cross_scroll.style.left)-scrollspeed+"px"
//if(MouseLeft==0){
//MouseChanged=1
//MouseLeft=1
//}
//lefttime=setTimeout("moveleft()",20)
//}
//else
//{
//cross_scroll.style.left=menuwidth-actualwidth
//if(MouseRight==1){
//MouseRight=0
//MouseChanged=1
//SetMouseType()
//MouseChange()
//}
//}
//}
}

function moveup()
{
//	if (loadedyes)
//		{
//		movestate2="up"
//		if(iedom&&parseInt(cross_scroll.style.top)-scrollspeed2>=(menuheight-actualheight))
//			{
//			cross_scroll.style.top=parseInt(cross_scroll.style.top)-scrollspeed2+"px"
//			if(MouseUp==0)
//				{
//				MouseChanged=1
//				MouseUp=1
//				}
//			uptime=setTimeout("moveup()",20)
//			}
//		else
//			{
//			cross_scroll.style.top=menuheight-actualheight
//			if(MouseDown==1)
//				{
//				MouseDown=0
//				MouseChanged=1
//				SetMouseType()
//				MouseChange()
//				}
//			if(MouseUp==0 && actualheight>menuheight)
//				{
//				MouseUp=1
//				MouseChanged=1
//				SetMouseType()
//				MouseChange()
//				}
//			}
//		}
}

function moveright(){
//if (loadedyes){
//movestate="right"
//if (iedom&&parseInt(cross_scroll.style.left)+scrollspeed<0){
//cross_scroll.style.left=parseInt(cross_scroll.style.left)+scrollspeed+"px"
//if(MouseRight==0){
//MouseChanged=1
//MouseRight=1
//}
//righttime=setTimeout("moveright()",20)
//showhidediv("hidden")
//}
//else
//{
//cross_scroll.style.left=0
//if(MouseLeft==1){
//MouseLeft=0
//MouseChanged=1
//SetMouseType()
//MouseChange()
//}
//showhidediv("visible")
//}
//}
}


function movedown()
{
//	if (loadedyes)
//		{
//		movestate2="down"
//		if (iedom&&parseInt(cross_scroll.style.top)+scrollspeed2<0)
//			{
//			cross_scroll.style.top=parseInt(cross_scroll.style.top)+scrollspeed2+"px"
//			if(MouseDown==0)
//				{
//				MouseChanged=1
//				MouseDown=1
//				}
//			downtime=setTimeout("movedown()",5)
//			}
//		else
//			{
//			cross_scroll.style.top=0
//			if(MouseUp==1)
//				{
//				MouseUp=0
//				MouseChanged=1
//				SetMouseType()
//				MouseChange()
//				}
//			if(MouseDown==0 && actualheight>menuheight)
//				{
//				MouseDown=1
//				MouseChanged=1
//				SetMouseType()
//				MouseChange()
//				}
//			}
//		}
}

var curposx
var curposy

function motionengine(e){
var dsocx=(window.pageXOffset)? pageXOffset: ietruebody().scrollLeft;
var dsocy=(window.pageYOffset)? pageYOffset : ietruebody().scrollTop;
curposy=window.event? event.clientX : e.clientX? e.clientX: ""
curposx=window.event? event.clientY : e.clientY? e.clientY: ""

curposy-=mainobjoffset-dsocx
curposx-=mainobjoffset2-dsocy

if(scrollmenutoggle)
{
var leftbound=(menuwidth-restwidth)/2
var rightbound=(menuwidth+restwidth)/2

var upbound=(menuheight-restheight)/2
var downbound=(menuheight+restheight)/2

if (curposy>rightbound){
scrollspeed=(curposy-rightbound)/((menuwidth-restwidth)/2) * maxspeed
if (window.righttime) clearTimeout(righttime)
if (movestate!="left") moveleft()
}
else if (curposy<leftbound){
scrollspeed=(leftbound-curposy)/((menuwidth-restwidth)/2) * maxspeed
if (window.lefttime) clearTimeout(lefttime)
if (movestate!="right") moveright()
}
else
scrollspeed=0

if (curposx>downbound){
scrollspeed2=(curposx-downbound)/((menuheight-restheight)/2) * maxspeed2
if (window.downtime) clearTimeout(downtime)
if (movestate2!="up") moveup()
}
else if (curposx<upbound){
scrollspeed2=(upbound-curposx)/((menuheight-restheight)/2) * maxspeed2
if (window.uptime) clearTimeout(uptime)
if (movestate2!="down") movedown()
}
else
scrollspeed2=0

if(MouseChanged){
MouseChanged=0
SetMouseType()
MouseChange()
}
}
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function stopmotion(e){
//if ((window.event&&!crossmain.contains(event.toElement)) || (e && e.currentTarget && e.currentTarget!= e.relatedTarget && !contains_ns6(e.currentTarget, e.relatedTarget))){
if (window.lefttime) clearTimeout(lefttime)
if (window.righttime) clearTimeout(righttime)
if (window.uptime) clearTimeout(uptime)
if (window.downtime) clearTimeout(downtime)
movestate=""
movestate2=""
//}
}

var flashct=0;
var flashcol='red'
var CurrentHint

function flashhint(){
//document.getElementById('hintcontainer').innerHTML = '<font size="2" face="Arial"><font color=' + hintcol + '>&nbsp;&nbsp;&nbsp;&nbsp;Hint:</font><font color="#008000"> Click again to Unfreeze menus. Count:' + flashct + '</font></font>';

//alert('Flash Count: ' + flashct)

//if(flashct==2){
//document.getElementById('hintcontainer').innerHTML = '<font size="2" face="Arial"><font color="' + hintcol + '#7E011B">&nbsp;&nbsp;&nbsp;&nbsp;Hint:</font><font color="red"> Click again to Unfreeze menus. Count:' + flashct + '</font></font>';
//alert('Flash 1')
//}
//else if(flashct){
//document.getElementById('hintcontainer').innerHTML = '<font size="2" face="Arial"><font color="#7E011B">&nbsp;&nbsp;&nbsp;&nbsp;Hint:</font><font color=> Click again to Unfreeze menus. Count:' + flashct + '</font></font>';
//alert('Flash 2')
//}

if(flashcol=='red'){
flashcol='#008000'
}
else
{
flashcol='red'
}

if(flashct > 0){
document.getElementById('hintcontainer').innerHTML = '<font size="1" face="Arial"><font color="#7E011B">&nbsp;&nbsp;&nbsp;&nbsp;Hint:</font><font color="' + flashcol + '">' + CurrentHint + '</font></font>';
hinttime=setTimeout("flashhint()",500)
flashct=flashct - 1;
}
}

function fillup(){
if (iedom){

//alert('Initialize')
crossmain=document.getElementById? document.getElementById('motioncontainer') : document.all.motioncontainer
menuwidth=parseInt(crossmain.style.width)
mainobjoffset=getposOffset(crossmain, 'left')
cross_scroll=document.getElementById? document.getElementById('motiongallery') : document.all.motiongallery
//actualwidth=document.all? cross_scroll.offsetWidth : document.getElementById('trueContainer').offsetWidth
actualwidth=document.getElementById('trueContainer').offsetWidth
menuheight=parseInt(crossmain.style.height)
//menuheight=document.getElementById('tc1').height + 40
//crossmain.style.height = parseInt(menuheight)+'px'
//crossmain.style.width = parseInt(menuheight)+'px'
mainobjoffset2=getposOffset(crossmain, 'top')
//actualheight=document.all? cross_scroll.offsetHeight : document.getElementById('trueContainer').offsetHeight
//actualheight=document.getElementById('trueContainer').offsetHeight
actualheight=document.getElementById('tc1').height
//singlemenuwidth=document.getElementById('tc1').width
MaxHeight=actualheight
//alert('ActualHeight: ' + actualheight)


//actualheight=menuheight
restwidth = menuwidth / 2
restheight = menuheight / 2
//alert('Menu Width: ' + menuwidth + '\nActual Width: ' + actualwidth + '\nMenuHeight: ' +menuheight + '\nActualHeight: ' + actualheight)

//loadMenu(1)
//showButton(1)

crossmain.onmousemove=function(e){
motionengine(e)
}


crossmain.onmouseout=function(e){
stopmotion(e)
//showhidediv("hidden")
}

function openwindow(url)
{
  NewWindow=window.open(url,'newWin','alwaysRaised=1; width=800,height=600,left=20,top=20,toolbar=No,location=No,scrollbars=no,status=No,resizable=yes,fullscreen=No');  NewWindow.focus(); void(0);  
}

crossmain.onmousedown=function(e)
{
//	alert('ActualHeight: ' + actualheight)
//	alert('curposx: ' + curposx)

	if (curposy < actualwidth)
	{
//	alert('curposx: ' + curposx + '\nTopScroll: ' + parseInt(document.getElementById('motioncontainer').scrollTop))
//	alert('curposx: ' + curposx + '\nTop2: ' + parseInt(document.getElementById('motiongallery').scrollTop) +  '\nTop3: ' + parseInt(document.getElementById('motioncontainer').scrollTop) +  '\nTop2: ' + parseInt(document.getElementById('trueContainer').scrollTop) + '\nTop: ' + parseInt(document.getElementById('motioncontainer').style.top) + '\nTop: ' + parseInt(document.getElementById('motiongallery').style.top) + '\nTop Offset: ' + getposOffset(crossmain, 'top') + '\n1: ' + document.getElementById('trueContainer').offsetHeight)
//	if(parent.document.getElementById('PopUpDiv').style.visibility=='hidden')
//		{
			cposx = (curposx - parseInt(document.getElementById('motiongallery').style.top))/actualheight
			
//			alert('cposx: ' + cposx)
//			alert('cposy: ' + cposy)

			cposx = (curposx + parseInt(document.getElementById('motioncontainer').scrollTop))/actualheight
			cposy = MenuNum - 1 + (curposy/actualwidth)
			if (cposx <= 1)
				{
				parent.frames['iframe4'].location.replace('menu_wishlist3.asp?action=ADDDISH&toppos=' + cposx + '&rightpos=' + cposy + '&skin=' + 1);
				}
	}
}
loadedyes=1
}
}
//window.onload=fillup


var ViewingMenuPages = 0
var lastCell

function changeButton(cellno)
{
	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;
}

var curcell = 1
var MenuNum = 1

function applyTransition (obj)
{
    obj.filters(0).Apply();
    obj.style.visibility = "visible";
    obj.filters(0).Play();
}

function applyImageTransition (obj, imgsrc)
{
    obj.filters(0).Apply();
    obj.src=imgsrc;
    obj.filters(0).Play();
}

function loadMenu2(cellno)
{
alert ('Got Here')
}

function loadMenu(cellno)
{
	if(ViewingMenuPages == 1)
		{
		ViewingMenuPages = 0
		document.getElementById('trueContainer').innerHTML = '<IMG id=tc1 src=' + MenuPath + cellno + '.jpg border=0>'
		}

	MenuNum = cellno
	if(lastCell)
		{
		lastCell.style.background = 'url(images/button1.jpg)'
		}
	else
		{
		document.getElementById('but1').style.background = 'url(images/button1.jpg)'
		}
	lastCell=document.getElementById('but'+cellno);
	document.getElementById('but'+cellno).style.background = 'url(images/button2.jpg)'
	if(ViewingMenuPages == 1)
		{
		ViewingMenuPages = 0
		document.getElementById('trueContainer').innerHTML = '<IMG id=tc1 src=' + MenuPath + cellno + '.jpg border=0>'
		}
	else
		{
		if(is_ie5_5up)
			{
			if(curcell < cellno)
				{
				tc1.style.filter='progid:DXImageTransform.Microsoft.Blinds(bands=1,direction=left,duration=0.4)';
				}
			else
				{
				tc1.style.filter='progid:DXImageTransform.Microsoft.Blinds(bands=1,direction=right,duration=0.4)';
				}
			applyImageTransition(tc1,MenuPath + cellno + '.jpg')
			}
		else
			{
			document.getElementById('trueContainer').innerHTML = '<IMG id=tc1 src=' + MenuPath + cellno + '.jpg border=0>'
			}	
		}


	if(cellno > 1)
		{
		pagemove=1
		}
	curcell = cellno
	document.getElementById('showpin').style.visibility='hidden';
}

function showPin()
{
	document.getElementById('showpin').style.visibility='visible';
}

function hidePin()
{
	document.getElementById('showpin').style.visibility='hidden';

	pintime=setTimeout("showPin()",2000)
}

function FocusInput(el)
{
	el.value = ""
}

var lemailbut_over = new Image();
var lemailbut_down = new Image();

lemailbut_over.src = "images/email_but_over.jpg";
lemailbut_down.src = "images/email_but_down.jpg";

var ltaxisbut_over = new Image();
var ltaxisbut_down = new Image();

ltaxisbut_over.src = "images/taxis_but_over.jpg";
ltaxisbut_down.src = "images/taxis_but_down.jpg";

var loffersbut_over = new Image();
var loffersbut_down = new Image();

loffersbut_over.src = "images/offers_but_over.jpg";
loffersbut_down.src = "images/offers_but_down.jpg";

var lmapbut_over = new Image();
var lmapbut_down = new Image();

lmapbut_over.src = "images/map_but_over.jpg";
lmapbut_down.src = "images/map_but_down.jpg";

var lorderbut_over = new Image();
var lorderbut_down = new Image();

lorderbut_over.src = "images/order_but_over.jpg";
lorderbut_down.src = "images/order_but_down.jpg";

var lprintbut_over = new Image();
var lprintbut_down = new Image();

lprintbut_over.src = "images/print_but_over.jpg";
lprintbut_down.src = "images/print_but_down.jpg";

function DoButton(img_but, newimage) {
document[img_but].src=newimage;
}

var screenW = 640, screenH = 480;
if (parseInt(navigator.appVersion)>3) {
 screenW = screen.width;
 screenH = screen.height;
}
else if (navigator.appName == "Netscape" 
    && parseInt(navigator.appVersion)==3
    && navigator.javaEnabled()
   ) 
{
 var jToolkit = java.awt.Toolkit.getDefaultToolkit();
 var jScreenSize = jToolkit.getScreenSize();
 screenW = jScreenSize.width;
 screenH = jScreenSize.height;
}

var pagemove = 0
var curcell = 1

function popon_sav()
{
	if(document.getElementById('PopUpDiv').style.visibility=='visible')
		{
		alert('To Place Your Order Please Click\non the \'Place Order\' Button in the \'Dish List\'        ')
		}
	else
		{
		document.getElementById('PopUpDiv').style.visibility='visible';
		if(pagemove==0 || lastCell==1)
			{	
			loadMenu(2)
			}
		}
}

var firstpopon=1;

function popon(adddish)
{
	if(firstpopon==1)
		{
		firstpopon = 0;
		document.getElementById('iframe4').style.left=winW - 275;
		}
		
	if(document.getElementById('PopUpDiv').style.visibility=='visible' && adddish!=1)
		{
		alert('To Place Your Order Please Click\non the \'Place Order\' Button in the \'Dish List\'        ')
		}
	else
		{
		document.getElementById('PopUpDiv').style.visibility='visible';
		}
}

function popon2()
{
	if(!document.getElementById('but'+(curcell+1)))
		{
		loadMenu(2)
		}
	else
		{
		loadMenu(curcell+1)
		}
}

function NextMenu()
{
	if(!document.getElementById('but'+(curcell+1)))
		{
		loadMenu(1)
		}
	else
		{
		loadMenu(curcell+1)
		}
	document.getElementById("motionContainer").scrollTop = 0;
}

function validatePC(theForm)
{
	alert('3.5 miles')
	return false;
}

function loadOffers(goID)
{
	ViewingMenuPages = 1

	document.getElementById('trueContainer').innerHTML = '<IFRAME allowtransparency = "true" name="myIframe" id="myIframe" width="420" height="490" frameborder="0" scrolling="no" marginwidth="0" marginheight="0"><h3>Sorry, your browser cannot display frames</h3></IFRAME>'

	frames['myIframe'].location ='takeaway_offers.asp?rstid=' + goID
	curcell=curcell - 1
	if(curcell < 1)
		{
		curcell = 1
		}
		
	if(lastCell)
		{
		lastCell.style.background = 'url(images/button1.jpg)'
		}
	else
		{
		document.getElementById('but1').style.background = 'url(images/button1.jpg)'
		}
		
	parent.document.getElementById('showpin').style.visibility='hidden';
	document.getElementById("motionContainer").scrollTop = 0;
}

function loadDistance(goID, goPC)
{
	ViewingMenuPages = 1
	document.getElementById('trueContainer').innerHTML = '<IFRAME allowtransparency = "true" name="myIframe" id="myIframe" width="420" height="490" frameborder="0" scrolling="no" marginwidth="0" marginheight="0"><h3>Sorry, your browser cannot display frames</h3></IFRAME>'

	goPC2 = document.CheckDist.PCDist.value;

	frames['myIframe'].location = 'distance_checker.asp?rstid=' + goID + '&rpc=' + goPC2 + '&pcr=' + goPC

	curcell=curcell - 1
	if(curcell < 1)
		{
		curcell = 1
		}
		
	if(lastCell)
		{
		lastCell.style.background = 'url(images/button1.jpg)'
		}
	else
		{
		document.getElementById('but1').style.background = 'url(images/button1.jpg)'
		}
		
	parent.document.getElementById('showpin').style.visibility='hidden';
	document.getElementById("motionContainer").scrollTop = 0;
	return false;
}

function wordSearch(goID)
{

	goWord = document.wSearch.wFinder.value;

	frames['kwframe'].location ='keyword_search.asp?ID=' + goID + '&keyword=' + goWord + '&skin=1'

	return false;
}


function showhours(goID)
{
	document.getElementById('PopUpDiv2').style.visibility='visible';
}

function showSections(goID)
{
	document.getElementById('SectionsDiv').style.visibility='visible';
}

function oo_showpage()
{
	fillup();
	document.getElementById('motioncontainer').style.visibility='visible';
	document.getElementById('oo_menus').style.visibility='visible';

	preloadMenus()	
}

function	preloadMenus()
{
image3 = new Image();
image3.src=MenuPath + '3.jpg'
image4 = new Image();
image4.src=MenuPath + '4.jpg'
image5 = new Image();
image5.src=MenuPath + '5.jpg'
image6 = new Image();
image6.src=MenuPath + '6.jpg'
image7 = new Image();
image7.src=MenuPath + '7.jpg'
image8 = new Image();
image8.src=MenuPath + '8.jpg'
image8 = new Image();
image8.src=MenuPath + '9.jpg'
image8 = new Image();
image8.src=MenuPath + '10.jpg'
}

