JumpFlag=1;
  
function autoscroll(instance){
	
	document.getElementById("scrollbar_" + instance).scrollTop = document.getElementById("scrollbar_" + instance).scrollHeight - document.getElementById("scrollbar_" + instance).offsetHeight;
}

function on_enter(e){
	if (!e) e = window.event;
	if(navigator.appName == "Microsoft Internet Explorer"){
		if(event.keyCode == 13){
			addmessage();
		}
	} else if(navigator.appName != "Microsoft Internet Explorer"){
		if( e.which == 13){	
			addmessage();
		}
	}
 
}


function autoscrolltoend(instance) {
	
    var chatdiv = document.getElementById('scrollbar_' + instance);
    chatdiv.scrollTop = chatdiv.scrollHeight - chatdiv.offsetHeight;
}
	
function CheckVal(CurrentInp) {
	
	JumpFlag=(CurrentInp.value!='') ? 0 : 1;

}


function ChangeFlag(CurrentInp) {

	if (CurrentInp.value.length==2) JumpFlag=1;

}

function go2next(CurrentInp) {

	if (JumpFlag==1) {
	
	with (CurrentInp) {

		if ( (value.length==maxLength) && (tabIndex<=document.FX.elements.length-1) ) {

			document.FX.elements[tabIndex].focus();

		}

	}
	}

}

function abschicken() {
	document.getElementById('overlay').style.display = 'block';
	document.sgcopy.submit();
}

function dbsearch_button() {
	document.getElementById('overlay').style.display = 'block';
	document.dbsearch_m.submit();
}

function adbestping() {
	document.getElementById('adbestping').style.display = 'none';
	document.getElementById('adbestping_content').style.display = 'none';
}


function handleEnter(inField, e) {
    var charCode;
    
    if(e && e.which){
        charCode = e.which;
    }else if(window.event){
        e = window.event;
        charCode = e.keyCode;
    }

    if(charCode == 13) {
		document.getElementById('overlay').style.display = 'block';
		document.dbsearch_m.submit();
    }
}


function show_channelgrouplist(option)
{
	if ( option == '1' ) {
		
		document.getElementById('div_channelgroup').style.display = 'block';
		document.getElementById('div_servergroup').style.display = 'none';
		
	} else { 
	
		document.getElementById('div_channelgroup').style.display = 'none';
		document.getElementById('div_servergroup').style.display = 'block';
	}
	
    return true;
	
}


function showbigpic(id) {
	document.getElementById(id).style.display = '';
}

function hidebigpic(id) {
	document.getElementById(id).style.display = 'none';
}


function show_roster_time(id) {
	
	
	for (var i = 1; i<=31; i++) {
		
		if(document.getElementById("c" + id + i) != null) {
			
		document.getElementById("c" + id + i).style.display='block';
		
		}
	}
	
}

function hide_roster_time(id) {
	
	
	for (var i = 1; i<=31; i++) {
		
		if(document.getElementById("c" + id + i) != null) {
		
		document.getElementById("c" + id + i).style.display='none'; 
		}
	}
	
}

function irs_overlay_hide(){

   		document.getElementById("irs_overlay").style.display = 'none';		
}
