function test ()
{
	alert('vinoti-hk : hi there');
}

function topMenu (current)
{
	var menuItems = new Array(
		'Home', 
		'Interior Project', 
		'Furniture',
		'Promotion',
		'Contact Us'
	);
	var menuLinks = new Array(
		'index', 
		'IP1', 
		'Furniture',
		'Promotion',
		'contacts'
	);
	
	var tablestring = '<table align=right cellspacing=0 cellpadding=0 width=100% class=topmenu_table><tr>';
	
	tablestring += '<td align=right>' + vlogo() + '</td>';
	
	for (var i=0; i<menuItems.length; i++) {
		var cellclass = 'link';
		var isCurrent = false;
		
		if (i == menuItems.length-1) cellclass += 'last';
		if (current == menuItems[i]) isCurrent = true;
		if (isCurrent) cellclass += 'cur';
		
		var tdstring = '<td class='+cellclass+'>';
		if (!isCurrent) tdstring += '<a href="'+menuLinks[i]+'.html">'
		tdstring += menuItems[i];
		if (!isCurrent) tdstring += '</a>';
		tdstring += '</td>';
		
		//alert(tdstring);
		tablestring += tdstring;
	}
	
	tablestring += '</tr></table>';
	//alert(tablestring);
	document.write(tablestring);
}

//------------------------------------------------------------

function pageMenu (curMenu, curIdx)
{
	curMenu = "Interior Project"; // might be able to use this later on as an input..
    
	//if (curMenu == "Interior Project") {
		var menuTitles = new Array(
			'Greenery Garden',  // 0
			'8 Waterloo Road',  // 1
			'One Beacon Hill',  // 2
			'Miami Crescent',   // 3
			'Boardcast Drive',  // 4
			'Park Avenue',      // 5
			'One Silversea',    // 6
			'Kingsland Villa',  // 7
			'Green Crest',      // 8
			'Boland Court',      // 9
			'Complete Projects' // 10
		);
		var linksMax = menuTitles.length-1;
		var menuLinks = new Array();
		for (var i=0; i<linksMax; i++) {
			menuLinks[i] = "IP" + (i+1);
		}
		menuLinks[linksMax] = 'IPcProjects';
	//}
	
	if (curIdx==100) curIdx = menuTitles.length; // 100 marking the default last page of the lot
	
	var outString = "";
	curIdx--; // IP1.html comes in with '1', making it suitable for the index
	if (curIdx == 0) {
		outString += "<span class='txtgrey smaller'><< previous page</span>";
	}
	else {
		outString += "<a href='" + menuLinks[curIdx-1] + ".html' class=smaller><< previous page</a>";
	}
	outString += " -- ";
	for (var i=0; i<menuTitles.length; i++) {
		if (i == curIdx) {
			outString += " " + (i+1) + " ";
		}
		else {
			outString += "<a href='" + menuLinks[i] + ".html' title='" + menuTitles[i] + "'> ";
			outString += (i+1);
			outString += " </a>";
		}
	}
	outString += " -- ";
	if (curIdx==menuTitles.length-1) {
		outString += "<span class='txtgrey smaller'>next page >></span>";
	}
	else {
		outString += "<a href='" + menuLinks[curIdx+1] + ".html' class=smaller>next page >></a>";
	}
	
	return outString;
}

//------------------------------------------------------------

function vlogo ()
{
	return '<span class=green_heading_13>vinoti-hk</span>&nbsp;&nbsp;&nbsp;<img src="images/logo_vinoti.jpg" width=20>';
}

//------------------------------------------------------------

function OpenVideo (vfile)
{
	var embed = 
		'<object id="wmp" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" ' +
	  	'codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,0,0" ' +
		'standby="Loading Microsoft Windows Media Player components..." ' +
		'type="application/x-oleobject">' +		
		'<param name="FileName" value="images/'+vfile+'">' +
		'<param name="ShowControls" value="1">' +
		'<param name="ShowDisplay" value="0">' +
		'<param name="ShowStatusBar" value="1">' +
		'<param name="AutoSize" value="1">' +
		'<param name="AutoStart" value="1">' +
		'<param name="Visible" value="1">' +
		'<param name="AnimationStart" value="0">' +
		'<param name="Loop" value="0">' +
		'<embed ' +
			'type="application/x-mplayer2" ' +
			'pluginspage="http://www.microsoft.com/windows95/downloads/contents/wurecommended/s_wufeatured/mediaplayer/default.asp" ' +
			'src="images/'+vfile+'" ' +
			'name=MediaPlayer2 showcontrols=1 showdisplay=0 showstatusbar=1 autosize=1 autostart=1 visible=1 animationatstart=0 loop=0>' +
		'</embed>' +
	'</object>';
	var newwin = window.open('#', "enlarged", "scrollbars,resizable,height=400,width=400");
	newwin.document.close();
	newwin.document.open();
	newwin.document.writeln(
		"<HTML><head><title>"+vfile+"</title></head><BODY><center>"+embed+"</center></BODY></HTML>"
	);
	//newwin.moveTo(5,0);
	newwin.focus();
}

//------------------------------------------------------------

function OpenBigImage (img)
{
	var imgwidth = 1700;
	var imgminwid= 1000;
	var srcwidth = screen.width-10;
	if (imgwidth > srcwidth) imgwidth = srcwidth-50;
	if (imgwidth < imgminwid) imgwidth = imgminwid;
	
	var newwin = window.open('#', "enlarged", "scrollbars,resizable,height="+(screen.height-80)+",width="+srcwidth);
	newwin.document.close();
	newwin.document.open();
	newwin.document.writeln(
		"<HTML><head><title>enlarged image</title></head><BODY><img src='images/" + img + 
		"' width=" + imgwidth + "></BODY></HTML>"
	);
	newwin.moveTo(5,0);
	newwin.focus();
}

//------------------------------------------------------------

function OpenImgItem (url, w, h)
{
	var newwin = window.open(url, "chair", "width="+w+",height="+h+",scrollbars,resizable");
	newwin.focus();
}