<!--

function getSubID(){
   return newId;
}
function getSubSelID(){
   return subItemId;
}
function getGalName(){
   return galName;
}
function getGalItems(){
   return galItems;
}

function changeTitle(imgSrc,AltCont) {
   document.getElementById('title').src=imgSrc;
   document.getElementById('title').alt=AltCont;
}
function changeid(nid){
   newId=nid;
   alert(newId);
}
function newImage(arg) {
   if (document.images) {
      rslt = new Image();
      rslt.src = arg;
      return rslt;
   }
}

function changeImages() {
   if (document.images && (preloadFlag == true)) {
      for (var 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) {
      hitech_over=newImage("../images/madeby-over.gif");
      preloadFlag = true;
   }
}

///////////////////////////////////////////////////////////////////////////////////////

function rePlace (name){
   var lang, res, str, str1;
   str=window.location.href;
   if(str.indexOf("#")){
      str1=str.replace("#","");
   }else{
      str1=str;
   }
   var lang = new Array("/ru","/en","/de");
   for(i=0;i<lang.length;i++){
      res=str1.indexOf(lang[i]);
      if(res==-1){
      }else{
         window.location.href= str1.replace(lang[i],("/"+name));
      }
   }
}

var the_win;
var buttName;
var cTitle;
var dpath,dp;

function launchGal(galName,imgCount,selectImg,cTitle,dpath){
   if(!buttName){
      buttName="Close";
      cTitle="Preview";
   }else{
      cTitle="Закрыть";
   }

   if (the_win) {
      if (!the_win.closed) {
         //the_win.focus();
         the_win.close();
      }
   }
   myW=650;
   myH=570;
   mypath="../photos/";
   if(dpath){
      dp="../";
   }else{
      dp=""
   }
   if(!selectImg){
      selectImg=1;
   }
   
   current_img = selectImg;
   
   winOpts = "width="+myW+",height="+myH+",toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,scrolling=1,resizable=1 top=50,left=50";
   the_win = window.open("", "myWin1", winOpts);
   the_win.document.open();
   the_win.document.current_img = current_img;
   the_win.document.write(
   "<html>" +
   "<head><meta http-equiv='Content-Type' content='text/html; charset=windows-1251'>" +
   "<title>"+cTitle+"</title>" +
   "<link rel='stylesheet' href='../css/gallery4.css' type='text/css'><script language='javascript'>function newImg(iname, id){document.myImg.src='../photos/'+iname;document.getElementById('img_'+id).className = 'selected';document.getElementById('img_'+document.current_img).className = '';document.current_img=id;}</script>"+
   "</head>"+
   "<body bgcolor='#00064C' leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'>"+
   "<table width='100%' border='0' cellpadding='0' cellspacing='0' align='center' height='100%'>"+
   "<tr><td valign='top'><table border='0' cellpadding='0' cellspacing='2' width='100%' height='100%'>"+
   "<tr><td align='center' height='100%'><table border='0' cellpadding='0' cellspacing='0'><tr><td><img src='../images/d_l.gif'></td><td class='countbg'>[ - ");
   for(z=1;z<=imgCount;z++) {
      sel_cl = ( z == selectImg ) ? 'class="selected"' : 'class=""';
      the_win.document.write("<a href=\"javascript:newImg(\'"+galName+z+".jpg"+"\', "+z+");\" "+sel_cl+" id=\"img_"+z+"\">"+z+"</a> - ");
   }
   the_win.document.write("]</td><td><img src='../images/d_r.gif'></td></tr></table><br><a href='#' onclick='javascript:window.close();'><img id='myImg' name='myImg' src='"+ mypath +galName+selectImg+".jpg' border='0' alt='Закрыть'></a></td></tr><tr>"+
   "<td align='center' class='closebar'><table border='0' cellpadding='2' cellspacing='2' width='100%' height='20'><tr><td width='80%' align='center'><table border='0' cellpadding='0' cellspacing='0'><tr><td><img src='../images/d_l.gif'></td><td class='countbg'> <a href='#' onclick='javascript:window.close();' class='menu'>Закрыть</a> </td><td><img src='../images/d_r.gif'></td></tr></table></td></tr></table></td></tr></table></td>"+
   "</tr></table></td></tr></table></body>"+
   "</html>"
   );
   the_win.document.close();
   the_win.focus();
};
function newImg(iname){
   //alert('dsfdf');
   the_win.document.myImg.src=mypath+iname;
}

var z;
var the_win1;
var current_img = 1;
function alaunchGal(imgname){
   if(!buttName){
      buttName="Close";
   }
   if(!cTitle){
      cTitle="Preview";
   }
   if (the_win) {
      if (!the_win.closed) {
         //the_win.focus();
         the_win.close();
      }
   }
   myW=650;
   myH=570;
   mypath="../photos/";
   z="../photos/"+imgname+".html";
   winOpts = "width="+myW+",height="+myH+",toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,scrolling=1,resizable=1 top=50,left=50";
   the_win1 = window.open(z, "", winOpts);
}
var murl;
function wopen(murl,myW,myH){
   if(!myW){
      myW=800;
   }
   if(!myH){
      myH=570;
   }
   winOpts = "width="+myW+",height="+myH+",toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,scrolling=1,resizable=1 top=50,left=50";
   the_win1 = window.open(murl, "", winOpts);
}
// -->
