﻿// JScript File
var RadWin
var hasFlash
var fMap
var iMap
function CheckLoad(){
    if (pluginlist.indexOf("Flash")!=-1){
        //Has Flash
        document.getElementById("flash_content").innerHTML = "<object style='z-index: 1' classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' width='589' height='348' id='Flash_Map' align='middle'><param name='allowScriptAccess' value='sameDomain' /><param id='fla1' name='movie' value='flash/map/map.swf' /><param name='quality' value='high' /><param name='bgcolor' value='#ffffff' /><param name='mode' value='opaque'><embed id='fla2' src='flash/map/map.swf' style='z-index:1' wmode='opaque' quality='high' bgcolor='#ffffff' width='589' height='348' name='Flash_Map' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' /></object>"
    } else {
        //No Flash
        document.getElementById("flash_content").innerHTML = "<img id='global-map' src='images/global-home/map.gif' border='0' usemap='#map'><map name='map'><area onMouseOver='ChangeMap(1)' onMouseOut='ResetMap()' shape='poly' alt='United States' coords='178,169,173,169,166,167,161,166,108,166,61,156,54,160,54,172,47,188,44,202,51,232,65,248,74,250,88,259,104,262,107,260,114,262,122,272,129,277,130,275,134,272,138,274,150,292,155,293,155,285,167,274,167,270,168,269,182,270,190,272,191,268,191,266,208,262,213,264,216,265,218,263,223,265,227,272,228,278,235,284,238,287,239,285,239,280,237,274,229,257,230,249,234,244,237,238,239,235,243,230,246,220,242,216,240,208,240,203,247,202,247,192,256,185,256,170,264,161,259,157,256,153,253,153,251,164,250,167,237,172,235,180,225,186,215,199,212,195,211,190,210,188,202,179,198,185,197,192,198,198,196,202,192,200,190,184,192,178,201,175,199,172,192,176,185,174,178,176,174,176,172,176' href='Javascript: MapSelect(1)' /><area onMouseOver='ChangeMap(2)' onMouseOut='ResetMap()' shape='poly' alt='United States' coords='62,34,34,76,36,82,30,79,23,68,19,63,9,67,10,62,13,60,15,60,11,56,3,59,2,61,2,47,5,30,12,23,18,14,25,10,41,10,46,18,60,31' href='Javascript: MapSelect(1)' /><area onMouseOver='ChangeMap(3)' onMouseOut='ResetMap()' shape='poly' alt='Canada' coords='78,44,62,34,34,77,38,88,46,104,49,114,46,120,49,132,62,155,106,164,177,168,184,164,196,165,206,174,217,173,218,180,216,186,214,194,224,188,225,182,233,177,244,170,250,164,251,153,258,153,265,162,272,153,270,163,280,150,288,127,285,118,277,104,265,95,258,96,234,80,216,48,163,18,111,9' href='Javascript: MapSelect(2)' /><area onMouseOver='ChangeMap(4)' onMouseOut='ResetMap()' shape='poly' alt='United Kingdom' coords='408,53,401,63,394,69,393,73,407,72,412,76,402,92,397,95,412,105,412,114,415,129,422,137,421,146,422,148,430,149,436,157,433,162,428,164,424,169,423,171,427,173,422,179,414,180,404,179,392,180,378,180,371,181,363,182,359,182,368,174,373,172,382,170,387,169,389,164,382,165,380,164,372,158,368,157,377,153,379,148,378,143,382,141,390,137,392,131,392,122,392,119,392,113,385,113,380,114,384,103,381,100,379,96,376,102,377,96,378,92,379,88,373,88,373,81,381,70,388,60,397,56,401,57,406,50' href='Javascript: MapSelect(3)' /><area onMouseOver='ChangeMap(5)' onMouseOut='ResetMap()' shape='poly' alt='Germany' coords='98,123,506,125,516,136,526,132,537,128,547,137,545,145,548,156,552,171,553,176,552,178,546,182,539,187,528,191,528,194,534,202,544,211,540,217,534,223,538,228,524,231,516,235,511,233,507,233,503,231,494,231,489,231,484,232,482,225,484,219,485,215,488,209,481,209,474,205,473,203,471,199,468,192,470,187,469,183,468,180,468,174,469,167,474,164,477,160,477,155,479,151,480,143,487,140,497,138,494,127,500,122' href='Javascript: MapSelect(4)' /><area onMouseOver='ChangeMap(6)' onMouseOut='ResetMap()' shape='poly' alt='Austria' coords='563,211,558,210,552,215,544,216,538,221,540,228,528,230,523,233,510,235,505,235,508,241,518,241,526,239,530,240,534,245,547,246,559,245,568,241,574,236,574,231,574,227,578,222,575,216,573,212,560,211' href='Javascript: MapSelect(5)' /><area onMouseOver='ChangeMap(7)' onMouseOut='ResetMap()' shape='poly' alt='Switzerland' coords='513,243,506,248,506,250,499,249,498,256,495,256,488,248,486,251,479,254,477,253,472,249,468,249,470,244,475,238,476,234,484,236,486,233,494,232,505,233,504,237,509,242' href='Javascript: MapSelect(6)' /><area onMouseOver='ChangeMap(8)' onMouseOut='ResetMap()' shape='poly' alt='Ireland' coords='373,102,370,115,364,120,360,138,357,145,346,143,340,145,335,148,326,148,324,145,323,137,328,133,334,127,336,123,331,122,333,116,334,114,333,110,343,109,348,108,344,104,352,99,360,99,364,100' href='Javascript: MapSelect(7)' /><area onMouseOver='ChangeMap(8)' onMouseOut='ResetMap()' shape='poly' alt='Netherlands' coords='373,102,370,115,364,120,360,138,357,145,346,143,340,145,335,148,326,148,324,145,323,137,328,133,334,127,336,123,331,122,333,116,334,114,333,110,343,109,348,108,344,104,352,99,360,99,364,100' href='Javascript: MapSelect(7)' /><area onMouseOver='ChangeMap(9)' shape='polygon' coords='480,151,476,155,479,160,473,166,468,167,468,172,464,174,463,173,458,171,452,174,447,173,446,169,452,166,454,164,449,163,454,159,457,155,460,149,463,156,466,155,467,145,469,143,474,142,478,143' href='Javascript: MapSelect(9)' alt='Netherlands' /></map>"
    }
}
function ChangeMap(tmp){
    document.getElementById("global-map").src = "images/global-home/" + tmp + ".gif"
}
function ResetMap(){
    document.getElementById("global-map").src = "images/global-home/map.gif"
}
function MapSelect(tmp){
    //
     if(document.getElementById("remember_me").checked == true){
        if(tmp == 1){
            //US
            var oWnd = radopen("select_language.aspx?l=1", "" );
            RadWin = oWnd
            oWnd.center
        } else if(tmp == 2){
            //Canada
            var oWnd = radopen("select_language.aspx?l=2", "" );
            RadWin = oWnd
            oWnd.center
        } else if(tmp == 3) {
            //Germany
            document.getElementById("countryDropDownList").selectedIndex = 5;
            __doPostBack("countryDropDownList","");
        } else if(tmp == 4) {
            //United Kingdom
            document.getElementById("countryDropDownList").selectedIndex = 8;
            __doPostBack("countryDropDownList","");
        } else if(tmp == 5) {
            //Austria
            document.getElementById("countryDropDownList").selectedIndex = 1;
            __doPostBack("countryDropDownList","");
        } else if(tmp == 6) {
            //Switzerland
            document.getElementById("countryDropDownList").selectedIndex = 7;
            __doPostBack("countryDropDownList","");
        } else if(tmp == 7) {
            //Ireland
            document.getElementById("countryDropDownList").selectedIndex = 4;
            __doPostBack("countryDropDownList","");
        } else if(tmp == 9) {
            //Netherlands
            document.getElementById("countryDropDownList").selectedIndex = 6;
            window.location.href = "http://www.thermacare.nl/"
        }
    } else {
        if(tmp == 1){
            document.getElementById("countryDropDownList").selectedIndex = 9;
            var oWnd = radopen("select_language.aspx?l=1", "" );
            RadWin = oWnd
            oWnd.center
        } else if(tmp == 2){
            document.getElementById("countryDropDownList").selectedIndex = 2;
            var oWnd = radopen("select_language.aspx?l=2", "" );
            RadWin = oWnd
            oWnd.center
        } else if(tmp == 3) {
            //Germany
            document.getElementById("countryDropDownList").selectedIndex = 5;
            window.location.href = "http://www.thermacare.de/"
        } else if(tmp == 4) {
            //UK
            document.getElementById("countryDropDownList").selectedIndex = 8;
            window.location.href = "http://www.thermacare.co.uk/"
        } else if(tmp == 5) {
            //Austria
            document.getElementById("countryDropDownList").selectedIndex = 1;
            window.location.href = "http://www.thermacare.at/"
        } else if(tmp == 6) {
            //Switz
            document.getElementById("countryDropDownList").selectedIndex = 7;
            window.location.href = "http://www.thermacare.de/"
        } else if(tmp == 7) {
            //Ireland
            document.getElementById("countryDropDownList").selectedIndex = 4;
            window.location.href = "http://www.thermacare.co.uk/"
        } else if(tmp == 9) {
            //Netherlands
            document.getElementById("countryDropDownList").selectedIndex = 6;
            window.location.href = "http://www.thermacare.nl/"
        }
    }   
}

function LanguageSelected(tmp){
    RadWin.close()
    if(document.getElementById("remember_me").checked == true){
        if(tmp == 1){
            document.getElementById("countryDropDownList").selectedIndex = 8;
            __doPostBack("countryDropDownList","");
        } else if(tmp == 2){
            document.getElementById("countryDropDownList").selectedIndex = 9;
            __doPostBack("countryDropDownList","");
        } else if(tmp == 3){
            document.getElementById("countryDropDownList").selectedIndex = 2;
            __doPostBack("countryDropDownList","");
        } else if(tmp == 4){
            document.getElementById("countryDropDownList").selectedIndex = 3;
            __doPostBack("countryDropDownList","");
        } else if(tmp == 5){
            document.getElementById("countryDropDownList").selectedIndex = 1;
            __doPostBack("countryDropDownList","");
        }
    } else {
        if(tmp == 1){
            //US English
            window.location.href = "home.aspx"
        } else if(tmp == 2){
            //US Spanish
            window.location.href = "es_US/"
        } else if(tmp == 3){
            //Canadian English
            window.location.href = "http://www.thermacare.ca/en_CA/"
        } else if(tmp == 4){
            //Canadian French
            window.location.href = "http://www.thermacare.ca/fr_CA/"
        }
    }
    
}

