<!--
// SLIDE
var time = null;
function slide_list(){
  document.write("<div id=board style='width:" + roller_w + "px;height:" + roller_h + "px;' onmouseover='clearTimeout(to);if (start_x)start_x++;' onmouseout='slide_roll();'><div id=roller>");
  for (i=0;i<img_name.length;i++){
    document.write(img_name[i]);
  }
  document.write("</div>");

  document.write("<div id=sub_roller style='top:-" + roller_h + "px;left:" + slide_w + "px;'>");
  for (i=0;i<img_name.length;i++){
    document.write(img_name[i]);
  }
  document.write("</div></div>");
}

function slide_roll(){
  if ( time ){
    num = img_name.length;
    if (Math.abs(start_x) > slide_w ) {
      document.getElementById('roller').style.left = start_x + slide_w*2 + "px";
    }else{
      document.getElementById('roller').style.left = start_x + "px";
    }
    document.getElementById('sub_roller').style.left = start_x + slide_w + "px";
    start_x -- ;
    if ( Math.abs(start_x) > slide_w*2 ) start_x = 0;
    to = setTimeout("slide_roll()",time);
  }
}
// end of SLIDE

var opened = 0;

function menu_switch(MID,EFF,VAR) {
    if ( navigator.userAgent.indexOf("MSIE") != -1 && EFF!='' && VAR!='') {
        document.getElementById(MID).style.filter="progid:DXImageTransform.Microsoft."+EFF+"("+VAR+")";
        document.getElementById(MID).filters(0).Apply();
        document.getElementById(MID).filters(0).Play();
    }

    document.getElementById(MID).style.display='block';
}

function hide_menu (){
    a = hide_menu.arguments;
    for(i=0; i<a.length; i++){
        MID = a[i];
        document.getElementById(MID).style.display='none';
    }
}

function showmenu (evt) {

    var x = 0;
    var y = 0;
    if ( navigator.userAgent.indexOf("MSIE") != -1 ){
        var x = window.event.clientX;
        var y = window.event.clientY+document.documentElement.scrollTop;
        //alert(window.event.clientY+":"+window.event.offsetY +":"+document.body.scrollTop);
            document.getElementById('quick_menu').style.filter="progid:DXImageTransform.Microsoft.barn(duration=0.5)";
            document.getElementById('quick_menu').filters(0).Apply();
            document.getElementById('quick_menu').filters(0).Play();
    }
    if ( navigator.userAgent.indexOf("Netscape") != -1 ){
        var x = evt.pageX;
        var y = evt.pageY;
    }
    if ( x && y ){
        document.getElementById('quick_menu').style.top=y+"px";
        document.getElementById('quick_menu').style.left=x+"px";
        if (!opened){
            document.getElementById('quick_menu').style.display='block';
            opened++;
        }else{
            document.getElementById('quick_menu').style.display='none';
            opened--;
        }
    }

}

//document.oncontextmenu=function(evt){
//    showmenu(evt);
//    return false;
//}

// marcomedia
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

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];}}
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

// form check
function check_inquiry(){
  f = document.inquiry;
  chkStr = f.inq_email.value;
    var Pat = /^[\w][\w\.\-]+@[\w][\w\.\-]+\.[\w][\w\.\-]+$/;
    var chk = chkStr.match(Pat);
  if (chk == null) {
    alert("Please input a valid E-Mail Address.");
    return false;
  }
  if (!f.inq_name.value){
    alert("Please input your name.");
    f.inq_name.focus();
    return false;
  }

  if (!f.inq_tel.value){
    alert("Please input your telephone number.");
    f.inq_tel.focus();
    return false;
  }

//  if (!f.inq_country.value){
//    alert("Please select your country.");
//    f.inq_country.focus();
//    return false;
//  }

  if (!f.inq_subject.value){
    alert("Please input the subject.");
    f.inq_subject.focus();
    return false;
  }
  if (!f.inq_message.value){
    alert("Please input your message.");
    f.inq_message.focus();
    return false;
  }
}

// tradeshow video
function media_win(m_id,mp) {
    mmsurl = "http://media.manufacture.com.tw/tradeshow.php?mid=" + m_id + "&mp=" + mp;
    window.open(mmsurl,'player','width=520,height=382,scrollbars=no,status=no,toolbars=no');
}
//-->

