function changecolor(nama){				
	var temp = eval("document.getElementById('" + nama + "')");		
	   if (temp.className =="fond1"){
             temp.className = "fond3";
       }else if (temp.className =="fond2"){       	
             temp.className = "fond4";
       }else if (temp.className =="fond3"){       	
             temp.className = "fond1";
       }else if (temp.className =="fond4"){       	
             temp.className = "fond2";
       }
}

function checkNormalChar(stringIn) {
	 retval = false 
	 var i;
     for (i=0;i<=stringIn.length-1;i++) { 
     	 //cho phep nhung ky tu tu A->Z, a->z, 0->9,va cac ky tu @,_
	      if (((stringIn.charCodeAt(i) >= 48)&&(stringIn.charCodeAt(i) <= 57)) || ((stringIn.charCodeAt(i) >= 64)&&(stringIn.charCodeAt(i) <= 90)) || ((stringIn.charCodeAt(i) >= 97)&&(stringIn.charCodeAt(i) <= 122)) ||(stringIn.charCodeAt(i)==95) ||(stringIn.charCodeAt(i)==46) ||(stringIn.charCodeAt(i)==45)) { 
                retval = true;
      	  }else{
      	  		retval = false;
      	  		break;
         }
     }
	 return retval;
}
function checkNormalName(stringIn) {
	 retval = false 
	 var i;
     for (i=0;i<=stringIn.length-1;i++) { 
     	 //cho phep nhung ky tu tu A->Z, a->z, 0->9,
	     // if (((stringIn.charCodeAt(i) >= 48)&&(stringIn.charCodeAt(i) <= 57)) || (stringIn.charCodeAt(i) == 32) || ((stringIn.charCodeAt(i) > 64)&&(stringIn.charCodeAt(i) <= 90)) || ((stringIn.charCodeAt(i) >= 97)&&(stringIn.charCodeAt(i) <= 122)) ||(stringIn.charCodeAt(i)==95) ||(stringIn.charCodeAt(i)==46) ||(stringIn.charCodeAt(i)==45)) { 
          if ((stringIn.indexOf("@") > 0)||(stringIn.indexOf("<") > 0)||(stringIn.indexOf(">") > 0)||(stringIn.indexOf("!") > 0)||(stringIn.indexOf("$") > 0)||(stringIn.indexOf("%") > 0)||(stringIn.indexOf("(") > 0)||(stringIn.indexOf(")") > 0)||(stringIn.indexOf("=") > 0)||(stringIn.indexOf("#") > 0)||(stringIn.indexOf("{") > 0)||(stringIn.indexOf("}") > 0)||(stringIn.indexOf("[") > 0)||(stringIn.indexOf("]") > 0)||(stringIn.indexOf("]") > 0)||(stringIn.indexOf("]") > 0)){ 
		      retval = false;
			  break;
      	  }else{
      	  		retval = true;      	  		
         }
     }
	 return retval;
}

function showDialog(url, width, height, target)
{

	return showWindow(url, true, false, false, false, false, false, false, false, true, width, height, 0, 0, target);
}

function showDialog1(url, width, height, target)
{

	return showWindow(url, true, false, false, true, false, false, false, false, true, width, height, 0, 0, target);
}

function openWindow(url, width, height, target)
{
    return showWindow(url, true, true, true, true, true, true, true, true, true, width, height, 0, 0, target);
}

function showWindow(url, isStatus, isMenubar, isResizeable, isScrollbars, isToolbar, isLocation, isFullscreen, isTitlebar, isCentered, width, height, top, left, target)
{
    if (isCentered)
    {
         top = (screen.height - height) / 2;
         left = (screen.width - width) / 2;
    }
    if(!target)
         target = '_blank';
                  
	open(url, target, 'status=' + (isStatus ? 'yes' : 'no') + ','

		+ 'menubar=' + (isMenubar ? 'yes' : 'no') + ','
	
		+ 'resizable=' + (isResizeable ? 'yes' : 'no') + ','
	
		+ 'scrollbars=' + (isScrollbars ? 'yes' : 'no') + ','
	
		+ 'toolbar=' + (isToolbar ? 'yes' : 'no') + ','
	
		+ 'location=' + (isLocation ? 'yes' : 'no') + ','
	
		+ 'fullscreen=' + (isFullscreen ? 'yes' : 'no') + ','
	
		+ 'titlebar=' + (isTitlebar ? 'yes' : 'no') + ','
	
		+ 'height=' + height + ',' + 'width=' + width + ','
	
		+ 'top=' + top + ',' + 'left=' + left);
}