function numberOption(begin,end,str)
{
	var dayOpt = "";
	if(str!=null) dayOpt += "<option value=''>--"+str+"--</option>";
  for(var i=begin;i<=end;i++)
  {
    if(i<10)
      dayOpt += "<option value="+i+">0"+i+"</option>";
		else
      dayOpt += "<option value="+i+">"+i+"</option>";
  }
  return dayOpt;
}

function monthOption()
{
  var month_names = new Array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');

	var monthOpt = "";
  for(var i=0;i<12;i++)
  {
		var j = i+1;
    monthOpt += "<option value='"+j+"'>"+month_names[i]+"</option>";
  }
  return monthOpt;
}

function GetDate()
{
	var dmy = new Date();	
	var cur_d = dmy.getDate();
	var cur_m = dmy.getMonth()+1;
	var cur_y = dmy.getYear();
	if(cur_d <= 9) cur_d = "0" + cur_d;
	if(cur_m <= 9) cur_m = "0" + cur_m;
	str = cur_d + "/" + cur_m + "/" + cur_y;
	document.write(str);
}

showing = false;
newColor = '#666666';
newBgColor = '#FFCC00';
newBgImg = null;

function showMenu(obj,showObj,menuType,nClr,nBgImg,nBgClr)
{
	showObj = eval(showObj);
	if(nClr) newColor = nClr;
	if(nBgClr) newBgColor = nBgClr;
	if(nBgImg) newBgImg = nBgImg;

	oldColor = obj.style.color;
	oldBgColor = obj.style.backgroundColor;
	if(newBgImg!=null) oldBgImg = obj.style.backgroundImage;
	
	obj.style.color = newColor;
	obj.style.backgroundColor = newBgColor;
	if(newBgImg!=null) obj.style.backgroundImage = 'url('+newBgImg+')';	
	
	if(showObj!=null && !showing)
	{
		showObj.style.display = "";
		if(document.all)
		{
			if(menuType==null)
			{
				showObj.style.left = obj.offsetLeft;
				showObj.style.top = obj.offsetTop + obj.offsetHeight;
			}
			else
			{
				showObj.style.left = obj.offsetLeft + obj.offsetWidth;
				showObj.style.top = obj.offsetTop;
			}
		}
		else
		{
			myLeft = (screen.width - 800)/2;
			if(menuType==null)
			{
				showObj.style.left = obj.offsetLeft + myLeft;
				showObj.style.top = obj.offsetTop + obj.offsetHeight;
			}
			else
			{
				showObj.style.left = obj.offsetLeft + obj.offsetWidth + myLeft;
				showObj.style.top = obj.offsetTop + 120;
			}
		}
		showing = true;
	}
	prevObj = obj;
}

function hideMenu(obj,showObj)
{
	showObj = eval(showObj);
	if(showObj!=null && showing) 
	{
		showing = false;
		showObj.style.display = 'none';
		if(prevObj!=null) 
		{
			prevObj.style.color = oldColor;
			prevObj.style.backgroundColor = oldBgColor;
			prevObj.style.backgroundImage = oldBgImg;
		}
	}
}
function showMe(obj)
{
	if(!showing) 
	{
		obj.style.display = '';
		showing = true;
		if(prevObj!=null)
		{
			prevObj.style.color = newColor;
			prevObj.style.backgroundColor = newBgColor;
			if(newBgImg!=null) prevObj.style.backgroundImage = 'url('+newBgImg+')';
		}
	}
}

function hideMe(obj)
{
	if(showing)
	{
		showing = false;
		obj.style.display = 'none';
		if(prevObj!=null) 
		{
			prevObj.style.color = oldColor;
			prevObj.style.backgroundColor = oldBgColor;
			if(oldBgImg!=null) prevObj.style.backgroundImage = oldBgImg;
		}
	}
}

snewColor = null;
snewBgColor = null;
snewBgImg = null;

soldColor = null;
soldBgColor = null;
soldBgImg = null;

function changeColor(obj,snClr,snBgImg,snBgClr)
{
	snewColor = snClr;
	snewBgColor = snBgClr;
	snewBgImg = snBgImg;
	
	if(snewColor!=null) 
	{
		soldColor = obj.style.color;
		obj.style.color = snewColor;
	}
	if(snewBgColor!=null) 
	{
		soldBgColor = obj.style.backgroundColor;
		obj.style.backgroundColor = snewBgColor;
	}
	if(snewBgImg!=null) 
	{
		soldBgImg = obj.style.backgroundImage;
		obj.style.backgroundImage = 'url('+snewBgImg+')';
	}
	
}

function restoreColor(obj)
{
	if(soldColor!=null) obj.style.color = soldColor;
	if(soldBgColor!=null) obj.style.backgroundColor = soldBgColor;
	if(soldBgImg!=null) obj.style.backgroundImage = soldBgImg;
}

function MM_preloadImages() 
{ //v3.0
  var d = document; 
	if(d.images)
	{ 
		if(!d.MM_p) d.MM_p = new Array();
    var i,j = d.MM_p.length, a = MM_preloadImages.arguments; 
		for(i=0; i<a.length; i++)
    	if (a[i].indexOf("#")!=0)
			{ 
				d.MM_p[j] = new Image; 
				d.MM_p[j++].src = a[i];
			}
	}
}


