function extLinks(){ 
	if(!document.getElementsByTagName)
		return; 
	var anchors=document.getElementsByTagName("a"); 
	var oReg=new RegExp("_","g");
	for(var i=0;i<anchors.length;i++){			
		if(anchors[i].getAttribute("href")&&anchors[i].getAttribute("rel")){
			anchors[i].target=anchors[i].getAttribute("rel");
			if(anchors[i].getAttribute("id")) {
				if (anchors[i].getAttribute("id")=='www.4mobile.sk') {
					anchors[i].href='http://4mobile.sk/?ref=15';
				} else {
					anchors[i].href='http://'+anchors[i].getAttribute("id").replace(oReg,".");
				}
			}
		}
	}
}

ratingMsgs = new Array(6);
ratingMsgColors = new Array(6);
barColors = new Array(6);

ratingMsgs[0] = "Nedostatočná";
ratingMsgs[1] = "Slabá";
ratingMsgs[2] = "Dobrá";
ratingMsgs[3] = "Bezpečná";
ratingMsgs[4] = "Veľmi silná";
ratingMsgs[5] = "Not rated"; //If the password server is down

ratingMsgColors[0] = "#808080";
ratingMsgColors[1] = "#da5301";
ratingMsgColors[2] = "#ccbe00";
ratingMsgColors[3] = "#1e91ce";
ratingMsgColors[4] = "#1e91ce";
ratingMsgColors[5] = "#808080";

barColors[0] = "#e0e0e0";
barColors[1] = "#da5301";
barColors[2] = "#f0e54b";
barColors[3] = "#1e91ce";
barColors[4] = "#1e91ce";
barColors[5] = "#e0e0e0";

hidePasswordBar = false;

function CreateRatePasswdReq(password) {
if (password.length<3) { DrawBar(0); }
else {
	if (password.length<5) { DrawBar(1); }
	else {
		if (password.length<8) { DrawBar(2); }
		else {
			if (password.length<10) { DrawBar(3); }
			else {
				DrawBar(4);
			}
		}
	}
}
}

function getElement(name) {
if (document.all) {
  return document.all(name);
}
return document.getElementById(name);
}

function DrawBar(rating) {
var posbar = getElement('posBar');
var negbar = getElement('negBar');
var passwdRating = getElement('passwdRating');
var barLength = 225;
if (rating >= 0 && rating <= 4) {  //We successfully got a rating
  posbar.style.width = barLength / 4 * rating;
  negbar.style.width = barLength / 4 * (4 - rating);
} else {
  posbar.style.width = 0;
  negbar.style.width = barLength;
  rating = 5; // Not rated Rating
}
posbar.style.background = barColors[rating];
passwdRating.innerHTML = "<font color='" + ratingMsgColors[rating] +
						 "'>" + ratingMsgs[rating] + "</font>";
}

function checkVisibility (visible) {
	if (visible==true) {
		document.getElementById("nextStep").style.visibility="visible";
	} else {
		document.getElementById("nextStep").style.visibility="hidden";
	}
}

function show_link(a) {window.status=a;return true;}
 function hide_link() {window.status=' ';}