
function showsubmenu(sid)
{
whichEl = eval("menu_" + sid);
if (whichEl.style.display == "none")
{
eval("menu_" + sid + ".style.display=\"\";");
}
else
{
eval("menu_" + sid + ".style.display=\"none\";");
}
}



function CheckInput(oInput) 
	{
    
	       if  ('' != oInput.value.replace(/\d/g,''))
	      {
			oInput.value = oInput.value.replace(/\D/g,'');
				
		  }
} 

function $(ig){
  return document.getElementById(ig);
}
function ChgSelect( objID,sValue )
{
	var obj = document.getElementById( objID );
	if( !obj ) return;
	for( i = 0; i < obj.options.length; i++ )
	{
		if( obj.options[i].value == sValue )
		{
			obj.selectedIndex = i;
			break;
		}
	}
}


function writeDateInfo()
{
        var day="";
        var month="";
        var ampm="";
        var ampmhour="";
        var myweekday="";
        var year="";
        mydate=new Date();
        myweekday=mydate.getDay();
        mymonth=mydate.getMonth()+1;
        myday= mydate.getDate();
        myyear= mydate.getYear();
        year=(myyear > 200) ? myyear : 1900 + myyear;
        if(myweekday == 0)
        weekday=" 星期日";
        else if(myweekday == 1)
        weekday=" 星期一";
        else if(myweekday == 2)
        weekday=" 星期二";
        else if(myweekday == 3)
        weekday=" 星期三";
        else if(myweekday == 4)
        weekday=" 星期四";
        else if(myweekday == 5)
        weekday=" 星期五";
        else if(myweekday == 6)
        weekday=" 星期六";
        document.write("　　　"+year+"年"+mymonth+"月"+myday+"日"+weekday);
} 


function zoomOut(){
decreaseImgSize();
decreaseFontSize();
}
var imgmax = 400;
var imgmin=10;
function zoomIn(){
var cols = Math.floor(Math.sqrt(50*104/99))+1 ;
//var cols = 15*(104/203) ;
   
increaseFontSize();
increaseImgSize();
}
function decreaseImgSize()
{
var imgTags = document.getElementsByTagName('img');
for(i=0;i<imgTags.length;i++){
  if(imgTags[i].style.width) {
         var s = parseInt(imgTags[i].style.width.replace("px",""));
      } else {
         var s = 50;
      }
   if(s>=imgmin) {
         s -= 20;
      }
   imgTags[i].style.width = s+"px" ;
}
}
function increaseImgSize()
{
var imgTags = document.getElementsByTagName('img');
for(i=0;i<imgTags.length;i++){
  if(imgTags[i].style.width) {
         var s = parseInt(imgTags[i].style.width.replace("px",""));
      } else {
         var s = 12;
      }
   if(s<=imgmax) {
         s += 20;
      }
   imgTags[i].style.width = s+"px" ;
}

}
var min=8;
var max=100;
function increaseFontSize() {
   var p = document.getElementsByTagName('font');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=max) {
         s += 3;
      }
      p[i].style.fontSize = s+"px"
   }
}
function decreaseFontSize() {
   var p = document.getElementsByTagName('font');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=min) {
         s -= 1;
      }
      p[i].style.fontSize = s+"px"
   }  
}


function readTxt() 
{ 
    alert(window.clipboardData.getData("text")); 
} 

function setTxt() 
{ 
    var t=document.getElementById("txt"); 
	//alert(t.value);
    t.select(); 
    window.clipboardData.setData('text',t.createTextRange().text); 
} 




var initial_fontsize    = 10;
var initial_lineheight  = 18;
function newasp_fontsize(type,objname){
 var whichEl = document.getElementById(objname);
 if (whichEl!=null) {
  if (type==1){
   if(initial_fontsize<64){
    whichEl.style.fontSize=(++initial_fontsize)+'pt';
    whichEl.style.lineHeight=(++initial_lineheight)+'pt';
   }
  }else {
   if(initial_fontsize>8){
    whichEl.style.fontSize=(--initial_fontsize)+'pt';
    whichEl.style.lineHeight=(--initial_lineheight)+'pt';
   }
  }
 }
}

function ChangeSize(type,objname){
 var objSize=document.getElementById(objname);
 objSize.style.fontSize="12px";
}
