<!--
var msgColor="#C00000";
var msgbgColor="#D3E2C6";

var strError="";

//------------------------------------------------------------
//CREATING REQUESTOBJECT
//------------------------------------------------------------
function createRequest() {
 	
 	//var request=null;
 	
	try{
		// FIREFOX, OPERA 8.0+, SAFARI
		request=new XMLHttpRequest();
	}
	catch (trymicrosoft){
		// INTERNET EXPLORER
		try{
			request=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (eothermicrosoft){
			try{
	 			request=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (failed){
				alert(err_unsupported_browser);
				request = null;
	    			return false;
			}
		}
	}

	if (request == null)
		alert(err_in_process);
}	
  
//------------------------------------------------------------
//FOCUS THE CONTROL
//------------------------------------------------------------
function getFocus(ctrl){
	var e_ctrl='document.getElementById(ctrl)';
	eval(e_ctrl).focus();
}

//------------------------------------------------------------
//OPEN FILE
//------------------------------------------------------------
function openfile(file){
	 top.location.href=file;
}

//------------------------------------------------------------
//GOT TO NEXT CONTROL
//------------------------------------------------------------
function goNext(e,ctl)
{
 if(e==13){
 	eval(ctl).focus();
 	return false;
 }	
}

//------------------------------------------------------------
//CALL FUNCTION BY ENTER KEY
//------------------------------------------------------------
function checkEnter(e,funName)
{
 if(e==13)
 	eval(funName);
}

//------------------------------------------------------------
//BOOKMARK
//------------------------------------------------------------
function bookmark(){
if (document.all)
	window.external.AddFavorite(url, title);
else if (window.sidebar)
	window.sidebar.addPanel(title, url, "")
} 


//------------------------------------------------------------
//EMAIL CHECK 
//------------------------------------------------------------
 function checkEmail()
  	{
  	var strEmail, strError, countAtRate, countDot, i;
  	var checkAtRate, checkDot;
  	var ValidChars,CountValidChars;
  	ValidChars="abcdefghijklmnopqrstuvwxyz0123456789_.@ABCDEFGHIJKLMNOPQRSTUVWXYZ-";
  	strEmail = checkEmail.arguments[0];
  	countAtRate=0;
  	countDot=0;
  	CountValidChars=0;
  	if (strEmail.length >= 7)
  		{
  		for(i=0;i<strEmail.length;i++)
  			{
  			if(strEmail.charAt(i)=="@")
  				countAtRate++;
  			if(strEmail.charAt(i)==".")
  				countDot++;
  			CountValidChars=0;
  			for(j=0;j<ValidChars.length;j++)
  				{
  				if(strEmail.charAt(i)==ValidChars.charAt(j))
  					{
  					CountValidChars++;
  					}
  				}
  			if(CountValidChars==0)
  				{
  				strError=0;
  				break;
  				}
  			}
  		}
  	checkAtRate=strEmail.indexOf("@",1);
  	checkDot=strEmail.indexOf(".",1);
  	for(i=1;i<countDot;i++)
  		checkDot=strEmail.indexOf(".",checkDot+1);
  	if(countAtRate==1 && countDot > 0 && strEmail.length >=7 && strError != 0)
  		strError=1;
  	else
  		strError=0;
  	if(checkDot>=strEmail.length-2)
  		strError=0;
  	if(strEmail.charAt(0)=="@" || strEmail.charAt(strEmail.length-1)=="@")
  		strError=0;
  	if(strEmail.charAt(0)=="." || strEmail.charAt(strEmail.length-1)==".")
  		strError=0;
  	if(checkDot < checkAtRate)
  		strError=0;
 
  	return strError;
 }

//------------------------------------------------------------
//EMAIL CHECK PHONE
//------------------------------------------------------------
 function checkPhone()
  	{
  	var strPh, strError, countDot, i;
  	var ValidChars,CountValidChars;
  	ValidChars="0123456789-";
  	strPh = checkPhone.arguments[0];
  	CountValidChars=0;
  	if (strPh.length >= 1)
  		{
  		for(i=0;i<strPh.length;i++)
  			{
  			CountValidChars=0;
  			for(j=0;j<ValidChars.length;j++)
  				{
  				if(strPh.charAt(i)==ValidChars.charAt(j))
  					{
  					CountValidChars++;
  					}
  				}
  			if(CountValidChars==0)
  				{
  				strError=0;
  				break;
  				}
  			}
  		}
  	return strError;
 }

//------------------------------------------------------------
//CHECK NUMBER
//------------------------------------------------------------
function checkNumber(){
  	var intNumber, strError, i;
  	var ValidChars,CountValidChars;
  	ValidChars="0123456789";
  	intNumber = checkNumber.arguments[0];
  	CountValidChars=0;
  	if (intNumber.length >= 1)
  		{
  		for(i=0;i<intNumber.length;i++)
  			{
  			CountValidChars=0;
  			for(j=0;j<ValidChars.length;j++)
  				{
  				if(intNumber.charAt(i)==ValidChars.charAt(j))
  					{
  					CountValidChars++;
  					}
  				}
  			if(CountValidChars==0)
  				{
  				strError=0;
  				break;
  				}
  			}
  		}
  	return strError;
}

//------------------------------------------------------------
//CHECK FLOAT
//------------------------------------------------------------
function checkFloat()
{
  	var floatNumber, strError, i;
  	var countDot=0;
  	var ValidChars,CountValidChars;
  	ValidChars="0123456789.";
  	floatNumber = checkFloat.arguments[0];
  	countAtRate=0;
  	CountValidChars=0;
  	if (floatNumber.length >= 1)
  		{
  		for(i=0;i<floatNumber.length;i++)
  			{
  			
  			if(floatNumber.charAt(i)==".")
  				countDot++;
  			
  			CountValidChars=0;
  			for(j=0;j<ValidChars.length;j++)
  				{
  				if(floatNumber.charAt(i)==ValidChars.charAt(j))
  					{
  					CountValidChars++;
  					}
  				}
  			if(CountValidChars==0)
  				{
  				strError=0;
  				break;
  				}
  			}
  		}
  	
  	if(countDot > 1){
  		strError=0;
  	}
  	else{
  		strError=1;
  	}	
   		
  	return strError;
}

//------------------------------------------------------------
//CHECK SPACE
//------------------------------------------------------------
//To Check Space on text box//
function chkSpace(txtfield){
	var i,j,txtval;
	j=0;
		txtfield=eval(txtfield);
		txtval=txtfield.value;
		for(i=0;i<txtval.length;i++){
			j++
		    if(txtval.substr(i,1)!=" ")
	    	break;
	    }

		txtval=txtval.substr(j-1,txtval.length);
		if(txtval==" ")
			txtval="";
			txtfield.value=txtval;
			return(txtval);
}

//------------------------------------------------------------
//CHECK IMAGE EXTENSION
//------------------------------------------------------------
function chkImageExt(iVal){	
   var validArrExt=new Array('JPG','GIF','PNG','BMP');
   if(iVal!=""){
	var StrExt=iVal.substring(iVal.lastIndexOf('.')+1);
	if (StrExt!=""){
	   StrExt=StrExt.toUpperCase();
	   var cnt=0;
	   for(var i=0;i<validArrExt.length;i++){
	   	if (StrExt==validArrExt[i]){
	   		cnt++;
	   		break;
	   	}
	   }
	   if (cnt==0){
	   	return 0;
	   }
	   else{
	   	return 1;
	   }
	}
  }
}
//------------------------------------------------------------
//Show hide Div
//------------------------------------------------------------

function ShowHide()
{
  var divCtrl=document.getElementById(ShowHide.arguments[0]);

  if(divCtrl.style=="" || divCtrl.style.display=="none")
  {
	divCtrl.style.display="block";
  }
  else if(divCtrl.style!="" || divCtrl.style.display=="block")
  {
	divCtrl.style.display="none";
  }
}

//------------------------------------------------------------
//POST DATA
//------------------------------------------------------------
function postdata(val1) {
	document.frm.method="post";
	document.frm.action=val1;
	document.frm.submit();
 }


//------------------------------------------------------------
//HIDE PRINT BUTTON
//------------------------------------------------------------
function printHide(){
	var divCtrl=document.getElementById(printHide.arguments[0]);
	divCtrl.style.display="none";
}

//------------------------------------------------------------
//SHOW PRINT BUTTON
//------------------------------------------------------------
function printShow(){
	var divCtrl=document.getElementById(printShow.arguments[0]);
	divCtrl.style.display="block";
}

//------------------------------------------------------------
//POP UP WINDOWS
//------------------------------------------------------------
function PopUp(val)
{
	window.open(val,"prvwo","width=650,height=400,scrollbars=yes,resizable=yes,status=0,top=0,left=0");
}
//-----------------
function openwin(pagename)
 {
	window.open(pagename,"prvw1","width=700,height=540,scrollbars=yes,resizable=yes,status=0,top=0,left=0");

 }

//------------------------------------------------------------
//OPEN IMAGE DYNAMICALLY
//------------------------------------------------------------
 var prevWndL=null;
 function openImg(var1) {
 	if (prevWndL!=null)
 	prevWndL.close();
 
     prevWndL=window.open("","prvwl","width=600,height=500,scrollbars=yes,resizable=yes,status=0,top=0,left=0");
     prevWndL.document.open();
     prevWndL.document.writeln('<html><title>Preview</title><body bgcolor=#ffffff><font size=3 face="Verdana,,Arial,Helvetica" color="brown"><b>Image Preview</b></font><p><hr noshade width="100%" color="#009999"><center>');
     prevWndL.document.writeln('<a href="javascript:window.close()" ><img src='+var1+' border="0"></a></center>');
     prevWndL.document.writeln('<br><hr noshade width="100%" color="#009999"><a href="javascript:window.close()">Close Preview</a><br></body></html>');
     prevWndL.document.writeln('<BR>');
     prevWndL.document.close();
   }

//------------------------------------------------------------
//SIMPLE DELETE ACTION
//------------------------------------------------------------
function del(val1)
 {
 	if(confirm("Are you sure to Delete?")==true)
 	{
		document.frm.method="post";
		document.frm.action=val1;
		document.frm.submit();
	}	
 }

//------------------------------------------------------------
//CALL FUNCTION 
//------------------------------------------------------------
function validation(){
    var formTag=document.getElementById("frm");
    var validation_for	=	eval("validate_"+validation.arguments[0]);
    var postRequest_for	=	eval("postRequest_"+validation.arguments[0]);
    var errormsgTag	=	document.getElementById("errormsg");
    top.location.href="#top";
	
    if (validation_for(formTag,errormsgTag)==true){
       	postRequest_for(formTag);
    }
}

//------------------------------------------------------------
//GLOBAL POST REQUEST 
//------------------------------------------------------------
function postRequest(pairs,page_name_url,page_name_title){
	pairs=pairs;
	var url=page_name_url;
	request.onreadystatechange=function(){
		if(request.readyState==4){
			if(request.status==200){
				var Doc = request.responseText;
				var requestState_for=eval("requestState_"+page_name_title);
				requestState_for(Doc);						
			}
		}
	}	
	request.open("POST",url,true);
	var contentType = "application/x-www-form-urlencoded; charset=UTF-8";
	request.setRequestHeader("Content-Type",contentType);
	request.send(pairs);
}

//------------------------------------------------------------
//CALL DISPLAY ERROR MESSAGE 
//------------------------------------------------------------
function msg(_msg){
	var msgDiv=document.getElementById("errormsg");
	msgDiv.style.display ="block";
	msgDiv.style.backgroundColor=err_bg_color;
	msgDiv.style.borderColor=err_border_color;
	msgDiv.innerHTML=_msg;
}

function msgDE(_msg){
	var msgDiv=document.getElementById("errormsgDE");
	msgDiv.style.display ="block";
	msgDiv.style.backgroundColor=err_bg_color;
	msgDiv.style.borderColor=err_border_color;
	msgDiv.innerHTML=_msg;
}
function msgeDE(_msg){
	var msgDiv=document.getElementById("e_errormsgDE");
	msgDiv.style.display ="block";
	msgDiv.style.backgroundColor=err_bg_color;
	msgDiv.style.borderColor=err_border_color;
	msgDiv.innerHTML=_msg;
}
//------------------------------------------------------------
//CLEAR ALL CONTROLS
//------------------------------------------------------------
function clearAllforms(login_form)
	 {
	   var formTag=document.getElementById(login_form);
	   for(var i=0;i<formTag.length-2;i++)
		{
		 formTag[i].value="";
		}
	 }
	 
//------------------------------------------------------------
//------------------------------------------------------------
//This is for div drag and drop
/***********************************************
* Drag and Drop Script: c Dynamic Drive (http://www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/
var dragobject={
	z: 0, x: 0, y: 0, offsetx : null, offsety : null, targetobj : null, dragapproved : 0,
	initialize:function(){
		document.onmousedown=this.drag
		document.onmouseup=function(){this.dragapproved=0}
	},
	drag:function(e){
		var evtobj=window.event? window.event : e
		this.targetobj=window.event? event.srcElement : e.target
		if (this.targetobj.id=="delete"){
			this.dragapproved=1
			if (isNaN(parseInt(this.targetobj.style.left))){this.targetobj.style.left=0}
			if (isNaN(parseInt(this.targetobj.style.top))){this.targetobj.style.top=0}
			this.offsetx=parseInt(this.targetobj.style.left)
			this.offsety=parseInt(this.targetobj.style.top)
			this.x=evtobj.clientX
			this.y=evtobj.clientY
			if (evtobj.preventDefault)
				evtobj.preventDefault()
			document.onmousemove=dragobject.moveit
		}
		if (this.targetobj.id=="datadetail_edit"){
			this.dragapproved=1
			if (isNaN(parseInt(this.targetobj.style.left))){this.targetobj.style.left=0}
			if (isNaN(parseInt(this.targetobj.style.top))){this.targetobj.style.top=0}
			this.offsetx=parseInt(this.targetobj.style.left)
			this.offsety=parseInt(this.targetobj.style.top)
			this.x=evtobj.clientX
			this.y=evtobj.clientY
			if (evtobj.preventDefault)
				evtobj.preventDefault()
			document.onmousemove=dragobject.moveit
		}

	},
	moveit:function(e){
		var evtobj=window.event? window.event : e
		if (this.dragapproved==1){
			this.targetobj.style.left=this.offsetx+evtobj.clientX-this.x+"px"
			this.targetobj.style.top=this.offsety+evtobj.clientY-this.y+"px"
			return false
		}
	}
}
dragobject.initialize();
//------------------------------------------------------------
//------------------------------------------------------------
//Disable right mouse click Script
//By Maximus (maximus@nsimail.com) w/ mods by DynamicDrive
//For full source code, visit http://www.dynamicdrive.com

var message="Right Click is 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")

//------------------------------------------------------------
//------------------------------------------------------------


//------------------------------------------------------------
//------------------------------------------------------------



// -->