/* ============================================================================================
	Project Name		:	INFOSAT
	Author Name		:	RAJASEKAR.R
	Last Modified By	:	RAJASEKAR.R
	Last Modified Date	: 	29-11-2002

To use the validaton fn, the following rules and syntaxes have to be kept in mind 

- all the fields should have proper understandable names

- the basic syntax for passing arguments to the fn is :

 checkValidity(formno,['all'/array],[array of names of elements],['no of elements to check for starting from first one'/''],'checking condition')


= 1st argument :: enter the form no to be used as in document.forms[formno]........


= 2nd argument['all'] :: starting from the first field if a continuous set of fields have to be 


				  validated for a condition, then enter 'all' as 2nd argument


		  [array] :: to define the exact element nos which require a validation, enter the 


				 nos as a javascript array (e.g new Array('0','3','4') or the array name).


= 3rd argument[array] :: define the names of the elements in the exact sequence of the array of element numbers.


= 4th argument['no. of elements'] :: if 2nd argument is 'all', then enter the no. of fields starting 


					     from the first one for which validation is to be done.


		  [''] :: if 2nd argument is an array, then enter '' in this one as it is not required.


= 5th argument['checking condition'] :: this argument will define the testing criteria as one of 


						    the following :-


				a. 'EMPTY' = to check and alert for empty fields


				b. 'ISNAN' = to check and alert for characters in number fields


				c. 'SPLCHAR' = to check and alert for special chars in fields


				d. 'NUMBER' = to check and alert for any numeral in a field value			


				e. 'EMAIL' = to check and alert for email validation


				f. 'SELECT' = to check and alert for non-selected drop down boxes


				g. 'SPLCHAR2' = to check and alert for special chars in fields except comma, 


				    underscore and hyphen


				h. 'MOBILE' = to check and alert the mobile number validation


				i. 'MOBILESPLCHAR' = to check and alert the mobile number validation


				j. 'RADIO' = to check and alert the radio button selection.

- the arrays can be defined beforehand or directly as an argument


============================================================================================ */

var spl = new Array('@',',','.','+','-','*','/','#','$','%','^','&','!','~','(',')','[',']','{','}','_','?','>','<',';',':','&lsquo;','&rsquo;','&quot');


var splnew = new Array('@',',','.','+','-','*','/','#','%','^','&','!','~','(',')','[',']','{','}','_','?','>','<');


var spl2 = new Array('@','+','*','/','#','$','%','^','&','!','~','(',')','[',']','{','}','_');


var mobilespl = new Array('@',',','.','*','/','#','$','%','^','&','!','~','(',')','[',']','{','}','_');


var namespl = new Array('@','+','-','*','/','#','$','%','^','&','!','~','(',')','[',']','{','}','_');


var len = spl.length;


var len2 = spl2.length;


var len3 = namespl.length;


var len4 = splnew.length;


var mobilelen =mobilespl.length;





var check = new Array();





// ========  check for required field validations ========





function checkValidity(formname,check,elemNames,elemLength,type) 
{
	
			var flag = true;
			
			var index;			
			
			var fno = formname;
			
			
					if(check == 'all')
					{			
							condition = elemLength; 			
					}
					else
					{					
							condition = check.length;
					}

		for(var i=0; i < condition; i++)
		{
			
			if(check == 'all')
			{
				index = i;
			}
			else
			{
				index=check[i];
			}

			if(type == 'EMPTY')
			{	
				 var st = document[formname].elements[index].value;
				 if(!checkEmpty(st))
				  {
				  	alert('Please do not keep the '+elemNames[i]+' field empty');
					 	document[formname].elements[index].value = '';
					 	document[formname].elements[index].focus();
					 	flag = 'false';
				    return flag;
					 	reak;	
				 }
			}
			else if(type == 'ISNAN')
			{
						counter = 0;
 				 		var st = document[formname].elements[index].value;
				 		if(!checkEmpty(st)) 
				 		{
			       		alert('Please do not keep the '+elemNames[i]+' field empty');
					 			document[formname].elements[index].value = '';
					 			document[formname].elements[index].focus();
					 			flag = 'false';
				       	return flag;

					 			break;
					 	}
				 		if(isNaN(st))
				 		{
				       alert('Please give valid numbers for '+elemNames[i]);
					 		 document[formname].elements[index].value = '';
					 		 document[formname].elements[index].focus();
					 		 flag = 'false';	
				       return flag;
					 			
					 		 break;	
				 		}
				 		if(parseInt(st)< 0)
				 		{
				       alert('Please give valid numbers for '+elemNames[i]);
					 		 document[formname].elements[index].value = '';
					 		 document[formname].elements[index].focus();
					 		 flag = 'false';
				       return flag;
					 			
					 		 break;
				 		}

						for(k=0;k<document[formname].elements[index].value.length;k++)
						{
							val1=document[formname].elements[index].value.charAt(k);

							if(val1 == ' ')
							{
									alert('Please enter a valid numeral for '+elemNames[i]);
									document[formname].elements[index].value = '';
									document[formname].elements[index].focus();
									flag = 'false';
									return flag;
									break;
							}
						}


			}
			else if(type == 'ISNANEMPTY')
			{			
					counter = 0;
					var st = document[formname].elements[index].value;
				 	
				 		if(isNaN(st))
				 		{
				 				alert('Please give valid numbers for '+elemNames[i]);
					 			document[formname].elements[index].value = '';
					 			document[formname].elements[index].focus();
					 			flag = 'false';
				       	return flag;
					 			break;
					 	}
				 		if(parseInt(st)< 0)
				 		{
				       alert('Please give valid numbers for '+elemNames[i]);
					 		 document[formname].elements[index].value = '';
					 		 document[formname].elements[index].focus();
					 		 flag = 'false';
				       return flag;
					 		 break;
				 		}
						
						for(k=0;k<document[formname].elements[index].value.length;k++)
						{
							val1=document[formname].elements[index].value.charAt(k);
							
							if(val1 == ' ')
							{
									alert('Please enter a valid numeral for '+elemNames[i]);
									document[formname].elements[index].value = '';
									document[formname].elements[index].focus();
									flag = 'false';
									return flag;
									break;
							}
  				 }
			}
			else if(type == 'DECIMAL')
			{
					counter = 0;
 				 	var st = document[formname].elements[index].value;

					 if(isNaN(st))
					 {
				       alert('Please give valid numbers for '+elemNames[i]);
					 		 document[formname].elements[index].value = '';
					 		 document[formname].elements[index].focus();
					 		 flag = 'false';
				       return flag;
					 		 break;
				   }
				 	 if(parseInt(st)< 0)
				 	 {
				       alert('Please give valid numbers for '+elemNames[i]);
					 		 document[formname].elements[index].value = '';
					 		 document[formname].elements[index].focus();
					 	 	 flag = 'false';
					 	 	 return flag;
					 		 break;
				 	 }
					
					 for(k=0;k<document[formname].elements[index].value.length;k++)
					 {
							val1=document[formname].elements[index].value.charAt(k);
							if(val1 == ' ')
							{
									alert('Please enter a valid numeral for '+elemNames[i]);
									document[formname].elements[index].value = '';
									document[formname].elements[index].focus();
									flag = 'false';
									return flag;						
									break;
							}
					 }
						
					if(st.indexOf(".") !=-1)
					{
							var val=st.indexOf(".");
							var diff=st.length-(val+1);
							if(diff>2)
							{
									alert('Please enter only 2 numbers after the decimal for '+elemNames[i]);
									document[formname].elements[index].focus();
									flag = 'false';
									return flag;	
									break;
							}
					}
					else
				  {
							if(st.length >7)
							{
									alert('Price Cannot be more than 9,99,9999 for '+elemNames[i]);
									document[formname].elements[index].focus();
									flag = 'false';
									return flag;
									break;
						  }		
				  }
			}
			
			else if(type == 'ISNANWHOLE')
			{
					counter = 0;
					for(k=0;k<document[formname].elements[index].value.length;k++)
					{
							val1=document[formname].elements[index].value.charAt(k);
							if(val1 == '.')
						  {
									alert('Please enter a whole number for '+elemNames[i]);
									document[formname].elements[index].value = '';
									document[formname].elements[index].focus();	
									flag = 'false';
									return flag;
									break;
							}
							if(val1 == ' ')
							{
									alert('Please enter a whole number for '+elemNames[i]);
									document[formname].elements[index].value = '';
									document[formname].elements[index].focus();
									flag = 'false';
									return flag;
									break;
						  }
						  if(isNaN(val1))
						  {
									alert('Please enter a whole number for '+elemNames[i]);
									document[formname].elements[index].value = '';
									document[formname].elements[index].focus();
									flag = 'false';
									return flag;
									break;
							}
					}


			} 
			else if(type == 'MOBILE')	
			{
				 counter = 0;
				 for(k=0;k<mobilespl.length;k++) 
				 {
						if(document[formname].elements[index].value.indexOf(mobilespl[k])>=0)	
						{
									alert('Please enter a correct  '+elemNames[i]);
									document[formname].elements[index].value = '';
									document[formname].elements[index].focus();
									flag = 'false';
									return flag;
									break;
						}
				}

				for(k=0;k<document[formname].elements[index].value.length;k++) 
				{
						val1=document[formname].elements[index].value.charAt(k);
						if((val1 >= 'a' && val1 <= 'z') || (val1 >= 'A' && val1 <= 'Z'))	
						{
								alert('Please enter numbers only for '+elemNames[i]);
								document[formname].elements[index].value = '';
								document[formname].elements[index].focus();
								flag = 'false';
								return flag;
								break;
						}
				}


			} 
			else if(type == 'SPLCHAR')	
			{			
				fval = document[formname].elements[index].value;
				 
					if(fval.indexOf("@") >= 0) 
					{
					   	alert('Special characters are not allowed in '+elemNames[i]);
					   	document[formname].elements[index].value = '';		                        
					   	document[formname].elements[index].focus();
			        flag = 'false'; 
							return flag;
			        break;            		  	  
			    }
			    for(var j=1;j<=len;j++)
			    {
			    	 if(fval.indexOf(spl[j]) >= 0) 
			    	 {
                  alert('Special characters are not allowed in '+elemNames[i]);
         		      document[formname].elements[index].value = '';
		              document[formname].elements[index].focus();
			            flag = 'false'; 


						return flag;


			                  break;


            		  	  }


			        }


			} else if(type == 'MOBILESPLCHAR')	{			


				fval = document[formname].elements[index].value;


			        for(var j=1;j<=mobilelen;j++){


				        if(fval.indexOf(spl[j]) >= 0) {


			                  alert('Special characters are not allowed in '+elemNames[i]);


                  		      document[formname].elements[index].value = '';


		                        document[formname].elements[index].focus();


			                  flag = 'false'; 


						return flag;


			                  break;


            		  	  }


			        }


			} else if(type == 'SPLCHAR2')	{			


				fval = document[formname].elements[index].value;


				        if(fval.indexOf("@") >= 0) {


			                  alert('Special characters are not allowed in '+elemNames[i]);


                  		      document[formname].elements[index].value = '';


		                        document[formname].elements[index].focus();


			                  flag = 'false'; 


						return flag;


			                  break;


            		  	  }





			        for(var j=1;j<=len2;j++){


				        if(fval.indexOf(spl2[j]) >= 0) {


			                  alert('Special characters are not allowed in '+elemNames[i]);


                  		      document[formname].elements[index].value = '';


		                        document[formname].elements[index].focus();


			                  flag = 'false'; 


						return flag;


			                  break;


            		  	  }


			        }


			} else if(type == 'NEWSPLCHAR')	{			


				fval = document[formname].elements[index].value;


			        for(var j=1;j<=len4;j++){


				        if(fval.indexOf(splnew[j]) >= 0) {


			                  alert('Special characters are not allowed in '+elemNames[i]);


                  		      document[formname].elements[index].value = '';


		                        document[formname].elements[index].focus();


			                  flag = 'false'; 


						return flag;


			                  break;


            		  	  }


			        }


					


			} else if(type == 'NAMECHECK')	{			


 				 var st = document[formname].elements[index].value;


				 if(!checkEmpty(st))  {


				       alert('Please do not keep the '+elemNames[i]+' field empty');


					 document[formname].elements[index].value = '';


					 document[formname].elements[index].focus();


					 flag = 'false';


				       return flag;


					 break;


				 }





				fval = document[formname].elements[index].value;


			        for(var j=1;j<=len3;j++){


				        if(fval.indexOf(spl2[j]) >= 0) {


			                  alert('Special characters are not allowed in '+elemNames[i]);


		                        document[formname].elements[index].focus();


			                  flag = 'false'; 


						return flag;


			                  break;


            		  	  }


			        }





			} else if(type == 'IP')	{			


/*


 				 var st = document[formname].elements[index].value;


				 if(!checkEmpty(st))  {


				       alert('Please do not keep the '+elemNames[i]+' field empty');


					 document[formname].elements[index].value = '';


					 document[formname].elements[index].focus();


					 flag = 'false';


				       return flag;


					 break;


				 }


*/





				fval = document[formname].elements[index].value;


				 if(isNaN(fval))  {


				       alert('Please give valid numbers for '+elemNames[i]);


					 document[formname].elements[index].value = '';


					 document[formname].elements[index].focus();


					 flag = 'false';


				       return flag;


					 break;


				 }


				for(k=0;k<document[formname].elements[index].value.length;k++) {


					val1=document[formname].elements[index].value.charAt(k);


					if(val1 == ' ')	{


						alert('Please enter a valid numeral for '+elemNames[i]);


						document[formname].elements[index].value = '';


						document[formname].elements[index].focus();


						flag = 'false';


						return flag;


						break;


					}


				}





/*





					fval = parseInt(fval);





			        if(fval > 255) {


		                  alert('Please enter proper IP values in  '+elemNames[i]);


              		      document[formname].elements[index].value = '';


	                        document[formname].elements[index].focus();


		                  flag = 'false'; 


						return flag;


		                  break;


			        }


*/





					


			} else if(type == 'NUMBER')	{			


				fval = document[formname].elements[index].value;


			        for(var j=0;j<=9;j++) {


		                if(fval.indexOf(j) >= 0) {


			                  alert('Please enter only alphabets for the '+elemNames[i]);


		                        document[formname].elements[index].value = '';


		                        document[formname].elements[index].focus();


			                  flag = 'false';        


						return flag;


                  			break;


			            }


			        }


			} else if(type == 'EMAIL') {			


				var email,atemail,atoccurance,splitter;


				email1 = document[formname].elements[index].value ;


				 if(!checkEmpty(email1))  {


				       alert('Please do not keep the '+elemNames[i]+' field empty');


					 document[formname].elements[index].value = '';


					 document[formname].elements[index].focus();


					 flag = 'false';


				       return flag;


					 break;


				 }


			    var issue=document[formname].elements[index].value.substring(0,document[formname].elements[index].value.indexOf("@"));
//       		    alert("tt"+document[formname].elements[index].value.substring(0,document[formname].elements[index].value.indexOf("@")));
//				alert(issue.length);
			          if (issue.length <1) {


			                alert("Email should have values before '@' symbol");


			                document[formname].elements[index].focus();


					    flag = 'false';


					    return flag;	


			                break ;


		                } 


				if (document[formname].elements[index].value != '') {


				    atemail=email1.indexOf("@");
					if (atemail==-1) {


			                alert("Email should have '@' symbol");


			                document[formname].elements[index].focus();


					    flag = 'false';


					    return flag;	


			                break ;


		                } else {


		                atoccurence=email1.indexOf("@");

            		    dotcheck=email1.indexOf(".",atoccurence);



                            	if (dotcheck==-1) {


		                        alert("Email should have '.' symbol");


            		            document[formname].elements[index].focus();


		                        flag = 'false';


					      return flag;	


      	            		break ;


	                        }


      	                splitter=email1.substring(atoccurence+1,2);


	                         if (splitter=='.') {


	                              alert("Incomplete email id");


                                	document[formname].elements[index].focus();


                                	flag = 'false';


			              	return flag;	


                                	break ;


                               }


                               if (atemail == (dotcheck-1))


                               {


                               	alert("Email should have some charcters between @ and . symbols");


                                	document[formname].elements[index].focus();


                                	flag = 'false';


				        	return flag;	


            		    	  	break ;


                        	 }


					if(dotcheck == document[formname].elements[index].value.length -1) {


						alert("Email should contain some characters after the dot symbol");


                                	document[formname].elements[index].focus();


                                	flag = 'false';


				        	return flag;	


            		    	  	break ;


					}


	                      }      


            		}


			}


			else if(type == 'SELECT') {	


				if(document[formname].elements[index].selectedIndex==0) {


				alert("Please select a valid option for "+elemNames[i]);


				document[formname].elements[index].focus();


                       	flag = 'false';


		        	return flag;


				break;


				}


			}


			else if(type == 'RADIO') {


				var checkornot = false;


				if(document[formname].elements[index].length)	{


					for(var j=0; j<document[formname].elements[index].length; j++)	{


						if(document[formname].elements[index][j].checked == true)	{


							checkornot = true;


							break;


						}


					}


				}


				else	{


					if(document[formname].elements[index].checked == true)	{


						checkornot = true;


						break;


					}


				}


				if(checkornot == false)


				{


					alert("Please select an option in "+elemNames);


					return 'false';


				}


			} else if(type == 'DESCRIPTION')	{			


				fval = document[formname].elements[index].value.length;


				if(fval > 500) {


			      	alert(elemNames[i]+' should not be more than 500 characters');


		                  document[formname].elements[index].focus();


			            flag = 'false'; 


					return flag;


			            break;


            		}


			


			} else if(type == 'TEXTAREA')	{			


				fval = document[formname].elements[index].value.length;


				if(fval > 250) {


			      	alert(elemNames[i]+' should not be more than 250 characters');


		                  document[formname].elements[index].focus();


			            flag = 'false'; 


					return flag;


			            break;


            		}


			} else if(type == 'TEXTAREA1000')	{			


				fval = document[formname].elements[index].value.length;


				if(fval > 1000) {


			      	alert(elemNames[i]+' should not be more than 1000 characters');


		                  document[formname].elements[index].focus();


			            flag = 'false'; 


					return flag;


			            break;


            		}


			} else if(type == 'TEXTAREA2000')	{			


				fval = document[formname].elements[index].value.length;


				if(fval > 2000) {


			      	alert(elemNames[i]+' should not be more than 2000 characters');


		                  document[formname].elements[index].focus();


			            flag = 'false'; 


					return flag;


			            break;


            		}


			} 


		





		}	// for loop ends


}  	// fn 'checkValidity' ends





        /*


	   function  isDate(document.form.day,document.form.month,document.form.year)


	   returns false if the date is not a valid date and also pops up error alert box.


	   returns true if the date is valid.	  	


	  */	








        function isDt(dd, mm, yy)


        {


                var d = parseInt(dd.value);


                var m = parseInt(mm.value);


                var y = parseInt(yy.value);





                if (!checkIsNaN(d)){


                        alert("invalid day");


                        dd.focus();


                        return false;


      	          }


                if (!checkIsNaN(m)){


                        alert("invalid month");


                        mm.focus();


                        return false;


                }


                if (!checkIsNaN(y)){


                        alert("invalid year");


                        return false;


                }





                if (checkDate(d,m,y,dd,mm,yy)){


//                      alert("valid date");


                        return true;


                }


                return false;


        }





        function checkIsNaN(obj)


        {


                if (obj == "" || isNaN(obj))


                        return false;


                return true;


        }





	// -- fn. to check for empty string --





	  function checkEmpty(str) {


		  var charFound = "false";


		  for(var i=0;i<str.length;i++)  {


		        var a = str.substr(i,1);


		        if(a == " ") charFound = "false";


		        else   {


            		    charFound = "true";


		                break;


		        }


		  }


		  if(charFound == "false") return false;


		  else   return true;


	  }








	//-- fn. to validate date entered in txt format





	function y2k(number) { return (number < 1000) ? number + 1900 : number; }





	function isDate(formname,ddelemno,mmelemno,yyelemno,day,month,year) {





	// checks if date passed is valid --- will accept dates in following format:


	// isDate(dd,mm,ccyy), or


	// isDate(dd,mm) - which defaults to the current year, or


	// isDate(dd) - which defaults to the current month and year.


	// Note, if passed the month must be between 1 and 12, and the


	// year in ccyy format.





	    if(year.length != 4)	


	    {	


		    alert('Please enter the year in YYYY format');


		    document[formname].elements[yyelemno].focus();


		    return false;	


	    }





	    var today = new Date();


	    year = ((!year) ? y2k(today.getYear()):year);


	    month = ((!month) ? today.getMonth():month-1);


	    if (!day) return false;


	    var test = new Date(year,month,day);


	    if ( (y2k(test.getYear()) == year) &&


      	   (month == test.getMonth()) &&


	         (day == test.getDate()) ) 


      	  return true;


	    else


	    {


		  alert('Invalid date entry');


		  document[formname].elements[ddelemno].focus();


	        return false;


	    }


	}








/************* The date validation through choose date form





	the function for the opening a new window calling a file called Calendar.html which will show the calendar listing of the years


	Function for the chosen value to be displayed in the parent browser in the format dd-mm-yyyy


	Function for Checking when there are two dates of which one should be lesser than given two date fields.





***************************/











var today = new Date();


var day   = today.getDate();


var month = today.getMonth();


var year  = y2k(today.getYear());


var Display;


function padout(number) {


return (number < 10) ? '0' + number : number;


}


function restart() {


Display.value = '' + padout(day) + '-' + padout(month - 0 + 1) + '-' + year;


mywindow.close();


}


function newWindow(disp) {


Display = disp;


mywindow=open('/layout/calendar.html','myname','resizable=no,width=350,height=270');


mywindow.location.href = '/layout/calendar.html';


if (mywindow.opener == null) mywindow.opener = self;


}


function checkStartEndDates(startdate,enddate) {





	var startDate = startdate.substring(6)+startdate.substring(3,5)+startdate.substring(0,2);


	var endDate = enddate.substring(6)+enddate.substring(3,5)+enddate.substring(0,2);


 


	if(parseInt(endDate) <= parseInt(startDate)) {


		alert('Please enter an end date greater than the start date');


		return false;


	}


	else return true;





}


function checkDates(startdate,enddate) {





	var startDate = startdate.substring(6)+startdate.substring(3,5)+startdate.substring(0,2);


	var endDate = enddate.substring(6)+enddate.substring(3,5)+enddate.substring(0,2);


 


	if(parseInt(endDate) < parseInt(startDate)) {


		alert('Please enter an end date greater than the start date');


		return false;


	}


	else return true;





}





function checkDates1(startdate,enddate) {





	var startDate = startdate.substring(6)+startdate.substring(3,5)+startdate.substring(0,2);


	var endDate = enddate.substring(6)+enddate.substring(3,5)+enddate.substring(0,2);


 


	if(parseInt(endDate) <= parseInt(startDate)) {


		alert('Please enter an end date greater than the start date');


		return false;


	}


	else return true;





}








function currentDate(datevalue)


{


var flag = true;


    day = parseInt(datevalue.substring(0,2));


    month = parseInt(datevalue.substring(3,5));


    year = parseInt(datevalue.substring(6));





    var today = new Date();


    year = ((!year) ? y2k(today.getYear()):year);


    month = ((!month) ? today.getMonth():month-1);





	if((y2k(today.getYear()) > year))


	{


		alert("Date should be greater than or equal to the current date");


		flag= 'false';


		return flag;


	}


	else if((y2k(today.getYear()) == year) && (month < today.getMonth()))


	{


		alert("Date should be greater than or equal to the current date");


		flag= 'false';


		return flag;


	}


	else if((y2k(today.getYear()) == year) && (month == today.getMonth()) && (day < today.getDate()))


	{


		alert("Date should be greater than or equal to the current date");


		flag= 'false';


		return flag;


	}


/*


	var checkmonth,checkday;


	var sysvariable, checkvariable; 





	if(month < 10)


	{


		checkmonth="0"+month;


	}


	else


	{


		checkmonth =month;


	}





	if(day < 10)


	{


		checkday="0"+day;


	}


	else


	{


		checkday =day;


	}





	if((today.getMonth()+1) < 10)


	{


		if(today.getDate() < 10)


		{


			//alert("new eeeeeeee"+parseInt(y2k(today.getYear())+"0"+today.getMonth()+"0"+today.getDate()));


			sysvariable =parseInt(y2k(today.getYear())+"0"+today.getMonth()+"0"+today.getDate());		


		}


		else


		{


			//alert(today.getYear());


			//alert(y2k(today.getYear()));


			//alert(parseInt(y2k(today.getYear())+"0"+today.getMonth()+""+today.getDate()));


			sysvariable =parseInt(y2k(today.getYear())+"0"+today.getMonth()+""+today.getDate());


		}


	}


	else if((today.getMonth()+1) >=10)


	{


		if(today.getDate() < 10)


		{


			//alert("new ccccccccc"+parseInt(y2k(today.getYear())+""+today.getMonth()+"0"+today.getDate()));


			sysvariable =parseInt(y2k(today.getYear())+""+today.getMonth()+"0"+today.getDate());		


		}


		else


		{


			//alert("new ddddddddd"+parseInt(y2k(today.getYear())+""+today.getMonth()+""+today.getDate()));


			sysvariable =parseInt(y2k(today.getYear())+""+today.getMonth()+""+today.getDate());





		}








	}


		//alert("Choose date"+year+""+checkmonth+""+checkday);


		checkvariable = parseInt(year+""+checkmonth+""+checkday) ;








if(today.getYear() == year)


{


	if((checkvariable - sysvariable) > 603)


	{


		//alert("inside the same year");


		alert("Date should be greater than current date but should be lesser than 6 months");


		flag= 'false';


		return flag;


	}	


	else


	{


		flag= 'true';


		return flag;


	}


}


else if(year > today.getYear())


{


	if((checkvariable - sysvariable) > 9403)


	{


		//alert("inside the diff year");


		alert("Date should be greater than current date but should be lesser than 6 months");


		flag= 'false';


		return flag;


	}


	else


	{


		flag= 'true';


		return flag;


	}








} */








}








// Difference Between 2 dates returning in days





function differenceDays(date1,date2,diff)


{


var dt1=date1.value;


var dt2=date2.value;


var mth,mth1;


var d1= dt1.substring(0,2);


var m1=dt1.substring(3,5);


var y1=dt1.substring(6,10);





var d2= dt2.substring(0,2);


var m2=dt2.substring(3,5);


var y2=dt2.substring(6,10);





if((m1=='01')){ mth='January' ;}


if((m1=='02')){ mth='February' ;}


if((m1=='03')){ mth='March' ;}


if((m1=='04')){ mth='April' ;}


if((m1=='05')){ mth='May' ;}


if((m1=='06')){ mth='June' ;}


if((m1=='07')){ mth='July' ;}


if((m1=='08')){ mth='August' ;}


if((m1=='09')){ mth='September' ;}


if((m1=='10')){ mth='October' ;}


if((m1=='11')){ mth='November' ;}


if((m1=='12')){ mth='December' ;}





if((m2=='01')){ mth11='January' ;}


if((m2=='02')){ mth1='February' ;}


if((m2=='03')){ mth1='March' ;}


if((m2=='04')){ mth1='April' ;}


if((m2=='05')){ mth1='May' ;}


if((m2=='06')){ mth1='June' ;}


if((m2=='07')){ mth1='July' ;}


if((m2=='08')){ mth1='August' ;}


if((m2=='09')){ mth1='September' ;}


if((m2=='10')){ mth1='October' ;}


if((m2=='11')){ mth1='November' ;}


if((m2=='12')){ mth1='December' ;}





var dt=mth+' '+d1+','+y1;


var dtt=mth1+' '+d2+','+y2;


var difference=(new Date(dtt)-new Date(dt));


var days= Math.round(difference/(1000*60*60*24));





diff.value=days;


}








function lesserDate(datevalue)


{


var flag = true;


    day = parseInt(datevalue.substring(0,2));


    month = parseInt(datevalue.substring(3,5));


    year = parseInt(datevalue.substring(6));





    var today = new Date();


/*


    year = ((!year) ? y2k(today.getYear()):year);


    month = ((!month) ? today.getMonth():month-1);


*/


		//alert("day "+day+" month"+month);


		//alert("today.getDate() "+today.getMonth()+"days"+today.getDate());





	if((y2k(today.getYear()) < year))


	{


		alert("Date should be less than or equal to current date");


		flag= 'false';


		return flag;


	}


	else if((y2k(today.getYear()) == year) && (month > (today.getMonth()+1)))


	{


		alert("Date should be less than or equal to current date");


		flag= 'false';


		return flag;


	}


	else if((y2k(today.getYear()) == year) && ((today.getMonth()+1) == month) && (day > today.getDate()))


	{


		alert("Date should be less than or equal to current date");


		flag= 'false';


		return flag;


	}





/*


	var checkmonth,checkday;


	var sysvariable, checkvariable; 





	if(month < 10)


	{


		checkmonth="0"+month;


	}


	else


	{


		checkmonth =month;


	}





	if(day < 10)


	{


		checkday="0"+day;


	}


	else


	{


		checkday =day;


	}





	if((today.getMonth()+1) < 10)


	{


		if(today.getDate() < 10)


		{


			//alert(parseInt(y2k(today.getYear())+"0"+today.getMonth()+"0"+today.getDate()));


			sysvariable =parseInt(y2k(today.getYear())+"0"+today.getMonth()+"0"+today.getDate());		


		}


		else


		{


			//alert(parseInt(y2k(today.getYear())+"0"+today.getMonth()+""+today.getDate()));


			sysvariable =parseInt(today.getYear()+"0"+today.getMonth()+""+today.getDate());


		}


	}


	else


	{


		if(today.getDate() < 10)


		{


			//alert(parseInt(today.getYear()+""+today.getMonth()+"0"+today.getDate()));


			sysvariable =parseInt(y2k(today.getYear())+""+today.getMonth()+"0"+today.getDate());		


		}


		else


		{


			//alert(parseInt(today.getYear()+""+today.getMonth()+""+today.getDate()));


			sysvariable =parseInt(y2k(today.getYear())+""+today.getMonth()+""+today.getDate());





		}








	}


		//alert(year+""+checkmonth+""+checkday);


		checkvariable = parseInt(year+""+checkmonth+""+checkday) ;








if(today.getYear() == year)


{


	if((checkvariable - sysvariable) < -603)


	{


		alert("Date should be lesser than current date but should be within 6 months");


		flag= 'false';


		return flag;


	}	


	else


	{


		flag= 'true';


		return flag;


	}


}


else if(year > today.getYear())


{


	if((checkvariable - sysvariable) < -9403)


	{


		alert("Date should be lesser than current date but should be within 6 months");


		flag= 'false';


		return flag;


	}


	else


	{


		flag= 'true';


		return flag;


	}








} 


*/





}





function registerDate(datevalue)


{


var flag = true;


    day = parseInt(datevalue.substring(0,2));


    month = parseInt(datevalue.substring(3,5));


    year = parseInt(datevalue.substring(6));





    var today = new Date();


   // year = ((!year) ? y2k(today.getYear()):year);


   // month = ((!month) ? today.getMonth():month-1);





	if((y2k(today.getYear()) < year))


	{


		alert("Date should be less than or equal to current date");


		flag= 'false';


		return flag;


	}


	else if((y2k(today.getYear()) == year) && (month > today.getMonth()))


	{


		alert("Date should be less than or equal to current date");


		flag= 'false';


		return flag;


	}


	


	else if((y2k(today.getYear()) == year) && (month == today.getMonth()) && (day > today.getDate()))


	{


		alert("Date should be less than or equal to current date");


		flag= 'false';


		return flag;


	}


}











function chequeDate(datevalue)


{


var flag = true;


    day = parseInt(datevalue.substring(0,2));


    month = parseInt(datevalue.substring(3,5));


    year = parseInt(datevalue.substring(6));





    var today = new Date();


//    year = ((!year) ? y2k(today.getYear()):year);


//    month = ((!month) ? today.getMonth():month-1);





	if((y2k(today.getYear()) > year))


	{


		alert("Date should be greater than or equal to the current date");


		flag= 'false';


		return flag;


	}


	else if((y2k(today.getYear()) == year) && (month < today.getMonth()))


	{


		alert("Date should be greater than or equal to the current date");


		flag= 'false';


		return flag;


	}


	else if((y2k(today.getYear()) == year) && (month == today.getMonth()) && (day < today.getDate()))


	{


		alert("Date should be greater than or equal to the current date");


		flag= 'false';


		return flag;


	}





	var checkmonth,checkday;


	var sysvariable, checkvariable; 





	if(month < 10)


	{


		checkmonth="0"+month;


	}


	else


	{


		checkmonth =month;


	}





	if(day < 10)


	{


		checkday="0"+day;


	}


	else


	{


		checkday =day;


	}





	if((today.getMonth()+1) < 10)


	{


		if(today.getDate() < 10)


		{


			//alert("new eeeeeeee"+parseInt(y2k(today.getYear())+"0"+today.getMonth()+"0"+today.getDate()));


			sysvariable =parseInt(y2k(today.getYear())+"0"+(today.getMonth()+1)+"0"+today.getDate());		


		}


		else


		{


			//alert(today.getYear());


			//alert(y2k(today.getYear()));


			//alert(parseInt(y2k(today.getYear())+"0"+today.getMonth()+""+today.getDate()));


			sysvariable =parseInt(y2k(today.getYear())+"0"+(today.getMonth()+1)+""+today.getDate());


		}


	}


	else if((today.getMonth()+1) >=10)


	{


		if(today.getDate() < 10)


		{


			//alert("new ccccccccc"+parseInt(y2k(today.getYear())+""+today.getMonth()+"0"+today.getDate()));


			sysvariable =parseInt(y2k(today.getYear())+""+(today.getMonth()+1)+"0"+today.getDate());		


		}


		else


		{


			//alert("new ddddddddd"+parseInt(y2k(today.getYear())+""+today.getMonth()+""+today.getDate()));


			sysvariable =parseInt(y2k(today.getYear())+""+(today.getMonth()+1)+""+today.getDate());





		}








	}


		//alert("Choose date"+year+""+checkmonth+""+checkday);


		checkvariable = parseInt(year+""+checkmonth+""+checkday) ;





//alert("Difference"+(parseInt(checkvariable) - parseInt(sysvariable)));


if((y2k(today.getYear())) == year)


{


	//alert("inside the same year"+checkvariable+"sys"+sysvariable);


	if((parseInt(checkvariable) - parseInt(sysvariable)) > 30)


	{


		//alert("inside the same year");


		alert("Date should be greater than current date but should be lesser than 30 days");


		flag= 'false';


		return flag;


	}	


	else


	{


		flag= 'true';


		return flag;


	}


}


else if((y2k(today.getYear())) < year )


{


	//alert("inside the diff year "+(parseInt(checkvariable) - parseInt(sysvariable)));


	if((parseInt(checkvariable) - parseInt(sysvariable)) < 9900)


	{


		//alert("inside the diff year 222222");


		alert("Date should be greater than current date but should be lesser than 30 days");


		flag= 'false';


		return flag;


	}


	else


	{


		flag= 'true';


		return flag;


	}








} 








}














//opening of New Window for order details


function orderDet(sOrderId)


{


      var zWindow=window.open("/subscription/admin/INFSubscriptionOrderDetailsPP.jsp?orderid="+sOrderId,"newwin", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=no,copyhistory=0,width=540,height=400,top=10,left=10");


}








function orderDetSupp(sOrderId)


{


      var zWindow=window.open("/subscription/supp/INFSubscriptionOrderDetailsPP2.jsp?orderid="+sOrderId,"newwin", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=no,copyhistory=0,width=540,height=400,top=10,left=10");


}





function orderDetCust(sOrderId)


{


      var zWindow=window.open("/subscription/cust/INFSubscriptionOrderDetailsPP1.jsp?orderid="+sOrderId,"newwin", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=no,copyhistory=0,width=540,height=400,top=10,left=10");


}











//opening of New Window for customer details





function customerDet(sCustomerId)


{


	var sCustomerId;


	var zWindow;


      zWindow=window.open("/registration/cust/INFCustomerDetails.jsp?custid="+sCustomerId,"newwin", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=no,copyhistory=0,width=700,height=500,top=10,left=10");


}





//opening of New Window for supplier details


function supplierDet(sSuppId)


{


	window.open("/registration/supp/INFSupplierDetails.jsp?suppid="+sSuppId,"","toolbar=0,status=0,menubar=0,scrollbars=yes,noresize,width=540,height=400,top=10,left=10");


}











//opening of New Window for supplier details


function invoiceDet(sOrderId)


{


	window.open("INFOSubscriptionInvoice.jsp?orderid="+sOrderId,"","toolbar=0,status=0,menubar=0,scrollbars=yes,noresize,width=540,height=400,top=10,left=10");


}





//product details


function prodDet(sProId)


{


	window.open("/subscription/cust/INFProductDetails.jsp?proid="+sProId,"","toolbar=0,status=0,menubar=0,scrollbars=yes,noresize,width=550,height=520,top=10,left=10");


}





// for printing a page 





function printPage(PrintVariable)


{


	var zWin=window.open("","mywin", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=no,copyhistory=0,width=850,height=300,left=10,top=10");


	zWin.document.write("<html><head>");


	zWin.document.write("\n<body ><form name=frm method=post>");


	zWin.document.write("<input type=hidden name=\"printValues\" value=\""+PrintVariable+"\">");


 	zWin.document.write("\n<script>document.frm.action='/general/INFPrintContent.jsp';document.frm.submit();<\/script>");


	zWin.document.write("\n</form></body>\n</html>");


}





/******************** Minutes format **************/


//minutes delivery details


function deilveryDetCust(sOrderId)


{


	window.open("/minutes/cust/INFDeliveryDetail.jsp?sordid="+sOrderId,"","toolbar=0,status=0,menubar=0,scrollbars=yes,noresize,width=840,height=400,top=10,left=10");


}





function minutesOrderDetCust(sOrderId)


{


      var zWindow=window.open("/minutes/cust/INFMinOrderDetails.jsp?orderid="+sOrderId,"newwin", "toolbar=1,location=1,directories=0,status=0,menubar=1,scrollbars=yes,resizable=no,copyhistory=0,width=540,height=400,top=10,left=10");


}


function adminutesOrderDetCust(sOrderId)


{


      var zWindow=window.open("/minutes/admin/INFMinutesOrderDetails.jsp?orderid="+sOrderId,"newwin", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=no,copyhistory=0,width=570,height=550,top=10,left=10");


}


function minutesOrderDetSupp(sOrderId)


{


      var zWindow=window.open("/minutes/supp/INFSuppMinutesOrderDetails.jsp?orderid="+sOrderId,"newwin", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=no,copyhistory=0,width=570,height=580,top=10,left=10");


}





function prodMinDet(sProdId)


{


	window.open("/minutes/admin/INFProductDetails.jsp?prodid="+sProdId,"","left=0,top=0,toolbar=0,status=0,menubar=0,scrollbar=yes,noresize,width=620,height=400");


}


function prodHardDet(sProdId)


{


	window.open("/sales/cust/INFProductDetails.jsp?prodid="+sProdId,"","left=0,top=0,toolbar=0,status=0,menubar=0,scrollbars=yes,width=620,height=600");


}


function adminprodHardDet(sProdId)


{


	window.open("/sales/admin/INFProductDetails.jsp?prodid="+sProdId,"","left=0,top=0,toolbar=0,status=0,menubar=0,scrollbars=yes,width=620,height=600");


}








function checking(obj)


{


obj.checked = true;


}





function showExcel(sProdId,sAccountId)


{


      var zWindow=window.open("/minutes/cust/INFShowExcel.jsp?prodid="+sProdId+"&orderid="+sAccountId,"newwin", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=no,copyhistory=0,width=540,height=400,top=10,left=10");


}


function viewExcel(sProd,sOrderId)


{


      var zWindow=window.open("/minutes/admin/INFAdminViewExcel.jsp?prodid="+sProd+"&accountid="+sOrderId,"newwin", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=no,copyhistory=0,width=540,height=400,top=10,left=10");


}





function SuppOrderDet(ssupId)


{


	window.open("/minutes/supp/INFSupplyOrderDetails.jsp?ssupId="+ssupId,"","left=0,top=0,toolbar=0,status=0,menubar=0,scrollbar=yes,resizable=no,width=620,height=480");


}


//opening of New Window for supplier details


function adminOrderDetails(sOrderId)


{


	window.open("/minutes/admin/INFAdminOrderDetails.jsp?orderid="+sOrderId,"","toolbar=0,status=0,menubar=0,scrollbars=yes,noresize,width=900,height=600");


}








//opening of New Window for customer invoice details





function custInvoice(sOrderId)


{


	var zWindow;


      zWindow=window.open("/subscription/cust/INFCustomerInvoicePP.jsp?orderid="+sOrderId,"newwin", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=yes,copyhistory=0,width=700,height=500,top=10,left=10");


}





//opening of New Window for admin invoice details





function adminInvoice(sOrderId)


{


	var zWindow;


      zWindow=window.open("/subscription/admin/INFAdminInvoicePP.jsp?orderid="+sOrderId,"newwin", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=no,copyhistory=0,width=700,height=500,top=10,left=10");


}





function adminInvoice1(sOrderId)


{


	var zWindow;


      zWindow=window.open("/subscription/admin/INFPaymentDetailsPP.jsp?orderid="+sOrderId,"newwin", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=no,copyhistory=0,width=700,height=300,top=10,left=10");


}














//opening of New Window for supplier invoice details





function suppInvoice(sOrderId)


{


	var zWindow;


      zWindow=window.open("/subscription/supp/INFSupplierInvoicePP.jsp?orderid="+sOrderId,"newwin", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=no,copyhistory=0,width=700,height=500,top=10,left=10");


}





//opening of New Window for cust purchase order details





function purchaseOrder(sOrderId)


{


	var zWindow;


      zWindow=window.open("/minutes/cust/INFPurchaseOrderDetails.jsp?orderid="+sOrderId,"newwin", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=no,copyhistory=0,width=800,height=600,top=10,left=10");


}





//opening of New Window for cust enquirydetails





function enquiryDetails(sEnqNo)


{


	var zWindow;


      zWindow=window.open("/sales/cust/INFViewEnquiry.jsp?enqno="+sEnqNo,"newwin", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=no,copyhistory=0,width=800,height=400,top=10,left=10");


}





//opening of New Window for cust PO





function purchaseDetails(sPordNo)


{


	var zWindow;


      zWindow=window.open("/sales/cust/INFViewPO.jsp?pordno="+sPordNo,"newwin", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=no,copyhistory=0,width=800,height=400,top=10,left=10");


}

function purchaseDetails1(sPordNo)


{


	var zWindow;


      zWindow=window.open("/sales/cust/INFViewPO1.jsp?pordno="+sPordNo,"newwin", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=no,copyhistory=0,width=800,height=400,top=10,left=10");


}




// Admin Purchase Enquiry Details


function adminEnquiryDetails(sEnqNo)


{


	var zWindow;


      zWindow=window.open("/purchase/admin/INFAdminViewEnquiry.jsp?enqno="+sEnqNo,"newwin", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=no,copyhistory=0,width=800,height=450,top=10,left=10");


}





// Admin Purchase Details


function adminPurchaseDetails(sPordNo)
{
	var zWindow;
      zWindow=window.open("/purchase/admin/INFViewAPO.jsp?pordno="+sPordNo,"newwin", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=no,copyhistory=0,width=800,height=450,top=10,left=10");
}

function adminPurchaseDetails1(sdelid,sdeldt,sprid,sprdt,ssupnm)
{
	var zWindow;
      zWindow=window.open("/purchase/admin/INFDeliveryDet.jsp?sdelid="+sdelid+"&sdeldt="+sdeldt+"&sprid="+sprid+"&sprdt="+sprdt+"&ssupnm="+ssupnm,"newwin", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=no,copyhistory=0,width=800,height=450,top=10,left=10");
}










//opening of New Window for cust purchase order details





function payDetails(sOrderId,sAgent,sRecDate,sPlace,fPayAmount,sCurrency,sInsNo,sCheckDate,sBankName,sRemarks,sPaymentMode,sPaidTo)


{


	var zWindow;


      zWindow=window.open("/minutes/admin/INFAdminPayDetails.jsp?orderid="+sOrderId+"&Agent="+sAgent+"&ReceivedDate="+sRecDate+"&Place="+sPlace+"&amount="+fPayAmount+"&currency="+sCurrency+"&insno="+sInsNo+"&checkdate="+sCheckDate+"&bankname="+sBankName+"&remarks="+sRemarks+"&paymentmode="+sPaymentMode+"&paidto="+sPaidTo,"newwin", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=no,copyhistory=0,width=750,height=550,top=10,left=10");


}


function suppPayDetails(sOrderId,sAgent,sRecDate,sPlace)


{


	var zWindow;


      zWindow=window.open("/minutes/supp/INFSupplierPayDetails1.jsp?orderid="+sOrderId+"&Agent="+sAgent+"&ReceivedDate="+sRecDate+"&Place="+sPlace,"newwin", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=no,copyhistory=0,width=700,height=500,top=10,left=10");


}





function payDetails1(sOrderId,sAgent,sRecDate,sPlace,sfilename)


{


	var zWindow;


      zWindow=window.open("/minutes/supp/INFUploadPP.jsp?orderid="+sOrderId+"&Agent="+sAgent+"&ReceivedDate="+sRecDate+"&Place="+sPlace+"&fileName="+sfilename,"newwin", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=no,copyhistory=0,width=700,height=500,top=10,left=10");


}








//opening of New Window for supplier invoice details





function suppViewInvoice(sOrderId)


{


	var zWindow;


      zWindow=window.open("/minutes/supp/INFSupplierInvoice.jsp?orderid="+sOrderId,"newwin", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=no,copyhistory=0,width=700,height=400,top=10,left=10");


}





//Viewing the Pictures





function showSatellite(val)


{


	if(val==1)


	{


		var zWindow;


      	zWindow=window.open("/general/telstar.html","newwin", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=no,copyhistory=0,width=700,height=400,top=10,left=10");


	}


	if(val==2)


	{


		


      	window.open("/general/nilesat.html","newwin", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=no,copyhistory=0,width=700,height=400,top=10,left=10");


	}


	if(val==3)


	{


		


      	window.open("/general/asiasat.html","newwin", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=no,copyhistory=0,width=700,height=550,top=10,left=10");


	}


	if(val==4)


	{


		


      	window.open("/general/arabsat.html","newwin", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=no,copyhistory=0,width=700,height=400,top=10,left=10");


	}


	if(val==5)


	{


		


      	window.open("/general/lmi.html","newwin", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=no,copyhistory=0,width=950,height=400,top=10,left=10");


	}


	if(val==6)


	{


		


      	window.open("/general/intel.html","newwin", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=no,copyhistory=0,width=950,height=410,top=10,left=10");


	}


	if(val==7)


	{


		


      	window.open("/general/eutel.html","newwin", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=no,copyhistory=0,width=950,height=400,top=10,left=10");


	}








}





//opening of New Window for Product support details for Subscription





function prodSupportFile1(sProId)


{


	window.open("/subscription/cust/INFProductDetails.jsp?proid="+sProId,"","toolbar=0,status=0,menubar=0,scrollbars=yes,noresize,width=540,height=400,top=10,left=10");


}














function prodSupportFile3(sProId)


{


	window.open("/subscription/cust/INFProductDetailsSupp.jsp?proid="+sProId,"","toolbar=0,status=0,menubar=0,scrollbars=yes,noresize,width=540,height=400,top=10,left=10");


}





//opening of New Window for Product support details for Minutes





function prodSupportFile2(sProId)


{


	window.open("/minutes/admin/INFProductDetails.jsp?prodid="+sProId,"","left=0,top=0,toolbar=0,status=0,menubar=0,scrollbar=yes,noresize,width=620,height=400");


}





function salesStar()


{


	window.open("/INFProductsNew.jsp?stype=Month","","left=0,top=0,toolbar=0,status=0,menubar=0,scrollbar=yes,noresize,width=650,height=600");





}





function resellerStar()


{


	window.open("/INFResellerStar.jsp?stype=Reseller","","left=0,top=0,toolbar=0,status=0,menubar=0,scrollbar=yes,width=650,height=420");


}


function productsNew()


{


	window.open("/INFProductsNew.jsp?stype=New","","left=0,top=0,toolbar=0,status=0,menubar=0,scrollbar=yes,noresize,width=650,height=600");


}





function mailPopUp(emailValue)


{


	window.open("/INFMailPopUp.jsp?email="+emailValue,"test","left=0,top=0,toolbar=0,status=0,menubar=0,scrollbar=yes,noresize,width=600,height=200");


}





function productsSpecial()


{


	window.open("/INFProductsNew.jsp?stype=Special","","left=0,top=0,toolbar=0,status=0,menubar=0,scrollbar=yes,noresize,width=650,height=600");


}


function InquiryDetails(sOrderId)


{


	window.open("/salesneg/admin/INFViewQuotation.jsp?orderid="+sOrderId,"newwin", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=no,copyhistory=0,width=750,height=900,top=10,left=10");





}


function adInquiryDetails(sOrderId)


{


	window.open("/salesneg/admin/INFOrderDetails.jsp?orderid="+sOrderId,"newwin", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=no,copyhistory=0,width=750,height=500,top=10,left=10");





}


function newsEvents()


{


	window.open("/INFNewsEvents.jsp?stype=New","","left=0,top=0,toolbar=0,status=0,menubar=0,scrollbar=yes,noresize,width=650,height=300");


}





function prodMinInquiryDet(sProdId)


{


	window.open("/salesneg/cust/INFMinProductDetails.jsp?prodid="+sProdId,"","left=0,top=0,toolbar=0,status=0,menubar=0,scrollbar=yes,noresize,width=620,height=400");


}





function prodSubInquiryDet(sProId)


{


	window.open("/salesneg/cust/INFSubProductDetails.jsp?proid="+sProId,"","toolbar=0,status=0,menubar=0,scrollbars=yes,noresize,width=540,height=400,top=10,left=10");


}





function custPassInfo(cust)


{


	window.open("/registration/admin/INFCustomerPassInfo.jsp?custid="+cust,"","toolbar=0,status=0,menubar=0,scrollbars=yes,noresize,width=540,height=400,top=10,left=10");


}





function custPassInfo1(cust)


{


	window.open("/registration/admin/INFCustomerPassInfo.jsp?custid="+cust+"&type=New","","toolbar=0,status=0,menubar=0,scrollbars=yes,noresize,width=540,height=400,top=10,left=10");


}





function privacyPolicy()


{


	window.open("/general/INFPrivacyPolicy.jsp","","toolbar=0,status=0,menubar=0,scrollbars=yes,noresize,width=700,height=650,top=10,left=10");


}


function partApp()


{


	window.open("/general/INFPartApp.jsp","","toolbar=0,status=0,menubar=0,scrollbars=yes,noresize,width=700,height=650,top=10,left=10");


}


function docRefrence(sDocNo)


{


	window.open("/dispatch/admin/INFDocumentInfo.jsp?docid="+sDocNo,"","toolbar=0,status=0,menubar=0,scrollbars=yes,noresize,width=700,height=500,top=10,left=10");


}





function leadsDetails(sLeadNo)


{


	window.open("/leads/admin/INFLeadsDetails.jsp?LeadNo="+sLeadNo,"","toolbar=0,status=0,menubar=0,scrollbars=yes,noresize,width=700,height=500,top=10,left=10");


}





function projRefrence(sProjId)


{


	window.open("/tracking/admin/INFJobAssignInfo.jsp?projid="+sProjId,"","toolbar=0,status=0,menubar=0,scrollbars=yes,noresize,width=700,height=500,top=10,left=10");


}


function DocDetails(sDocId)


{


      var zWindow=window.open("/DocumentCenter/Admin/INFDocDetails.jsp?docid="+sDocId,"newwin", "toolbar=1,location=1,directories=0,status=0,menubar=1,scrollbars=yes,resizable=no,copyhistory=0,width=540,height=400,top=10,left=10");


}





function WareHouseDetails(sType,Id)
{
      var zWindow=window.open("/masters/INFWareHouseMasterView.jsp?type="+sType+"&sId="+Id,"newwin", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,noresize,copyhistory=0,width=475,height=325,top=10,left=10");
}
function ReEnquiryDetails(enqid1,quotid1)


{


      var zWindow=window.open("/sales/admin/INFViewReQuotation.jsp?enqid="+enqid1+"&quotid="+quotid1,"newwin", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=yes,copyhistory=0,width=770,height=400,top=10,left=10");


}
function ReEnquiryDetails1(enqid2,quotid2)
{
      var zWindow=window.open("/sales/admin/INFViewReQuotation1.jsp?enqid="+enqid2+"&quotid="+quotid2,"newwin", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=yes,copyhistory=0,width=770,height=400,top=10,left=10");

}



function DocIDDetails(sDocId)


{


      var zWindow=window.open("/DocumentCenter/Admin/INFDocumentIDDetails.jsp?docid="+sDocId,"","toolbar=0,status=0,menubar=0,scrollbars=yes,noresize,width=700,height=400,top=10,left=10");





}


function OtherServices(sStockTransferId)
{
      var zWindow=window.open("/reports/admin/INFStockTransferReportView.jsp?sStockTransId="+sStockTransferId,"newwin","toolbar=0,status=0,menubar=0,scrollbars=yes,noresize,width=350,height=300,top=10,left=10");
}

function wareHouseAdd(qty,prodid,deliveryid,stype)
{
      var zWindow=window.open("/purchase/admin/INFWeareHouseAdd.jsp?qty="+qty+"&prodid="+prodid+"&deliveryid="+deliveryid+"&stype="+stype,"newwin","toolbar=0,status=0,menubar=0,scrollbars=yes,noresize,width=700,height=400,top=10,left=10");

}

function EmployeeDetails(sEmployeeid)


{


	window.open("/Employee/Admin/INFEmployeeDetailspop.jsp?Employeeid="+sEmployeeid,"","toolbar=0,status=0,menubar=0,scrollbars=yes,noresize,width=700,height=500,top=10,left=10");


}


function EnqDetails(enqno)


{


	window.open("/sales/cust/INFViewEnquiry.jsp?enqno="+enqno,"","toolbar=0,status=0,menubar=0,scrollbars=yes,resize,width=700,height=500,top=10,left=10");


}

function EnqDetails1(squot,senqid)


{


      var zWindow=window.open("/sales/cust/INFViewQuotation.jsp?quotationid="+squot+"&type="+senqid,"newwin", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=yes,copyhistory=0,width=770,height=600,top=10,left=10");


}
function EnqDetails2(squot,stype,senqid)


{


      var zWindow=window.open("/sales/cust/INFViewQuotation.jsp?quotationid="+squot+"&type="+stype+"&enq="+senqid,"newwin", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=yes,copyhistory=0,width=770,height=600,top=10,left=10");


}
function EnqDetails3(quot,type,enqid)
{
     var zWindow=window.open("/sales/cust/INFViewEnquiry1.jsp?squot="+quot+"&stype="+type+"&senqid="+enqid,"newwin", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=yes,copyhistory=0,width=770,height=600,top=10,left=10");
}



function prodHardDetSupp(sProdId)
{
	window.open("/purchase/supp/INFProductDetails.jsp?prodid="+sProdId,"","left=0,top=0,toolbar=0,status=0,menubar=0,scrollbars=yes,width=620,height=600");
}

function MinuteFault(sTrackingNo)
{
	window.open("/rma/Admin/INFMinutesFaultView.jsp?trackingNo="+sTrackingNo,"","left=0,top=0,toolbar=0,status=0,menubar=0,scrollbars=yes,width=500,height=300");
}

function SubscriptionFault(sTrackingNo)
{
	window.open("/rma/Admin/INFSubscriptionFaultView.jsp?trackingNo="+sTrackingNo,"","left=0,top=0,toolbar=0,status=0,menubar=0,scrollbars=yes,width=450,height=300");
}

function payCollectInf(sPciId,val)
{
	if(val==0)
		window.open("/payment/admin/INFPaymentCollectInfo.jsp?payno="+sPciId,"","left=0,top=0,toolbar=0,status=0,menubar=0,scrollbars=yes,width=730,height=480");
	if(val==1)
		window.open("/payment/admin/INFPaymentCollectInfo.jsp?payno="+sPciId+"&type=instruct","","left=0,top=0,toolbar=0,status=0,menubar=0,scrollbars=yes,width=730,height=480");

}
function ForwarderDetails(Id)
{
      var zWindow=window.open("/masters/INFForwarderMasterView.jsp?sId="+Id,"newwin", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,noresize,resizable=yes,copyhistory=0,width=500,height=460,top=10,left=10");
}

// for view RMA Details.
function rmaNumber(complaint_id)
{
	window.open("/rma/Admin/INFRMADetails.jsp?complaint_id="+complaint_id,"","left=100,top=100,toolbar=0,status=0,menubar=0,scrollbars=yes,noresize,width=600,height=500");
}


function quotAdminDetails(qid,type)
{
	window.open("/purchase/admin/INFAdminViewQuotPopup.jsp?quotid="+qid,"","left=100,top=100,toolbar=0,status=0,menubar=0,scrollbars=yes,noresize,width=700,height=550");
}


				
// for view Invoice Details.
function invoiceNumber(invoiceno)
{
	window.open("/rma/Admin/INFRMADetails.jsp?complaint_id="+invoiceno,"","left=100,top=100,toolbar=0,status=0,menubar=0,scrollbars=yes,noresize,width=600,height=500");
}


// for view Re-enquiry Details by Admin.
function AdminViewReEnqDet(enqNo)
{
	window.open("/purchase/admin/INFViewReQuotDet.jsp?enqno="+enqNo,"","left=100,top=100,toolbar=0,status=0,menubar=0,scrollbars=yes,noresize,width=700,height=550");
}

function logout(val)
{	
		var tot;
		tot=confirm('Are You Sure You Want to Logout?');

				if(tot==true)
			{
				window.location.href='/general/INFSupplierLogout.jsp';
						 	
			}
			else
			{
				return false;
			}

return true;
			
}

function logoutAdmin(val)
{	
		var tot;
		tot=confirm('Are You Sure You Want to Logout?');

				if(tot==true)
			{
				window.location.href='/general/INFAdminLogout.jsp';
						 	
			}
			else
			{
				return false;
			}

return true;
			
}