function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);}

function wclose() {
self.close();
}

function web_rest(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=1, scrollbars=1, location=1, statusbar=1, menubar=1, resizable=1, width=800, height=600, left = 50, top = 0');");
}

function recipe(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0, scrollbars=1, location=0, statusbar=1, menubar=0, resizable=1, width=400, height=450, left = 50, top = 0');");
}

// topmenu start
var ie5 = (document.getElementById && document.all); 
var ns6 = (document.getElementById && !document.all);

// to change the duration of the effect, change the duration number. "Duration=2" => 2 seconds
var fade = "blendTrans(Duration=0.1)";

var myEffect = fade;

function showFilter(obj, visibility) {
	if(ie5){
		menu[obj].style.filter = myEffect; // set your effect from one of the top 25 differents effects
		menu[obj].filters[0].Apply();
		menu[obj].style.visibility = visibility;
		menu[obj].filters[0].Play();
	}
	else if(ns6){
		menu[obj].style.visibility = visibility;
	}
}

function showHide(obj, visibility) {
	if(ie5 || ns6){
		menu[obj].style.visibility = visibility;
	}
}

function menuBarInit() {
	if(ie5 || ns6){
   		menu = document.getElementsByTagName("div");
	}
}

function MakeActive(num) {
    	if(ie5 || ns6) {
        	for(i=0;i<lnk.length;i++) {
        		lnk[i].style.color = "#006699";
        		lnk[num].style.color = "red";
        	}
    	}
}

function makeActiveInit() {
    	if(ie5 || ns6){
        	lnk = document.getElementById("tb").getElementsByTagName("a");
        		for(i=0;i<lnk.length;i++){
        			lnk[i].onfocus=new Function("if(this.blur)this.blur()");
        			lnk[0].style.color = "red";
			}
        }	
	if(ie5)
	    document.getElementById("tb").style.visibility = "visible";
}




function SwitchMenu(obj){
	if(document.getElementById){
	var el = document.getElementById(obj);
	var ar = document.getElementById("cont").getElementsByTagName("DIV");
		if(el.style.display == "none"){
			for (var i=0; i<ar.length; i++){
				ar[i].style.display = "none";
			}
			el.style.display = "block";
		}else{
			el.style.display = "none";
		}
	}
}
function ChangeClass(menu, newClass) { 
	 if (document.getElementById) { 
	 	document.getElementById(menu).className = newClass;
	 } 
} 
document.onselectstart = new Function("return true");
// topmenu end




// Begin topmenu restaurant
function formHandling(forma){
var URL = document.forma.site.options[document.forma.site.selectedIndex].value;
window.location.href = URL;
}
// End topmenu restaurant




// Begin topmenu programs
function formHandler(form) {
var windowprops = "height=500,width=650,location=yes,"
+ "scrollbars=yes,menubars=no,toolbars=no,resizable=yes";

var URL = form.site.options[form.site.selectedIndex].value;
popup = window.open(URL,"MenuPopup",windowprops);
}
// End topmenu programs





// image slide start //

var rotate_delay = 4000; // delay in milliseconds (4000 = 4 secs)
current = 0;
function next() {
if (document.slideform.slide[current+1]) {
document.images.show.src = document.slideform.slide[current+1].value;
document.slideform.slide.selectedIndex = ++current;
   }
else first();
}
function previous() {
if (current-1 >= 0) {
document.images.show.src = document.slideform.slide[current-1].value;
document.slideform.slide.selectedIndex = --current;
   }
else last();
}
function first() {
current = 0;
document.images.show.src = document.slideform.slide[0].value;
document.slideform.slide.selectedIndex = 0;
}
function last() {
current = document.slideform.slide.length-1;
document.images.show.src = document.slideform.slide[current].value;
document.slideform.slide.selectedIndex = current;
}
function ap(text) {
document.slideform.slidebutton.value = (text == "Stop") ? "Start" : "Stop";
rotate();
}
function change() {
current = document.slideform.slide.selectedIndex;
document.images.show.src = document.slideform.slide[current].value;
}
function rotate() {
if (document.slideform.slidebutton.value == "Stop") {
current = (current == document.slideform.slide.length-1) ? 0 : current+1;
document.images.show.src = document.slideform.slide[current].value;
document.slideform.slide.selectedIndex = current;
window.setTimeout("rotate()", rotate_delay);
   }
}

// image slide end //
