////////////////////////////////////////////////////////////////////////////
//Home Page Javascript
////////////////////////////////////////////////////////////////////////////
function readCookie(countryPref) {

	if (document.cookie == '') { 
    	return null;
	}else{

	var firstChar, lastChar;
	var theBigCookie = unescape(document.cookie);
		firstChar = theBigCookie.indexOf('nnr_country_preference');

			if(firstChar != -1)  {
				//firstChar += name.length + 1;
				lastChar = theBigCookie.indexOf(';', firstChar);

					if(lastChar == -1) lastChar = theBigCookie.length;
						var countrySetUp = unescape(theBigCookie.substring(firstChar, lastChar));
						var	country = countrySetUp.toLowerCase(); 
					 
								if (country.indexOf('australia') != -1){
									window.location='/intl.jsp?section=intl_au&country=Australia&intl_section=ho';
								}else if (country.indexOf('brazil') != -1){
									window.location='http://www.ibope.com.br/eratings/ogrupo/empresa/eratings/index.htm';	
								}else if (country.indexOf('france') != -1){
									window.location='http://www.mediametrie.com/web/eratings.html';
								}else if (country.indexOf('germany') != -1){
									window.location='/intl.jsp?section=intl_gr&country=Germany&intl_section=ho';	
								}else if (country.indexOf('hong') != -1){
									window.location='/intl.jsp?section=intl_hk&country=Hong%20Kong&intl_section=ho';	
								}else if (country.indexOf('italy') != -1){
									window.location='/intl.jsp?section=intl_it&country=Italy&intl_section=ho';	
								}else if (country.indexOf('japan') != -1){
									window.location='http://www.netratings.co.jp/';
								}else if (country.indexOf('netherlands') != -1){
									window.location='/intl.jsp?section=intl_nl&country=Netherlands&intl_section=ho';
								}else if (country.indexOf('spain') != -1){
									window.location='/intl.jsp?section=intl_sp&country=Spain&intl_section=ho';
								}else if (country.indexOf('sweden') != -1){
									window.location='/intl.jsp?section=intl_sw&country=Sweden&intl_section=ho';
								}else if (country.indexOf('switzerland') != -1){
									window.location='/intl.jsp?section=intl_sz&country=Switzerland&intl_section=ho';
								}else if (country.indexOf('kingdom') != -1){
									window.location='/intl.jsp?section=intl_uk&country=United%20Kingdom&intl_section=ho';
								}else {
								return null;
								}
									
		} else {
		return null;
	
		}

    }
}

////////////////////////////////////////////////////////////////////////////
//Country Page Javascript
////////////////////////////////////////////////////////////////////////////
function readCookie2(){

var theBigCookie = unescape(document.cookie);
var	firstChar = theBigCookie.indexOf('nnr_country_preference');

	
	

	if(firstChar == -1)  {
	CountryCookieSetter = window.open('/cookie.jsp?section=cookie_setter','CountryCookieSetter','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=222,height=222');								
		} 
   }