﻿<!--
//linked from meta include file for convenience

//------common------
//image path
var thepath="/english/images/";
var r_speed=7;	

{
	function initPath(p_imgpath)
	{
		
		//image path
		thepath=p_imgpath+thepath;
	}

	function setCookie(c_name,value,expiredays)
	{
		var exdate=new Date();
		
		exdate.setDate(exdate.getDate()+expiredays);
		document.cookie=c_name+ "=" +escape(value)+
		((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
	}
	
	function getCookie(c_name)
	{
	if (document.cookie.length>0)
	  {
	  c_start=document.cookie.indexOf(c_name + "=");
	  if (c_start!=-1)
	    {
	    c_start=c_start + c_name.length+1;
	    c_end=document.cookie.indexOf(";",c_start);
	    if (c_end==-1) c_end=document.cookie.length;
	    return unescape(document.cookie.substring(c_start,c_end));
	    }
	  }
	return "";
	}
		
	function rfade(p_obj,p_alpha,p_speed)
	{
		//this will cause the object to fade / appear.  p_alpha is the current opacity, the speed is the interval amount.  negative amount will cause it to fade, pos. will cause it to appear.
		//0 is nothing, 100 is full
	
		var robj;
		var r_speed=p_speed;
		var r_alpha=p_alpha+p_speed;
		
		//just in case
		if(r_alpha>=100)
		{
			r_alpha=100;
		}else if(r_alpha<=0){
			r_alpha=0;
		}
		
		robj=document.getElementById(p_obj);
		
		//safari / mozilla
		robj.style.opacity=(r_alpha/100);
		//IE
		robj.style.filter = 'alpha(opacity=' + r_alpha + ')';
			
		if(((r_alpha<=(100-r_speed)) && (r_speed>0)) || ((r_alpha>=(0-r_speed)) && (r_speed<0)))
		{
			setTimeout('rfade("'+robj.id+'",('+r_alpha+'),'+r_speed+');',100);	
		}else{
			if(r_speed>0)
			{
				robj.style.zIndex=10;
			}else if(r_speed<0){
				robj.style.zIndex=1;
				
				//------
				//which one?	
				//------			
				if(p_obj.indexOf(t_imgid)>=0)
				{
					changepic_t(p_obj);
				}else{
					changepic(p_obj);
				}
				
			}
		}
	}
	
	
}
	
// -->
