﻿// top menu
function topLink(id) {
  if (id == 0) {
    alert("Sign-in");
  } else if (id == 1) {
    alert("Register");
  } else if (id == 2) {
    alert("Site tour");
  } else if (id == 3) {
    alert("Global networks");
  } else if (id == 4) {
    alert("Sign-out");
  }  else if (id == 5) {
    alert("My Profile");
  }  
}

// my url
function goMyUrl(url) {
  alert(url);
}

// advanced
function goAdvanced() {
  alert("advanced");
}

// search
function goSearch(drop, str) {
  alert(drop + " : " + str);
}

// popular tag
function popularTag(str) {
  alert(str);
}

// menu
function goMenu(one, two, three) {
  alert(one + " : " + two + " : " + three);
}

// change flash size
function setSize(flash, stwidth, stheight) {
  var w = parseInt(stwidth);	
  var h = parseInt(stheight);	

	var el = thisMovie(flash);
	el.setAttribute("height", h);
	el.style.height = h + "px";
	el.setAttribute("width", w);
	el.style.width = w + "px";
	
	var el = document.getElementById(flash); 
	el.style.height = h + "px";
	el.style.width = w + "px";	
}
function thisMovie(movieName) { 
	if (navigator.appName.indexOf("Microsoft") != -1) {
		  return getElementByTagAndId("object", movieName);
	} else {
		  return getElementByTagAndName("embed", movieName);
	}
}
function getElementByTagAndId(tagName, id){
	var el = null;
	var els = document.getElementsByTagName(tagName);
	for(var i=0 ; i < els.length ; i++){
		if(els[i].id == id) {	el = els[i];	break;	}
	}
	return el;
}
function getElementByTagAndName(tagName, name){
	var el = null;
	var els = document.getElementsByTagName(tagName);
	for(var i=0 ; i < els.length ; i++){
		if(name == "" && i == 0){	el = els[i];	break;	}
		if(els[i].name == name) {	el = els[i];	break;	}
	}
	return el;
}
