function bwwNewWindow(strMyPage, strMyName, intWidth, intheight, scroll) {
	var intWidth;   // width and height of the popup window, these values are in the anchor link
	var intheight;  //
	var intWinLeft = 25; // location of the popup window, this is set at the center of screen
	var intWinTop = 25;
	var strWinprops = 'height='+intheight+',width='+intWidth+',top='+intWinTop+',left='+intWinLeft+',scrollbars='+scroll+',resizable=no'; 
	var strwin = window.open(strMyPage, strMyName, strWinprops);
	if (parseInt(navigator.appVersion) >= 4) { strwin.window.focus(); }
}

function Get_Cookie(name) {
    var start = document.cookie.indexOf(name+"=");
    var len = start+name.length+1;
    if ((!start) && (name != document.cookie.substring(0,name.length))) return null;
    if (start == -1) return null;
    var end = document.cookie.indexOf(";",len);
    if (end == -1) end = document.cookie.length;
    return unescape(document.cookie.substring(len,end));
}

function Set_Cookie(name,value,expires,path,domain,secure) {
    document.cookie = name + "=" +escape(value) +
        ( (expires) ? ";expires=" + expires.toGMTString() : "") +
        ( (path) ? ";path=" + path : "") +
        ( (domain) ? ";domain=" + domain : "") +
        ( (secure) ? ";secure" : "");
}

function Delete_Cookie(name,path,domain) {
    if (Get_Cookie(name)) document.cookie = name + "=" +
        ( (path) ? ";path=" + path : "") +
        ( (domain) ? ";domain=" + domain : "") +
        ";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}

var days = 14; // valid two weeks from now

function isCookieEnabled() {
   if (document.all) return navigator.cookieEnabled;
   Set_Cookie('testcookie',today.getTime());
   var tc = Get_Cookie('testcookie');
   Delete_Cookie('testcookie');
   return (tc == today.getTime());
}

var today = new Date();
var zero_date = new Date(0,0,0);
today.setTime(today.getTime() - zero_date.getTime());

var todays_date = new
Date(today.getYear(),today.getMonth(),today.getDate(),0,0,0);
var expires_date = new Date(todays_date.getTime() + (days * 86400000));

var beenHere = Get_Cookie('beenHere');
//alert(beenHere);
switch (beenHere) {
		case 'ca' :
		window.location.replace('http://www.fixodent.ca');
		break;
		case 'cr' :
		window.location.replace('http://www.pg.com.hr/products/mouthcare/blendadent.shtml');
		break;
		case 'de' :
		window.location.replace('http://www.blend-a-dent.de');
		break;
		case 'hu' :
		window.location.replace('http://www.pg.hu/products/mouthcare/blendadent.shtml');
		break;
		case 'uk' :
		window.location.replace('http://fixodent.co.uk');
		break;
}

function change_country(country){
	if(country != ""){
		Set_Cookie('beenHere', country, expires_date);
		switch (country) {
   			case 'ca' :
			window.location.replace('http://www.fixodent.ca');
			break;
			case 'cr' :
			window.location.replace('http://www.pg.com.hr/products/mouthcare/blendadent.shtml');
			break;
			case 'de' :
			window.location.replace('http://www.blend-a-dent.de');
			break;
  			case 'hu' :
			window.location.replace('http://www.pg.hu/products/mouthcare/blendadent.shtml');
			break;
			case 'uk' :
			window.location.replace('http://fixodent.co.uk');
			break;
			case 'us' :
			window.location.replace('http://www.fixodent.com');
			break;
		}
	}
}
function change_language(language){
  if(language != ""){
    Set_Cookie('beenHere', language, expires_date);
    switch (language) {
      case 'en' :
      window.location.replace('/en/');
      break;
      case 'fr' :
      window.location.replace('/fr/');
      break;
    }
  }
}

function reset_country(country){
	document.forms['form1'].Country.selectedIndex  = 0;
}

