//#####################################################################
function switchClass(obj,strClassName) {
resetClass('menu_passive');
/*
	if(!obj){
		for(var c=1;c<10;c++){
			document.getElementById('td'+c).className = strClassName;
		}
	}else{
		document.getElementById(obj).className = strClassName;
	}
*/
	document.getElementById(obj).className = strClassName;
}

function resetClass(strClassName) {
	for(var c=1;c<10;c++){
		document.getElementById('td'+c).className = strClassName;
	}
}

//#####################################################################
function viewimg(file){
  myWin=open("", "displayWindow","top=-4,left=-4, width=510, height=520, scrollbars=no,status=no,toolbar=no,menubar=no");
  myWin.document.open();
  myWin.document.write("<html><head><title>ООО \"ВАДАС Индастри\"</title>\n");
  myWin.document.write("<link rel='STYLESHEET' type='text/css' href='styles.css'>\n");
  myWin.document.write("<link rel='STYLESHEET' type='text/css' href='links.css'>\n");


  myWin.document.write("<script language=javascript>\n");
  myWin.document.write("function fitWindowSize() {\n");
  myWin.document.write("window.resizeTo(510, 520);\n");
  myWin.document.write("var elem=document.all.item('imgb');\n");
  myWin.document.write("var w=elem.width+20;\n");
  myWin.document.write("var h=elem.height+4;\n");
  myWin.document.write("window.moveTo(10,10);\n");
//  myWin.document.write("window.moveTo((screen.width-w)/2,(screen.height-(h+50))/2);\n");
  myWin.document.write("window.resizeTo(w,h+60);\n");
  myWin.document.write("}\n\r");
  myWin.document.write("</script>\n");
  myWin.document.write("</head>\n");

  myWin.document.write("<body onLoad=\"fitWindowSize()\" marginheight=0 marginwidth=0 topmargin=0 leftmargin=0 rightmargin=0 bottommargin=0 valign=middle bgcolor=#ffffff background=images/bg.gif>\n");
  myWin.document.write(" <table border=0 cellspacing=0 cellpadding=0 width=100% height=100%>\n");
  myWin.document.write("  <tr>\n   <td ALIGN=center VAlign=middle Width=100% Height=100%><div id='txt' class='div'>Please wait...<br>Loading image...</div>");
  myWin.document.write("<img id=imgb src=",file," border=0 class=image></td>\n  </tr>\n");
  myWin.document.write("  <tr>\n   <td valign=middle align=center><a class=links href='javascript:window.close()'>[закрыть окно]</a></td>\n  </tr>\n");
  myWin.document.write("  <tr>\n   <td valign=middle align=center><img src=images/spacer.gif width=3 height=3 border=0></td>\n  </tr>\n");
  myWin.document.write(" </table>\n");
  myWin.document.write("</body>\n");
  myWin.document.write("<html>\n");
  myWin.document.close();
}


function newimage(arg){
  if(document.images){
    rslt=new Image();
    rslt.src=arg;
    return rslt;
  }
}
function changeimages(){
  if(document.images && (preloadflag==true)){
    for(i=0;i<changeimages.arguments.length;i+=2)document[changeimages.arguments[i]].src=changeimages.arguments[i+1];
  }
}
var preloadflag = false;
function preloadimages(){
  if(document.images){
    	_mask = newimage("images/wspacer.gif");
    preloadflag = true;
  }
}

function popup(file){
  myWin=open(file, "displayWindow","top=200,left=200, width=680, height=490, scrollbars=yes,status=yes,toolbar=no,menubar=no,resizable=yes, fullscreen=no");
}

function ChangeImage(obj){
	if(document.images){
		document.getElementById("viewimage").filters.revealTrans.apply();
//		document.getElementById("viewimage").filters.revealTrans.Transition = 16; //5
		document.getElementById("viewimage").src = obj;
		document.getElementById("viewimage").filters.revealTrans.play(1.0);
	}
}
