function LimitLength() 
{
    var maxCount = 180;
    var scanElem = document.getElementById("_ctl0__ctl0_txtText");
    var infoElem = document.getElementById("_ctl0__ctl0_editCount");
    if (scanElem.value.length > maxCount) 
    {
      alert ("Too long.");
      scanElem.value = scanElem.value.substring (0, maxCount);
    }
    else 
    {
      infoElem.value = (maxCount - scanElem.value.length);
    }
}

function sc(cn)
{
	var i;
	for (i=1; i < 5; i++)
	{
		var elem = document.getElementById("UCHeader1_UCNavigation1_nc" + i);
		elem.bgColor = "";
		if (i == cn)
			elem.bgColor = "#793434";
	}
	var dv = document.getElementById("Layer1");
	var de = document.getElementById("UCThemePanel1_CELL_ThemePanel");
	de.innerHTML = dv.innerHTML;
}
function np2(url, w, h)
{
	window.open(url,'_blank','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width="+ w +",height="+ h +"')
}
function np(url)
{
	w = window.screen.width - 30;
	h = window.screen.height - 220;
	var newWin = window.open(url,'pic','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width='+ w +',height='+ h + ', top=40, left=15');
	newWin.focus();
}
function sp(url, sTitle)
{
	var w = 200;
	var h = 40;
	url = 'ShowImage.aspx?src=' + url + '&auto=true&name=' + sTitle;
	var newWin = window.open(url, '_blank', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width='+ w +',height='+ h + ', top=50, left=50');
	newWin.focus();
}
var newWin = null;
function sp2(url, w, h, sTitle)
{
	if (newWin && newWin != null)
		newWin.close();
	
	w = w+1;
	h = h+1;
	var x = window.screen.width / 2 - w / 2;
	var y = window.screen.height/ 2 - h / 2;
	//url = 'ShowImage.aspx?src=' + url + '&name=' + sTitle;
	newWin = window.open(url, '_blank' ,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width='+ w +', height='+ h + ', top='+ y +', left=' + x);
	//newWin = window.open(url, '_blank' ,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width='+ w +', height='+ h + ', top='+ 0 +', left=' + 0);
	newWin.focus();
}
function pURL(sUrl)
{
	var r = new String(sUrl);
	return r.replace(/ /gi, '%20');
}




var message="Function Disabled!";

///////////////////////////////////
function clickIE4(){
if (event.button==2){
//alert(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
//alert(message);
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("/*alert(message);*/return false")


