function getwinWSize() {
	var winW = 0;

  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    winW = window.innerWidth;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    winW = document.documentElement.clientWidth;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    winW = document.body.clientWidth;
  }
  return winW;
}

function getwinHSize() {
	var winH = 0;

  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    winH = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    winH = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    winH = document.body.clientHeight;
  }
	return winH;
}

function init()
{
	var winW = getwinWSize(), winH = getwinHSize();
	var startmenu = ( (winW - 780 ) / 2);
	wLeft = (winW  - 780) /2;
	if (winW < 780) 	{
		startmenu = 1;
		wLeft = 1;
	}
//	barleft.width = wLeft;
//	barright.width = wLeft;

//function menu(size, orientation, x, y, offsetX, offsetY, bgOut, bgOver, fontFace, fontSize, 
//	fontStyleOut, fontStyleOver, textColorOut, textColorOver, borderSize, borderColor, margin, showChar, 
//	showOnClick, sepItems, isMainMenu, hasAnimations, animationType, hasShadow, sOffX, sOffY, shadowColor)

	//Main Menu items: img:images/bg.jpg
	menus[0] = new menu(31, "horizontal", startmenu, 257, 3, 0, "", "", "Verdana", 6, 
		"bold", "bold", "#000000", "#3366FF", 0, "#ffffff", 0, "", false, true, true, false, 0, false, 4, 4, "");
	menus[0].addItem("default.asp","", 59, "left", "<img src='images/menu_home.gif' border='0'>", 0);
	menus[0].addItem("his_majesty.asp","", 246, "left", "<img src='images/menu_majesty.gif' border='0'>", 0);
	menus[0].addItem("#","", 174, "left", "<img src='images/menu_rajadamnern.gif' border='0'>", 1);
//	menus[0].addItem("news_pressrelease.asp","", 34, "left", "News PressRelease", 0);
	menus[0].addItem("fightresult.asp","", 108, "left", "<img src='images/menu_fightresult.gif' border='0'>", 0);
	menus[0].addItem("gallery.asp","", 77, "left", "<img src='images/menu_gallery.gif' border='0'>", 0);
	menus[0].addItem("contactus.asp","",116, "left", "<img src='images/menu_contactus.gif' border='0'>", 0); //contactus.asp

	//Sub Menu for 1 Main Menu Item ("HIS MAJESTIC THE KING & MUAY THAI"):
	menus[1] = new menu(230, "vertical", 10, 10, -1, -1, "#f0c207", "#f0c207", "Verdana", 7, "bold", 
		"bold", "#000000", "#3366FF", 1, "#FFFFFF", 5, "", false, true, false, false, 0, false, 4, 4, "");
	menus[1].addItem("history.asp", "",20, "left", "&nbsp;HISTORY OF RAJADAMNERN", 2);
	menus[1].addItem("honour.asp", "",20, "left", "&nbsp;HONOUR HISTORY OF RAJADAMNERN", 0);
	menus[1].addItem("his_muaythai.asp", "",20, "left", "&nbsp;HISTORY OF MUAYTHAI", 0);
	menus[1].addItem("rajadumnern_today.asp", "",20, "left", "&nbsp;RAJADAMNERN STADIUM TODAY", 3);
	menus[1].addItem("regulation.asp", "",20, "left", "&nbsp;MUAYTHAI & REGULATION", 4);


	//Sub Menu for 2 Main Menu Item ("HISTORY OF RAJADAMNERN"):
	menus[2] = new menu(130, "vertical", 0, 0, -5, -5, "#f0c207", "#f0c207", "Verdana", 7, "bold", 
		"bold", "#000000", "#3366FF", 1, "#FFFFFF", 5, "", false, true, false, false, 12, false, 4, 4, "");

	menus[2].addItem("past_manager.asp", "",20, "left", "&nbsp;PAST MANAGER", 0);


	//Sub Menu for 3 Main Menu Item ("RAJADAMNERN STADIUM TODAY"):
	menus[3] = new menu(200, "vertical", 0, 0, -5, -5, "#f0c207", "#f0c207", "Verdana", 7, "bold", 
		"bold", "#000000", "#3366FF", 1, "#FFFFFF", 5, "", false, true, false, false, 12, false, 4, 4, "");
	menus[3].addItem("word_director.asp", "",20, "left", "&nbsp;WORD FROM DIRECTOR", 0); 
	menus[3].addItem("word_manager.asp", "",20, "left", "&nbsp;WORD FROM STADIUM MANAGER", 0); 
	menus[3].addItem("promoter.asp", "",20, "left", "&nbsp;PROMOTER", 0); //promoter.asp
	menus[3].addItem("champ.asp", "",20, "left", "&nbsp;CHAMP RANK", 0); //champ.asp

	//Sub Menu for 4 Main Menu Item ("MUAY THAI & REGULATION"):
	menus[4] = new menu(180, "vertical", 0, 0, -5, -5, "#f0c207", "#f0c207", "Verdana", 7, "bold", 
		"bold", "#000000", "#3366FF", 1, "#FFFFFF", 5, "", false, true, false, false, 12, false, 4, 4, "");

	menus[4].addItem("development.asp", "",20, "left", "&nbsp;DEVELOPMENT OF MUAYTHAI", 0);
	menus[4].addItem("decoration.asp", "",20, "left", "&nbsp;DECORATION", 0);
	menus[4].addItem("nai_khanomtom.asp", "",20, "left", "&nbsp;NAI KHANOM TOM", 0);


	// show maintable after set lelft and right bar already
//	maintable.style.display="inline";
} //OUTER CLOSING BRACKET. EVERYTHING ADDED MUST BE ABOVE THIS LINE.

