function changepicture(objImg) {
 objImg.src ="../images/nopic.gif";
} 
	function cofrDel(){
    cf=confirm('Are you sure you want to delete this file(s)?');
	if (cf){
		window.submit();
	}	
	return false;
	}
	function docheckone()
		   {
		   		var alen=document.inc_newManger.elements.length;
				var isChecked=true;
				alen=(alen>5)?document.inc_newManger.chkid.length:0;
				if (alen>0)
				{
			   		for(var i=0;i<alen;i++)
						if(document.inc_newManger.chkid[i].checked==false)
							isChecked=false;
				}else
				{
					if(document.inc_newManger.chkid.checked==false)
						isChecked=false;
				}				
				document.inc_newManger.chkall.checked=isChecked;
		   }
function docheck(status,from_)
		   {
		   		var alen=document.inc_newManger.elements.length;
				alen=(alen>5)?document.inc_newManger.chkid.length:0;
				if (alen>0)
				{
			   		for(var i=0;i<alen;i++)
						document.inc_newManger.chkid[i].checked=status;
				}else
				{
						document.inc_newManger.chkid.checked=status;
				}
				if(from_>0)
					document.inc_newManger.chkall.checked=status;
		   }
 function checkInput()
		   {
				var alen=document.inc_newManger.elements.length;
				var isChecked=false;
				var isNum=true;
				alen=(alen>5)?document.inc_newManger.chkid.length:0;
				if (alen>0)
				{
			   		for(var i=0;i<alen;i++)
					{
						if(document.inc_newManger.chkid[i].checked==true)
						{
							isChecked=true;							
							break;
						}
					}
					if (!isChecked)											
						alert("Please select at least one of them");
					
				}else
				{
					if(document.inc_newManger.chkid.checked==true)
						isChecked=true;
					if (!isChecked)											
						alert("Please select at least one of them");
				}
				
				if (isChecked)											
					calculatechon();												
			return isChecked;
		  } 
function calculatechon()
			{			
				var strchon="";
				var alen=document.inc_newManger.elements.length;				
				alen=(alen>5)?document.inc_newManger.chkid.length:0;
				if (alen>0)
				{
			   		for(var i=0;i<alen;i++)
						if(document.inc_newManger.chkid[i].checked==true)
							strchon+=document.inc_newManger.chkid[i].value+",";
				}else
				{
					if(document.inc_newManger.chkid.checked==true)
						strchon=document.inc_newManger.chkid[i].value;
				}
				document.inc_newManger.checkID.value=strchon;	
				
			}	
//------------------------------------------------------------------------------------------
function overTables(
		str_tableId, // table id (req.)
		num_headerOffset, // how many rows to skip before applying effects at the begining (opt.)
		num_footerOffset, // how many rows to skip at the bottom of the table (opt.)
		str_moverColor // background color for rows with mouse over (opt.)
	)
{
		// validate required parameters
	if (!str_tableId) 
		return alert ("No table(s) ID specified in parameters");

	var objTables = (document.all ? document.all[str_tableId] : document.getElementById(str_tableId));
	if (!objTables) 
		return alert ("Can't find table(s) with specified ID (" + str_tableId + ")");

	// set defaults for optional parameters
	var rowConfig = [];

	rowConfig.headerOffset = (num_headerOffset ? num_headerOffset : 0);
	rowConfig.footerOffset = (num_footerOffset ? num_footerOffset : 0);

	rowConfig.oddColor = "";
	rowConfig.evenColor = "";
	//rowConfig.onClickColor = "#cccccc";

	rowConfig.moverColor = (str_moverColor ? str_moverColor : '#6699cc');
	
	// init multiple tables with same ID
	if (objTables.length)
		for (var i = 0; i < objTables.length; i++)
			tt_initTable(objTables[i], rowConfig);
	// init single table
	else
		tt_initTable(objTables, rowConfig);
}


function tt_initTable (objTable, rowConfig) 
{
	objTable.style.cursor = "pointer";

	var lastClickedRow = [],
	col_trs = objTable.rows;
	for (var i = rowConfig.headerOffset; i < col_trs.length - rowConfig.footerOffset; i++) 
	{
		col_trs[i].config = rowConfig;
		col_trs[i].lastClickedRow = lastClickedRow;
		col_trs[i].setColor = tt_setColor;
		col_trs[i].onmouseover = tt_mover; 
		col_trs[i].onmouseout = tt_mout;
		col_trs[i].order = (i - rowConfig.headerOffset) % 2;
		col_trs[i].onmouseout();
	}
}
function tt_setColor(str_color) 
{
	//this.style.backgroundColor = str_color;
	for(i=0;i<this.cells.length;i++)
		this.cells[i].style.backgroundColor = str_color;
}

// event handlers
function tt_mover () 
{
	if (this.lastClickedRow.clicked != this)
		this.setColor(this.config.moverColor);
}

function tt_mout () 
{
	if (this.lastClickedRow.clicked != this)
		this.setColor(this.order ? this.config.oddColor : this.config.evenColor);
}

function tt_onClick () 
{
	if (this.lastClickedRow.clicked == this) 
	{
		this.lastClickedRow.clicked = null;
		this.onmouseover();
	}
	else 
	{
		var last_clicked = this.lastClickedRow.clicked;
		this.lastClickedRow.clicked = this;

		if (last_clicked) 
			last_clicked.onmouseout();

		this.setColor(this.config.onClickColor);
	}
}
function clearText(thefield){
if (thefield.defaultValue==thefield.value)
thefield.value = ""
}
/*
"Whats new?" image script-
By Website Abstraction (www.wsabstract.com)
Over 200+ free scripts here!
*/

//set the below to the image you wish to use as the "new" image
/*var imagetag='<img src="news.gif">'
var today=new Date()
function expireat(expiredate){
var expire=new Date(expiredate)
if (today.getTime()<=expire.getTime())
document.write(imagetag)
}
Su dung
expireat("December 22, 2000")
*/
function emailCheck(emailStr) {
// checks if the e-mail address is valid
var emailPat = /^(\".*\"|[A-Za-z]\w*)@(\[\d{1,3}(\.\d{1,3}){3}]|[A-Za-z]\w*(\.[A-Za-z]\w*)+)$/;
var matchArray = emailStr.match(emailPat);
if (matchArray == null) {
alert("Dia chi Email khong hop le!.  Hay nhap lai (Kiem tra dau '@' va dau '.' trong dia chi Email)");
return false;
}
// make sure the IP address domain is valid
var IPArray = matchArray[2].match(/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/);
if (IPArray != null) {
for (var i=1;i<=4;i++) {
if (IPArray[i]>255) {
alert("Destination IP address is invalid!")
return false;
      }
   }
}
return true;
}
// Script Source: CodeLifter.com
// Copyright 2003
// Do not remove this notice.

// SETUPS:
// ===============================

// Set the horizontal and vertical position for the popup

PositionX = 100;
PositionY = 100;

// Set these value approximately 20 pixels greater than the
// size of the largest image to be used (needed for Netscape)

defaultWidth  = 500;
defaultHeight = 500;

// Set autoclose true to have the window close automatically
// Set autoclose false to allow multiple popup windows

var AutoClose = true;

// Do not edit below this line...
// ================================
if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;
function popImage(imageURL,imageTitle){
if (isNN){imgWin=window.open('about:blank','',optNN);}
if (isIE){imgWin=window.open('about:blank','',optIE);}
with (imgWin.document){
writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);');
writeln('width=100-(document.body.clientWidth-document.images[0].width);');
writeln('height=100-(document.body.clientHeight-document.images[0].height);');
writeln('window.resizeTo(width,height);}');writeln('if (isNN){');
writeln('window.innerWidth=document.images["George"].width;');writeln('window.innerHeight=document.images["George"].height;}}');
writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');
if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
else writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
writeln('<img name="George" src='+imageURL+' style="display:block"></body></html>');
close();
}}
function do_refresh(actionString){   
		window.location=actionString;
}
function ItemMinimize(Name) {
if (Name<=8) {
  for(i=1;i<8;i++) {
	var MItem=document.getElementById('IDM_'.concat(i));	
    if (i==Name){

			if (MItem.style.display=='') {
				MItem.style.display='none';
			}
			else {
				MItem.style.display='';
			}
	}
	else {
		MItem.style.display='none';
	}
  }  
}
else {
	var MItem=document.getElementById('IDM_'.concat(Name));	
    
			if (MItem.style.display=='') {
				MItem.style.display='none';			
			}
			else {
				MItem.style.display='';			
			} 
	}
}
function ItemMinimizeweb(Name) {
if (Name<=8) {
  for(i=1;i<8;i++) {
	var MItem=document.all('IDM_'.concat(i));	
    if (i==Name){
			if (MItem.style.display=='') {
				MItem.style.display='none';
			}
			else {
				MItem.style.display='';
			}
	}
	else {
		MItem.style.display='none';
	}
  }  
}
else {
	var MItem=document.all('IDM_'.concat(Name));	
    
			if (MItem.style.display=='') {
				MItem.style.display='none';			
			}
			else {
				MItem.style.display='';			
			} 
	}
}
