//////////////////////
//    GEMAS 2005	  //
//////////////////////

menunum  = 0;
menus    = new Array();
_d       = document;
function addmenu(){menunum++;menus[menunum]=menu;}
function dumpmenus(){mt="<scr"+"ipt language=javascript>";
for(a=1;a<menus.length;a++){mt+=" menu"+a+"=menus["+a+"];"}mt+="<\/scr"+"ipt>";_d.write(mt)}


effect   = "Fade(duration=0.5);Alpha(style=0,opacity=85);Shadow(color='000000', Direction=35, Strength=5)"
effect2  = "randomdissolve(duration=1);Alpha(style=0,opacity=95);Shadow(color='000000', Direction=35, Strength=6)"

timegap          = 500   // delay menu sampai hilang
followspeed      = 5
followrate       = 40
suboffset_top    = 10;   // jarak vertikal dgn submenu
suboffset_left   = 10;   // jarak horizontal dgn submenu
closeOnClick     = true

host   = "http://www.cpucom.com/";
imgsrc = "http://www.cpucom.com/images/";

style=[
"FFFFFF",              	 // warna link text
"FF3333",              	 // warna link background
"000000",              	 // warna hover text
"FFFFFF",              	 // warna hover background
"000000",              	 // Menu Border Color
10,                      // Font Size dalam pixels
"normal",                // Font Style (italic / normal)
"bold",                	 // Font Weight (bold / normal)
"Verdana, Arial",        // Nama font
4,                       // Pading Item Menu
imgsrc+"arrow.gif",      // Image Sub Menu
1,                       // 3D Border & Separator bar
"000000",                // 3D High Color --- kalo pake Separator Bar
"000000",                // 3D Low Color
"000000",              	 // Warna font halaman yang sedang aktif
"FFFFFF",                // Warna background halaman yang sedang aktif
imgsrc+"arrow_down.gif", // Image top bar
"0753DC",              	 // Warna font yang sedang diseleksi
"FFFFFF",              	 // Warna background yang sedang diseleksi
"000000",              	 // Warna Separator
]


addmenu(menu=[
"mainmenu",      // Nama menu
84,             // jarak menu dari atas
,                // jarak menu dari kiri
128,             // lebar kotak main menu
2,               // tebal border menu
"center",        // posisi menu di screen
style,           // memanggil 'style' di atas
1,               // menu -> visible or not, default: 0, jadi harus diisi 1
"center",        // posisi text menu dalam kotak, default: "left"
effect2,
1,               // menu mengikuti scorllbar, default: 0
1,               // menu horizontal/vertikal, default: "vertikal"
,                // abis over submenu nggak hilang, default: 0
,                // posisi panah, default: "right"
,                // bgcolor dari atas
,                // menu berpanah agak menjorok, default: 0
,                // buka menu pertama x, harus click dulu, default: 0
,
,
,
,

    // ISI MAIN MENU :
    // "Description Text", "URL", "Alternate URL", "Status Bar", "Separator Bar"
,"&nbsp;Home", host,  , "Back to the Home Page", 1
,"&nbsp;Product", host+"kategori_list.php",   , "dapurHALO", 1
,"&nbsp;Download Price", "show-menu=pricelist",   , "Download Price", 1
,"&nbsp;News", host+"berita/news.php",   , "Product & Services", 1
,"&nbsp;About Us", "show-menu=about",   , "Network Coverage", 1
,"&nbsp;Other Links", "show-menu=search",   , "Search",  1

])

        // SUB-SUB MENU DAN ISINYA :
        

        addmenu(menu=["pricelist",,,140,1,"",style,,,effect,,,,,,,,,,,,
        ,"&nbsp;price distributor", host+"price_dist.php",,"infoBARU",1
        ,"&nbsp;price customer", host+"price_cust.php",,"infoLALU",1
        ])

	 addmenu(menu=["about",,,140,1,"",style,,,effect,,,,,,,,,,,,
        ,"&nbsp;company profile", "#",,"infoBARU",1
        ,"&nbsp;contact us",host+"contact_us.php" ,,"infoLALU",1
        ])


        addmenu(menu=["search",,,140,1,"",style,,,effect,,,,,,,,,,,,
        ,"<img src="+imgsrc+"google_icon.gif border=0>&nbsp;&nbsp;Google.com", "http://www.google.com swapimage="+imgsrc+"newsimage_over.gif",,,1
        ,"<img src="+imgsrc+"yahoo_icon.gif border=0>&nbsp;&nbsp;Yahoo", "http://www.yahoo.com swapimage="+imgsrc+"newsimage_over.gif",,,1
        ,"<img src="+imgsrc+"av_icon.gif border=0>&nbsp;&nbsp;Altavista", "http://altavista.com swapimage="+imgsrc+"newsimage_over.gif",,,1
        ,"<img src="+imgsrc+"excite.gif border=0>&nbsp;&nbsp;Excite", "http://www.excite.com swapimage="+imgsrc+"newsimage_over.gif",,,

         // www.searchindonesia.com
         // www.catcha.co.id
         // www.naver.co.id
         // www.infoindonesia.com

        ])

dumpmenus()



// Scrolling message settings
  var MessageText = "PT. CPUCOM DATA SYSTEM "
  var DisplayLength = 150
  var pos = 1 - DisplayLength;
  function ScrollInStatusBar(){
  var scroll = "..:: ";
  pos++;
  if (pos == MessageText.length) pos = 1 - DisplayLength;
  if (pos<0) {
  	for (var i=1; i<=Math.abs(pos); i++)
  	scroll = scroll + "";
  	    scroll = scroll + MessageText.substring(0, DisplayLength - i + 1);
  }
  else
      scroll = scroll + MessageText.substring(pos, pos + DisplayLength);
  window.status = scroll;
  //Scrolling speed
  setTimeout("ScrollInStatusBar()",0);
  }
  ScrollInStatusBar()



function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}



// Mulai
/*
Fading Scroller- By DynamicDrive.com
For full source code, and usage terms, visit http://www.dynamicdrive.com
This notice MUST stay intact for use
*/

var delay=1000 //set delay between message change (in miliseconds)
var fcontent=new Array()
begintag='' //set opening tag, such as font declarations
fcontent[0]="<h5>Distributor Terbaik dan Terpercaya</h>"
fcontent[1]="<h5>PT.CPUCOM DATA SYSTEM</h>"
closetag=''

var fwidth='260px' //set scroller width
var fheight='10px' //set scroller height

var fadescheme=0 //set 0 to fade text color from (white to black), 1 for (black to white)
var fadelinks=1 //should links inside scroller content also fade like text? 0 for no, 1 for yes.

///No need to edit below this line/////////////////

var hex=(fadescheme==0)? 255 : 0
var startcolor=(fadescheme==0)? "rgb(255,255,255)" : "rgb(0,0,0)"
var endcolor=(fadescheme==0)? "rgb(0,0,0)" : "rgb(0,0,255)"

var ie4=document.all&&!document.getElementById
var ns4=document.layers
var DOM2=document.getElementById
var faderdelay=0
var index=0

if (DOM2)
faderdelay=2000

//function to change content
function changecontent(){
	if (index>=fcontent.length)
		index=0
		if (DOM2){
			document.getElementById("fscroller").style.color=startcolor
			document.getElementById("fscroller").innerHTML=begintag+fcontent[index]+closetag
			linksobj=document.getElementById("fscroller").getElementsByTagName("A")
			if (fadelinks)
				linkcolorchange(linksobj)
				colorfade()
			} else if (ie4)
				document.all.fscroller.innerHTML=begintag+fcontent[index]+closetag
			else if (ns4){
			document.fscrollerns.document.fscrollerns_sub.document.write(begintag+fcontent[index]+closetag)
			document.fscrollerns.document.fscrollerns_sub.document.close()
		}
	index++
	setTimeout("changecontent()",delay+faderdelay)
}

// colorfade() partially by Marcio Galli for Netscape Communications.  ////////////
// Modified by Dynamicdrive.com

frame=20;

function linkcolorchange(obj){
	if (obj.length>0){
		for (i=0;i<obj.length;i++)
			obj[i].style.color="rgb("+hex+","+hex+","+hex+")"
		}
	}

function colorfade() {
// 20 frames fading process
if(frame>0) {
	hex=(fadescheme==0)? hex-12 : hex+12 // increase or decrease color value depd on fadescheme
	document.getElementById("fscroller").style.color="rgb("+hex+","+hex+","+hex+")"; // Set color value.
	if (fadelinks)
		linkcolorchange(linksobj)
		frame--;
		setTimeout("colorfade()",30);
	} else {
		document.getElementById("fscroller").style.color=endcolor;
		frame=20;
		hex=(fadescheme==0)? 255 : 0
	}
}
// Akhir



function cekLogin( loginForm )
{
		if( loginForm.username.value == '' && loginForm.passwd.value == ''){
	        alert ( "Maaf, anda belum mengisi field Username dan Password " );
			loginForm.username.focus();
			return false;
	    }
        else if( loginForm.username.value == '' ){
            alert ( "Maaf, anda belum mengisi field username " );
			loginForm.username.focus();
			return false;
		}
		else if( loginForm.passwd.value == '' ){
	        alert ( "Maaf, anda belum mengisi field Password " );
			loginForm.passwd.focus();
			return false;
	    }		
}



