//preloading images
home_on = new Image(71,22); home_out = new Image(71,22);
profile_on = new Image(86,22); profile_out = new Image(86,22);
restaurant_on = new Image(117,22); restaurant_out = new Image(117,22);
contactus_on = new Image(113,22); contactus_out = new Image(113,22);

home_on.src = "_images/nav_home_on.gif"; home_out.src = "_images/nav_home_out.gif";
profile_on.src = "_images/nav_profile_on.gif"; profile_out.src = "_images/nav_profile_out.gif";
restaurant_on.src = "_images/nav_restaurant_on.gif"; restaurant_out.src = "_images/nav_restaurant_out.gif";
contactus_on.src = "_images/nav_contactus_on.gif"; contactus_out.src = "_images/nav_contactus_out.gif";

//fixing netscape font size problem
if(!document.all) document.write("<style>.text{ font-family: 'Trebuchet MS', Trebuchet, Arial, Verdana; font-size: 13px; color:#330000; }<\/style>");

//function for preloading big pictures
function pictures(name, number){
	p = new Array();
	loading = new Image();

	for(i=0; i<number; i++){
		p[i] = new Image();
	}
	
	loading.src = "_images/pic_loading.gif";
	
	for(i=0; i<number; i++){
		p[i].src = "_images/pic_" + name + "_" + (i+1) + ".jpg";
	}
}

//current picture is first in the row
var current = 0;

//function for changing the big pictures
function change(direction){
	document.bigpic.src = loading.src;
	var end = p.length - 1;
	if(direction==0){
		if(current==0){
			document.bigpic.src = p[end].src;
			current = end;
		}
		else{
			document.bigpic.src = p[current-1].src;
			current--;
		}
	}
	else{
		if(current==end){
			document.bigpic.src = p[0].src;
			current = 0;
		}
		else{
			document.bigpic.src = p[current+1].src;
			current++;
		}
	}
}