var d=document; var imghl = new Array();
// ************************************* //
function getObj(name){
	return d.getElementById?d.getElementById(name):d.all(name)
}
// ************************************* //
function preload(){
 hl_images = preload.arguments;
 for(i=0; i<hl_images.length; i++){
   imghl[(hl_images[i])]=new Image;
   imghl[(hl_images[i])].src=''+hl_images[i];
 }
} 
// ************************************* //
function swap(n,i){ 
 try{
   if(!swap.arguments.length){
     d[r_n].src=r_s;
   }else{
     r_s=d[n].src;
	 r_n=n;d[n].src=imghl[i].src
   }
 }catch(e){}
}
// ************************************* //
function newWindow1(file,t,l,w,h){
	window.focus();
	if(typeof(msgWindow)=='object') msgWindow.close();
	msgWindow = open('','window1','scrollbars=0,resizable=0,status=1,left='+l+',top='+t+',width='+w+',height='+h);
	msgWindow.location.href = file;
	if(msgWindow.opener == null) msgWindow.opener = self;
}
// ************************************* //
function isDef(obj){
	if( typeof(obj) == 'undefined' || obj == null) return false;
	else return true;
}
// ************************************* //
function get_random(){
	randomNum = '';
	for (i=0; i<2; ++i) {
		tmp = Math.random()*8;	
		randomNum += tmp.toString().replace(".","");
	}
	return randomNum;
}
// ************************************* //
function soundOver(){
	mysound.gotoAndStop('/SoundPlayer', 'start');
}
function soundOut(){
	mysound.gotoAndStop('/SoundPlayer', 'stop');
}
function attach_sound(){
	try{
  	a_arr = d.getElementsByTagName("a");a_cnt = a_arr.length; 
  	for(i=0; i < a_cnt; ++i){
 			if( InArray( a_arr[i].className, Array('topMenuLnk','topMenuLnk_hl','rightMenuLnk','rightMenuLnk','rightMenuLnk_hl'))){
   	 		a_arr[i].onmouseover = soundOver;
   	 		a_arr[i].onmouseout = soundOut;
			}
	 	}
	}catch(e){}
}
// ************************************* //
function InArray( value, array ){
	hslen = array.length;
	for ( counter = 0; counter < hslen; ++ counter ){
		if( array[counter] == value ) return true;
	}
	return false;
}
// ************************************* //
function ArrayKeyExists( key, array ){
	for ( element_key in array ) {
		if( element_key == key ) return true;
	}
	return false;
}