﻿//<!--
 var lastTab  = "T0";
 var tabCount = 0;
 ///<summary> handle tab view switching </summary>
 ///<param name="cmd">0:mouseout, 1:mouseIn, 2:clicked</param>
 ///<remarks>
 /// Tab menus must have id of T0, T1 ... Tn
 /// Tab-view content must accordingly have id of pageT0, pageT1 ... pageTn
 /// Individual page should set correct tabCount and the lastTab(initial tab) variables
 ///</remarks>
 function tabs(sender, cmd){
    if(sender.id == lastTab) return;

    if(cmd == 2){
       var tabView = document.getElementById("tabView");
       //var fadable = (tabView != null) && (tabView.filters != null);
       //if( fadable ) tabView.filters[0].apply();

       for(i=0; i<tabCount; i++){
          document.getElementById("T"+i).className = "state0"
          document.getElementById("pageT"+i).style.display="none";
       }
       lastTab = sender.id;
       document.getElementById("page"+sender.id).style.display="block";
       
       //if( fadable ) tabView.filters[0].play();
    }
    sender.className = "state" + cmd;
 }
 ///<summary> a rotator of several contents</summary>
 function rotator(idx){
   var tabView = document.getElementById("tabView");
   var fadable = (tabView != null) && (tabView.filters != null);
   if( fadable ) tabView.filters[0].apply();
   for(i=0; i<tabCount; i++){
      document.getElementById("pageT"+i).style.display="none";
   }
   document.getElementById("pageT"+idx).style.display="block";
   if( fadable ) tabView.filters[0].play();
 }

 function showFlash(swf, width, height)
 {
    document.write(
       '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" \
         codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" \
         width ="'+width+'" \
         height="'+height+'" > \
            <param name="movie" value="' + swf + '" /> \
            <param name="quality" value="high" /> \
            <param name="bgcolor" value="#ffffff" /> \
            <embed src="images/intro.swf" width="'+width+'" height="'+height+'" " \
                 pluginspage="http://www.macromedia.com/go/getflashplayer" \
                 allowScriptAccess="sameDomain" \
                 type="application/x-shockwave-flash" /> \
        </object>');
 }
 
function openNew(url){
    window.open(url);
}
//-->
