// Fenster und Tur v.4.06
// ---------------------------------
// (C) 2001 Andrew Chernyavsky for Solar Unity

var IE = (navigator.appName == "Microsoft Internet Explorer") ? 1 : 0;
var NS = (navigator.appName == "Netscape") ? 1 : 0;
var fhideMenu = null;

if (document.images){
profile0 = new Image(); profile0.src = "img/m_profile.gif";
profile2 = new Image(); profile2.src = "img/m_profile_2.gif";
produce0 = new Image(); produce0.src = "img/m_produce.gif";
produce2 = new Image(); produce2.src = "img/m_produce_2.gif";
clients0 = new Image(); clients0.src = "img/m_clients.gif";
clients2 = new Image(); clients2.src = "img/m_clients_2.gif";
windows0 = new Image(); windows0.src = "img/m_windows.gif";
windows2 = new Image(); windows2.src = "img/m_windows_2.gif";
working0 = new Image(); working0.src = "img/m_working.gif";
working2 = new Image(); working2.src = "img/m_working_2.gif";
news0 = new Image(); news0.src = "img/m_news.gif";
news2 = new Image(); news2.src = "img/m_news_2.gif";
str0 = new Image(); str0.src = "img/8.gif";
str2 = new Image(); str2.src = "img/8w.gif";
arrowp0 = new Image(); arrowp0.src = "img/arrow_p.gif";
arrowp2 = new Image(); arrowp2.src = "img/arrow_p2.gif";
arrown0 = new Image(); arrown0.src = "img/arrow_n.gif";
arrown2 = new Image(); arrown2.src = "img/arrow_n2.gif";
}

function fenster_mainmenu() {
var mediate="", section="", curNum="";
var curSw=0;
var NameSection = new Array();
aSection = ["profile","produce","clients","windows","working","news"];
mediate = location.href.substring(location.href.length, location.href.lastIndexOf("/")+1);
section = mediate.substring(0, mediate.lastIndexOf("_"));
mediate = location.href.substring(location.href.length, location.href.lastIndexOf("_")+1);
curNum = mediate.substring(0, mediate.lastIndexOf("."));
document.write("<img src='img/8.gif' width=1 height=117><br>");
 for (var i = 0; i < aSection.length; i++) {
  curSw = (aSection[i]==section && curNum==1) ? 1 : 0;
  fenster_menu(aSection[i],curSw);
 }
}

function fenster_menu(name,sw) {
var line;
line = (sw == 1) ? "8w" : "8";
// if (name == "profile") {
//   document.write("<a href=\""+name+"_1.html\" onmouseover=\"mAction('"+name+"',2);\" onmouseout=\"mAction('"+name+"',"+sw+");\">");
// } else {
//   document.write("<a href=\""+name+"_1.html\" onmouseover=\"mAction('"+name+"',2); fShow('"+name+"');\" onmouseout=\"mAction('"+name+"',"+sw+"); timefHide();\">");
// }
document.write("<a href=\""+name+"_1.html\" onmouseover=\"mAction('"+name+"',2); fShow('"+name+"');\" onmouseout=\"timefHide();\">");
document.write("<img name='"+name+"s1' src=\"img/"+line+".gif\" width=140 height=1 border=0><br>");
document.write("<img name='"+name+"' src=\"img/m_"+name+".gif\" width=140 height=14 border=0><br>");
document.write("<img name='"+name+"s2' src=\"img/"+line+".gif\" width=140 height=1 border=0>");
document.write("</a><br>");
}

function mAction(iname,phase) {
 if (document.images){
  switch (phase) {
   case 1 :
    document[iname].src = eval(iname+"0.src");
    document[iname+"s1"].src = str2.src;
    document[iname+"s2"].src = str2.src;
    break;
   case 2 :
    document[iname].src = eval(iname+"2.src");
    document[iname+"s1"].src = str2.src;
    document[iname+"s2"].src = str2.src;
    break;
   default :
    document[iname].src = eval(iname+"0.src");
    document[iname+"s1"].src = str0.src;
    document[iname+"s2"].src = str0.src;
    break;
  }
 }
}


function fShow(name){
fhideAll();
clearTimeout(fhideMenu);
 if (document.images) {
  if(IE) {
   eval('document.all["m"+name].style.visibility="visible"');
  }
  if(NS){
   eval('document.layers["m"+name].visibility="visible"');
  }
 mAction(name,2);
 }
}

function fHide(name){
 mAction(name,0);
 if (IE) eval('document.all["m"+name].style.visibility="hidden"');
 if (NS) eval('document.layers["m"+name].visibility="hidden"');
}

function timefHide(){
 fhideMenu=setTimeout('fhideAll()',500);
}

function fhideAll() {
fHide('profile');
fHide('produce');
fHide('clients');
fHide('windows');
fHide('working');
fHide('news');
}

function fenster_flypack() {
document.write("<div id=\"mprofile\">");
document.write("</div>");

document.write("<div id=\"mproduce\">");
fenster_t_fmenu();
document.write("<td><a class=\"fmenu\" href=\"produce_1.html\" onmouseout=\"timefHide();\" onmouseover=\"clearTimeout(fhideMenu); mAction('produce',2);\"><p class=\"fmenutext\">Окна&nbsp;из&nbsp;ПВХ&nbsp;&#150;&nbsp;оптимальный&nbsp;выбор&nbsp;&nbsp;&nbsp;</a></td>");
fenster_m_fmenu();
document.write("<td><a class=\"fmenu\" href=\"produce_2.html\" onmouseout=\"timefHide();\" onmouseover=\"clearTimeout(fhideMenu); mAction('produce',2);\"><p class=\"fmenutext\">Алюминий&nbsp;&#150;&nbsp;воплощение&nbsp;мечты&nbsp;в&nbsp;жизнь&nbsp;&nbsp;&nbsp;</a></td>");
fenster_m_fmenu();
document.write("<td><a class=\"fmenu\" href=\"produce_3.html\" onmouseout=\"timefHide();\" onmouseover=\"clearTimeout(fhideMenu); mAction('produce',2);\"><p class=\"fmenutext\">Раздвижные&nbsp;системы&nbsp;&nbsp;&nbsp;</a></td>");
fenster_b_fmenu();
document.write("</div>");

document.write("<div id=\"mclients\">");
fenster_t_fmenu();
document.write("<td><a class=\"fmenu\" href=\"clients_1.html\" onmouseout=\"timefHide();\" onmouseover=\"clearTimeout(fhideMenu); mAction('clients',2);\"><p class=\"fmenutext\">Вы&nbsp;решили&nbsp;поменять&nbsp;окна&nbsp;&nbsp;&nbsp;</a></td>");
fenster_m_fmenu();
document.write("<td><a class=\"fmenu\" href=\"clients_2.html\" onmouseout=\"timefHide();\" onmouseover=\"clearTimeout(fhideMenu); mAction('clients',2);\"><p class=\"fmenutext\">Изготовление&nbsp;и&nbsp;установка&nbsp;&nbsp;&nbsp;</a></td>");
fenster_m_fmenu();
document.write("<td><a class=\"fmenu\" href=\"clients_3.html\" onmouseout=\"timefHide();\" onmouseover=\"clearTimeout(fhideMenu); mAction('clients',2);\"><p class=\"fmenutext\">Уход&nbsp;за окнами&nbsp;&nbsp;&nbsp;</a></td>");
fenster_b_fmenu();
document.write("</div>");

document.write("<div id=\"mwindows\">");
fenster_t_fmenu();
document.write("<td><a class=\"fmenu\" href=\"windows_1.html\" onmouseout=\"timefHide();\" onmouseover=\"clearTimeout(fhideMenu); mAction('windows',2);\"><p class=\"fmenutext\">Пластиковые окна&nbsp;&nbsp;&nbsp;</a></td>");
fenster_m_fmenu();
document.write("<td><a class=\"fmenu\" href=\"windows_2.html\" onmouseout=\"timefHide();\" onmouseover=\"clearTimeout(fhideMenu); mAction('windows',2);\"><p class=\"fmenutext\">Материал&nbsp;и&nbsp;Профиль&nbsp;&nbsp;&nbsp;</a></td>");
fenster_m_fmenu();
document.write("<td><a class=\"fmenu\" href=\"windows_3.html\" onmouseout=\"timefHide();\" onmouseover=\"clearTimeout(fhideMenu); mAction('windows',2);\"><p class=\"fmenutext\">Стеклопакеты&nbsp;&nbsp;&nbsp;</a></td>");
fenster_b_fmenu();
document.write("</div>");

document.write("<div id=\"mworking\">");
fenster_t_fmenu();
document.write("<td><a class=\"fmenu\" href=\"working_1.html\" onmouseout=\"timefHide();\" onmouseover=\"clearTimeout(fhideMenu); mAction('working',2);\"><p class=\"fmenutext\">Обзор&nbsp;объектов,&nbsp;часть&nbsp;1&nbsp;&nbsp;&nbsp;</a></td>");
fenster_m_fmenu();
document.write("<td><a class=\"fmenu\" href=\"working_2.html\" onmouseout=\"timefHide();\" onmouseover=\"clearTimeout(fhideMenu); mAction('working',2);\"><p class=\"fmenutext\">Обзор&nbsp;объектов,&nbsp;часть&nbsp;2&nbsp;&nbsp;&nbsp;</a></td>");
fenster_m_fmenu();
document.write("<td><a class=\"fmenu\" href=\"working_3.html\" onmouseout=\"timefHide();\" onmouseover=\"clearTimeout(fhideMenu); mAction('working',2);\"><p class=\"fmenutext\">Обзор&nbsp;объектов,&nbsp;часть&nbsp;3&nbsp;&nbsp;&nbsp;</a></td>");
fenster_b_fmenu();
document.write("</div>");

document.write("<div id=\"mnews\">");
fenster_t_fmenu();
document.write("<td><a class=\"fmenu\" href=\"news_1.html\" onmouseout=\"timefHide();\" onmouseover=\"clearTimeout(fhideMenu); mAction('news',2);\"><p class=\"fmenutext\">Выстака&nbsp;SWEET&nbsp;HOME&nbsp;&nbsp;&nbsp;</a></td>");
fenster_b_fmenu();
document.write("</div>");

}

function fenster_t_fmenu() {
document.write("<table border=0 cellspacing=0 cellpadding=0 bgcolor=\"#B2B9D8\">");
document.write("<tr>"+
"<td bgcolor=\"#BDC4E5\"><img src=\"img/8.gif\" width=1 height=1></td>"+
"<td bgcolor=\"#BDC4E5\"><img src=\"img/8.gif\" width=2 height=1></td>"+
"<td bgcolor=\"#BDC4E5\"><img src=\"img/8.gif\" width=1 height=1></td>"+
"<td bgcolor=\"#BDC4E5\"><img src=\"img/8.gif\" width=2 height=1></td>"+
"<td bgcolor=\"#324395\"><img src=\"img/8.gif\" width=1 height=1></td>"+
"</tr>");
document.write("<tr>"+
"<td bgcolor=\"#BDC4E5\"><img src=\"img/8.gif\" width=1 height=2></td>"+
"<td><img src=\"img/8.gif\" width=1 height=1></td>"+
"<td><img src=\"img/8.gif\" width=1 height=1></td>"+
"<td><img src=\"img/8.gif\" width=1 height=1></td>"+
"<td bgcolor=\"#324395\"><img src=\"img/8.gif\" width=1 height=2></td>"+
"</tr>");
document.write("<tr>"+
"<td bgcolor=\"#BDC4E5\"><img src=\"img/8.gif\" width=1 height=1></td>"+
"<td><img src=\"img/8.gif\" width=1 height=1></td>");
}

function fenster_m_fmenu() {
document.write("<td><img src=\"img/8.gif\" width=1 height=1></td>"+
"<td bgcolor=\"#324395\"><img src=\"img/8.gif\" width=1 height=1></td>"+
"</tr>"+
"<tr>"+
"<td bgcolor=\"#BDC4E5\"><img src=\"img/8.gif\" width=1 height=1></td>"+
"<td><img src=\"img/8.gif\" width=1 height=1></td>");
}

function fenster_b_fmenu() {
document.write("<td><img src=\"img/8.gif\" width=1 height=1></td>"+
"<td bgcolor=\"#324395\"><img src=\"img/8.gif\" width=1 height=1></td>"+
"</tr>");
document.write("<tr>"+
"<td bgcolor=\"#BDC4E5\"><img src=\"img/8.gif\" width=1 height=2></td>"+
"<td><img src=\"img/8.gif\" width=1 height=1></td>"+
"<td><img src=\"img/8.gif\" width=1 height=1></td>"+
"<td><img src=\"img/8.gif\" width=1 height=1></td>"+
"<td bgcolor=\"#324395\"><img src=\"img/8.gif\" width=1 height=2></td>"+
"</tr>");
document.write("<tr>"+
"<td bgcolor=\"#324395\"><img src=\"img/8.gif\" width=1 height=1></td>"+
"<td bgcolor=\"#324395\"><img src=\"img/8.gif\" width=2 height=1></td>"+
"<td bgcolor=\"#324395\"><img src=\"img/8.gif\" width=1 height=1></td>"+
"<td bgcolor=\"#324395\"><img src=\"img/8.gif\" width=2 height=1></td>"+
"<td bgcolor=\"#324395\"><img src=\"img/8.gif\" width=1 height=1></td>"+
"</tr>");
document.write("</table>");
}


function fenster_Review() {
var ref = "", curURL = "", allNum="";
var mediate="", section="", prepNum="", curNum="";
mediate = location.href.substring(location.href.length, location.href.lastIndexOf("/")+1);
section = mediate.substring(0, mediate.lastIndexOf("_"));
prepNum = mediate.substring(mediate.length, mediate.lastIndexOf("_")+1);
curNum = prepNum.substring(0, prepNum.lastIndexOf("."));
 switch (section) {
  case "produce" :
   allNum = 3;
   break;
  case "clients" :
   allNum = 3;
   break;
  case "windows" :
   allNum = 3;
   break;
  case "working" :
   allNum = 3;
   break;
  case "news" :
   allNum = 1;
   break;
  default :
   allNum = 0;
   break;
 }
 for (var i = 1; i <= allNum; i++) {
 ref = i+"";
 curURL = section+"_"+ref+".html";
  if (i == curNum) {
   document.write("["+ref+"]&nbsp;");
  } else {
   document.write("<b>"+ref.link(curURL)+"</b>&nbsp;");
  }
 }
}              

function toplogo() {
document.write("<img src=\"img/top_fenster.gif\" width=140 height=113 border=0 usemap=\"#MapMap\"><map name=\"MapMap\"><area shape=\"poly\" coords=\"16,52,79,52,79,75,78,76,78,75,120,75,120,100,16,100\" href=\"./\" alt=\"SOLAR: Окна и Двери\" title=\"SOLAR: Окна и Двери\"><area shape=\"circle\" coords=\"48,37,26\" href=\"../\" alt=\"SOLAR: Главная страница\" title=\"SOLAR: Главная страница\"></map>");
}

function topblock() {
document.write("<img src='img/top1a.gif' width=370 height=10><img src='img/top1b.gif' width=230 height=10><img src='img/8w.gif' width=1 height=1><br>"+
"<img src='img/top2a.gif' width=30 height=85>");
blocks(1,10);
blocks(2,9);
blocks(3,8);
blocks(4,11);
document.write("<br>"+
"<img src='img/top3a.gif' width=240 height=18><img src='img/top3b.gif' width=18 height=18><img src='img/8.gif' width=83 height=18><img src='img/top3d.gif' width=258 height=18>");
}

function blocks(num, mult) {
var rnd = 0, size = 0;
var today = new Date();
today = Math.round(today.getTime() / mult);
rnd = today % 10;
 switch (num) {
  case 1 :
   size=210;
   break;
  case 2 :
   size=130;
   break;
  case 3 :
   size=110;
   break;
  case 4 :
   size=140;
   break;
  default :
   size=1;
   break;
 }
document.write("<img src='blocks/block"+num+rnd+".jpg' width="+size+" height=85 border=0>");
}

function nextprev() {
var mediate="", npage="";
var Url = new Array();
Url = ["index","profile_1","produce_1","produce_2","produce_3","clients_1","clients_2","clients_3","windows_1","windows_2","windows_3","working_1","working_2","working_3","news_1","profile_1"];
mediate = location.href.substring(location.href.length, location.href.lastIndexOf("/")+1);
npage = mediate.substring(0, mediate.lastIndexOf("."));
for (var i = 1; i < Url.length-1; i++) {
 if (Url[i] == npage)
  break;
} 
document.write("<table width='100%' border=0 cellspacing=0 cellpadding=0><tr>");
document.write("<td align=left><a href='"+Url[i-1]+".html' onmouseover='prev.src=arrowp2.src' onmouseout='prev.src=arrowp0.src'><img name='prev' src='img/arrow_p.gif' witdth=26 height=21 border=0 alt='Предыдущая страница'></a></td>");
document.write("<td align=center><font color='#003980' class='permiss2'><b>Cтраницы этого раздела:</b></font><br>");
fenster_Review();
document.write("</td>");
document.write("<td align=right><a href='"+Url[i+1]+".html' onmouseover='next.src=arrown2.src' onmouseout='next.src=arrown0.src'><img name='next' src='img/arrow_n.gif' witdth=26 height=21 border=0 alt='Дальше...'></a></td>");
document.write("</tr></table>");
}

function win_Hshow(picID,wTop,wLeft) {
win_Hobject = window.open("","Himagewin","width=790,height=526,top="+wTop+",left="+wLeft+",scrollbars=0");
win_Hobject.document.writeln("<html><head><title>SOLAR: Fenster - "+picID+"</title></head><meta http-equiv=\"Content-Type\" content=\"text/html\">"+
"<body bgcolor=\"#000040\" leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\">"+
"<img src=\"objects/solar_"+picID+".jpg\" width=\"790\" height=\"526\" border=\"0\">"+
"</body></html>");
win_Hobject.document.close();
win_Hobject.focus();
}

function win_Vshow(picID,wTop,wLeft,wVLong) {
win_Vobject = window.open("","Vimagewin","width=542,height="+wVLong+",top="+wTop+",left="+wLeft+",scrollbars=1");
win_Vobject.document.writeln("<html><head><title>SOLAR: Fenster - "+picID+"</title></head><meta http-equiv=\"Content-Type\" content=\"text/html\">"+
"<body bgcolor=\"#000040\" leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\">"+
"<img src=\"objects/solar_"+picID+".jpg\" width=\"526\" height=\"790\" border=\"0\">"+
"</body></html>");
win_Vobject.document.close();
win_Vobject.focus();
}

function win_show(picID,sWidth,sHeight,wTop,wLeft) {
win_object = window.open("","Himagewin","width="+sWidth+",height="+sHeight+",top="+wTop+",left="+wLeft+",scrollbars=0");
win_object.document.writeln("<html><head><title>SOLAR: Fenster - "+picID+"</title></head><meta http-equiv=\"Content-Type\" content=\"text/html\">"+
"<body bgcolor=\"#000040\" leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\">"+
"<img src=\"img/"+picID+".jpg\" width=\""+sWidth+"\" height=\""+sHeight+"\" border=\"0\">"+
"</body></html>");
win_object.document.close();
win_object.focus();
}
