// Function for dynamically including the right lang.js file depending on which directory it is called from
// Example: URL is http://www.oracle.com/nz/index.html => This will include /global/nz/admin/jscripts/lang.js
// Example: URL is http://www.oracle.com/global/nz/index.html => This will include /global/nz/admin/jscripts/lang.js
// Written by Dom Lindars 18-JUL-2004

// Including the default lang.js so the variables are defined, so if the dynamic lang fails it still renders

langJS_Version = 2;

readInfoCookie()

var uname = ORA_UCM_INFO.firstname; //getName(user_info)
var topnav = new Array(10)
for (var i = 0; i < topnav.length; i++ ) topnav[i] = new item(i);

var tab = new Array(15)
for (var i = 0; i < tab.length; i++ ) tab[i] = new item(i);

function item(Id){
  this.id = Id, this.label = '', this.url = '', this.target = '_top'
}

function option(i){
  this.id = i, this.label = '', this.url = '';
  return this;
}

///-- DON'T TOUCH ABOVE THIS LINE

var strings = new Object()
strings.language_root  	=  ""
strings.countryselect   = "Worldwide"
strings.search_label    = "search site"
strings.search_URL      = "/ultrasearch/wwws/searchoc.jsp"
strings.print_label    	= "Printer View"
strings.mail_label     	= "Tell a Friend"
strings.mail_URL		    = "/admin/account/mail.html"
strings.rate_label     	= "Rate This Page"
strings.rate_URL		    = "/admin/account/rate.html"
strings.salesrep_label  = "Contact a Sales Rep"
strings.salesrep_URL	  = "/admin/account/sales.html"
strings.subscribe_label	= "Subscribe"
strings.subscribe_URL	  = "/subscribe/subscribe_smallwindow.html"
strings.glossary_label	= "Glossary"
strings.glossary_URL	  = "/glossary/axx.html"
strings.signin_label	  = "Register"
strings.signin_URL		  = "/admin/account/index.html"
strings.signout_label	  = "Sign Out"
strings.account_label	  = "Account"
strings.ident_label    	= "Welcome " + uname
strings.mem1_label     	= "If you are not " + uname + ", "
strings.mem2_label     	= "for a free Oracle Web account"
// footer
strings.copyright_label	  = "Copyright &copy; 2006, Oracle. All Rights Reserved"
strings.copyright_URL     = "#"
strings.aboutoracle_label	= "About Oracle"
strings.aboutoracle_URL   = "/corporate/"
strings.contactus_label	  = "Contact Us"
strings.contactus_URL     = "/corporate/contact/"
strings.rss_label	  = "RSS " + "<img src='http://oracleimg.com/admin/images/otn/xml_small.gif' width='19' height='9' border='0'>"
strings.rss_URL     = "/rss/index.html"
strings.legal_label		    = "Legal Notices and Terms of Use"
strings.legal_URL         = "/html/copyright.html"
strings.privacy_label		  = "Privacy Statement"
strings.privacy_URL       = "/html/privacy.html"
strings.oracle_logo       = "http://oracleimg.com/admin/images/ocom/oralogo_small.gif"

topnav[1].label     = "ORACLE.COM"
topnav[1].url       = "/index.html"
topnav[1].target    = "_top"
topnav[2].label     = "TECHNOLOGY NETWORK"
topnav[2].url       = "/technology/index.html"
topnav[2].target    = "_top"
topnav[3].label     = "PARTNERS"
topnav[3].url       = "/partners/index.html"
topnav[3].target    = "_top"
topnav[4].label     = "STORE"
topnav[4].url       = "http://oraclestore.oracle.com"
topnav[4].target    = "_top"
topnav[5].label     = "SUPPORT"
topnav[5].url       = "/support/index.html"
topnav[5].target    = "_top"
TopNavVal = 5;

tab[1].label = "PRODUCTS"
tab[1].url = "/products/index.html"
tab[2].label = "SOLUTIONS"
tab[2].url = "/solutions/index.html"
tab[3].label = "CUSTOMER SUCCESSES"
tab[3].url = "/customers/index.html"
tab[4].label = "SERVICES"
tab[4].url = "/services/index.html"
tab[5].label = "ORACLE"
tab[5].url = "/corporate/index.html"
TabMaxVal = 5;

// define the country list
var c1 = [
     [ "Worldwide", "" ],
     [ "Argentina", "/ar/" ],
     [ "Australia", "/au/" ],
     [ "Austria", "/at/" ],
     [ "Bahrain", "/me/" ],
     [ "Bangladesh", "/pk/" ],
     [ "Belgium & Luxembourg", "/be/" ],
     [ "Bosnia", "/ba/" ],
     [ "Bhutan", "/pk/" ],
     [ "Brasil", "/br/" ],
     [ "Bulgaria", "/bg/" ],
     [ "Brunei", "/pk/" ],
     [ "Cambodia", "/pk/" ],
     [ "Canada - English", "/ca-en/" ],
     [ "Canada - French", "/ca-fr/" ],
     [ "Chile", "/cl/" ],
     [ "China", "/cn/" ],
     [ "Colombia", "/co/" ],
     [ "Costa Rica", "/cr/" ],
     [ "Croatia", "/hr/" ],
     [ "Czech Republic", "/cz/" ],
     [ "Denmark", "/dk/" ],
     [ "Ecuador", "/ec/" ],
     [ "Egypt", "/me/" ],
     [ "Estonia", "/ee/" ],
     [ "Finland", "/fi/" ],
     [ "France", "/fr/" ],
     [ "Germany", "/de/" ],
     [ "Greece", "/gr/" ],
     [ "Hong Kong", "/hk/" ],
     [ "Hungary", "/hu/" ],
     [ "India", "/in/" ],
     [ "Indonesia", "/ea/" ],
     [ "Ireland", "/ie/" ],
     [ "Israel", "/il/" ],
     [ "Italy", "/it/" ],
     [ "Japan", "http://www.oracle.co.jp" ],
     [ "Jordan", "/me/" ],
	 [ "Kazakhstan", "/ru/" ],
     [ "Korea", "/kr/" ],
     [ "Kuwait", "/me/" ],
     [ "Laos", "/pk/" ],
     [ "Latvia", "/lv/" ],
     [ "Lebanon", "/me/" ],
     [ "Lithuania", "/lt/" ],
     [ "Malaysia", "/my/" ],
     [ "Maldives", "/pk/" ],
	 [ "Malta", "/global/mt/" ],
     [ "Mexico", "/mx/" ],
	 [ "Moldova", "/ru/" ],
     [ "Nepal", "/pk/" ],
     [ "Netherlands", "/nl/" ],
     [ "New Zealand", "/nz/" ],
     [ "Norway", "/no/" ],
     [ "Oman", "/me/" ],
     [ "Pakistan", "/pk/" ],
     [ "Peru", "/pe/" ],
     [ "Philippines", "/ea/" ],
     [ "Poland", "/pl/" ],
     [ "Portugal", "/pt/" ],
     [ "Puerto Rico", "/pr/" ],
     [ "Qatar", "/me/" ],
     [ "Romania", "/ro/" ],
     [ "Russia", "/ru/" ],
     [ "Saudi Arabia", "/me/" ],
     [ "Serbia & Montenegro", "/yu/" ],
     [ "Singapore", "/ea/" ],
     [ "Slovakia", "/sk/" ],
     [ "Slovenia", "/si/" ],
     [ "South Africa", "/za/" ],
     [ "Spain", "/es/" ],
     [ "Sri Lanka", "/pk/" ],
     [ "Sweden", "/se/" ],
     [ "Switzerland -- French", "/ch-fr/" ],
     [ "Switzerland -- German", "/ch-de/" ],
     [ "Taiwan", "/tw/" ],
     [ "Thailand", "/th/" ],
     [ "Turkey", "/tr/" ],
	 [ "Ukraine", "/ru/" ],
     [ "United Arab Emirates", "/me/" ],
     [ "United Kingdom", "/uk/" ],
     [ "United States", "/" ],
     [ "Venezuela", "/ve/" ],
     [ "Yemen", "/me/" ]
];   
var CountriesMaxVal = 70;

// Start of lang_include.js dynamic lang.js include

var Str = window.location.pathname;
Str = Str.substring( 1 );
Str = Str.substring( 0, Str.indexOf( '/' ) );
//Str = Str.replace( /\/wocportal\/page\/wocprod\/ocom/, '' );

//var countryCode = '';
 if(countryCode == null) var countryCode = '';
 if(countryCode != '') document.write( '<script language=Javascript src="http://www.oracle.com/global/' + countryCode +'/admin/jscripts/lang.js"><'+'/script>' );

var LangValue = getArg('lang');

if ( LangValue && LangValue != '' )
{
  document.write( '<script language=Javascript src="' + LangValue + '"><'+'/script>' );
  document.close;
}
else if ( Str.length == 2 || Str.length == 5 )
{
  countryCode = Str;
  langJS_Version = '';
  document.write( '<script language=Javascript src="/global/' + Str + '/admin/jscripts/lang.js"><'+'/script>' );
  document.close;
}
else if ( Str == 'global' || Str == 'lang' ) // So that it works for /global/xx/ and /lang/xx/ also
{
  var Str2 = window.location.pathname;
  Str2 = Str2.substring( Str.length + 2 );
  Str2 = Str2.substring( 0, Str2.indexOf( '/' ) );
  countryCode = Str2;
  langJS_Version = '';
  document.write( '<script language=Javascript src="/' + Str + '/' + Str2 + '/admin/jscripts/lang.js"><'+'/script>' );
  document.close;
}
else if ( Str == 'cdc' ) // Allows /cdc/ to use this include files
{
  countryCode = Str;
  langJS_Version = '';
  document.write( '<script language=Javascript src="/' + Str + '/admin/jscripts/lang.js"><'+'/script>' );
  document.close;
}
else if ( Str == 'education' ) // Allows /education/ to use this include files
{
  var url = location.href;
  if ( url.indexOf( '/index.html?' ) > -1 ) 
  {
    url = url.replace( /index\.html\?/, '' );
    location.replace( url );
  }
  else
  {
    var Str2 = window.location.pathname;
    Str2 = Str2.substring( 1 );
    Str2 = Str2.substring( Str2.indexOf( '/' ) + 1 );
    Str2 = Str2.substring( 0, Str2.indexOf( '/' ) );
  
    if ( Str2 == 'lang' ) // Allows /education/lang/xx/ to use /global/xx/admin/jscripts/lang.js
    { 
      var Str3 = window.location.pathname;
      Str3 = Str3.substring( 1 );
      Str3 = Str3.substring( Str3.indexOf( '/' ) + 1 );
      Str3 = Str3.substring( Str3.indexOf( '/' ) + 1 );
      Str3 = Str3.substring( 0, Str3.indexOf( '/' ) );
      
      if ( Str3 == 'zhs' )
      {
        langJS_Version = '';
        document.write( '<script language=Javascript src="/lang/cn/admin/jscripts/lang.js"><'+'/script>' );
        langDataSetId = '9';  // China = 9
      }
      else if ( Str3 == 'zht' )
      {
        langJS_Version = '';
        document.write( '<script language=Javascript src="/lang/tw/admin/jscripts/lang.js"><'+'/script>' );
        langDataSetId = '21';  // Taiwan = 21
      }
      else    
      {
        langJS_Version = '';
        document.write( '<script language=Javascript src="/global/' + Str3 + '/admin/jscripts/lang.js"><'+'/script>' );
        countryCode = Str3;
      }
      document.close;
    }
    else
    {
      langJS_Version = '';
      document.write( '<script language=Javascript src="/' + Str + '/admin/jscripts/lang.js"><'+'/script>' );
      document.close;
    }
  }
}

// End of lang_include.js dynamic lang.js include

// Start of setting of default langDataSetId, which ends up in document.searchForm.datasetId search field 

var langDataSetId = '';

if ( countryCode != '' ) 
{
  if ( countryCode == 'au' ) langDataSetId = '3'; // Australia = 3
  else if ( countryCode == 'at' ) langDataSetId = '4'; // Austria = 4
  else if ( countryCode == 'be' ) langDataSetId = '5';  // Belgium = 5
  else if ( countryCode == 'br' ) langDataSetId = '6';  // Brazil = 6
  else if ( countryCode == 'bg' ) langDataSetId = '7';  // Bulgaria = 7
  else if ( countryCode == 'ca' ) langDataSetId = '8';  // Canada = 8
  else if ( countryCode == 'ca-en' ) langDataSetId = '8';  // Canada = 8
  else if ( countryCode == 'ca-fr' ) langDataSetId = '8';  // Canada = 8
  else if ( countryCode == 'cn' ) langDataSetId = '9';  // China = 9
  else if ( countryCode == 'hr' ) langDataSetId = '10';  // Croatia = 10
  else if ( countryCode == 'cz' ) langDataSetId = '11';  // Czech = 11
  else if ( countryCode == 'dk' ) langDataSetId = '12';  // Denmark = 12
  else if ( countryCode == 'fr' ) langDataSetId = '13';  // France = 13
  else if ( countryCode == 'de' ) langDataSetId = '14';  // Germany = 14
  else if ( countryCode == 'it' ) langDataSetId = '15';  // Italy = 15
  else if ( countryCode == 'kr' ) langDataSetId = '16';  // Korea = 16
  else if ( countryCode == 'ln' ) langDataSetId = '17';  // Latin America = 17
  else if ( countryCode == 'ln-es' ) langDataSetId = '17';  // Latin America = 17
  else if ( countryCode == 'ln-pt' ) langDataSetId = '17';  // Latin America = 17
  else if ( countryCode == 'uk' ) langDataSetId = '18';  // UK = 18
  else if ( countryCode == 'pt' ) langDataSetId = '19';  // Portugal = 19
  else if ( countryCode == 'es' ) langDataSetId = '20';  // Spain = 20
  else if ( countryCode == 'tw' ) langDataSetId = '21';  // Taiwan = 21
}

// End of setting of default langDataSetId, which ends up in document.searchForm.datasetId search field 


