function confirmSubmit()
{
	var answer = confirm('Are you sure you wish to continue?');
	if(answer)
		return true;
	else
		return false;	
}

function genericConfirmSubmit(message)
{
	var answer = confirm(message);
	if(answer)
	{
		answer = confirm('Are you sure you wish to continue?');
		if(answer)
			return true;
		else
			return false;
	}
	else
		return false;
}		

function submitMessage(message)
{
	var answer = confirm(message);
	if(answer)
	 	return true;
	else
	 	return false;
}

function dateCheck(startDate,endDate)
{
	//check if valid str&end date
	
	var strdate=startDate.value;
	var enddate=endDate.value;
	
	if(!(checkValidDate(strdate,enddate))){
		alert("Start Date should not be greater than End Date");
		return false;
	}
	
	return true;
}

function checkValidDate(strdate,enddate){
	// get the position of "/"
	var dtCh= "/";
	
	var pos1=strdate.indexOf(dtCh);
	var pos2=strdate.indexOf(dtCh,pos1+1);

    //get start date parsed
	var strMonth=strdate.substring(0,pos1);
	var strDay=strdate.substring(pos1+1,pos2);
	var strYear=strdate.substring(pos2+1);
	
	//get end date parsed
	var endMonth=enddate.substring(0,pos1);
	var endDay=enddate.substring(pos1+1,pos2);
	var endYear=enddate.substring(pos2+1);
	
	//Validate date range
	if(strYear<=endYear){
		if((strYear==endYear)){
			if(strMonth<=endMonth){
				if(strMonth==endMonth){
					if(!(strDay<=endDay)){
						return false;
					}
				}
			}
			else{
				return false;
			}
		}		
	}else{
		return false;
	}
	return true;
}

		
		