function insertFlash(elm, url, w, h) {
 if (!document.getElementById(elm)) return;
 var str = '';
 str += '<object width="'+ w +'" height="'+ h +'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0">';
 str += '<param name="movie" value="'+ url +'">';
 str += '<param name="wmode" value="transparent">';
 str += '<param name="quality" value="autohigh">';
 str += '<embed width="'+ w +'" height="'+ h +'" src="'+ url +'" quality="autohigh" wmode="transparent" type="application/x-shockwave-flash" plugspace="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>';
 str += '</object>';
 document.getElementById(elm).innerHTML = str;
}

function tye(i,u)
{
    var ii = document.getElementById(i);
    
    if( !ii.nextSibling || ii.nextSibling.getAttribute("depth") <= ii.getAttribute("depth") )
    {
        window.location = u;
    }
}

function ol(menu)
{
    var m = document.getElementById('menu');
    
    var fc = m.firstChild;    
    
    if( fc.getAttribute("id") != menu.getAttribute("id") )
    {
        while( fc.nextSibling.getAttribute( "id" ) != menu.getAttribute( "id" ) )
        {
            fc = fc.nextSibling;
        }
        fc = fc.nextSibling;
    }
    
    var d = fc.getAttribute("depth");
    var c = false;
    if( fc.nextSibling.getAttribute( "depth") > d )
    {
        c = true;
    }
    
    while( fc.nextSibling )
    {
        if( fc.nextSibling.getAttribute("depth") > d )
        {
            if( fc.nextSibling.style.display != 'block' )
            {
                fc.nextSibling.style.display = 'block';
            }
            else
            {
                fc.nextSibling.style.display = 'none';
            }
            fc=fc.nextSibling;
        }
        else
        {
            break;
        }
    }
    
    if( c )
    {
        return false;
    }
    else
    {    
        return true;
    }
}

function checkinfo()
{
		  var errinfo="";
		  var aa=document.mes;
		  if (aa.subject.value==""){
		    errinfo=errinfo+"\nSuject is null";
		  }
		  if (aa.content.value==""){
		    errinfo=errinfo+"\nMessage is null";
		  }
		  if (aa.company.value==""){
		    errinfo=errinfo+"\nCompany is null";
		  }
		  if (aa.email.value==""){
		    errinfo=errinfo+"\nE-mail is null";
		  }
		  if (aa.telno.value==""){
		    errinfo=errinfo+"\nTel is null";
		  }
		  if (aa.email.value!=""&&(aa.email.value.indexOf('@',0)==-1||aa.email.value.indexOf('.',0)==-1||aa.email.value.charAt(0)=="."||aa.email.value.charAt(0)=="@"||aa.email.value.lastIndexOf('@')==aa.email.value.length-1 || aa.email.value.lastIndexOf('.')==aa.email.value.length-1)){
		    errinfo=errinfo+"\nE-mail format is not right";
		  }
		  if (errinfo!=""){
		    alert(errinfo);
			return false;
		  }
}
