

//////////////////// Usage ////////////////////////////////////
//    var string = "{6} 123 Main St {7} Vancouver CA {3}";   //
//    string = replaceAll( string, "{6}", "#" );             //
//    string = replaceAll( string, "{7}", "," );             //
//    string = replaceAll( string, "{3}", " " );             //
//////////////////// Usage ////////////////////////////////////





// ********* 








function datediff(date1, date2)
{
  var d1 = date1;
  var d2 = date2;
  var day = 1000*60*60*24;
  var TwoHours = 1000*60*60*2;
  var diff = Math.ceil(((d2.getTime()-d1.getTime())-TwoHours)/(day));
  return diff;
}

function dateadd(date1, noofdays)
{
  var d1 = date1;
  var day = 1000*60*60*24;
  var TwoHours = 1000*60*60*2;
  var noofms = (noofdays * day) + TwoHours;
  var resultdate = d1.getTime() + noofms;
  return new Date(resultdate);
}
/*for toggling between 2 DIV(by ID), therefore one of the DIV has to manually insert "display:none;"*/


function ConvertYYYYMMDD(DateToConvert, Seperator)
{
	retdate = "";
	if (DateToConvert!="") 
		{
		try
			{
			var datecomp = DateToConvert.split(Seperator);
			retdate = datecomp[2] + Right("0"+datecomp[1],2) + Right("0"+datecomp[0],2);
			}
		catch (e)
			{		
			}
		}
	
	return(retdate);
}


// remember the the HTML should be TRIM before using this function e.g. no extra space/tab/carriage return
// In DOM, IE and firefox with take in the extra space/tab/carriage return as Child....


//Clone Method To Copy Options Instead of Moving















