$.getJSON("http://api.wipmania.com/jsonp?callback=?",
function(data) {
country=data.address.country_code;
// Germany
if(country=="DE")
{
	var newDiv = document.createElement("div");
	newDiv.innerHTML = '<table><tr><td style="width:120px;text-align:right;"><img src="/media/104054/CTA_flag_DE.png" width="62" height="62" alt="German flag" title="German flag" /></td><td style="width:430px;color:#303b4c;text-align:center;">Laden Sie unsere Dental System-Broschure in Deutsch herunter</td><td style="width:280px;"><a href="/media/97820/German_Dental%20Brochure%202010_small version.pdf" target="_blank"><img src="/media/104078/CTA_download_button_DE.png" width="246" height="46" alt="German brochure download" title="German brochure download" /></a></td></tr></table>';
	var my_div = document.getElementById("cta_block");
	my_div.appendChild(newDiv);	
}
// France
if(country=="FR")
{
	// create a new div element and give it some content
	var newDiv = document.createElement("div");
	newDiv.innerHTML = '<table><tr><td style="width:120px;text-align:right;"><img src="/media/104096/CTA_flag_FR.png" width="62" height="62" alt="French flag" title="French flag" /></td><td style="width:430px;color:#303b4c;text-align:center;">Telecharger notre Brochure dentaire dans votre langue</td><td style="width:280px;"><a href="/media/100676/FR_Dental%20Brochure%202010.pdf" target="_blank"><img src="/media/104090/CTA_download_button_FR.png" width="246" height="46" alt="French brochure download" title="French brochure download" /></a></td></tr></table>';
	// add the newly created element and it's content into the DOM
	var my_div = document.getElementById("cta_block");
	my_div.appendChild(newDiv);	
}
// Italy
if(country=="IT")
{
	var newDiv = document.createElement("div");
	newDiv.innerHTML = '<table><tr><td style="width:120px;text-align:right;"><img src="/media/104066/CTA_flag_IT.png" width="62" height="62" alt="Italian flag" title="Italian flag" /></td><td style="width:430px;color:#303b4c;text-align:center;">Scarica la nostra dental brochure in Italiano</td><td style="width:280px;"><a href="/media/96160/IT_Dental%20Brochure%202010_Low-res.pdf" target="_blank"><img src="/media/104072/CTA_download_button_IT.png" width="246" height="46" alt="Italian brochure download" title="Italian brochure download" /></a></td></tr></table>';
	var my_div = document.getElementById("cta_block");
	my_div.appendChild(newDiv);	
}
// Spain
if(country=="ES")
{
	var newDiv = document.createElement("div");
	newDiv.innerHTML = '<table><tr><td style="width:120px;text-align:right;"><img src="/media/104060/CTA_flag_ES.png" width="62" height="62" alt="Spain flag" title="Spain flag" /></td><td style="width:430px;color:#303b4c;text-align:center;">Descargue nuestra Dental Brochure en su idioma</td><td style="width:280px;"><a href="/media/96152/ES_Dental%20Brochure%202010_web.pdf" target="_blank"><img src="/media/104084/CTA_download_button_ES.png" width="246" height="46" alt="Spanish brochure download" title="Spanish brochure download" /></a></td></tr></table>';
	var my_div = document.getElementById("cta_block");
	my_div.appendChild(newDiv);	
}
// Portugal
if(country=="PT")
{
	var newDiv = document.createElement("div");
	newDiv.innerHTML = '<table><tr><td style="width:120px;text-align:right;"><img src="/media/126178/CTA_flag_PT.png" width="62" height="62" alt="Portugal flag" title="Portugal flag" /></td><td style="width:430px;color:#303b4c;text-align:center;">Baixe a nossa Brochura Dental em seu idioma local</td><td style="width:280px;"><a href="/media/97576/Dental%20Brochure%202010_Portuguese.pdf" target="_blank"><img src="/media/126154/CTA_download_button_PT.png" width="246" height="46" alt="Portuguese brochure download" title="Portuguese brochure download" /></a></td></tr></table>';
	var my_div = document.getElementById("cta_block");
	my_div.appendChild(newDiv);	
}
// Greece
if(country=="GR")
{
	var newDiv = document.createElement("div");
	newDiv.innerHTML = '<table><tr><td style="width:120px;text-align:right;"><img src="/media/126166/CTA_flag_GR.png" width="62" height="62" alt="Greece flag" title="Greece flag" /></td><td style="width:430px;color:#303b4c;text-align:center;">????????? ?? ???????????? ??? ???????? ??? ?????? ???</td><td style="width:280px;"><a href="/media/108892/Greek_Dental%20Brochure%202010.pdf" target="_blank"><img src="/media/126142/CTA_download_button_GR.png" width="246" height="46" alt="Greek brochure download" title="Greek brochure download" /></a></td></tr></table>';
	var my_div = document.getElementById("cta_block");
	my_div.appendChild(newDiv);	
}
// Turkey
if(country=="TR")
{
	var newDiv = document.createElement("div");
	newDiv.innerHTML = '<table><tr><td style="width:120px;text-align:right;"><img src="/media/126401/CTA_flag_TR.png" width="62" height="62" alt="Turkey flag" title="Turkey flag" /></td><td style="width:430px;color:#303b4c;text-align:center;">Dental brosurumuzu kendi dilinizde &laquo;Indirin&raquo;</td><td style="width:280px;"><a href="http://3shape.com/media/108896/Turkey_Dental%20Brochure%202010.pdf" target="_blank"><img src="/media/126395/CTA_download_button_TR.png" width="246" height="46" alt="Turkish brochure download" title="Turkish brochure download" /></a></td></tr></table>';
	var my_div = document.getElementById("cta_block");
	my_div.appendChild(newDiv);	
}
// China
if(country=="CN")
{
	var newDiv = document.createElement("div");
	newDiv.innerHTML = '<table><tr><td style="width:120px;text-align:right;"><img src="/media/126160/CTA_flag_CN.png" width="62" height="62" alt="China flag" title="China flag" /></td><td style="width:430px;color:#303b4c;text-align:center;">???????“??”???????(Dental Brochure)</td><td style="width:280px;"><a href="/media/101456/CHN_Dental%20Brochure%202010.pdf" target="_blank"><img src="/media/126130/CTA_download_button_CN.png" width="246" height="46" alt="Chinese brochure download" title="Chinese brochure download" /></a></td></tr></table>';
	var my_div = document.getElementById("cta_block");
	my_div.appendChild(newDiv);	
}

