/*====================================================================
Camundanet.com  JavaScript Library v.1b
======================================================================
Developed by Hapu Estudio Creativo(R).                http://hapu.net/
         This code is released under GPL (GNU Public License)
Feel free to edit/use [at OWN risk] so long as you keep this copyright
Please, let we know if this code is useful, if you update it, comments
  and suggestions to php@hapu.net -- Donations are welcomed! :)
____________________________________________________________________*/

camundanet_format_form  = '<div style="margin-top:5px;"><center>Comuníquese telefónicamente con nosotros desde la ciudad más cercana a su ubicación a través de <A HREF="http://www.camundanet.com" target="_blank" style="text-decoration:none;color:#000060;">camundaNET</A></div><div style="margin-top:7px">#SELECT1 #SELECT2</center></div>';
camundanet_txt_country  = 'País...';
camundanet_txt_city     = 'Ciudad...';
camundanet_format_print = 'Comuníquese telefónicamente con nosotros desde<br><b>#CITY, #COUNTRY</b>.<br>Llame al <b>#TEL</b> e ingrese <b>#INT</b><br><div style="font-size:0.8em;padding-top:4px;text-align:right;"><A HREF=#RESET style="text-decoration:none;color:#000060;">Seleccionar otra ciudad</A></div>';

var camundanet_country = new Object();
var camundanet_city    = new Object();
camundanet_country['AR'] = 'Argentina (54)';
   camundanet_city['AR']  = new Object();
   camundanet_city['AR']['Buenos Aires'] = '(11) 5273-4000';
   camundanet_city['AR']['Bahía Blanca'] = '(291) 485-4000';
   camundanet_city['AR']['Córdoba'] = '(351) 569-4000';
   camundanet_city['AR']['La Plata'] = '(221) 446-4000';
   camundanet_city['AR']['Mar del Plata'] = '(223) 432-1700';
   camundanet_city['AR']['Mendoza'] = '(261) 476-4000';
   camundanet_city['AR']['Rosario'] = '(341) 527-4000';
camundanet_country['AU'] = 'Australia (61)';
   camundanet_city['AU']  = new Object();
   camundanet_city['AU']['Adelaide'] = '(8) 7421-2359*';
   camundanet_city['AU']['Brisbane'] = '(7) 3018-2881*';
   camundanet_city['AU']['Melbourne'] = '(3) 8807-2174*';
   camundanet_city['AU']['Perth'] = '(8) 9282-3229*';
   camundanet_city['AU']['Sydney'] = '(2) 8307-3881*';
camundanet_country['AT'] = 'Austria (43)';
   camundanet_city['AT']  = new Object();
   camundanet_city['AT']['Número Nacional'] = '(7) 209-02010*';
camundanet_country['BE'] = 'Bélgica (32)';
   camundanet_city['BE']  = new Object();
   camundanet_city['BE']['Antwerp'] = '(3) 747-00-20*';
   camundanet_city['BE']['Brussels'] = '(2) 747-00-20*';
camundanet_country['BR'] = 'Brasil (55)';
   camundanet_city['BR']  = new Object();
   camundanet_city['BR']['Florianopolis'] = '(48) 3027-2671';
   camundanet_city['BR']['Porto Alegre'] = '(51) 3376-0573';
   camundanet_city['BR']['Rio de Janeiro'] = '(21) 3002-0480';
   camundanet_city['BR']['San Pablo'] = '(11) 3301-5426';
camundanet_country['CA'] = 'Canadá (1)';
   camundanet_city['CA']  = new Object();
   camundanet_city['CA']['Calgary'] = '(403) 775-2208*';
   camundanet_city['CA']['Edmont'] = '(780) 628-3504*';
   camundanet_city['CA']['Halifax'] = '(902) 482-3738*';
   camundanet_city['CA']['Kitchener'] = '(519) 957-1904*';
   camundanet_city['CA']['Ottawa'] = '(613) 686-1602*';
   camundanet_city['CA']['Quebec City'] = '(418) 948-3307*';
   camundanet_city['CA']['Vancouver'] = '(604) 628-4266*';
   camundanet_city['CA']['Winipeg'] = '(204) 480-4085*';
camundanet_country['CL'] = 'Chile (56)';
   camundanet_city['CL']  = new Object();
   camundanet_city['CL']['Santiago'] = '(2) 595-2813';
   camundanet_city['CL']['Valparaiso'] = '(3) 276-8427';
camundanet_country['ES'] = 'España (34)';
   camundanet_city['ES']  = new Object();
   camundanet_city['ES']['Número Nacional'] = '(902) 900-060*';
   camundanet_city['ES']['Baleares'] = '(97) 157-99-12*';
   camundanet_city['ES']['Barcelona'] = '(93) 396-80-00*';
   camundanet_city['ES']['Bilbao'] = '(94) 434-47-90*';
   camundanet_city['ES']['Cádiz'] = '(95) 692-07-01';
   camundanet_city['ES']['Gerona'] = '(97) 298-29-40*';
   camundanet_city['ES']['Lleida'] = '(97) 398-29-40*';
   camundanet_city['ES']['Madrid'] = '(91) 151-67-49';
   camundanet_city['ES']['Malaga'] = '(95) 123-98-22';
   camundanet_city['ES']['Sevilla'] = '(95) 439-49-40*';
   camundanet_city['ES']['Tarragona'] = '(97) 727-19-40*';
   camundanet_city['ES']['Tenerife'] = '(92) 298-02-28';
   camundanet_city['ES']['Valencia'] = '(96) 112-84-10*';
camundanet_country['US'] = 'Estados Unidos (1)';
   camundanet_city['US']  = new Object();
   camundanet_city['US']['Nueva York, NY'] = '(347) 632-4433';
   camundanet_city['US']['Anaheim, CA'] = '(714) 333-0397*';
   camundanet_city['US']['Baltimore'] = '(443) 455-0697*';
   camundanet_city['US']['Birmingham'] = '(121) 314-8447*';
   camundanet_city['US']['Boise, ID'] = '(208) 906-1197*';
   camundanet_city['US']['Buffalo, NY'] = '(716) 200-1692*';
   camundanet_city['US']['Burbank, CA'] = '(818) 688-2797*';
   camundanet_city['US']['Clearwater'] = '(727) 470-7697*';
   camundanet_city['US']['Denver, CO'] = '(303) 997-1197*';
   camundanet_city['US']['Freemont-Newawk, CA'] = '(510) 248-0397*';
   camundanet_city['US']['Jacksonville'] = '(904) 647-0897*';
   camundanet_city['US']['Jersey City'] = '(201) 984-1823*';
   camundanet_city['US']['Keys'] = '(305) 890-1597*';
   camundanet_city['US']['Las Vegas, NV'] = '(702) 553-2797*';
   camundanet_city['US']['Los Angeles, CA'] = '(323) 375-2897*';
   camundanet_city['US']['Michigan'] = '(616) 608-0509*';
   camundanet_city['US']['New York, NY'] = '(646) 291-2168*';
   camundanet_city['US']['Norwalk, CA'] = '(562) 262-0897*';
   camundanet_city['US']['Oakland Berkeley, CA'] = '(510) 495-6397*';
   camundanet_city['US']['Oakland Trinidad, CA'] = '(510) 544-4497*';
   camundanet_city['US']['Ogden, UT'] = '(801) 823-1197*';
   camundanet_city['US']['Orlando, FL'] = '(321) 445-0797*';
   camundanet_city['US']['Palo Alto, CA'] = '(650) 644-1997*';
   camundanet_city['US']['Passadena, CA'] = '(626) 243-2197*';
   camundanet_city['US']['Philadelphia'] = '(267) 861-0797*';
   camundanet_city['US']['Pittsburge'] = '(412) 360-7797*';
   camundanet_city['US']['Portland, OR'] = '(503) 334-0597*';
   camundanet_city['US']['Reno, NV'] = '(775) 562-4697*';
   camundanet_city['US']['Sacramento, CA'] = '(916) 313-3897*';
   camundanet_city['US']['Salt Lake City, UT'] = '(801) 618-0497*';
   camundanet_city['US']['San Diego, CA'] = '(619) 393-1797*';
   camundanet_city['US']['San Francisco, CA'] = '(415) 376-7297*';
   camundanet_city['US']['San Jose, CA'] = '(408) 538-2197*';
   camundanet_city['US']['San Mateo, CA'] = '(650) 523-6897*';
   camundanet_city['US']['San Rafael, CA'] = '(415) 223-4197*';
   camundanet_city['US']['Santa Barbara, CA'] = '(805) 456-8597*';
   camundanet_city['US']['Santa Cruz, CA'] = '(831) 480-3997*';
   camundanet_city['US']['Santa Monica, CA'] = '(310) 862-5297*';
   camundanet_city['US']['Sarasota'] = '(941) 487-7697*';
   camundanet_city['US']['Seattle, WA'] = '(206) 829-6497*';
   camundanet_city['US']['Spokane, WA'] = '(509) 931-0297*';
   camundanet_city['US']['Tacoma, WA'] = '(253) 617-4597*';
   camundanet_city['US']['Tampa, FL'] = '(813) 574-0797*';
   camundanet_city['US']['Torrance, CA'] = '(310) 294-8397*';
   camundanet_city['US']['Twin Cities, MN'] = '(612) 235-6188*';
   camundanet_city['US']['Walnut Creek, CA'] = '(925) 891-8297*';
   camundanet_city['US']['Washington DC'] = '(202) 552-1297*';
   camundanet_city['US']['Wilmington'] = '(302) 824-0697';
camundanet_country['FR'] = 'Francia (33)';
   camundanet_city['FR']  = new Object();
   camundanet_city['FR']['Paris'] = '(1) 72-09-04-04*';
camundanet_country['NL'] = 'Holanda (31)';
   camundanet_city['NL']  = new Object();
   camundanet_city['NL']['Utretch'] = '(30) 711-0327*';
camundanet_country['IE'] = 'Irlanda (353)';
   camundanet_city['IE']  = new Object();
   camundanet_city['IE']['Número Nacional'] = '(766) 022026*';
   camundanet_city['IE']['Dublin'] = '(1) 4361726*';
camundanet_country['IT'] = 'Italia (39)';
   camundanet_city['IT']  = new Object();
   camundanet_city['IT']['Milano'] = '(02) 4507-3696';
   camundanet_city['IT']['Roma'] = '(06) 9028-3706';
   camundanet_city['IT']['Torino'] = '(011) 1982-3396';
camundanet_country['MX'] = 'Mexico (52)';
   camundanet_city['MX']  = new Object();
   camundanet_city['MX']['Mexico DF'] = '(55) 1163-8949';
   camundanet_city['MX']['Aguascalientes'] = '(44) 9235-8197';
   camundanet_city['MX']['Guadalajara'] = '(33) 5004-0781';
   camundanet_city['MX']['León'] = '(47) 7493-8181';
   camundanet_city['MX']['Monterrey'] = '(81) 5030-7419';
   camundanet_city['MX']['Puebla '] = '(22) 2462-9655';
camundanet_country['PT'] = 'Portugal (351)';
   camundanet_city['PT']  = new Object();
   camundanet_city['PT']['Lisboa'] = '210100299*';
camundanet_country['RO'] = 'Rumania (40)';
   camundanet_city['RO']  = new Object();
   camundanet_city['RO']['Número Nacional'] = '(31) 71-00055*';
camundanet_country['UK'] = 'Reino Unido (44)';
   camundanet_city['UK']  = new Object();
   camundanet_city['UK']['Número Nacional'] = '(870) 478-1699';
   camundanet_city['UK']['Cambridge'] = '(1223) 858-747*';
   camundanet_city['UK']['Edinburh'] = '(131) 516-8747*';
   camundanet_city['UK']['Leeds'] = '(113) 350-8747*';
   camundanet_city['UK']['Liverpool'] = '(151) 601-8747*';
   camundanet_city['UK']['London'] = '(20) 7100-6747*';
   camundanet_city['UK']['Manchester'] = '(161) 660-8447*';
   camundanet_city['UK']['Nottingham'] = '(115) 871-8347*';
   camundanet_city['UK']['Oxford'] = '(1865) 988-147*';
camundanet_country['SE'] = 'Suecia (46)';
   camundanet_city['SE']  = new Object();
   camundanet_city['SE']['Malmo'] = '(40) 690-5090*';
camundanet_country['CH'] = 'Suiza (41)';
   camundanet_city['CH']  = new Object();
   camundanet_city['CH']['Basel'] = '(61) 511-7717*';
   camundanet_city['CH']['Biel'] = '(32) 511-9010*';
   camundanet_city['CH']['Zurich'] = '(44) 500-9109*';

/*====================================================================
JS Function: chngContent()                               v.01-Nov-2005
----------------------------------------------------------------------
Author: Ariel Filipiak <ary@hapu.net>                      01-Nov-2005
Copyright(c)2002-2006 Hapu Estudio Creativo(R)         http://hapu.net
Feel free to edit/use [at OWN risk] so long as you keep this copyright
====================================================================*/
function chngContent(id,content){
    if (document.all) {                     // IE
        document.all[id].innerHTML=content;
    } else if (document.layers) {           // NS
        document.layers[id].document.open();
        document.layers[id].document.write(content);
        document.layers[id].document.close();
    } else if (document.getElementById){    // FF
        r = document.createRange();
        e = document.getElementById(id);
        r.setStartBefore(e);
        htmlFrag = r.createContextualFragment(content);
        while (e.hasChildNodes()) e.removeChild(e.lastChild);
        e.appendChild(htmlFrag);
    }
}

/*====================================================================
JS Function: chrgCamundanetCities()                      v.20-Sep-2006
----------------------------------------------------------------------
Author: Ariel Filipiak <ary@hapu.net>                      20-Sep-2006
Copyright(c)2002-2006 Hapu Estudio Creativo(R)         http://hapu.net
Feel free to edit/use [at OWN risk] so long as you keep this copyright
====================================================================*/
function chrgCamundanetCities(obj,city_field) {
    obj.form[city_field].options.length = 0;
    obj.form[city_field].options[0] = new Option(camundanet_txt_city,'');
	obj.form[city_field].options[0].defaultSelected = true;
	obj.form[city_field].options[0].selected = true;
    i = 1;
    for (c in camundanet_city[obj[obj.selectedIndex].value]) {
        obj.form[city_field].options[i] = new Option(c,camundanet_city[obj[obj.selectedIndex].value][c]);
        i++;
    }
}

/*====================================================================
JS Function: stringCamundanetForm()                      v.20-Sep-2006
----------------------------------------------------------------------
Author: Ariel Filipiak <ary@hapu.net>                      20-Sep-2006
Copyright(c)2002-2006 Hapu Estudio Creativo(R)         http://hapu.net
Feel free to edit/use [at OWN risk] so long as you keep this copyright
====================================================================*/
function stringCamundanetForm(camunda_num,id,country_code) {
    select1 = '<select class="camundanet_select1" name="camundanet_country" onChange="chrgCamundanetCities(this,\'camundanet_city\');\"><option value="">' + camundanet_txt_country;
    for (c in camundanet_country)
        select1+= '<option value="' + c + '"' + (typeof(country_code)!='undefined' && c == country_code ? ' selected' : '') + '>' + camundanet_country[c];
    select1+= '</select>';

    select2 = '<select class="camundanet_select2" name="camundanet_city" onChange="printCamundanetPhone(this,\'camundanet_country\',\'' + camunda_num + '\',\'' + id + '\');">' +
              '<option value="">' + camundanet_txt_city;
    if (typeof(country_code)!='undefined') {
        for (c in camundanet_city[country_code])
            select2+= '<option value="' + camundanet_city[country_code][c] + '">' + c;
    }
    select2 += '</select>';
    string  = '<form style="margin:0px;";>' + camundanet_format_form.replace('#SELECT1',select1);
    string  = string.replace('#SELECT2',select2) + '</form>';
    return string;
}

/*====================================================================
JS Function: printCamundanetPhone()                      v.20-Sep-2006
----------------------------------------------------------------------
Author: Ariel Filipiak <ary@hapu.net>                      20-Sep-2006
Copyright(c)2002-2006 Hapu Estudio Creativo(R)         http://hapu.net
Feel free to edit/use [at OWN risk] so long as you keep this copyright
====================================================================*/
function printCamundanetPhone(obj,country_field,camunda_num,id) {
    country_code = obj.form[country_field].options[obj.form[country_field].options.selectedIndex].value;
    country = obj.form[country_field].options[obj.form[country_field].options.selectedIndex].text;
    country = country.substr(0,country.lastIndexOf(' ('));
    city    = obj.options[obj.options.selectedIndex].text;
    phone   = obj.options[obj.options.selectedIndex].value;
    sipbro  = '';
    if ((i = phone.lastIndexOf('*'))>0) {
        phone   = phone.substr(0,i);
        sipbro  = '*7538-';
    }
    string  = camundanet_format_print.replace('#COUNTRY',country);
    string  = string.replace('#CITY',city);
    string  = string.replace('#TEL',phone);
    string  = string.replace('#INT',sipbro + camunda_num);
    string  = string.replace('#RESET','"javascript:void(null)" onClick="chngContent(\'' + id + '\',stringCamundanetForm(\'' + camunda_num + '\',\'' + id + '\',\'' + country_code + '\'));"');
    chngContent(id,string);
}

/*====================================================================
JS Function: printCamundanet()                           v.20-Sep-2006
----------------------------------------------------------------------
Author: Ariel Filipiak <ary@hapu.net>                      20-Sep-2006
Copyright(c)2002-2006 Hapu Estudio Creativo(R)         http://hapu.net
Feel free to edit/use [at OWN risk] so long as you keep this copyright
====================================================================*/
function printCamundanet(camunda_num,id,w,h,country_code) {
    document.write('<div id="' + id + '" style="width:' + w + 'px;height:' + h + 'px"  class="camundanet"><layer name="' + id + '" width="' + w + 'px" height="' + h + 'px">' + stringCamundanetForm(camunda_num,id,country_code) + '</layer></div>');
}