// Open Contact window
function openWindow(url)
{
	openWindow(url,"_blank",false);
}
function openWindow(url,name)
{
	openWindow(url,name,false);    
}
// Open Document 
function openDocument(url)
{
	openWindow(url,"_blank",true);
}
function openDocument(url,name)
{
	openWindow(url,name,true);
}
// Open document in a new window
function openWindow(url,name,isResize)
{
	var top = 0;
	var left = 0;	
	// origin size: width = 459, height= 390 zz
	// Size below: origin size + scrollbars size
	var width = 620;
    var height= 560;	
	var sWindowProperties  ="statusbar=no,scrollbars=yes,toolbar=no,";	
	if (isResize==true)
	{
		sWindowProperties += "resizable=yes,";
		width = window.screen.availWidth - 10;
		height= window.screen.availHeight - 50;
	} else {		
		sWindowProperties += "resizable=no,";
		top = 155;
		if (window.screen.availWidth >(width+60))
		{
			left = (window.screen.availWidth - width - 60);
		}		
	}
	sWindowProperties +="width=" + width + ", height=" + height + ", top=" + top + ", left=" + left ;	

    if (name!=null)
    {
		window.open(url,name,sWindowProperties);
    }else
    {
		window.open(url,"_blank",sWindowProperties);
    }
}
// Change Style of an Item (MenuItem)
function changeStyle(item,cssClass)
{ 
	if (item!=null)
	{
		if(cssClass!=null&&cssClass!='')
		{
			item.className=cssClass;
		}
	};
};

// Refresh Screen
function RefreshScreen() {

	
	// Check Browser Object
	if (bw==null)
	{
		bw = new lib_bwcheck() ;
	}
	
	var imgHomePage = window.document.getElementById("imgHomePage");	
	var cellHomePage =window.document.getElementById("cellHomePage");	
	var LeftNavigationBanner = window.document.getElementById("LeftNavigationBanner");
	var LeftDarkBanner = window.document.getElementById("LeftDarkBanner");
	var CellBlank = window.document.getElementById("CellBlank");
	var HomePageMainTable = window.document.getElementById("HomePageMainTable");
	
	//fix height error for Netscape,Opera
	if ((LeftDarkBanner!=null) && (bw.ie==0) )
	{
		LeftDarkBanner.style.height = screen.availHeight - 207 ;
	}
	
	//Proccess for HomePage	
	// HomePage's image
	if ((imgHomePage != null) && (cellHomePage!=null) && (HomePageMainTable!=null) && (CellBlank!=null) && (LeftNavigationBanner!=null) &&(LeftDarkBanner!=null) )
	{		

		var iHomePageMainTableWidth = HomePageMainTable.offsetWidth;

		imgHomePage.style.position='absolute';
		imgHomePage.style.top = 113;
		//alert(iHomePageMainTableWidth);
		if (bw.ie==0)
		{
			iHomePageMainTableWidth += 80 ;
		}
		imgHomePage.style.left = LeftNavigationBanner.offsetWidth+LeftDarkBanner.offsetWidth  ;
		imgHomePage.style.width = iHomePageMainTableWidth +CellBlank.offsetWidth  ;
		cellHomePage.height =243;//191;
		cellHomePage.style.width = iHomePageMainTableWidth;
		
		if (CellBlank!=null)
		{
			CellBlank.style.height=191;
		}
	}
	
	
	var SectionHorizontalMenuCell = window.document.getElementById("SectionHorizontalMenuCell");
	if (SectionHorizontalMenuCell!=null)
	{
		if (SectionHorizontalMenuCell.innerHTML== '')
		{
			SectionHorizontalMenuCell.style.display = 'none';
		}
	}

	//Process for Table Layout
	var Cell_Menu_Hor_And_Ver = window.document.getElementById("Cell_Menu_Hor_And_Ver");
	var CellSectionImages = window.document.getElementById("CellSectionImages");

	var PanelDocument = window.document.getElementById("PanelDocument");
	var Main_Table_Object = window.document.getElementById("Main_Table_Object");
	var Data_Table_Object = window.document.getElementById("Data_Table_Object");
	var Cell_Data = window.document.getElementById("Cell_Data");
	
	var Cell_Line_Bottom = window.document.getElementById("Cell_Line_Bottom");

	var HeaderTable_Object =  window.document.getElementById("HeaderTable_Object");

	var SectionHorizontalMenu_PanelMenu =  window.document.getElementById("SectionHorizontalMenu_PanelMenu");
	var SectionVerticalMenu_PanelMenu =  window.document.getElementById("SectionVerticalMenu_PanelMenu");
	
	var iTopTable = 106;
	var iLeftTable = 0 ;
	
	//return;
	
	if ((PanelDocument!=null) && (Main_Table_Object!=null) && (Data_Table_Object!=null) && (Cell_Data!=null) && (CellBlank!=null)&&(Cell_Line_Bottom!=null) && (HeaderTable_Object !=null)  )	{
		
		var iHeightPanelDocument = PanelDocument.offsetHeight;

		if ((Cell_Menu_Hor_And_Ver !=null) && ((Cell_Menu_Hor_And_Ver.offsetHeight ) >iTopTable ) )		{
			iTopTable = Cell_Menu_Hor_And_Ver.offsetHeight;
		} else {
			var SectionMenuBlank =  window.document.getElementById("SectionMenuBlank");
			
			if (Cell_Menu_Hor_And_Ver !=null)	{
				Cell_Menu_Hor_And_Ver.style.height = iTopTable ;
				if (SectionMenuBlank!=null)
				{
					SectionMenuBlank.style.height = '40%';
				}
			}
		
		}
		
		if ((LeftNavigationBanner!=null) && (LeftDarkBanner !=null))	{
			iLeftTable =  LeftNavigationBanner.offsetWidth + LeftDarkBanner.offsetWidth  ;
		}

		PanelDocument.style.height = iHeightPanelDocument ;
		Cell_Data.style.height =  Data_Table_Object.offsetHeight  ;


		if (HeaderTable_Object.style.position != 'absolute')	{
			HeaderTable_Object.style.position = 'absolute';
			HeaderTable_Object.style.top = 1;
		}
		
		
		if (PanelDocument.offsetWidth < 712)	{
			PanelDocument.style.width = 712;
		}

		HeaderTable_Object.style.width = PanelDocument.offsetWidth + CellBlank.offsetWidth -2;

	
		if (Data_Table_Object.style.position != 'absolute')	{
			Data_Table_Object.style.position = 'absolute';
			Data_Table_Object.style.zIndex = 2;
		}

		
		HeaderTable_Object.style.top =iTopTable +48;
		HeaderTable_Object.style.left = iLeftTable+2;


		Data_Table_Object.style.top =iTopTable +48 ;
		Data_Table_Object.style.left = iLeftTable+2;
		
		var Cell_Line_Bottom_Obj = window.document.getElementById("Cell_Line_Bottom_Obj");

		if (bw.ie==1)
		{
			if (Cell_Line_Bottom_Obj!=null)
			{
				Cell_Line_Bottom_Obj.style.height = 38;
			}
		} else {
			if (Cell_Line_Bottom_Obj!=null)
			{
				Cell_Line_Bottom_Obj.style.height = 20;
			}
		}
		

		if( (CellSectionImages !=null) && (CellSectionImages.offsetHeight > iTopTable ))	{
			CellBlank.style.height = CellSectionImages.offsetHeight - iTopTable;
			if (CellBlank.offsetHeight > 20)
			{
				CellBlank.style.height  = 1;
			}
		} else if (CellSectionImages !=null){
			CellSectionImages.style.height = iTopTable ;
			CellBlank.style.height = 50;
		}
		
		HeaderTable_Object.className = 'TableBackgroundCaption' ;
	}


	//Process for bottom and top menu 

	var Container_TopMenu  = window.document.getElementById("Container_TopMenu");
	var TopMenu_FlatMenu10  = window.document.getElementById("TopMenu_FlatMenu10");
	var Container_BottomMenu  = window.document.getElementById("Container_BottomMenu");
	var BlankCell_BottomMenu  = window.document.getElementById("BlankCell_BottomMenu");
	var BottomMenu_PanelMenu  = window.document.getElementById("BottomMenu_PanelMenu");

	if ((Container_TopMenu!=null) && (TopMenu_FlatMenu10!=null) && (Container_BottomMenu!=null) &&(BlankCell_BottomMenu!=null) && (BottomMenu_PanelMenu!=null)) {

		Container_BottomMenu.style.width = TopMenu_FlatMenu10.offsetWidth ;

		if (bw.opera==1)
		{
			BottomMenu_PanelMenu.style.width = TopMenu_FlatMenu10.offsetWidth ;
		}
		
		BlankCell_BottomMenu.style.width = Container_TopMenu.offsetWidth - TopMenu_FlatMenu10.offsetWidth ;
	}
	
	FixSizeForInformation();
}

///Process for size of textfield in Opera and netscape
function FixSizeForInformation() {
	
	if (bw.ns == 1){

		var CellCounttry = window.document.getElementById("CellCounttry");
		if (CellCounttry!=null){
			CellCounttry.style.width = '62px';
		}

		var CellEMail = window.document.getElementById("CellEMail");
		var EMailServer = window.document.getElementById("EMailServer");

		if  ((CellEMail!=null) && (EMailServer!=null)){
			CellEMail.style.width = '310px';
			EMailServer.style.width = '240px';
		}
	}

	if (bw.opera == 1){
		
		var EMailServer = window.document.getElementById("EMailServer");
		var Sector = window.document.getElementById("Sector");
		var selectCountry = window.document.getElementById("selectCountry");
		if  ((EMailServer!=null) && (Sector!=null) && (selectCountry!=null) ){
			EMailServer.style.width = '247px';
			Sector.style.width = '185px';
			selectCountry.style.width = '185px';
		}
	}
	
}



// Fix the error of Netscape Version 4 
function MM_reloadPage(init) {  
  if (init==true) {
	  with (navigator)  {
		if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
			document.MM_pgW=innerWidth; 
			document.MM_pgH=innerHeight; 
			onresize=MM_reloadPage; 
		}
	  }
  } else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
// Reloads the window if Nav4 resized
MM_reloadPage(true);

// Check Browser
function lib_bwcheck(){ 
  this.ver=navigator.appVersion;
  this.agent=navigator.userAgent;
  this.dom=document.getElementById?1:0;
  this.opera=this.agent.indexOf("Opera")>-1 ;

  this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera)?1:0; 
  this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera)?1:0;
  this.ie7=(this.ver.indexOf("MSIE 7")>-1 && this.dom && !this.opera)?1:0;
  this.ie4=(document.all && !this.dom && !this.opera)?1:0;
  this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
  this.ns4=(document.layers && !this.dom)?1:0;
	
  this.mo = this.agent.indexOf("Mozilla")>-1 ;
  
  this.ie=this.ie4||this.ie5||this.ie6||this.ie7;
  this.ns=this.ns6||this.ns4;
  this.mac=this.agent.indexOf("Mac")>-1;
 
  this.bw=(this.ie7||this.ie6||this.ie5||this.ie4||this.ns4||this.ns6||this.opera||this.mo);
  return this;
}
// Check Browser Object
bw = new lib_bwcheck() 

