// возвращает cookie если есть
function getCookie(name) {
	var matches = document.cookie.match(new RegExp(
	  "(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)"
	));
	return matches ? decodeURIComponent(matches[1]) : "";
}

// уcтанавливает cookie
function setCookie(name, value, props) {
	props = props || {};
	var exp = props.expires;
	if (typeof exp == "number" && exp) {
		var d = new Date();
		d.setTime(d.getTime() + exp*1000);
		exp = props.expires = d;
	}
	if(exp && exp.toUTCString) { props.expires = exp.toUTCString(); }

	value = encodeURIComponent(value);
	var updatedCookie = name + "=" + value + "; path=/";
	for(var propName in props){
		updatedCookie += "; " + propName;
		var propValue = props[propName];
		if(propValue !== true){ updatedCookie += "=" + propValue; }
	}
	document.cookie = updatedCookie;

}

// удаляет cookie
function deleteCookie(name) {
	setCookie(name, null, { expires: -1 });
}


function mainGetCookie(name)
{
   return getCookie(name);
}
function mainSetCookie(name,value)
{
   setCookie(name, value, {expires:14*24*60*60} );
}

function BuyRequest(id,type,price,min_price,volSize,name,weight,dfs)
{
   var newWnd = window.open("http://home-video.ru/buy-request.html?"+id+"&"+price+"&"+min_price+"&"+volSize+"&"+type+"&"+dfs+"&"+weight+"&"+escape(name)+"&"+mainGetCookie("rrr"), "hvcart", "resizable=no,toolbar=no,status=no,left=-30,top=-30,width=10,height=10");
   newWnd.blur();
}
function ToCart(id,type,price,min_price,volSize,name,weight,dfs)
{
   var newWnd = window.open("http://home-video.ru/tocart.html?"+id+"&"+price+"&"+min_price+"&"+volSize+"&"+type+"&"+dfs+"&"+weight+"&"+escape(name)+"&"+mainGetCookie("rrr"), "hvcart", "resizable=yes,left=-30,top=-30,width=10,height=10,scrollbars=yes");
   mainSetCookie("rrr","ept");
   newWnd.blur();
}
function OpenCart()
{
   ToCart(0,0,0,0,0,'',0,0);
}
function OpenDFSCart()
{
   ToCart(0,0,0,0,0,'',0,1);
}

if( document.referrer.indexOf("home-video") < 0 )
{
   mainSetCookie("rrr",document.referrer);
}

var bNavigator = (navigator.appName == "Netscape");
var bFireFox = (navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 5);
if( bNavigator && !bFireFox )
{
   window.location.href = "http://home-video.ru/netscape.html";
}
else
{
   window.name = "main";
}

function replace(s, t, u)
{
   i = s.indexOf(t);
   if (i == -1)
   {
      return s;
   }
   r = s.substring(0,i) + u;
   if( (i + t.length) < s.length)
   {
      r += s.substring(i + t.length, s.length);
   }
   return r;
}

function OnSearch(text)
{
   text = text.toLowerCase();
   if( text == null || text == "" || text.length < 3 ){alert("Пожалуйста, задайте ключевые слова для поиска.\nКлючевые слова должны быть длиной не менее 3 символов!");return;}
   text = replace(text,"\"","");text = replace(text,"\'","");text = replace(text,"\"","");text = replace(text,"\'","");if( text == "o" || text == "о" || text == "O" || text == "О" ){text = "otello";}
   if( text=="k9" || text=="k-9" || text=="k 9" || text=="к-9" || text=="к 9" || text=="к9" ){ text="ka9"; }
   if( text=="k-19" || text=="k 19" || text=="к-19" || text=="к 19" || text=="к19" ){ text="k19"; }
   if( text=="a-ha" || text=="a ha" || text=="a/ha" ){ text="aha"; }
   if( text=="ac-dc" || text=="ac dc" || text=="acdc" ){ text="ac/dc"; }
   window.location.href = "/cgi-bin/search.cgi?text="+text;
}

function OnPSearch(text)
{
   text = text.toLowerCase();
   if( text == null || text == "" || text.length < 3 ){alert("Пожалуйста, задайте ключевые слова для поиска.\nКлючевые слова должны быть длиной не менее 3 символов!");return;}
   text = replace(text,"\"","");text = replace(text,"\'","");text = replace(text,"\"","");text = replace(text,"\'","");if( text == "o" || text == "о" || text == "O" || text == "О" ){text = "otello";}
   if( text=="k9" || text=="k-9" || text=="k 9" || text=="к-9" || text=="к 9" || text=="к9" ){ text="ka9"; }
   if( text=="k-19" || text=="k 19" || text=="к-19" || text=="к 19" || text=="к19" ){ text="k19"; }
   if( text=="a-ha" || text=="a ha" || text=="a/ha" ){ text="aha"; }
   if( text=="ac-dc" || text=="ac dc" || text=="acdc" ){ text="ac/dc"; }
   window.location.href = "/cgi-bin/searchp.cgi?text="+text;
}



nereidFadeObjects = new Object();
nereidFadeTimers = new Object();
function nereidFade(object, destOp, rate, delta){
if(!document.all) return;
if(object!="[object]"){setTimeout("nereidFade("+object+","+destOp+","+rate+","+delta+")",10);return;}
clearTimeout(nereidFadeTimers[object.sourceIndex]);
diff=destOp-object.filters.alpha.opacity;
direction=1;
if(object.filters.alpha.opacity>destOp){direction=-1;}
delta=Math.min(direction*diff,delta);
object.filters.alpha.opacity+=direction*delta;
if(object.filters.alpha.opacity!=destOp){nereidFadeObjects[object.sourceIndex]=object;nereidFadeTimers[object.sourceIndex]=setTimeout("nereidFade(nereidFadeObjects["+object.sourceIndex+"],"+destOp+","+rate+","+delta+")",rate);}
}
function addToFavorites(){
if(document.all){window.external.AddFavorite( document.location.href, document.title );}
else if(navigator.appName=="Netscape" && parseInt(navigator.appVersion)>=4){alert("В Netscape, чтобы добавить в \"Избранное\", нажмите Ctrl+D");}
else{alert("К сожалению не знаю как добавить в \"Избранное\" в вашем web-browser'e  :o(\nЧтобы добавить, используйте, пожалуйста, меню или \"горячие клавиши\" вашего web-browser'a...");}
}
function setLight(id){document.all[id].style.background="#88ACDC";document.all[id].style.borderBottomStyle="ridge";}
function setDark(id){document.all[id].style.background="#E7E7E7";document.all[id].style.borderBottomStyle="groove";}
function hmnu(obj,m){ if(m=='1'){obj.style.background="#88ACDC";obj.style.borderBottomStyle="ridge";obj.style.cursor="hand";} if(m=='0'){obj.style.background="#E7E7E7";obj.style.borderBottomStyle="groove";} }


d=document;

d.write("<tr>");
d.write("<td class=black-bg width=20><img src='http://dvd.home-video.ru/_img/null.gif' alt='dvd диск' border=0 width=1 height=20></td>");
d.write("<td class=black-bg width=230><img src='http://dvd.home-video.ru/_img/null.gif' alt='dvd фильм' border=0 width=1 height=20></td>");
d.write("<td class=black-bg width=220><img src='http://dvd.home-video.ru/_img/null.gif' alt='dvd' border=0 width=1 height=20></td>");
d.write("<td class=black-bg width=330><img src='http://dvd.home-video.ru/_img/null.gif' alt='домашний кинотеатр' border=0 width=1 height=20></td>");
d.write("<td class=black-bg width=220><img src='http://dvd.home-video.ru/_img/null.gif' alt='двд диск' border=0 width=1 height=20></td>");
d.write("<td class=black-bg width=220><img src='http://dvd.home-video.ru/_img/null.gif' alt='dvd диск купить' border=0 width=1 height=20></td>");
d.write("<td class=black-bg width=220><img src='http://dvd.home-video.ru/_img/null.gif' alt='dvd фильм купить' border=0 width=80 height=1></td>");
d.write("<td class=black-bg width=220><img src='http://dvd.home-video.ru/_img/null.gif' alt='dvd плеер' border=0 width=1 height=20></td>");
d.write("</tr>");

d.write("<tr>");
d.write("<td class=red-bg-10 width=20><img src='http://dvd.home-video.ru/_img/null.gif' alt='' border=0 width=1 height=1><img src='http://dvd.home-video.ru/_img/null.gif' alt='' border=0 width=20 height=0></td>");
d.write("<td class=red-bg-20 width=230><div class=hdr1>Home</div></td>");
d.write("<td class=white-bg-10 colspan=4 width=990><div class=hdr2>Video</div></td>");
d.write("<td class=white-bg-10 width=220><p class='title_menu_text'>&nbsp;</p></td>");
d.write("<td class=red-bg-10 width=220><center><img src='http://dvd.home-video.ru/_img/dvd_logo_big.gif' alt='Это раздел DVD-дисков' width=133 height=66 border=0 align=center></center></td>");
d.write("</tr>");

d.write("<tr>");
d.write("<td class=red-bg-11 width=20><img src='http://dvd.home-video.ru/_img/null.gif' alt='' border=0 width=0 height=20></td>");
d.write("<td class=red-bg-21 width=230><div class=small_title>Интернет-магазин DVD-фильмов</div></td>");
d.write("<td class=white-bg-11c width=220><p class='title_menu_text'>&nbsp;&nbsp;<a class=top_menu1 href='javascript:history.back();' title='Вернуться к предыдущей странице'>Назад</a>&nbsp;&nbsp;</p></td>");

d.write("<td class=red-bg-11c width=220><p class='title_menu_text'>&nbsp;</p></td>");
d.write("<td class=white-bg-11c width=220><p class='title_menu_text'>&nbsp;</p></td>");
d.write("<td class=red-bg-11cs width=220><p class='title_menu_text'>&nbsp;</p></td>");

d.write("<td class=white-bg-11s width=220><p class='title_menu_text'>&nbsp;&nbsp;&nbsp;&nbsp;</p></td>");
d.write("<td class=red-bg-11 width=220><p class='title_menu_text'>&nbsp;&nbsp;<a class=top_menu1 href='javascript:addToFavorites()' title='Добавить эту страницу в &quot;Избранное&quot;'>Добавить&nbsp;в&nbsp;&quot;Избранное&quot;</a>&nbsp;&nbsp;</p></td>");
d.write("</tr>");

d.write("<tr>");
d.write("<td class=red-bg-11 width=20><img src='http://dvd.home-video.ru/_img/null.gif' alt='' border=0 width=1 height=1></td>");
d.write("<td class=main-menu>");


//<!-- main menu -->
d.write("<TABLE class=main-menu cellSpacing=0 cellPadding=0 width=100%><TBODY><TR><TD class=title>Меню</TD></TR><TR><TD class=text-bg><TABLE border=0 cellSpacing=0 cellPadding=0 width=100%>");
d.write("<TR><TD onMouseOver=hmnu(this,'1') onMouseOut=hmnu(this,'0') class=item-text><a href='http://dvd.home-video.ru/index.php'>Главная&nbsp;страница</a></TD></TR>");
d.write("<TR><TD onMouseOver=hmnu(this,'1') onMouseOut=hmnu(this,'0') class=item-text><a href='http://dvd.home-video.ru/first.shtml'>Описание&nbsp;магазина</a></TD></TR>");
d.write("<TR><TD onMouseOver=hmnu(this,'1') onMouseOut=hmnu(this,'0') class=item-text><a href='http://dvd.home-video.ru/catalog.shtml'>Каталог&nbsp;фильмов</a></TD></TR>");
d.write("<TR><TD onMouseOver=hmnu(this,'1') onMouseOut=hmnu(this,'0') class=item-text><a href='http://dvd.home-video.ru/cgi-bin/show.cgi?t=genre&id=new-year'><font color=red>к Новому Году!</font></a></TD></TR>");
d.write("<TR><TD onMouseOver=hmnu(this,'1') onMouseOut=hmnu(this,'0') class=item-text><a href='http://dvd.home-video.ru/cgi-bin/show.cgi?t=genre&id=travel-guide'><font color=red>Вы собрались в отпуск?</font></a></TD></TR>");
d.write("<TR><TD onMouseOver=hmnu(this,'1') onMouseOut=hmnu(this,'0') class=item-text><a href='http://dvd.home-video.ru/cgi-bin/show.cgi?t=genre&id=sale'><font color=red>РАСПРОДАЖА !!!</font></a></TD></TR>");
d.write("<TR><TD onMouseOver=hmnu(this,'1') onMouseOut=hmnu(this,'0') class=item-text><a href='http://dvd.home-video.ru/news/index.shtml'>Новинки&nbsp;недели</a></TD></TR>");
d.write("<TR><TD onMouseOver=hmnu(this,'1') onMouseOut=hmnu(this,'0') class=item-text><a href='http://dvd.home-video.ru/search.shtml'>Поиск&nbsp;фильмов</a></TD></TR>");
d.write("<TR><TD onMouseOver=hmnu(this,'1') onMouseOut=hmnu(this,'0') class=item-text><a href='javascript:OpenCart();'>Корзина&nbsp;заказов</a></TD></TR>");
d.write("<TR><TD onMouseOver=hmnu(this,'1') onMouseOut=hmnu(this,'0') class=item-text-last><a href='http://home-video.ru/contacts.shtml'>Наши&nbsp;контакты</a></TD></TR>");
d.write("</TABLE></TD></TR></TBODY></TABLE>");



d.write("<TABLE class=main-menu cellSpacing=0 cellPadding=0 width=100%><TBODY><TR><TD class=title>Доп. услуги</TD></TR><TR><TD class=text-bg><TABLE border=0 cellSpacing=0 cellPadding=0 width=100%>");
d.write("<TR><TD onMouseOver=hmnu(this,'1') onMouseOut=hmnu(this,'0') class=item-text><a href='http://home-video.ru/vhs-to-dvd/'>Перевод&nbsp;VHS&nbsp;на&nbsp;DVD</a></TD></TR>");
d.write("<TR><TD onMouseOver=hmnu(this,'1') onMouseOut=hmnu(this,'0') class=item-text-last><a href='http://dvd.home-video.ru/cgi-bin/show.cgi?t=genre&id=bulk'>DVD-R болванки</a></TD></TR>");
d.write("</TABLE></TD></TR></TBODY></TABLE>");



//<!-- conditions -->
d.write("<TABLE class=main-menu cellSpacing=0 cellPadding=0 width=100%><TBODY><TR><TD class=title>Наши условия</TD></TR><TR><TD class=text-bg><TABLE border=0 cellSpacing=0 cellPadding=0 width=100%>");
d.write("<TR><TD onMouseOver=hmnu(this,'1') onMouseOut=hmnu(this,'0') class=item-text><a href='http://home-video.ru/price.shtml'>Цены</a></TD></TR>");
d.write("<TR><TD onMouseOver=hmnu(this,'1') onMouseOut=hmnu(this,'0') class=item-text><a href='http://home-video.ru/delivery.shtml'>Доставка</a></TD></TR>");
d.write("<TR><TD onMouseOver=hmnu(this,'1') onMouseOut=hmnu(this,'0') class=item-text-last><a href='http://dvd.home-video.ru/defects.shtml'>Обмен&nbsp;брака</a></TD></TR>");
d.write("</TABLE></TD></TR></TBODY></TABLE>");



//<!-- Awards -->
d.write("<TABLE class=main-menu cellSpacing=0 cellPadding=0 width=100%><TBODY><TR><TD class=title>Кинопремии</TD></TR><TR><TD class=text-bg><TABLE border=0 cellSpacing=0 cellPadding=0 width=100%>");
d.write("<TR><TD onMouseOver=hmnu(this,'1') onMouseOut=hmnu(this,'0') class=item-text><a href='http://dvd.home-video.ru/awards/oskar.shtml'>ОСКАР</a></TD></TR>");
d.write("<TR><TD onMouseOver=hmnu(this,'1') onMouseOut=hmnu(this,'0') class=item-text><a href='http://dvd.home-video.ru/awards/goldenglobose.shtml'>Золотой&nbsp;Глобус</a></TD></TR>");
d.write("<TR><TD onMouseOver=hmnu(this,'1') onMouseOut=hmnu(this,'0') class=item-text><a href='http://dvd.home-video.ru/awards/mtvmovie.shtml'>MTV&nbsp;Movie&nbsp;Award</a></TD></TR>");
d.write("<TR><TD onMouseOver=hmnu(this,'1') onMouseOut=hmnu(this,'0') class=item-text-last><a href='http://dvd.home-video.ru/awards/brit.shtml'>Brit&nbsp;Awards</a></TD></TR>");
d.write("</TABLE></TD></TR></TBODY></TABLE>");



//<!-- Best -->
d.write("<TABLE class=main-menu cellSpacing=0 cellPadding=0 width=100%><TBODY><TR><TD class=title>Лучшие</TD></TR><TR><TD class=text-bg><TABLE border=0 cellSpacing=0 cellPadding=0 width=100%>");
d.write("<TR><TD onMouseOver=hmnu(this,'1') onMouseOut=hmnu(this,'0') class=item-text><a href='http://dvd.home-video.ru/cgi-bin/show.cgi?t=actors'>Иностранные&nbsp;актеры</a></TD></TR>");
d.write("<TR><TD onMouseOver=hmnu(this,'1') onMouseOut=hmnu(this,'0') class=item-text><a href='http://dvd.home-video.ru/cgi-bin/show.cgi?t=actresses'>Иностранные&nbsp;актрисы</a></TD></TR>");
d.write("<TR><TD onMouseOver=hmnu(this,'1') onMouseOut=hmnu(this,'0') class=item-text><a href='http://dvd.home-video.ru/cgi-bin/show.cgi?t=actors-ru'>Русские&nbsp;актеры</a></TD></TR>");
d.write("<TR><TD onMouseOver=hmnu(this,'1') onMouseOut=hmnu(this,'0') class=item-text><a href='http://dvd.home-video.ru/cgi-bin/show.cgi?t=actresses-ru'>Русские&nbsp;актрисы</a></TD></TR>");
d.write("<TR><TD onMouseOver=hmnu(this,'1') onMouseOut=hmnu(this,'0') class=item-text-last><a href='http://dvd.home-video.ru/awards/index.shtml'>Кассовые&nbsp;фильмы</a></TD></TR>");
d.write("</TABLE></TD></TR></TBODY></TABLE>");



d.write("<TABLE class=main-menu-smallfont cellSpacing=0 cellPadding=0 width=100%><TBODY><TR><TD class=title>Рекомендуем!</TD></TR><TR><TD class=text-bg><TABLE border=0 cellSpacing=0 cellPadding=0 width=100%>");
d.write("<TR><TD onMouseOver=hmnu(this,'1') onMouseOut=hmnu(this,'0') class=item-text><a href='http://dvd.home-video.ru/cgi-bin/show.cgi?t=1&id=9007'>ОперА. Хроники убойного ...</a></TD></TR>");
d.write("<TR><TD onMouseOver=hmnu(this,'1') onMouseOut=hmnu(this,'0') class=item-text><a href='http://dvd.home-video.ru/cgi-bin/show.cgi?t=1&id=8989'>[on_line] / секс, ложь и интернет</a></TD></TR>");
d.write("<TR><TD onMouseOver=hmnu(this,'1') onMouseOut=hmnu(this,'0') class=item-text><a href='http://dvd.home-video.ru/cgi-bin/show.cgi?t=1&id=8847'>Барханов и его телохранитель</a></TD></TR>");
d.write("<TR><TD onMouseOver=hmnu(this,'1') onMouseOut=hmnu(this,'0') class=item-text><a href='http://dvd.home-video.ru/cgi-bin/show.cgi?t=1&id=6346'>Братство убийц</a></TD></TR>");
d.write("<TR><TD onMouseOver=hmnu(this,'1') onMouseOut=hmnu(this,'0') class=item-text><a href='http://dvd.home-video.ru/cgi-bin/show.cgi?t=1&id=9020'>Гамера: \"Защитник Вселенной\"</a></TD></TR>");
d.write("<TR><TD onMouseOver=hmnu(this,'1') onMouseOut=hmnu(this,'0') class=item-text><a href='http://dvd.home-video.ru/cgi-bin/show.cgi?t=1&id=8998'>Дом летающих кинжалов</a></TD></TR>");
d.write("<TR><TD onMouseOver=hmnu(this,'1') onMouseOut=hmnu(this,'0') class=item-text><a href='http://dvd.home-video.ru/cgi-bin/show.cgi?t=1&id=8704'>Запах ночи</a></TD></TR>");
d.write("<TR><TD onMouseOver=hmnu(this,'1') onMouseOut=hmnu(this,'0') class=item-text><a href='http://dvd.home-video.ru/cgi-bin/show.cgi?t=1&id=8988'>Кафе \"Донс Плам\"</a></TD></TR>");
d.write("<TR><TD onMouseOver=hmnu(this,'1') onMouseOut=hmnu(this,'0') class=item-text><a href='http://dvd.home-video.ru/cgi-bin/show.cgi?t=1&id=8838'>Князь Дракула</a></TD></TR>");
d.write("<TR><TD onMouseOver=hmnu(this,'1') onMouseOut=hmnu(this,'0') class=item-text><a href='http://dvd.home-video.ru/cgi-bin/show.cgi?t=1&id=8706'>Круговерть</a></TD></TR>");
d.write("<TR><TD onMouseOver=hmnu(this,'1') onMouseOut=hmnu(this,'0') class=item-text><a href='http://dvd.home-video.ru/cgi-bin/show.cgi?t=1&id=8840'>Моя жена гангстер</a></TD></TR>");
d.write("<TR><TD onMouseOver=hmnu(this,'1') onMouseOut=hmnu(this,'0') class=item-text><a href='http://dvd.home-video.ru/cgi-bin/show.cgi?t=1&id=8708'>Незваный гость</a></TD></TR>");
d.write("<TR><TD onMouseOver=hmnu(this,'1') onMouseOut=hmnu(this,'0') class=item-text><a href='http://dvd.home-video.ru/cgi-bin/show.cgi?t=1&id=8717'>Погоня</a></TD></TR>");
d.write("<TR><TD onMouseOver=hmnu(this,'1') onMouseOut=hmnu(this,'0') class=item-text><a href='http://dvd.home-video.ru/cgi-bin/show.cgi?t=1&id=8314'>Принц Динозавров</a></TD></TR>");
d.write("<TR><TD onMouseOver=hmnu(this,'1') onMouseOut=hmnu(this,'0') class=item-text><a href='http://dvd.home-video.ru/cgi-bin/show.cgi?t=1&id=6878'>Сборник м/ф \"Были и небыли...</a></TD></TR>");
d.write("<TR><TD onMouseOver=hmnu(this,'1') onMouseOut=hmnu(this,'0') class=item-text><a href='http://dvd.home-video.ru/cgi-bin/show.cgi?t=1&id=6886'>Сборник м/ф \"Волшеб. сказки...</a></TD></TR>");
d.write("<TR><TD onMouseOver=hmnu(this,'1') onMouseOut=hmnu(this,'0') class=item-text><a href='http://dvd.home-video.ru/cgi-bin/show.cgi?t=1&id=6889'>Сборник м/ф \"Малышам о мал...</a></TD></TR>");
d.write("<TR><TD onMouseOver=hmnu(this,'1') onMouseOut=hmnu(this,'0') class=item-text><a href='http://dvd.home-video.ru/cgi-bin/show.cgi?t=1&id=6893'>Сборник м/ф \"Про волка и лису\"</a></TD></TR>");
d.write("<TR><TD onMouseOver=hmnu(this,'1') onMouseOut=hmnu(this,'0') class=item-text><a href='http://dvd.home-video.ru/cgi-bin/show.cgi?t=1&id=6984'>Трудно быть Богом</a></TD></TR>");
d.write("<TR><TD onMouseOver=hmnu(this,'1') onMouseOut=hmnu(this,'0') class=item-text-last><a href='http://dvd.home-video.ru/cgi-bin/show.cgi?t=1&id=8712'>Фантастический выдумщик</a></TD></TR>");
d.write("</TABLE></TD></TR></TBODY></TABLE>");




d.write("</td>");
d.write("<td class=body colspan=6>");
