function initCountry(){$("#lnk_country_drop").attr("href","javascript:void(0);");$("#intl_inquiry").attr("href","javascript:void(0);");var b,a=$("#country_code").text();b=fillCountyList(a,b);curURL=$(location).attr("href");if("US"!=a&&"CA"!=a&&"AU"!=a&&""!=a)if("ID"!=a&&"GB"!=a&&"IT"!=a&&"GN"!=a&&"CH"!=a)$("#header").fadeTo("slow",0.2),$("#navigation").fadeTo("slow",0.2),$("#main_section").fadeTo("slow",0.2),$("#box_section").fadeTo("slow",0.2),$("#footer").fadeTo("slow",0.2),load_country_choice(a), $("#pop_country_choice").show();else if(-1==curURL.indexOf("/cc/"))return window.location.href=matchCountry(a),!1;$("#country a").hoverIntent(function(){},function(){});$("body").click(function(a){$(a.target).is("#img_country_down")?($("#country_choice").slideDown("slow"),$("#img_country_down").hide(),$("#img_country_up").show()):$("#country_choice").is(":visible")&&($("#country_choice").slideUp("slow"),$("#img_country_down").show(),$("#img_country_up").hide())});$(".lnk_change_country").click(function(){$("#country_choice").slideDown("slow"); $("#img_country_down").hide();$("#img_country_up").show();$("html, body").animate({scrollTop:99999},"slow")});$(".cc_img_flag").click(function(){$("#cc_radio_"+$(this).attr("id").substr($(this).attr("id").length-2)).attr("checked",!0)});$("#intl_inquiry").click(function(){$.cookie("cc_inquiry","No");$("#country_choice").slideUp("slow");$("#img_country_down").show();$("#img_country_up").hide();$("#header").fadeTo("slow",0.2);$("#navigation").fadeTo("slow",0.2);$("#main_section").fadeTo("slow",0.2); $("#box_section").fadeTo("slow",0.2);$("#footer").fadeTo("slow",0.2);$("#logo").fadeTo("slow",0.2);$("#menu").fadeTo("slow",0.2);$("#main_section_cc").fadeTo("slow",0.2);customURL=-1!=$(location).attr("href").indexOf("/cc/")?"../../images/":"images/";$.cookie("myCountry_name",$("#curCountry").text());load_distribuor_inquiry();$("#pop_distributor_inquiry").show();$("#curCountry").html("International Inquiries");$("#imgFlag").attr("src",customURL+"flags/un_flag.png");$("html, body").animate({scrollTop:0}, "slow")})} function matchCountry(b){$.cookie("myCountry",b);var a=$(location).attr("href");"http://www.senegence.com/senegence/"==a&&(a="http://www.senegence.com/senegence/default.aspx");curFile=-1!=a.indexOf("?")?a.substring(a.lastIndexOf("/"),a.indexOf("?")):a.substring(a.lastIndexOf("/"));"/index.html"==curFile&&(curFile="/main.html");a=-1!=a.indexOf("/cc/")?a.replace(a.substring(a.indexOf("/cc/")),curFile):a.replace(a.substring(a.indexOf(curFile)),curFile);"ID"!=b&&"GB"!=b&&"IT"!=b&&"GN"!=b&&"CH"!=b?a=a.replace(curFile, curFile+"?cc="+b.toLowerCase()):-1!=curFile.indexOf("html")?a=a.replace(curFile,"/cc/"+b.toLowerCase()+"/index.html"):-1!=curFile.indexOf("aspx")&&(a=a.replace(curFile,"/cc/"+b.toLowerCase()+"/default.aspx"));return a} function pop_country_choice(b){"US"!=b&&"CA"!=b&&"AU"!=b&&"ID"!=b&&"GB"!=b&&"IT"!=b&&"GN"!=b&&"CH"!=b&&($("#header").fadeTo("slow",0.2),$("#navigation").fadeTo("slow",0.2),$("#main_section").fadeTo("slow",0.2),$("#box_section").fadeTo("slow",0.2),$("#footer").fadeTo("slow",0.2),load_country_choice(b),$("#pop_country_choice").show())} function fillCountyList(b,a){var f="",c="",d="xml/country.xml",e="images/";-1!=$(location).attr("href").indexOf("/cc/")?(e="../../images/",d="../../xml/country.xml"):(e="images/",d="xml/country.xml");$.ajax({type:"GET",url:d,dataType:"xml",success:function(d){$(d).find("country").each(function(){$(this).find("Land").text()!=f&&(""!=f&&(c+="</ul></li>"),c+="<li>",c=c+"<span>"+$(this).find("Land").text()+"</span>",c+="<ul>");c=c+"<li>&bull; <a href='javascript:window.location.href = matchCountry(\""+ $(this).find("Code").text()+"\");'>"+$(this).find("Name").text()+"</a></li>";$(this).find("Code").text()==b&&(a=$(this).find("Name").text());f=$(this).find("Land").text()});c+="</ul></li>";""==a&&(a="United States");$("#fill_country").html(c);$("#curCountry").html(a);$("#imgFlag").attr("src",e+"flags/"+b.toLowerCase()+"_flag.png");$("#imgFlag_hsm_un").attr("src",e+"flags/"+b.toLowerCase()+"_flag.png");return a}})} function load_country_choice(b){$("#pop_country_choice").html("<p>SeneGence International is <br />expanding to become available <br />in your country soon</p><img id='imgFlag_pop_un' src='' alt='Country Flag' /><p>If you are interested in an opportunity to <br />distribute our products where you live, <br />click <a href='javascript:void(0);' id='cc_inquiry'>here</a> for Distributor Inquiry Form.</p><img src='images/bar_pop_country_choice.png' alt='Bar' /><p>Please select the following <br />available countries</p><img src='images/flags/us_flag.png' alt='United State' title='United States' id='cc_img_US' class='cc_img_flag' /><img src='images/flags/ca_flag.png' alt='Canada' title='Canada' id='cc_img_CA' class='cc_img_flag' /><img src='images/flags/au_flag.png' alt='Australia' title='Australia' id='cc_img_AU' class='cc_img_flag' /><br /><input type='radio' name='country' value='US' id='cc_radio_US' title='United States' checked='checked' /><input type='radio' name='country' value='CA' id='cc_radio_CA' title='Canada' /><input type='radio' name='country' value='AU' id='cc_radio_AU' title='Australia' /><br /><img src='images/flags/gb_flag.png' alt='United Kingdom' title='United Kingdom' id='cc_img_GB' class='cc_img_flag' /><img src='images/flags/ch_flag.png' alt='Switzerland' title='Switzerland' id='cc_img_CH' class='cc_img_flag' /><img src='images/flags/it_flag.png' alt='Italy' title='Italy' id='cc_img_IT' class='cc_img_flag' /><img src='images/flags/id_flag.png' alt='Indonesia' title='Indonesia' id='cc_img_ID' class='cc_img_flag' /><img src='images/flags/gn_flag.png' alt='Guinea' title='Guinea' id='cc_img_GN' class='cc_img_flag' /><br /><input type='radio' name='country' value='GB' id='cc_radio_GB' title='United Kingdom' /><input type='radio' name='country' value='CH' id='cc_radio_CH' title='Switzerland' /><input type='radio' name='country' value='IT' id='cc_radio_IT' title='Italy' /><input type='radio' name='country' value='ID' id='cc_radio_ID' title='Indonesia' /><input type='radio' name='country' value='GN' id='cc_radio_GN' title='Guinea' /><p><input type='checkbox' name='def_country' value='checked' checked='checked' />Make this my default country<br /></p><input type='button' value='' style='background:url(images/btn_proceed.png) no-repeat' id='btn_proceed' />");var a= "images/",a=-1!=$(location).attr("href").indexOf("/cc/")?"../../images/":"images/";$("#imgFlag_pop_un").attr("src",a+"flags/"+b.toLowerCase()+"_flag.png");$("#btn_proceed").click(function(){b=$("input:radio[name=country]:checked").val();$("#pop_country_choice").fadeOut("slow",function(){window.location.href=matchCountry(b)})});$("#cc_inquiry").click(function(){$.cookie("cc_inquiry","Yes");$("#country_choice").slideUp("slow");$("#img_country_down").show();$("#img_country_up").hide();$("#header").fadeTo("slow", 0.2);$("#navigation").fadeTo("slow",0.2);$("#main_section").fadeTo("slow",0.2);$("#box_section").fadeTo("slow",0.2);$("#footer").fadeTo("slow",0.2);a=-1!=$(location).attr("href").indexOf("/cc/")?"../../images/":"images/";$.cookie("myCountry_name",$("#curCountry").text());load_distribuor_inquiry();$("#pop_distributor_inquiry").show()})} $(document).ready(function(){var b="US",a=$(location).attr("href");-1!=a.indexOf("/cc/")?(b=a.substring(a.indexOf("/cc/")+4,a.indexOf("/cc/")+6).toUpperCase(),pop_country_choice(b)):-1!=a.indexOf("?cc=")?(b=a.substring(a.indexOf("?cc=")+4,a.indexOf("?cc=")+6).toUpperCase(),pop_country_choice(b)):(b=$("#country_code").text(),$.cookie("myCountry")?b=$.cookie("myCountry"):$.getJSON("http://api.wipmania.com/jsonp?callback=?","",function(a){b=a.address.country_code}).complete(function(){$.cookie("myCountry", b);$("#country_code").html(b);"US"!=b&&"CA"!=b&&"AU"!=b&&"ID"!=b&&"GB"!=b&&"IT"!=b&&"GN"!=b&&"CH"!=b&&($("#header").fadeTo("slow",0.2),$("#navigation").fadeTo("slow",0.2),$("#main_section").fadeTo("slow",0.2),$("#box_section").fadeTo("slow",0.2),$("#footer").fadeTo("slow",0.2),load_country_choice(b),$("#pop_country_choice").show());initCountry();return 0}));$.cookie("myCountry",b);$("#country_code").html(b);initCountry()});
