var agent = navigator.userAgent;

String.prototype.trim = function()
	{
		return this.replace(/(^[\s]*)|([\s]*$)/g, "");
	};

String.prototype.inc = function(k1, k2)
	{
		return k2 == null ? this.indexOf(k1) > -1 ? true : false : (k2 + this + k2) .indexOf(k2 + k1 + k2) > -1 ? true : false;
	};

String.prototype.toArray=function(key)
	{
		var l = this, v;
		if(key == null) key = "|";
		v = key;
		if(key == "n")
		{
			l = l.replace(/\r/g,"");
			v = "\n";
		}
		l = l.replace(new RegExp("(\\"+key+")+","g"), v).replace(new RegExp("^[\\" + key + "]*|[\\" + key + "]+$","g"), "");
		return l == "" ? new Array() : l.split(v);		
	};

Array.prototype.add = function(key)
{
	this[this.length] = key;
};



var is_Opr = agent.inc("Opera");
var is_IE = agent.inc("IE") && !is_Opr;
var is_IE4 = agent.inc("IE 4");
var is_IE5 = agent.inc("IE 5") || agent.inc("IE 4");
var is_IE5_5 = agent.inc("IE 5.5");
var is_IE6 = is_IE && !is_IE5;
var is_Moz = agent.inc("Mozilla") && !is_Opr && !is_IE;

function oo(obj){
	return typeof(obj) != "string" ? obj : (is_IE5 ? document.all(obj) : document.getElementById(obj));
}

function co(elm){
	return document.createElement(elm);
}

if(is_IE4)
{
	oo=function(key){return document.all[key]}
	document.getElementsByName=function(key){var a=new Array(),ol=document.all;for(i=0;i<ol.length;i++){if(ol[i].name==key)a[a.length]=ol[i];}return a;}
	document.getElementsByTagName=function(key){var a=new Array(),ol=document.all;for(i=0;i<ol.length;i++){if(ol[i].tagName.toLowerCase()==key)a[a.length]=ol[i];}return a;}
}
if(is_Moz)
{
	Event.prototype.__defineGetter__("srcElement",function(){var node=this.target;while(node.nodeType!=1){node=node.parentNode;}return node;});
	HTMLElement.prototype.__defineGetter__("children",function(){return this.childNodes});
	HTMLElement.prototype.__defineGetter__("parentElement",function(){return this.parentNode});
}
function trim(str){	
	return str.trim();
}
function isIE(){	
	return is_IE;
}
function isFF(){
	return is_Moz;
}
function show(obj){
	if(oo(obj)){
		oo(obj).style.display = "";
	}
}
function hidden(obj){
	if(oo(obj)){
		oo(obj).style.display = "none";
	}
}
function getDisplay(obj){
	return oo(obj).style.display;
}



var cur_call_kind = 0;
function set_vo_menu(key)
{
	oo("id_tab_vo_" + cur_call_kind).className="tab_bt";
	oo("id_tab_vo_" + key).className="tab_bt1";
	hidden('id_main_vo_' + cur_call_kind);
	show('id_main_vo_' + key);
	cur_call_kind = key;
}