if (top.location == self.location) {
  self.location = "/default.php";
}

var curProfile = "misha";

function showProfile(strId,objTemp) {
  if(strId!=curSelected) {
    document.getElementById(curSelected).className = "";
    document.getElementById(curSelected).style.display = "none";
	document.getElementById("link"+curSelected).className = "";
	document.getElementById(curSelected).className = "";
    curSelected = strId;
    document.getElementById(curSelected).style.display = "block";
	document.getElementById("link"+curSelected).className = "selected";
  }
}

function init() {
  arrAnchors = document.getElementsByTagName("a");
  for(i=0;i<arrAnchors.length;i++) {
    arrAnchors[i].onfocus = new Function("if(this.blur)this.blur()");
	if(arrAnchors[i].rel=="new") {
	  arrAnchors[i].target = "_new";
	}
	if(arrAnchors[i].rel=="content") {
	  arrAnchors[i].target = "content";
	}
	if(arrAnchors[i].rel=="collection") {
	  arrAnchors[i].onclick = new Function("showCol(this);return false");
	}
	if(arrAnchors[i].rel=="top") {
	  arrAnchors[i].target = "_top";
	}
  }
  arrDivs = document.getElementsByTagName("div");
  for(i=0;i<arrDivs.length;i++) {
    if(arrDivs[i].className=="feature") {
	  curSelected = arrDivs[i].id;
	}
  }
}

var curSelected = "";

function showState(objField) {
  if(objField.selectedIndex!=0) {
    document.getElementById(curSelected).className = "";
    document.getElementById(curSelected).style.display = "none";
    curSelected = objField.options[objField.selectedIndex].value;
    document.getElementById(curSelected).style.display = "block";
  }
}

function showNews(strId) {
  if(strId!=curSelected) {
    document.getElementById(curSelected).className = "";
    document.getElementById(curSelected).style.display = "none";
	document.getElementById("link"+curSelected).className = "";
    curSelected = strId;
    document.getElementById(curSelected).style.display = "block";
	document.getElementById("link"+curSelected).className = "selected";
  }
}

function showCol(objTemp) {
  strSrc = objTemp.getElementsByTagName("img")[0].src.toString();
  strNew = strSrc.replace("sm_","lg_");
  document.getElementById("colimage").src = strNew;
}

