<script language=javascript>
strSeparator = "-"
strDate="20060312"
strDateArray  =  new Array()
if(/^(\d{4})(\d{2})(\d{2})$/.test(strDate))
{
strDateArray[0]=RegExp.$1
strDateArray[1]=RegExp.$2
strDateArray[2]=RegExp.$3
}
alert(strDateArray)
</script>