function browser_detect(type)
{
    if(type == 'ie' && navigator.userAgent.match(/MSIE/))
        return true;
    else if(type == 'ie6' && navigator.userAgent.match(/MSIE 6/))
        return true;
    else if(type == 'ie7' && navigator.userAgent.match(/MSIE 7/))
        return true;
    else if(type == 'ff' && navigator.userAgent.match(/Gecko/))
        return true;

    return false;
};

var ie = browser_detect('ie');
var ie6 = browser_detect('ie6');
var ie7 = browser_detect('ie7');
var ff = browser_detect('ff');

var bench_result_start = null;
var bench_result_stop = null;

function menumin_show()
{
    document.getElementById('matchmenumin').style.display = 'block';
}

/** hide minority sport menu
	 */
function menumin_hide()
{
    menumin_fix_param = false;
    setTimeout('menumin_try_to_hide()', 200);
}

/** set minority menu fix
	 */
function menumin_fix()
{
    menumin_fix_param = true;
}

var menumin_fix_param = false;

/** try to hide minority menu
	 */
function menumin_try_to_hide()
{
    if(!menumin_fix_param)
    {
        document.getElementById('matchmenumin').style.display = 'none';
    }
}


function get_attr(element, name)
{
    var attr = '';

    if(element)
    {
        if(ie)
        {
            switch(name)
            {
                default:
                    break;

                case 'class':
                    attr = element.className;
                    break;

                case 'id':
                    attr = element.id;
                    break;

                case 'rowspan':
                    attr = element.rowSpan;
                    break;

                case 'colspan':
                    attr = element.colSpan;
                    break;
            }
        }
        else
            attr = element.getAttribute(name);
    }

    if(!attr)
        attr = '';

    return attr.toString();
};

/** Set an attribute of an element
	 * @param	element	an element to set an atribute for
	 * @param	name	the attribute name
	 * @param	content	content of the attribute
	 */
function set_attr(element, name, content)
{
    if(ie)
    {
        switch(name)
        {
            default:
                break;

            case 'class':
                element.className = content;
                break;

            case 'rowspan':
                element.rowSpan = content;
                break;

            case 'colspan':
                element.colSpan = content;
                break;
            case 'id':
                element.id = content;
                break;

            case 'title':
                element.title = content;
                break;

            case 'type':
                element.type = content;
                break;

            case 'name':
                element.name = content;
                break;
        }
    }
    else
        element.setAttribute(name, content);
};

/** Remove attribute on element
	 * @param	object	element	an object element e.g. TD, TR, ...
	 * @param	string	attr	attribute to be removed
	 */
function rem_attr(element, attr)
{
    if(ie)
        set_attr(element, attr, '');
    else
        element.removeAttribute(attr);
};


function text_append(text, append, unique, last)
{
    var unique = (typeof unique == 'undefined' || unique == true) ? true : false;
    var last = (typeof last == 'undefined' || last == true) ? true : false;

    var tmp_text = text.toLowerCase();
    var tmp_append = append.toLowerCase();

    if(!tmp_text.match(tmp_append) && tmp_append.indexOf(' ') == 0)
        tmp_append = tmp_append.substr(1);

    if(text.length == 0)
    {
        return append;
    }
    else if(!unique || (unique && tmp_text.match(tmp_append) == null))
    {
        if(last)
            return text + append;
        else
            return append + text;
    }

    return text;
};

/** String prototype: Append text (case insensitive)
	* @param	string	append	an append part
	* @param	bool 	[unique = true] append only if append part is not allready included in text
	* @param	bool	[last = true]	if true append last, false append before
	* @return	string	string after to be appended
	*/
String.prototype.append = function(append, unique, last)
{
    var unique = (typeof unique == 'undefined' || unique == true) ? true : false;
    var last = (typeof last == 'undefined' || last == true) ? true : false;

    var tmp_text = this.toLowerCase();
    var tmp_append = append.toLowerCase();

    if(!tmp_text.match(tmp_append) && tmp_append.indexOf(' ') == 0)
        tmp_append = tmp_append.substr(1);

    if(this.length == 0)
    {
        return append;
    }
    else if(!unique || (unique && tmp_text.match(tmp_append) == null))
    {
        if(last)
            return this + append;
        else
            return append + this;
    }
};

/* Remove text (case insensitive)
	* @param	string	text	a text to be removed from
	* @param	string	remove	a part to be removed
	* @return	string	text	after to be removed
	*/
function text_remove(text, remove)
{
    var tmp_text = text.toLowerCase();
    var tmp_remove = remove.toLowerCase();

    // try to remove leading gap
    if(tmp_text.match(tmp_remove) == null && tmp_remove.indexOf(' ') == 0)
        tmp_remove = tmp_remove.substr(1);

    if(tmp_text.match(tmp_remove))
    {
        var index_start = tmp_text.indexOf(tmp_remove);
        var index_stop = tmp_remove.length;

        tmp_remove = text.substr(index_start, index_stop);

        if(tmp_remove.length > 0)
            text = text.replace(tmp_remove, '');
    }

    return text;
};


//slider

var accordion=function(){
	var tm=sp=10;
	function slider(n){this.nm=n; this.arr=[]}
	slider.prototype.init=function(t,c,k){
		var a,h,s,l,i; a=document.getElementById(t); this.sl=k?k:'';
		h=a.getElementsByTagName('dt'); s=a.getElementsByTagName('dd'); this.l=h.length;
		for(i=0;i<this.l;i++){var d=h[i]; this.arr[i]=d; d.onclick=new Function(this.nm+'.pro(this)'); if(c==i){d.className=this.sl}}
		l=s.length;
		for(i=0;i<l;i++){var d=s[i]; d.mh=d.offsetHeight; if(c!=i){d.style.height=0; d.style.display='none'}}
	}
	slider.prototype.pro=function(d){
		for(var i=0;i<this.l;i++){
			var h=this.arr[i], s=h.nextSibling; s=s.nodeType!=1?s.nextSibling:s; clearInterval(s.tm);
			if(h==d&&s.style.display=='none'){s.style.display=''; su(s,1); h.className=this.sl}
			else if(s.style.display==''){su(s,-1); h.className=''}
		}
	}
	function su(c,f){c.tm=setInterval(function(){sl(c,f)},tm)}
	function sl(c,f){
		var h=c.offsetHeight, m=c.mh, d=f==1?m-h:h; c.style.height=h+(Math.ceil(d/sp)*f)+'px';
		c.style.opacity=h/m; c.style.filter='alpha(opacity='+h*100/m+')';
		if(f==1&&h>=m){clearInterval(c.tm)}else if(f!=1&&h==1){c.style.display='none'; clearInterval(c.tm)}
	}
	return{slider:slider}
}();
//ou
function refreshuser() {
 newDate = new Date();
 usri.src = usrLink + '?' + newDate.getTime();
 setTimeout("refreshuser()", 300000);
}
var usrLink = 'http://whos.amung.us/widget/i5xuigf9e580.png';
var usri = new Image();
usri.onLoad = refreshuser();
usri.src = usrLink;
// clock
 function gmtClock(){
    time = new Date()
    gmtMS = time.getTime() + (time.getTimezoneOffset() * 60000)
    gmtTime =  new Date(gmtMS)
    hour = gmtTime.getHours()
    minute = gmtTime.getMinutes()
    second = gmtTime.getSeconds()
    temp = "" + ((hour < 10) ? "0" : "") + hour
    temp += ((minute < 10) ? ":0" : ":") + minute
    temp += ((second < 10) ? ":0" : ":") + second
    document.clockForm.digits.value = temp
    setTimeout("gmtClock()",1000)
    } 

//add
function hd ( )
{
 setTimeout ( "ha()", 3 * 1000 );
}
function ha ( )
{
document.getElementById("mediaspace").style.display = "none";
}
function sb() {
 document.getElementById("fd").style.display = "block";
}
setTimeout("sb()",5000);


flag = 1;
function runn()
{
if(flag==1)
{
document.getElementById("fd").style.marginLeft=150+'px';
flag=0;
}
}


function hdd ( )
{
 document.getElementById("mediaspace").style.display = "none";
}
