function trim(str){
return str.replace(/^\s+|\s+$/g,'');
}

function FormReset(Form) {
	Form.reset();
	return false;
}

function WindoWView(ID) {
	window.open('ViewTapestry.asp?action=Show&Topic=TapestryProcess&ID='+ID,'View','toolbar=no,height=150,width=720');
}

function Shorting(Page,Short) {
	var Page = Page.replace("&Short=Desc","").replace("&Short=Asc","").replace("&Short=","");
	var strUrl = Page+"&Short="+Short;
	//location.href = strUrl;
	alert(strUrl)
}


function checkDate(strDate) {
	var myDate = new Date();
	vDate = strDate.split("/")
	validDate = myDate.setFullYear(vDate[2],vDate[1],vDate[0]);
	return validDate;
}

// Check the two dates and Process the value
// Send the value  11-07-2006
function checkDays(sDate,eDate) {
	
  date1 = sDate.split("/");
  date2 = eDate.split("/");
  
  if(checkDate(eDate) < checkDate(sDate)) {  
  D1 = date1[0] - 6; }
  else  {
  D1 = date1[0]; }  
  D2 = date2[0];
  
  var sDate = new Date(date1[1]+"/"+D1+"/"+date1[2]);
  var eDate = new Date(date2[1]+"/"+D2+"/"+date2[2]);
  var daysApart = Math.abs(Math.round((sDate-eDate)/86400000));
  return daysApart;
}
// End Here



/*
function ClipBD() {	setInterval("window.clipboardData.setData('text','')",20); }
ClipBD();
*/