
	/**************************************************************
 set the focus on the form control passed to this function
 ***************************************************************/


function Focus(formname,controlname)
{
	document.forms[formname].elements[controlname].focus();	
}


function ConfirmDeletion()
{// used to comform any deletion from data grid....
	return confirm('Continue deleting ? ');
}

function ConfirmRemove()
{// used to comform any deletion from data grid....
	return confirm('Continue removing ? ');
}

function ConfirmRemoveItem(prodName)
{// used to comform any deletion from data grid....
	return confirm('Remove ' + prodName + ' from Cart ? ');
}

 function ConfirmClose()
 {
// Confirm for closing the application		 
 window.close();
  }


/**************************************************************
 AllowOnly: This function allow entering just the specified
            Expression to a textbox or textarea control.

 Parameters:
      Expression = Allowed characters.calcISTTime
                   a..z => ONLY LETTERS
                   0..9 => ONLY NUMBERS
                   other symbols...

 Example: use the onKeyPress event to make this function work:
          //Allows only from A to Z
          onKeyPress="AllowOnly('a..z');"

          //Allows only from 0 to 9
          onKeyPress="AllowOnly('0..9');"

          //Allows only A,B,C,1,2 and 3
          onKeyPress="AllowOnly('abc123');"

          //Allows only A TO Z,@,#,$ and %
          onKeyPress="AllowOnly('a..z|@#$%');"

		  //Allows only A,B,C,0 TO 9,.,,,+ and -
          onKeyPress="AllowOnly('ABC|0..9|.,+-');"

 Remarks: Use the pipe "|" symbol to separate a..z from 0..9 and symbols

 Returns: None
***************************************************************/
function AllowOnly(Expression)
{
	Expression = Expression.toLowerCase();
	Expression = Replace(Expression, 'a..z', 'abcdefghijklmnopqrstuvwxyz');
	Expression = Replace(Expression, '0..9', '0123456789');
	Expression = Replace(Expression, '|', '');

	var ch = String.fromCharCode(window.event.keyCode);
	ch = ch.toLowerCase();
	Expression = Expression.toLowerCase();
	var a = Expression.indexOf(ch);
	if (a == -1) 
		window.event.keyCode = 0;
}
/**************************************************************
 Replace: Returns a string in which a specified substring has 
          been replaced with another substring a specified 
          number of times.

 Parameters:
      Expression = String expression containing substring to 
                   replace
      Find       = Substring being searched for.
      Replace    = Replacement substring.

 Returns: String
***************************************************************/
function Replace(Expression, Find, Replace)
{
	var temp = Expression;
	var a = 0;

	for (var i = 0; i < Expression.length; i++) 
	{
		a = temp.indexOf(Find);
		if (a == -1)
			break
		else
			temp = temp.substring(0, a) + Replace + temp.substring((a + Find.length));
	}

	return temp;
}

/*****************/

/**************************************************************
 Replace: Opens a popup window with already scheduled date.

 Parameters:
      ordid      = String orderid.
      deldate    = String already delivery date 

***************************************************************/

function OpenRescheduler(ordid, deldate)
	{
		//alert("RescheduleOrder.aspx?OrderID="+ordid+"&DelDate="+deldate);
		var winl = (screen.width-400)/2;
		var wint = (screen.height-285)/2;
		window.open("RescheduleOrder.aspx?OrderID="+ordid+"&DelDate="+deldate,"Reschedule","left=300,top=320,height=300,width=530,scrollbars=0,statusbars=0,menubar=0,top="+wint+",left="+winl);
	}
	
	/**************************************************************
 Replace: Opens a popup window with already scheduled date.

 Parameters:
      ordid      = String orderid.
      deldate    = String already delivery date 

***************************************************************/

function OpenForgetPwd()
	{
		//alert("RescheduleOrder.aspx?OrderID="+ordid+"&DelDate="+deldate);
		var winl = (screen.width-400)/2;
		var wint = (screen.height-285)/2;
		window.open("ForgetPwd.aspx","ForgetPwd","height=190,width=500,scrollbars=0,statusbars=0,menubar=0,top="+wint+",left="+winl);
	}
	
/**************************************************************
 Replace: Opens a popup window with available shipping address for the particular order.

 Parameters:
      ordid      = String orderid.
      deldate    = String already delivery date .
      ordno      = String order no.
      status     = String status of the order.
***************************************************************/

	function OpenAddrChgr(ordid, deldate,ordno,status)
	{
		//alert("RescheduleOrder.aspx?OrderID="+ordid+"&DelDate="+deldate);
		//alert("opening Addr chag");
		test=window.open("ChangeShippingAddr.aspx?OrderID="+ordid+"&DelDate="+deldate+"&OrderNo="+ordno+"&Status="+status,"ChangeAddr","left=320,top=0,scrollbars=1,status=0,menubar=0");
	}
	
/*Replace: Opens a popup window with available shipping address for the particular order.

 Parameters:
      ordid      = String orderid.
      deldate    = String already delivery date .
      ordno      = String order no.
      status     = String status of the order.
***************************************************************/

	function OpenRecommandPage()
	{
		//alert("RescheduleOrder.aspx?OrderID="+ordid+"&DelDate="+deldate);
		var winl = (screen.width-400)/2;
		var wint = (screen.height-285)/2;
		window.open("RecommandSite.aspx","RP","height=295,width=450,scrollbars=0,statusbars=0,menubar=0,top="+wint+",left="+winl);
	}
	

/*Replace: Opens a popup window with available shipping address for the particular order.	
	 Parameters:
      ordid      = String orderid.
      deldate    = String already delivery date .
      ordno      = String order no.
      status     = String status of the order.
***************************************************************/

	function OpenOrderClip(Page)
	{
		//alert("RescheduleOrder.aspx?OrderID="+ordid+"&DelDate="+deldate);
		var winl = (screen.width-400)/2;
		var wint = (screen.height-285)/2;
		window.open("ViewOrderClip.aspx?OrdID="+Page,"RP","height=300,width=300,scrollbars=0,statusbars=0,menubar=0,top="+wint+",left="+winl);
	}
	
/*Replace: Opens a popup window with available shipping address for the particular order.

 Parameters:
      ordid      = String orderid.
      deldate    = String already delivery date .
      ordno      = String order no.
      status     = String status of the order.
***************************************************************/

	function OpenSuggestionPage()
	{
		//alert("RescheduleOrder.aspx?OrderID="+ordid+"&DelDate="+deldate);
		var winl = (screen.width-400)/2;
		var wint = (screen.height-285)/2;
		 window.open("PostSuggestions.aspx","SP","width=730,height=375,scrollbars=0,statusbars=0,menubar=0,top="+wint+",left="+winl);
		 //alert("Opened");
		 //alert(document.body.offsetHeight+"   "+document.body.offsetWidth);
	}
	
	
	/*Replace: Opens a popup window for showing the image in full size..

 Parameters:
      ImageURL      = Path of the image to be shown.
***************************************************************/

	function ShowFullImage(ImageURL)
	{
		//alert("RescheduleOrder.aspx?OrderID="+ordid+"&DelDate="+deldate);
		//alert(ImageURL);
		var R=ImageURL;
		//alert(R);
		var winl = (screen.width-400)/2;
		var wint = (screen.height-285)/2;
		window.open(R,"FI","width=300,height=300,scrollbars=1,statusbars=0,menubar=0,top="+wint+",left="+winl);
	}
	
	
	/*Replace: Opens a popup window with available review description.

 Parameters:
      RIDid      = ReviewID.
      Desc       = Review Description.
***************************************************************/

	function OpenReviewDescPage(RevID)
	{
		//alert("RescheduleOrder.aspx?OrderID="+ordid+"&DelDate="+deldate);
		var R=RevID;
		//var winl = (screen.width-400)/2;
		//var wint = (screen.height-285)/2;
		var winl = 0;
		var wint = 0;
		//alert(R);
		 window.open("ReviewDescription.aspx?RID="+R,"RD","scrollbars=0,statusbars=0,menubar=0,top="+wint+",left="+winl);
	}
	
	/*Replace: Opens a popup window with available review description.

 Parameters:
      RIDid      = ReviewID.
      Desc       = Review Description.
***************************************************************/

	function OpenUploadedImage(PID)
	{
		//alert("RescheduleOrder.aspx?OrderID="+ordid+"&DelDate="+deldate);
		var R=PID;
		var winl = (screen.width-400)/2;
		var wint = (screen.height-285)/2;
		//alert(R);
		 window.open("ImagesUploaded.aspx?PID="+R,"RD","height=300,width=300,statusbars=0,menubar=0,top="+wint+",left="+winl);
	}
	
	
	function OpenUploadedImageAdmin(OID)
	{
		//alert("RescheduleOrder.aspx?OrderID="+ordid+"&DelDate="+deldate);
		var R=PID;
		var winl = (screen.width-400)/2;
		var wint = (screen.height-285)/2;
		//alert(R);
		 window.open("ImagesUploadedAdmin.aspx?OID="+R,"RD","height=300,width=300, statusbars=0,menubar=0,top="+wint+",left="+winl);
	}
	
	
	
/*Replace: Opens a popup window with available review description.

 Parameters:
      RIDid      = ReviewID.
      Desc       = Review Description.
***************************************************************/
	function OpenImage(RevID)
	{
		//alert("RescheduleOrder.aspx?OrderID="+ordid+"&DelDate="+deldate);
        var R=RevID;
		var winl = (screen.width-400)/2;
		var wint = (screen.height-285)/2;
		window.open("ViewImage.aspx?ImageName="+R,"RD","height=300,width=300,scrollbars=0,statusbars=0,menubar=0,top="+wint+",left="+winl);
	}
	
	/*Replace: Opens a popup window with available review description.

 Parameters:
      RIDid      = ReviewID.
      Desc       = Review Description.
***************************************************************/
	function OpenImageUser(RevID)
	{
		//alert("RescheduleOrder.aspx?OrderID="+ordid+"&DelDate="+deldate);
        var R=RevID;
		var winl = (screen.width-400)/2;
		var wint = (screen.height-285)/2;
		window.open("ViewImage.aspx?ImageName="+R,"RD","height=300,width=300,scrollbars=0,statusbars=0,menubar=0,top="+wint+",left="+winl);
	}
	
	
//Function ClearAll()
//Created by Maheswaran
//For clearing all the input fields in the Add / Edit Reminder Page.

function ClearAll()
{
  var elm;
  try
  {
  elm = document.getElementById("txtFirstName");
  elm.value="";
  elm = document.getElementById("txtLastName");
  elm.value="";
  elm = document.getElementById("txtDate");
  elm.value="";
  elm = document.getElementById("txtDetails");
  elm.value="";
  elm = document.getElementById("ddlTitle");
  elm.options[0].selected=true;
  elm = document.getElementById("ddlOccasion");
  elm.options[0].selected=true;
  elm = document.getElementById("ddlReminderType");
  elm.options[0].selected=true;
  return false;
  }
  catch(err)
  {
  return false;
  }
}


//Function ClearAllInRef()
//Created by Maheswaran
//For clearing all the input fields in the Add / Edit Reminder Page.

function ClearAllInRef()
{
  var elm;
  try
  {
  elm = document.getElementById("txtFN");
  elm.value="";
  elm = document.getElementById("txtLN");
  elm.value="";
  elm = document.getElementById("txtDN");
  elm.value="";
  elm = document.getElementById("txtAddr1");
  elm.value="";
  elm = document.getElementById("txtAddr2");
  elm.value="";
  elm = document.getElementById("txtZip");
  elm.value="";
  elm = document.getElementById("txtPhone");
  elm.value="";
  elm = document.getElementById("txtEmail");
  elm.value="";
  elm = document.getElementById("txtMobile");
  elm.value="";
  elm = document.getElementById("txtLandmrk");
  elm.value="";
  elm = document.getElementById("ddlCity");
  elm.options[0].selected=true;
  elm = document.getElementById("txtCountry");
  elm.value="";
  elm = document.getElementById("ddlState");
  elm.options[0].selected=true;
  
  return false;
  }
  catch(err)
  {
  //alert(err);
  return false;
  }
}


/*Replace: Clears all the input fields for registeration in the login page.

 Parameters:
            Null
***************************************************************/

	function ClearInLogin()
	{
	        var elmLogin;
			try
			{
				elmLogin = document.getElementById("TxtNewUserName");
				elmLogin.value="";
				elmLogin = document.getElementById("TxtNewPwd");
				elmLogin.value="";
				elmLogin = document.getElementById("TxtNewConfirmPwd");
				elmLogin.value="";
				elmLogin = document.getElementById("txtNewFName");
				elmLogin.value="";
				elmLogin = document.getElementById("txtNewLName");
				elmLogin.value="";
				return false;
		    }
		    catch(err)
			{
			    return false;
			}
	}
	
	

//Function TimeValidationInExecuteOrder()
//Created by Maheswaran
//For checking whether the date & time is selected or not.

function TimeValidationInExecuteOrder()
{
  //alert(document.Form1.ddlTime.value)
  var StatusChkBox=document.getElementById("rblForDeliveryOption");
  var TimeDdl=document.getElementById("ddlTime");
  var DateComp=document.getElementById("DeliveredDate");
  var ArrayOptions=StatusChkBox.getElementsByTagName("input");
  var strTimeSelected=document.Form1.ddlTime.value;
  //alert(TimeDdl.options.count);
  /*for(var j=0; j<TimeDdl.options.count; j++)
  {
     if(TimeDdl.options[i].selected)
     {
        strTimeSelected=TimeDdl.options[i].value;
        //alert(strTimeSelected);
        //alert(TimeDdl.options[i].value);
     }
  }*/
 
  for( var i=0; i<ArrayOptions.length; i++)
  {
     if(ArrayOptions[i].checked)
       {
         //if((ArrayOptions[i].value=="3") & (TimeDdl.options[0].value=="- Time -" || DateComp.value==""))
         if((ArrayOptions[i].value=="3") & (strTimeSelected=="" || DateComp.value==""))
         {
            alert(i);
            alert("Please select delivered date and time.");
            return false;
         }
         else if((ArrayOptions[i].value=="5") & (strTimeSelected=="" || DateComp.value==""))
         {
            alert("Please select delivered date and time.");
            return false;
         }
       }
  }
}

//Function TimeValidationInExecuteOrder()
//Created by Maheswaran
//For checking whether the date & time is selected or not.

function CheckOrderNo(txtOrdNo)
{
  var OrdNoComp=document.getElementById(txtOrdNo);
  if(OrdNoComp.value=="")
  {
    alert("Please enter the order number.");
    return false;
  }
  else
  {
    var strCondition=" where dbo.SC_Order.OrderNumber='"+OrdNoComp.Value+"'";
    return this.href="../PublicUser/PublicOrderDetail.aspx?Condition="+strCondition;
  }
}

//Function ClearDateAndTime()
//Created by Maheswaran
//For clearing the date and time selected.
function ClearDateAndTime()
{
  var objDate=document.getElementById("DeliveredDate");
  var objTime=document.getElementById("ddlTime");
  alert(objDate.value);
  objDate.value="";
  objTime.options[0].selected=true;
  return false;
}

//Function ClearDateAndTime()
//Created by Maheswaran
//For clearing the date and time selected.
function CheckEmailID()
{
  var objFEID=document.getElementById("txtFEId");
  var objEID=document.getElementById("txtEId");
  if(objFEID.value!="")
  {
      if(/^(\w+\.){0,1}\w+\@\w{1,}\.\w{1,}(\.\w+){0,1}$/.test(objFEID.value))
         {
          //alert(objFEID.value);
         }
      else
         {
          alert("Please enter valid email id.");
          return false;
         }
  }
  else
  {
	alert("Please enter your friend email id.");
	return false;
  }
  if(objEID.value!="")
  {
	if(/^(\w+\.){0,1}\w+\@\w{1,}\.\w{1,}(\.\w+){0,1}$/.test(objEID.value))
	{
	//alert(objEID.value);
	}
	else
	{
	alert("Please enter valid email id.");
	return false;
	}
  }
  else
  {
	alert("Please enter your email id.");
	return false;
  }
}


//Function CheckNoOfCharsInMultilineTB() **********Not Used*********
//Created by Maheswaran
//For clearing the date and time selected.
function CheckNoOfCharsInMultilineTB(TBName,NoOfChars)
{
    //alert(NoOfChars);
   // alert(TBName);
	var TBObj=document.getElementById(TBName);
	if(TBObj.value.length>NoOfChars)
	{
	     //alert("More");
		
		 if(confirm("The no of charactors is beyond the limit.If you press ok the text will automatically reduced to 1000 charactors.If you press cancel you can edit the text."))
		 {
		  TBObj.value=TBObj.value.substring(0,NoOfChars);
		 //alert("Ok");
	     return false;
	     }
	     else
	     {
	     //alert("Cancel");
	     return false;
	     }
	}
}

//Function ShowReminder()
//Created by Maheswaran
//For limiting the no of charactors in multiline textbox
function ShowRemainder(TBName,MaxLength)
{
    var TBObj=document.getElementById(TBName);
    //alert(TBObj);
    /*var RmdObj=document.getElementById("txtLength");
   // alert(RmdObj);
    //alert(TBObj.value.length+1);
	if(TBObj.value.length+1>0)
	{
	  if((10-TBObj.value.length+1)==0)
	  {
	  return false;
	  }
	  else
	  {
	  //alert(TBObj.value.length);
	  RmdObj.value=10-(TBObj.value.length+1);
	  }
	}*/
	
	if(TBObj.value.length+1>MaxLength)
	{
	alert("Your suggestions / feedbacks should be less than " + MaxLength + "  characters.");
	TBObj.value=TBObj.value.substring(0,MaxLength);
	//TBObj.focus();
	return false;
	}
}

/*Replace: Opens a popup window with available shipping address for the particular order.

 Parameters:
      ordid      = String orderid.
      deldate    = String already delivery date .
      ordno      = String order no.
      status     = String status of the order.
***************************************************************/

	function GetSelectedCity()
	{
	   var elem=document.getElementById("hdCity");
	   alert(elem.value);
	   return false;
	}
	
	/**************************************************************
 Replace: For validating whether the given to amount is greater thatn the from amount value

***************************************************************/

function FromToAmtCheckInAdvSearch()
	{
	//alert('Plese enter valid To amount');
	  var FromComp=document.getElementById("txtPriceFrom");
	  var ToComp=document.getElementById("txtPriceTo");
	  if(FromComp.value != "" & ToComp.value !="")
	  {
	   if(parseInt(FromComp.value)>parseInt(ToComp.value))
	   {
	     alert('To amount must be greater that From amount.');
	     return false;
	   }
	  }
	}
	
	/**************************************************************
 Replace: After waiting for particular seconds it will automatically redirect to HomePage

***************************************************************/

function WaitAndRedirectToHomePage()
	{
	var elm=document.getElementById("HomePageLink");
	var elm1=document.getElementById("hdTimeOut");
	
	//alert(elm1.value);
	setTimeout("location.href='"+elm.href+"';", elm1.value);
	}
	
	/**************************************************************
 Replace: After waiting for particular seconds it will automatically redirect to HomePage

***************************************************************/

function ValidationInOrderReport()
	{
		var elm=document.getElementById("FromDate");
		var elm1=document.getElementById("ToDate");
		var elm2=document.getElementById("ddlCity");
		if(elm2.options[0].selected)
		{
		alert('Please select city.');
		return false;
		}
		else if(elm.value=="")
		{
		alert('Please enter From date.');
		return false;
		}
		else if(elm1.value=="")
		{
		alert('Please enter To date.');
		return false;
		}
		
	}
	
	
/**************************************************************
 Replace: After waiting for particular seconds it will automatically redirect to HomePage

***************************************************************/

function PrintWindow(OID)
	{
	
	    //Click here to print link code
		/*var elm=document.getElementById(CompName);
		elm.style.display = 'none';
		window.print();*/
		
		//Print button click code
		//alert(OID);
		var str = "PrintOrderInformation.aspx?OrderID="+OID+"&FromWhere=Print";
		//alert(str);
		//window.open("PrintOrderInformation.aspx?OrderID="+OID+"&FromWhere=Print");
		window.open("PrintOrderInformation.aspx?OrderID="+OID+"&FromWhere=Print","RD","scrollbars=1,statusbars=0,menubar=0,top=0,left=0");
		return false;
	}
	
	/**************************************************************
 Replace: After waiting for particular seconds it will automatically redirect to HomePage

***************************************************************/

function FileTypeTest(CompName)
	{
		var ext = CompName.value;
		ext = ext.substring(ext.length-3,ext.length);
		ext = ext.toLowerCase();
		if(ext != 'jpg' & ext != 'jpeg' & ext != 'gif') 
		  {
			alert('You selected a .'+ext+ ' file; please select a .jpg / .gif / .jpeg file instead!');
			return false; 
		  } 
		else 
		  {
			return true;
		  }
		/*if(ext != 'jpeg') 
		  {
			alert('You selected a .'+ext+ ' file; please select a .jpeg file instead!');
			return false; 
		  } 
		else 
		  {
			return true;
		  }
		if(ext != 'gif') 
		  {
			alert('You selected a .'+ext+ ' file; please select a .gif file instead!');
			return false; 
		  } 
		else 
		  {
			return true;
		  }*/

	}
	
	
	/**************************************************************
 Replace: After waiting for particular seconds it will automatically redirect to HomePage

***************************************************************/

function FileEmptyTest()
	{
	  ipArray=new Array();
	  ipArray = document.getElementsByTagName("input");
	  //alert(ipArray.length);
	  var result;
	  var count=1;
	  for(var n=0;n<ipArray.length;n++)
	     {  
			if(ipArray[n].type == "file")
			{
			 if(ipArray[n].value == "")
			 {
			   //alert(n);   
			   result = false;
			   break;
			 }
			 else
			 {
			  result = FileTypeTest(ipArray[n])
			  
			  if(result == false)
			  {
			   return false;
			  } 
			  count = count + 1;
			 }
			}
		 }
		 if(result == false)
		 {
		   alert("Please select upload image for item " + count + "." );
	       return false;
	     }
	     else
	     {
	      return true;
	     }
	}
	
	function OpenPrintWindow(PageName)
	{
	   // alert("Called");
		//var winl = (screen.width-400)/2;
		//var wint = (screen.height-285)/2;
		try
		{
	    var winl = (screen.width-400)/2;
		var wint = (screen.height-285)/2;
		window.open(PageName,"RD","height=700,width=1000,scrollbars=1,top=0,left=0");
	    }
	    catch(err)
	    {
	    alert(err);
	    }
	    return false;
	}
	
	function FromToDateValidation(FromComp,ToComp)
	{
	    var elemFrom = document.getElementById(FromComp);
	    var elemTo = document.getElementById(ToComp);
	    d=elemFrom.value.substring(0,2);
        d=d+".00";
        var di=parseFloat(d);
        
        m=elemFrom.value.substring(3,6);
        y=elemFrom.value.substring(7,11);
        //alert(elemFrom.value);
        //alert(elemTo.value);
        d1=elemTo.value.substring(0,2);
        
        d1=d1+".00";
        var di1=parseFloat(d1);
        m1=elemTo.value.substring(3,6);
        y1=elemTo.value.substring(7,11);
        
   		if		(  m  ==  "JAN" )	{m=1;}
	    else if	(  m  ==  "FEB" )	{m=2;}
		else if	(  m  ==  "MAR" )	{m=3;}
		else if	(  m  ==  "APR" )	{m=4;}
		else if	(  m  ==  "MAY" )	{m=5;}
		else if	(  m  ==  "JUN" )	{m=6;}
		else if	(  m  ==  "JUL" )	{m=7;}
		else if	(  m  ==  "AUG" )	{m=8;}
		else if	(  m  ==  "SEP" )	{m=9;}
		else if	(  m  ==  "OCT" )	{m=10;}
		else if	(  m  ==  "NOV" )	{m=11;}
		else if	(  m  ==  "DEC" )	{m=12;}
		
		if		(  m1  ==  "JAN" )	{m1=1;}
	    else if	(  m1  ==  "FEB" )	{m1=2;}
		else if	(  m1  ==  "MAR" )	{m1=3;}
		else if	(  m1  ==  "APR" )	{m1=4;}
		else if	(  m1  ==  "MAY" )	{m1=5;}
		else if	(  m1  ==  "JUN" )	{m1=6;}
		else if	(  m1  ==  "JUL" )	{m1=7;}
		else if	(  m1  ==  "AUG" )	{m1=8;}
		else if	(  m1  ==  "SEP" )	{m1=9;}
		else if	(  m1  ==  "OCT" )	{m1=10;}
		else if	(  m1  ==  "NOV" )	{m1=11;}
		else if	(  m1  ==  "DEC" )	{m1=12;}
       
       //vijai
       if(parseInt(y) > parseInt(y1))
    {
            alert("Delivery From Date should be earlier than Delivery To date.");
            //elemFrom.value = "";
            return false;
    }
    else if(parseInt(y) == parseInt(y1))
    {
			if( parseInt(m) == parseInt(m1))
			{
					if(di > di1)
					{ 
							//alert(parseInt(di));
							//alert(dd.getDate());
							alert("Delivery From Date should be earlier than Delivery To date.");
							//elemFrom.value = "";
							return false;
					}
			}
			else if( parseInt(m1) < parseInt(m))
			{
					alert("Delivery From Date should be earlier than Delivery To date.");
					//elemFrom.value = "";
					return false;	
			}
    }    
	}
	
	function OpenImageFromDetail(PageName, PgID)
	{
		alert(PageName);
	   if(PgID == 1)
	      {
	         window.open(PageName,"VI","scrollbars=1,top=0,left=0");    
	             
	      }      
	   else if(PgID == 2)
	       {
	          window.open(PageName,"VI","scrollbars=1,top=0,left=0");
	       }
	
	}
	
/*************************************************************************/
		
/*************************************************************************/