// JavaScript Document

$(document).ready(function(){
	theFlag = '<img src="http://www.cisco.com/web/europe/images/usflag-wide.gif" width="18" height="11" alt="" border="0" />';
	var theContainer = document.getElementById("framework-base-main");
	var a = theContainer.getElementsByTagName("a");
	//alert(a[0].nodeValue);
	for (var i = 0; i <a.length; i++) {
		// Do not handle Images
		if(a[i].getElementsByTagName("img").length<1 ){
		// only handle cisco links
			if(a[i].href.indexOf("cisco.com") >= 0) {
				if(a[i].href.indexOf("/web/" + countrySite + "/") == -1  && a[i].href.indexOf("/support/" + countrySite + "/") == -1 && a[i].href.indexOf("mailto:") == -1 && a[i].href.indexOf("/offer/urls/") == -1 )
					{
						a[i].style.textDecoration= "none";
						// temporarilty storing inner HTML Value
						var temp=a[i].innerHTML;
						var tempHTML='<span style="text-decoration:underline;">';
						tempHTML +=temp;
						tempHTML +='</span>&nbsp;';
						tempHTML +=theFlag;
						// Updating inner HTML Value
						a[i].innerHTML=tempHTML;
					}
			}else if(a[i].href.indexOf("myciscocommunity.com") >= 0){
						a[i].style.textDecoration= "none";
						// temporarilty storing inner HTML Value
						var temp=a[i].innerHTML;
						var tempHTML='<span style="text-decoration:underline;">';
						tempHTML +=temp;
						tempHTML +='</span>&nbsp;';
						tempHTML +=theFlag;
						// Updating inner HTML Value
						a[i].innerHTML=tempHTML;
				}
		}
	}
});
