/* action div related function start */

var btnclick = false;
//var objFieldObject = "" ;
//var strFieldType  = "" ;

if(document.body)

	//document.body.onclick=bodyaction;
          /*
		  	function validPATH(el){
	
					
					var elval= el.value.replace(/[\n\r\s]+/,"");
					if(elval =="") return true;
					var str=el.value;
					if(1){
					var filter1=/^(([a-zA-Z]:)|(\\\\{2}\w+)\\$?)(\\\\(\w[\w ]*))+(\.([a-zA-Z]){3}){0,1}$/i		   }
					if(1){
					 var filter2=/^\/(\w+\/)*([\w])+(\.([a-zA-Z]){3}){0,1}$/i		
					}
					if (filter1.test(str) || filter2.test(str))
					var testresults=true;
					else {el.focus();el.select();testresults=false;}
					
					return (testresults);
				}
			*/

function ShowUploadingProgrees()
{   		
        document.getElementById("Media_Uploading").style.display="";
		//alert(document.getElementById("Media_Uploading"));
}

function showdiv(divname)

{

		var temp;
        temp = document.getElementsByTagName("DIV");

        for(i=0;i<temp.length;i++)
        {
			if(temp[i].id.indexOf("lstdv")==0)  
				{ 
				   //alert(temp[i].id + " INDEX = "+temp[i].id.indexOf("d"));
				   temp[i].style.display="none"; 
				}
        }
		
		document.getElementById(divname).style.position = "absolute" ;
		
        document.getElementById(divname).style.display="block";

}



function bodyaction()
{

       if(!btnclick)

        {

                var temp = document.getElementsByTagName("DIV");

                for(i=0;i<temp.length;i++)
                {
                        if(temp[i].id.indexOf("lstdv")==0) temp[i].style.display="none";                }

		        }

        else
			{
					btnclick=false;
			}
		

}

function hidediv(divname)

{

        document.getElementById(divname).style.display="none";

}



function tdover(tdname)

{

        if(document.getElementById(tdname).className!="drpMenuTDBorderHover")
                document.getElementById(tdname).className="drpMenuTDBorderHover";

}

function tdout(tdname)

{

        if(document.getElementById(tdname).className!="drpMenuTDBorder")

                document.getElementById(tdname).className="drpMenuTDBorder";

}

////////////////////////////////////////////////////////////////////////////////////////////////

function getposition(ImageId,divId)
{
         // alert(ImageId);

         // alert(divId);

        //alert(document.getElementById(imageid).offsetLeft);

        var imageid = document.getElementById( ImageId );

        objMenuDiv =  document.getElementById( divId );

        x = moveXbySlicePos ( 0, imageid, divId );

        //alert(x);

        y = moveYbySlicePos ( 18, imageid );

        document.getElementById( divId ).style.top = y;

        document.getElementById( divId ).style.left = x;

        showdiv( divId );
}

function moveXbySlicePos (x, img, divId)

{

        var leftside = 65;

        if (!document.layers)

        {

                var onWindows = navigator.platform ? navigator.platform == "Win32" : false;

                var macIE45 = document.all && !onWindows && getExplorerVersion() == 4.5;

                var par = img;

                var lastOffset = 0;

                while(par)

                {

                        if( par.leftMargin && ! onWindows ) x += parseInt(par.leftMargin);

                        if( (par.offsetLeft != lastOffset) && par.offsetLeft ) x += parseInt(par.offsetLeft);

                        if( par.offsetLeft != 0 ) lastOffset = par.offsetLeft;

                        par = macIE45 ? par.parentElement : par.offsetParent;

                }

     }



         else if (img.x) x += img.x;



         if(parseInt(document.getElementById(divId).style.width) + x > (document.body.clientWidth))

                 x= x-leftside;

        return x;

}

function moveYbySlicePos (y, img)

{

        if(!document.layers) {

                var onWindows = navigator.platform ? navigator.platform == "Win32" : false;

                var macIE45 = document.all && !onWindows && getExplorerVersion() == 4.5;

                var par = img;

                var lastOffset = 0;

                while(par){

                        if( par.topMargin && !onWindows ) y += parseInt(par.topMargin);

                        if( (par.offsetTop != lastOffset) && par.offsetTop ) y += parseInt(par.offsetTop);

                        if( par.offsetTop != 0 ) lastOffset = par.offsetTop;

                        par = macIE45 ? par.parentElement : par.offsetParent;

                }

        } else if (img.y >= 0) y += img.y;

        return y;

}



/* Following And above functions are same except the message displays is changed */
function CompareDates2(txtAuctionSDate, txtAuctionEDate, Caption1, Caption2, focusElement, IsFocus)
{
	// Pass IsFocus='No' if you don't want to focus on any element
	// focusElement is the control on which will have focus after alert
	// txtAuctionSDate is the object of first date
	// txtAuctionEDate is the object of end date
	
	if(IsFocus==null) IsFocus = 'Yes';
	if(txtAuctionSDate.value.length!=0 && txtAuctionEDate.value.length!=0 )
	{
		var StartDate = txtAuctionSDate.value;
		var EndDate = txtAuctionEDate.value;
		var arrStart = StartDate.split("/");
		var arrEnd = EndDate.split("/");
		if(arrEnd[2]<arrStart[2])
		{
			alert( Caption2 + ' must be greater than ' + Caption1 + '.' );
			
			/* if focus is shown or not */
		
			if(IsFocus=='Yes')
			{
				if(focusElement==null) focusElement = txtAuctionEDate.focus();
				else { focusElement.focus();}
			}
			
			return false;
		
		}
		else if(arrEnd[2]==arrStart[2])
		{
			if(parseInt(arrEnd[0])<parseInt(arrStart[0]))
			{
				alert( Caption2 + ' must be greater than ' + Caption1 + '.' );
				
				/* if focus is shown or not */
				if(IsFocus=='Yes')
				{
					if(focusElement==null) focusElement = txtAuctionEDate.focus();
					else { focusElement.focus();}
				}
			
				return false;
			}
			else if(parseInt(arrEnd[0])==parseInt(arrStart[0]))
			{
				if(parseInt(arrEnd[1])<arrStart[1])
				{
					alert( Caption2 + ' must be greater than ' + Caption1 + '.' );
					/* if focus is shown or not */
				
					if(IsFocus=='Yes')
					{
						if(focusElement==null) focusElement = txtAuctionEDate.focus();
						else { focusElement.focus();}
					}
					return false;
				}
				else return true;
			}
			else return true;
		}
		else return true;
	}
	else
	{
		return true;
	}
}

/* action div related function end */

function date_compare(start_date,end_date)

{

        //alert(start_date +"-----"+ end_date);

        var stdate=start_date.split("-");

        var enddate=end_date.split("-");



        var stmillsec=Date.UTC(parseInt(stdate[0]),parseInt(stdate[1],10),parseInt(stdate[2],10));

        var enmillsec=Date.UTC(parseInt(enddate[0]),parseInt(enddate[1],10),parseInt(enddate[2],10));





        //alert(enddate[1] +"####"+ parseInt(enddate[1],10));

        //alert(parseInt(stdate[0])+","+parseInt(stdate[1],10)+","+parseInt(stdate[2],10)+"@@@@@@@"+parseInt(enddate[0])+","+parseInt(enddate[1],10)+","+parseInt(enddate[2],10));

        //alert(stmillsec +"-----"+ enmillsec );

        if(stmillsec < enmillsec)

        {

                //alert(stmillsec +"-----"+ enmillsec +"false");

                return false;

        }

        else

        {

                //alert(stmillsec +"-----"+ enmillsec +"true");

                return true;

        }

}



function Resize(imgPreview)

{

        var nwidth=imgPreview.width+50;

        var nheight=imgPreview.height+200;

        if(nwidth<200)

                nwidth=200;

        if(nheight<200)

                nheight=200;



        window.resizeTo(nwidth,nheight);

}// JavaScript Document





function go(id)

{

	if(confirm('Are you sure you want to delete the selected item?'))

	{

		document.frmusergroup.delids.value = id;

		return true;

		//onClick="return MultiDelete(\''.$_SESSION['goToUrl'].'\');"

		//document.frmusergroup.submit();

	}



}



function CheckIsSelected( formName,checkBoxName,hiddenName,msg )
{
	
        var obj=eval("document."+formName);
		
		var chkobj=eval("document."+formName+"."+checkBoxName);

		var hidobj=eval("document."+formName+"."+hiddenName);
		var blSelected = false;
				
                if(!chkobj.length)

                {
                        if(chkobj.checked)

                            blSelected = true;
                }

                else
                {

                        for(i=0;i<chkobj.length;i++)

                        {

                                if(chkobj[i].checked)

                                {

                                                blSelected = true;

                                                break;

                                }



                        }

                }



                if(!blSelected)
				{
		
					if(msg)
					{
						alert(msg);
					}
					else
					{
						alert('Please select at least one record.');
					}
		
					return false;
		
				}
                else
                {

					var values="";
					if(!chkobj.length)
					{
							hidobj.value=chkobj.value
					}
					else
					{
							for(i=0;i<chkobj.length;i++)
							{
									if(chkobj[i].checked)
											values = values+chkobj[i].value+",";
							}
							hidobj.value=values.substring(0,values.length -1);
					}
					return true;

                }

}



function SelectAll(formName,selChkName,checkBoxName)
{ 	

	 var selchkobj=eval("document."+formName+"."+selChkName);  	 

	 var chkobj=eval("document."+formName+"."+checkBoxName);
	 
        if(selchkobj.checked)

                {

                        if(!chkobj.length)

                        {

                                chkobj.checked = true;

                        }

                        else

                        {

                                for(i=0;i<chkobj.length;i++)

                                {

                                        if(chkobj[i].disabled == false)

                                        chkobj[i].checked = true;

                                }

                        }

                }

                else

                {

                        if(!chkobj.length)

                        {

                                chkobj.checked = false;

                        }

                        else

                        {

                                for(i=0;i<chkobj.length;i++)

                                {

                                        chkobj[i].checked = false;

                                }

                        }

                }

}


function getElementObject(objElement,objForm, elType)
{
	CheckBr = checkBrowser();
	
	if(CheckBr =='IE')
	{
      var HtmlObj = eval("objForm."+objElement);

	  return HtmlObj ;
	}
	else
	{

		return eval("objForm."+objElement);
		//var objSel = eval ("document."+objForm.elements) ; //document.getElementsByTagName( elType ) ;

		
		var objEl = document.getElementsByTagName(elType);				//objForm.elements ;
			
		var retObj = null ; 			
	
        for(y=0; y<objEl.length; y++)
		{ 
		
			if ( objEl[y].id == objElement )
				{
					retObj = objEl[y] ;
					break;
				}			       
		}
	
		return retObj ;
	}
}


function MainSelCheck(formName,selChkName,checkBoxName,index)

{
        var selchkobj=eval("document."+formName+"."+selChkName);
        var chkobj=eval("document."+formName+"."+checkBoxName);
		
		
        if(chkobj.length)

        {

                var tmp=eval("document."+formName+"."+checkBoxName+"["+index+"]");
		

                if(tmp.checked)

                {

                        var selall=true;

                        for(i=0;i<chkobj.length;i++)

                        {

                                if(chkobj[i].checked == false && chkobj[i].disabled == false)

                                {

                                        selall=false;

                                        break;

                                }

                        }

                        if(selall)

                                selchkobj.checked=true;

                        else

                                selchkobj.checked=false;

                }

                else

                {

                        selchkobj.checked=false;

                }

                return true;

        }

        else

        {

                if(chkobj.checked)

                        selchkobj.checked=true;

                else

                        selchkobj.checked=false;

        }



        return true;



}

function ImageWindow(imageUrl)

{

        imWindow = window.open("", "tinyWindow", 'toolbar=0,width=550,height=500,scrollbars=yes,resizable=yes')

        html="<html><head><title>View Image</title><body width=100% height=100%>";

        html+="<style type='text/css'><!--";

        html+=".style1 {BORDER-RIGHT: 1px groove #4EACEC; BORDER-TOP: 1px groove #2F688E; FONT-WEIGHT: bold; FONT-SIZE: 10px; BORDER-LEFT: 1px groove #2F688E; COLOR: #ffffff; BORDER-BOTTOM: 1px groove #4EACEC; FONT-FAMILY: Verdana; BACKGROUND-COLOR: #489FDA}";

        html+="--></style>";

        html+="<table align=center width='100%' height='90%'><tr><td align=center valign=middle>";

        html+="<img src='" + imageUrl + "'>";

        html+="</td></tr></table>";

        html+="<p align=center><input type=button value='Close' onclick='window.close()' class='style1'></p>";

        html+="</body></html>";

        imWindow.document.write(html);

}

function CompareDates(txtAuctionSDate, txtAuctionEDate, Caption1, Caption2, focusElement, IsFocus)

 {



    // Pass IsFocus='No' if you don't want to focus on any element

	// focusElement is the control on which will have focus after alert

	// txtAuctionSDate is the object of first date

	// txtAuctionEDate is the object of end date





			if(IsFocus==null) IsFocus = 'Yes';



		          if(txtAuctionSDate.value.length!=0 && txtAuctionEDate.value.length!=0 )

                        {

                          var StartDate = txtAuctionSDate.value;

                          var EndDate = txtAuctionEDate.value;



                          var arrStart = StartDate.split("/");

                          var arrEnd = EndDate.split("/");



                          if(arrEnd[2]<arrStart[2])

                                {

                                 alert( Caption1 + ' must be smaller than ' + Caption2 + '.' );



								 /* if focus is shown or not */

                                  if(IsFocus=='Yes')

									 {

										if(focusElement==null) focusElement = txtAuctionEDate.focus();

										else { focusElement.focus();}

									 }



                                  return false;

                                }

                          else if(arrEnd[2]==arrStart[2])

                                {

                                  	if(parseInt(arrEnd[0])<parseInt(arrStart[0]))

                                    {

                                         alert( Caption1 + ' must be smaller than ' + Caption2 + '.' );



										 /* if focus is shown or not */

                                         if(IsFocus=='Yes')

											 {

												if(focusElement==null) focusElement = txtAuctionEDate.focus();

												else { focusElement.focus();}

											 }



                                          return false;

                                    }

                                  	else if(parseInt(arrEnd[0])==parseInt(arrStart[0]))

                                    {

                                          if(parseInt(arrEnd[1])<parseInt(arrStart[1]))

                                                {

                                                alert( Caption1 + ' must be smaller than ' + Caption2 + '.' );



												   /* if focus is shown or not */

												   if(IsFocus=='Yes')

													 {

														if(focusElement==null) focusElement = txtAuctionEDate.focus();

														else { focusElement.focus();}

													 }



                                                 return false;

                                                }

										else return true;

                                     }

									else return true;



                                }

							else return true;

	                    }

                else

                        {

                                return true;

                        }

}

// Removes leading whitespaces
function Ltrim( value ) {

		var re = /\s*((\S+\s*)*)/;
		return value.replace(re, "$1");

}

		// Removes ending whitespaces
function Rtrim( value ) {

		var re = /((\s*\S+)*)\s*/;
		return value.replace(re, "$1");

}

// Removes leading and ending whitespaces
function trim( value ) {
		return Ltrim(Rtrim(value));

}

// that function appends 0 if in date if day or month is single digit long then it prefix 0 with it to make two digit long.

function ReturnValidDate(DateValue)
{
		
	var DateArray =DateValue.split("/");
	var strToReturn ='';
	if(DateArray[0].length==1)
	{
		strToReturn +='0'+DateArray[0]+'/';
	}
	else
	{
		strToReturn =DateArray[0]+'/';
	}
	
	if(DateArray[1].length==1)
	{
		strToReturn +='0'+DateArray[1]+'/';
	}
	else
	{
		strToReturn +=DateArray[1]+'/';
	}
	strToReturn += DateArray[2];
	//alert("return date:-"+strToReturn);
	return strToReturn;

}
function ReturnResponse(strURL)
{
	CheckBr = checkBrowser();
	
	if(CheckBr =='IE')
	{
		
		 objHTTP=new ActiveXObject("MSXML2.XMLHTTP");
		 var a=objHTTP.open("GET", strURL,false);
		 objHTTP.send();
		 strResult = objHTTP.responseText;
		
	}
	else
	{		
		objHTTP = new XMLHttpRequest();
		
		objHTTP.open( "GET", strURL,false ) ;	

		objHTTP.send(null);
		
		strResult = objHTTP.responseText;	

	}
	return strResult
}
 function CheckForInteger(eCode)
  {
               
   if((eCode<48)||(eCode>57))
	{
		return false;
     }
  }
  
//This is Used for Validate the zip Code
function isValidZip(Zip)
{        
        var Zip = new String(Zip);                
		var filterString = /^([0-9a-zA-Z][a-zA-Z0-9-+]*)$/ ;
        return filterString.test(Zip);
} 

//This is Used for Validate the phone
function isValidPhone(PhoneNo)
{        
        var PhoneNo = new String(PhoneNo);                
		var filterString = /^([0-9a-zA-Z][a-zA-Z0-9-+]*)$/ ;
        return filterString.test(PhoneNo);
} 

/* following function Trim the left and right Spaces from a value*/
/******* Vikas 7/10/2006 **********************/

function trimLR(el)
{
	var str = el.replace(/[\n\r\s]+/,"");
	if(str!=="") while(str.charAt(0)==" "){str = str.substring(1,str.length)}
	if(str!=="") while(str.charAt(str.length-1)==" "){str = str.substring(0,(str.length)-1)}
	return str;
}




function IsNumeric(sText)
{
   var ValidChars = "0123456789.";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
   
   }
   
// function to create popup in div

function AddPopup(pstrFile,strHeading,intsrcWinId) 
{
	
	win_init();
	//var ver=navigator.appVersion;
	//var ie7=(ver.indexOf("MSIE 7")>-1)?1:0;
	//var bw=(ie7);
	//if(bw==1)
	//{
		winpage= new lib_doc_size();
	//}
	/*else
	{
		winpage='';
	}
	*/
	var intTop = document.body.scrollTop + 25;

	strAdminUser = "<iFrame src=\""+pstrFile+"\" width=\"100%\" height=\"100%\" frameborder=\"0\" marginheight=\"0\" id=\"newFrame\" nodeValue=\"\" scrolling=\"auto\" align=\"left\" style=\"margin-left:0.05cm;margin-right:0cm;position:absolute;\"></iFrame>";		
	addWindow(strHeading,strAdminUser,125,intTop,750,550,false,null,intsrcWinId);
		
} 
function AddFrontPopup(pstrFile,strHeading,intsrcWinId,Fwidth,Fheigth) 
{
	
	win_init();
	//alert("dfsgfsdanu");
	//var ver=navigator.appVersion;
	//var ie7=(ver.indexOf("MSIE 7")>-1)?1:0;
	//var bw=(ie7);
	//if(bw==1)
	//{
		winpage= new lib_doc_size();
	//}
	/*else
	{
		winpage='';
	}
	*/
	var intTop = document.body.scrollTop + 25;

	strAdminUser = "<iFrame src=\""+pstrFile+"\" width=\"100%\" height=\"100%\" frameborder=\"0\" marginheight=\"0\" id=\"newFrame\" nodeValue=\"\" scrolling=\"auto\" align=\"left\" style=\"margin-left:0.05cm;margin-right:0cm;position:absolute;\"></iFrame>";		
	addWindow(strHeading,strAdminUser,125,intTop,Fwidth,Fheigth,false,null,intsrcWinId);
		
} 
//End popup function


/*
// function to create new Div

function AddPopup(strURL, title)
	{
		//document.getElementById("sample1").style.display = "block";	

		if (winList['sample1']) 
			{		
				strAdminUser = '<iFrame src=\"'+strURL+'\" width=\"750\" height=\"470\" frameborder=\"0\" marginheight=\"0\" id=\"newFrame\" nodeValue=\"\" scrolling=\"auto\" align=\"left\" style=\"top=20px;margin-left:-0.19cm;margin-right:0cm;position:absolute;\"></iFrame>';			

				winList['sample1'].open(); 			

				var objTitle = document.getElementById("detailPopUpTitle");

				objTitle.innerHTML = title ;
			
				var objClientDiv = document.getElementById( "clientArea" ) ;				
				var str  = strAdminUser ;
				setTimeout("givePopupTimeDelay('"+str+"')",100);
			}		
		return false;
	}

function givePopupTimeDelay( strAdminUser )
	{
		var objClientDiv = document.getElementById( "clientArea" ) ;
		objClientDiv.innerHTML = strAdminUser ;
	}

// end function ----------
*/

function getDelay(strURL)
	{
		location.href = strURL ;	
	}

function GoToURL(strURL, intRomId)
{   	
	var resp = ReturnResponse(_JS_WWWROOT+'/common/putInSession.php?pintSessRomId='+intRomId); 

	setTimeout( "getDelay('"+strURL+"')", 1 );	
}

// For FormField 

function GoToFormField(strURL)
{
getRequest(strURL);
}

function InsertIntoTable(strURL)
{ 
	
	//alert(parent.);			
	//return false;			
	
   if(document.frmAddQuickLaunchBar.txtName.value == '')
   {
	   alert("Item title field is empty");
        return false;
   }   
   
    var strItemName;	
	var quickDivObj = document.getElementById("sample2");
    strItemName = document.frmAddQuickLaunchBar.txtName.value;
	strKeyName = document.frmAddQuickLaunchBar.txtkey.value;
	strCtrlKeyName = document.frmAddQuickLaunchBar.txtctrlkey.value;	
	quickSetToFalse(quickDivObj);
	//alert(strItemName);
	getRequest(_JS_WWWROOT+'/functional/ui/UIFAddMoveablediv.php?strItemName='+strItemName+'&strURL='+strURL+'&strKeyName='+strKeyName+'&strCtrlKeyName='+strCtrlKeyName+'&action=AddQLB','','');
	 //alert(_JS_WWWROOT+'/functional/ui/UIFAddMoveablediv.php?strItemName='+strItemName+'&strURL='+strURL+'&strKeyName='+strKeyName+'&strCtrlKeyName='+strCtrlKeyName+'&action=AddQLB');

}



//Disable right mouse click Script
//By Maximus (maximus@nsimail.com) w/ mods by DynamicDrive
//For full source code, visit http://www.dynamicdrive.com

function clickIE4(){
if (event.button==2){
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
return false;
}
}
}

function DisableRightButton(){

		if (document.layers){
		document.captureEvents(Event.MOUSEDOWN);
		document.onmousedown=clickNS4;
		}
		else if (document.all&&!document.getElementById){
		document.onmousedown=clickIE4;
		}

		document.oncontextmenu=new Function("return false")
		
}
/*
	Function is use for validation of formfields when filed type is selectbox,checkbox,radiobutton
*/


function ValidCaption(EnterString)
{
	
	var val = new String(EnterString) ;                
	var regExp = /^[a-zA-Z0-9_\.:\/\s-]+$/ ;
	
	return regExp.test(val) ;
	//return /^[a-zA-Z0-9_.:/\s-]*$/.test(val) ;
	
}





function matchString(strMatch, strString)
	{		
		var objRegExp = eval("/"+strMatch+"/i");		
		return objRegExp.test(strString); 
		
	}

/* Function to make a alphanumeric validation on the value passed thru this function */
function alphanumeric(alphane)
	{
		var numaric = alphane;
		for(var j=0; j<numaric.length; j++)
			{
			  var alphaa = numaric.charAt(j);
			  var hh = alphaa.charCodeAt(0);
			  if((hh > 47 && hh<58) || (hh > 64 && hh<91) || (hh > 96 && hh<123))
			  {
			  }
			else	{
				 return false;
			  }
			}
	 return true;
	}
function alphanumeric2(alphane)
	{
		var numaric = alphane;
		for(var j=0; j<numaric.length; j++)
			{
			  var alphaa = numaric.charAt(j);
			 // alert("alphaa ::"+alphaa);
			  var hh = alphaa.charCodeAt(0);
			  
			  if((hh > 47 && hh<58) || (hh > 64 && hh<91) || (hh > 96 && hh<123))
			  {
				  			  

			  }
				else
				{
					 return false;
				}
			}
	 return true;
	}
/* Following function is used to check Browser */

function checkBrowser()
	{
		var browser = navigator.appName; //find the browser name

		if(browser == "Microsoft Internet Explorer")
		{
		  return 'IE';
		}
		else
		{
		  return 'NS'; 	
		}
	}

/* Following function shows the focus on the first form field */

function GetFocusOnField( strFormName ,strFieldName)//form Name,and field Name
	{
		setTimeout("AShortDelayInFocus('"+strFormName+"','"+strFieldName+"')", 1000);
	}

/* function called by above function after a very short delay, so that page is fully loaded by 
   AJAX and set the focus on the passing form's field */

function AShortDelayInFocus( strFormName, strFieldName )
	{
		 // Create Object for the form field	
		 objField = eval( "document."+strFormName+"."+strFieldName );
		 if( typeof(objField) == "object" ) // check if object type is there
			{					
				objField.focus(); // sets the focus		
			}
	}





function TrimString(STRING){
STRING = LTrim(STRING);
return RTrim(STRING);
}

function RTrim(STRING){
while(STRING.charAt((STRING.length -1))==" "){
STRING = STRING.substring(0,STRING.length-1);
}
return STRING;
}


function LTrim(STRING){
while(STRING.charAt(0)==" "){
STRING = STRING.replace(STRING.charAt(0),"");
}
return STRING;
}


function getFlashMovieObject(movieName)
{
  if (window.document[movieName]) 
  {
    return window.document[movieName];
  }
  if (navigator.appName.indexOf("Microsoft Internet")==-1)
  {
    if (document.embeds && document.embeds[movieName])
      return document.embeds[movieName]; 
  }
  else
  {
    return document.getElementById(movieName);
  }
}


///  CHECK MAIL FORMATE  -- Ramendra Singh
function validEmail(el)
{				
	var elval;
	var str=el;
	var filter=/^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/	;
	count ='';
	if (!filter.test(str))
	{
	 count = '1'; 
	}
}    