function zero(xVal,xLen){
  xMax = (xLen - 1) * 10;
  if(xVal < xMax){
    xStr="";
    for(i=1;i<xLen;i++){
      xStr= "0" + xVal;
    }
    return(xStr);
  } else {
    return(xVal);
  }
}

function st(p0){
 p1 = String(p0).length % 3;
 p2 = String(p0).length - p1;
 p3 = "";
 for (ix = p1; ix < p2 ; ix+=3) {
   p3 = p3 + ',' + String(p0).substr(ix,3);
 }
 if(p1 == 0){
   p3 = p3.substr(1);
 } else {
   p3 = String(p0).substring(0,p1) + p3;
 }
 return(p3);
}

function fck(){
	var c1=document.fmail.name.value;
	var c2=document.fmail.comment.value;
	var c3=0;
	if(c1 == ""){c3=1;}
	if(c2 == ""){c3=1;}
	if(c3 == 1){
		alert("Input name and text!");
		return false;
	} else {
		return true;
	}
}

function sc(){
  oEbody = document.getElementsByTagName("BODY");
  oEbody.item(0).style.backgroundImage = document.scForm.scSelect.options[document.scForm.scSelect.selectedIndex].value;
}

function dds(ddt){
  if(ddt == 1){
    myD     = new Date();
  } else {
    myD     = new Date(document.lastModified);
  }
  myYear  = myD.getFullYear();
  myMonth = zero(myD.getMonth() + 1,2);
  myDay   = zero(myD.getDate(),2);
  docDate = myYear + "/" + myMonth + "/" + myDay;
  document.write(docDate);
  document.close();
}

