var hasFlash
var pagecheck
var mFlash
var homeFlash = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='965' height='520' id='site_wyeth' align='top'><param name='allowScriptAccess' value='sameDomain' /><param name='allowFullScreen' value='false' /><param name='movie' value='flash/site.swf' /><param name='quality' value='high' /><param name='bgcolor' value='#ffffff' /><embed src='flash/site.swf' quality='high' bgcolor='#ffffff' width='965' height='520' name='site_wyeth' align='top' allowScriptAccess='sameDomain' allowFullScreen='false' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' /></object>"
var homeAFlash = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='965' height='275' id='arthritis_wyeth' align='middle'><param name='allowScriptAccess' value='sameDomain' /><param name='allowFullScreen' value='false' /><param name='movie' value='flash/arthritis_wyeth.swf' /><param name='quality' value='high' /><param name='bgcolor' value='#ffffff' /><embed src='flash/arthritis_wyeth.swf' quality='high' bgcolor='#ffffff' width='965' height='275' name='arthritis_wyeth' align='middle' allowScriptAccess='sameDomain' allowFullScreen='false' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' /></object>"
var fullFlash = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='325' height='130' id='callouts_wyeth' align='top'><param name='allowScriptAccess' value='sameDomain' /><param name='allowFullScreen' value='false' /><param name='movie' value='flash/callouts_wyeth.swf' /><param name='quality' value='high' /><param name='bgcolor' value='#ffffff' /><embed src='flash/callouts_wyeth.swf' quality='high' bgcolor='#ffffff' width='325' height='130' name='callouts_wyeth' align='top' allowScriptAccess='sameDomain' allowFullScreen='false' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"
var EmbedTag = "<embed type='application/x-shockwave-flash' src='flash/callouts_wyeth.swf' style='' id='callouts' name='callouts' bgcolor='#FFFFFF' quality='best' width='325' height='130'>"
var mImage = "<img src='images/common/top_right_flash_image_nonew.jpg' border='0' />"
var hAImage = "<img src='images/arthritis_landing/no_flash_header.jpg' border='0' />"
var hImage = "<img src='images/common/main_image.jpg' border='0' />"
function FlashLoadCheck() {
    if (pluginlist.indexOf("Flash")!=-1){
        //Flash Installed
        hasFlash = true
    } else {
        //No Flash
        hasFlash = false
    }
    CheckMens()
}
function CheckMens(){
    var tmp
    tmp = window.location.href
    pagecheck = false
    if(tmp.indexOf("/menstrual/") > -1){
        pagecheck = true
    }
}
function LoadHomeFlash(){
    FlashLoadCheck()
    if(hasFlash == true){
        so = new SWFObject("flash/shell.swf", "index", "965", "520", "8", "#FFFFFF");
        so.useExpressInstall("flash/expressinstall.swf");
        so.addParam("quality", "best");
        so.write("flashContent");
    } else {
        document.getElementById("flashContent").innerHTML = hImage
    }
}
function LoadAHomeFlash(){
    FlashLoadCheck()
    if(hasFlash == true){
        document.getElementById("flashContent").innerHTML = homeAFlash
    } else {
        document.getElementById("flashContent").innerHTML = hAImage
    }
}
function LoadSubFlash(){
    FlashLoadCheck()
    if(hasFlash == true){
        var tmp
        tmp = window.location.href
        if(tmp.indexOf("/contact_us.aspx") < 1){
            document.getElementById("flashContent2").innerHTML = fullFlash
        }
    } else {
        document.getElementById("flashContent2").innerHTML = mImage
    }
}
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');

function change_country(country){
	if(country != ""){
		Set_Cookie('beenHere', country, expires_date);
		switch (country) {
   			case 'com' : 
			window.location.replace('/index.aspx'); 
			break;
  			case 'de' : 
			window.location.replace('http://www.thermacare.de/index.html'); 
			break;
			case 'uk' : 
			window.location.replace('http://www.thermacare.co.uk/index.html'); 
			break;
			case 'caen' : 
			window.location.replace('http://www.thermacare.ca/en_CA/index.aspx'); 
			break;
			case 'cafr' : 
			window.location.replace('http://www.thermacare.ca/fr_CA/index.aspx'); 
			break;
		}
	}
}

function reset_country(country){
	document.forms['form1'].Country.selectedIndex  = 0;	
}

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 LeaveWyeth(tmp,tmp2){
    if(pagecheck == false){
        if(hasFlash == true){
        
            tmp6 = window.location.href
            mFlash = ""
            if(tmp6.indexOf("products-arthritis-heatwraps.aspx") < 0) { 
                mFlash = document.getElementById("flashContent2").innerHTML
                if(navigator.userAgent.indexOf('MSIE') != -1){
                    mFlash = mFlash.substring(0,mFlash.indexOf("</object>")) + EmbedTag + "</object>"
                }
                document.getElementById("flashContent2").innerHTML = mImage
            } else { //arthritis main page
                mFlash = document.getElementById("flashContent").innerHTML
                if(navigator.userAgent.indexOf('MSIE') != -1){
                    mFlash = mFlash.substring(0,mFlash.indexOf("</object>")) + EmbedTag + "</object>"
                }
                document.getElementById("flashContent").innerHTML = hAImage
            }
        }
    }
    var oWnd = radopen("leavewyeth_confirm.aspx?target=" + tmp, "" );
    oWnd.add_close(CloseRad)
    if (navigator.userAgent.indexOf('MSIE') !=-1){
        var h = (screen.height-400)/2
        var w = (screen.width-450)/2
        oWnd.moveTo(w,h)
    } else {
        oWnd.center
    }
}
function JingleLeave(tmp){
    var oWnd = radopen("leavewyeth_confirm.aspx?target=" + tmp, "" );
    oWnd.add_close(CloseRad)
    if (navigator.userAgent.indexOf('MSIE') !=-1){
        var h = (screen.height-400)/2
        var w = (screen.width-450)/2
        oWnd.moveTo(w,h)
    } else {
        oWnd.center
    }
}
function CloseRad(){
    if(hasFlash == true){
        tmp6 = window.location.href
        if(tmp6.indexOf("products-arthritis-heatwraps.aspx") < 0){
            document.getElementById("flashContent2").innerHTML = mFlash
        } else {
            document.getElementById("flashContent").innerHTML = homeAFlash
        }
    }
}