﻿ var ico2=new Array;
 var ico=new Array;
 var ten=new Array;
var rsCl=new Array;
var rsTY=new Array;
var rmap=new Array;

var hidData='';
var kkold='';

var ClassifierName=new Array;
var Tid='';
var sid='';
var t='';

var pOld=-1;
var RegionZoom='';
var page='';
var relod=false





// - загрузка станицы НАЧАЛО


function wonload()
{
//alert(strreg)


if (document.getElementById("motioncontainer")) fillup();

if (p!=0 || o!=0 || r!=0)
{ if (document.getElementById("cm_map")) reo()  }
else
{if (document.getElementById("preloader")) document.getElementById("preloader").style.visibility = "hidden"

if (w=='region')
{



if (Tid!=='') 
{if (document.getElementById("cm_map")) setTimeout('cm_load()', 500);
} else {
document.getElementById("sidebarDIV").style.display="block";
document.getElementById("sidebarDIV").style.visibility = "visible";
}
}

if (sid!='')
{
if (document.getElementById("cm_map")) setTimeout('cm_load()', 500);
}

if (w=='main')
{
if (document.getElementById("cm_map")) setTimeout('cm_load()', 500);
}

if (w=='search')
{
if (document.getElementById("cm_map")) document.getElementById("cm_map").background='url(/images/start_map.jpg)'; 
}

}





IM='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="667" height="364" id="interactiveMap" align="middle"><param name="wmode" value="opaque" /><param name="movie" value="/interactiveMap.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#cccccc" /><param name="play" value="true" /><param name="loop" value="true" /><param name="wmode" value="window" /><param name="scale" value="showall" /><param name="menu" value="true" /><param name="devicefont" value="false" /><param name="salign" value="" /><param name="allowScriptAccess" value="sameDomain" /><object type="application/x-shockwave-flash" data="/interactiveMap.swf" width="667" height="364" name="interactiveMap"  id="interactiveMap" ><param name="movie" value="/interactiveMap.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#cccccc" /><param name="play" value="true" /><param name="loop" value="true" /><param name="wmode" value="window" /><param name="scale" value="showall" /><param name="menu" value="true" /><param name="devicefont" value="false" /><param name="salign" value="" /><param name="allowScriptAccess" value="sameDomain" /> <param name="wmode" value="opaque" /></object></object>'

if ( w!='main'  && w!='search')
{
//if (document.getElementById('start_map')) document.getElementById('start_map').innerHTML=IM;
}
else
{
if (w!='search')
{
if (document.getElementById('start_map')) document.getElementById("start_map").style.visibility = "hidden"
}
}







//if (document.getElementById("map_canvas")) initialize();
//alert(document.getElementById('st_re'))
try
{
document.getElementById('st_re1').innerHTML=strreg;
}
catch(Error){}




if (p==0)
{
if (document.getElementById('bal1')) document.getElementById('bal1').style.visibility='visible'; 
}else{
if (document.getElementById('bal1')) document.getElementById('bal1').style.visibility='hidden'; 
}


if (r==0)
{
if (document.getElementById('bal2')) document.getElementById('bal2').style.visibility='visible';
}else{
if (document.getElementById('bal2')) document.getElementById('bal2').style.visibility='hidden'; 
}



if (p!=0 || r!=0)
{
if (document.getElementById('rounded3')) document.getElementById('rounded3').style.visibility='visible';
if (document.getElementById('region')) document.getElementById('region').style.paddingRight='121px'
}


}



// wonload() - загрузка станицы КОНЕЦ




function sp(id,w)
{
if (w==1) document.getElementById('sp'+id).style. backgroundColor='#C6E0C3'; 
if (w==0) document.getElementById('sp'+id).style. backgroundColor='#FFFFFF'; 
}


  var flag=false;
     var shift_x;
     var shift_y;
  
function start_drag(w,e){

itemToMove=document.getElementById(w);
     if(!e) e = window.event;
     flag=true;
     shift_x = e.clientX-parseInt(itemToMove.style.left);
     shift_y = e.clientY-parseInt(itemToMove.style.top);
  
     if(e.stopPropagation) e.stopPropagation();
     else e.cancelBubble = true;
     if(e.preventDefault) e.preventDefault();
     else e.returnValue = false;
}
  
function end_drag(){ flag=false; }
  
function dragIt(w,e){

itemToMove=document.getElementById(w);
//alert(itemToMove);
     if(!flag) return;
     if(!e) e = window.event;
     itemToMove.style.left = (e.clientX-shift_x) + "px";
     itemToMove.style.top = (e.clientY-shift_y) + "px";
  
     if(e.stopPropagation) e.stopPropagation();
     else e.cancelBubble = true;
     if(e.preventDefault) e.preventDefault();
     else e.returnValue = false;
}


function sch(w,w1)
{
itemTo=document.getElementById(w);
//if (itemTo.style.display=="block")
if (w1==0)
{

       itemTo.style.display="none";
          itemTo.style.visibility = "hidden";


if  (relod)
{ relod=false
document.location.reload();
}


}else{
    itemTo.style.display="block";
          itemTo.style.visibility = "visible";
}




}












































function PopupAnketa(artID,paramname,param) {
  var width=480;
  var height=540;
  var left=screen.width/2-width/2;
  var top=screen.height/2-height/2;
  var wnd = window.open("/default.asp?artID="+artID+"&"+ paramname+"="+escape(param), "anketapopup","left="+left+",top="+top+",width="+width+",height="+height+",resizable=0,status=0,scrollbars=1");
  if(wnd)
    wnd.focus();
}


      function OpJ()
   {
  location.href='/u.asp?j=1&reloads=1';
    
   }




function PopupPic(name, id, width, height){
  var left=screen.width/2-width/2;
  var top=screen.height/2-height/2;
  var wnd = window.open("/services/popuppic.asp?name="+ name+"&id="+id, "","left="+left+",top="+top+",width="+width+",height="+height+",resizable=0,status=0,scrollbars=0");
  if(wnd)
    wnd.focus();
}



function PopupGal1(id,i){
width=1052;
height=810;

  var left=screen.width/2-width/2;
  var top=screen.height/2-height/2;
  var wnd = window.open("/gal.asp?id="+id+"&i="+i, "_blank","left="+left+",top="+top+",width="+width+",height="+height+",resizable=no,status=no,scrollbars=no,channelmode=no,directories=no,location=no,menubar=no,toolbar=no,copyhistory=no");
  if(wnd)
    wnd.focus();
}




var cartWindow
function PopupGal(id,i){
width=1052;
height=810;

  var left=screen.width/2-width/2;
  var top=screen.height/2-height/2;
url="/gal.asp?id="+id+"&i="+i;


if ((!cartWindow)||cartWindow.closed) {
cartWindow = window.open(url, "","left="+left+",top="+top+",width="+width+",height="+height+",resizable=0,status=0,scrollbars=0")

} else {
cartWindow.location.href = url;
}
cartWindow.focus();






}




function PrintPreview(){
  var url = window.location.href;
  var title = window.document.title;
  if(url.indexOf("#") != -1)
  	url = url.substring(0,url.indexOf("#"));
  if(url.indexOf("?") != -1)
    url = url + "&mode=print"
  else
    url = url + "?mode=print"
  var wnd = window.open( url , "PrintPreview","width=540,height=600,resizable=1,status=0,scrollbars=1");
  if(wnd)
    wnd.focus();
}

function MailLink(){
  var url = window.location.href;
  var title = window.document.title;
  var wnd = window.open("/services/maillink.asp" , "MailLink","width=472,height=501,resizable=1,status=0,scrollbars=1");
  if(wnd)
    wnd.focus();
}

function RemoveLinks(){
	if(window.opener)
	window.opener.name = "top"
	for(i=0; i<document.links.length; i++){
		var lnk = document.links[i].href;
		if(lnk.indexOf("javascript") == -1 && lnk.indexOf("#") == -1){
			document.links[i].target="top";
			document.links[i].onclick = new Function("opener.focus();");
		}
	}
}

var imagesHidden = false;
var images = null;

function HideImages(){
  if(images == null)
    images = new Array(document.images.length);
  var selfpath = document.location.href.split("/");
  for(i=0; i<document.images.length; i++){
    if(!imagesHidden){
      var path = document.images[i].src.split("/");
      if(path.length>5 || path.length==4 || selfpath[2] != path[2]){
        images[i] = document.images[i].src;
        document.images[i].src="/images/blank.gif";
      }  
    }
    else if(images[i] != null){
      document.images[i].src=images[i];
    }
  }
  imagesHidden = !imagesHidden;
  if(imagesHidden)
    document.getElementById("hide").innerText = "Show images"
  else
    document.getElementById("hide").innerText = "Hide images"
}

function GetTitle(){
  if(opener)
    if(opener.document.title)
      this.document.title = opener.document.title;
}


function Toggle(element){
  if(element.tagName == "IMG"){
    var div = element.parentNode.parentNode.parentNode.parentNode.parentNode; //TD->TR->TBODY->TABLE->DIV
    var folder = element.parentNode.nextSibling;
    if(element.src.indexOf("_minus.gif")!=-1){
      element.src = element.src.substring(0, element.src.indexOf("_minus.gif")) + "_plus.gif";
      folder.childNodes.item(0).src = "/images/tree/folder_closed.gif";
      var childs = div.childNodes;
      for(var i=1; i< childs.length; i++){
        if(childs[i].tagName == "DIV"){
          childs[i].style.display = "none";
          childs[i].style.visibility = "hidden";
        }
      }
      div.setAttribute("expanded", "false");
    }
    else{
      element.src = element.src.substring(0, element.src.indexOf("_plus.gif")) + "_minus.gif";
      folder.childNodes.item(0).src = "/images/tree/folder_open.gif";
      var childs = div.childNodes;
      for(var i=1; i< childs.length; i++){
        if(childs[i].tagName == "DIV"){
          childs[i].style.display = "block";
          childs[i].style.visibility = "visible";
        }
      }
      div.setAttribute("expanded", "true");
    }
  }
}

function ExpandVisual(table){
  var img = table.getElementsByTagName("IMG");
  if(img.length >= 2){
    var x = img[img.length-1].src.indexOf("_closed.gif");
    if(x != -1)
      img[img.length-1].src = "/images/tree/folder_open.gif";
    x = img[img.length-2].src.indexOf("_plus.gif");
    if(x != -1)
      img[img.length-2].src = img[img.length-2].src.substring(0, x) + "_minus.gif";
  }
}

function ExpandAll(){
  var rootDiv = document.getElementById("SiteMap");
  if(rootDiv){
    var childs = rootDiv.getElementsByTagName("DIV");
    for(var i=0; i<childs.length; i++){
        if(childs[i].getAttribute("expanded") != "true"){
          ExpandVisual(childs[i].childNodes.item(0));
          childs[i].setAttribute("expanded", "true")
        }
        if(childs[i].parentNode != rootDiv){
          childs[i].style.display="block";
          childs[i].style.visibility = "visible";
        }
    }
  }
}

function CollapseVisual(table){
  var img = table.getElementsByTagName("IMG");
  if(img.length >= 2){
    var x = img[img.length-1].src.indexOf("_open.gif");
    if(x != -1)
      img[img.length-1].src = "/images/tree/folder_closed.gif";
    x = img[img.length-2].src.indexOf("_minus.gif");
    if(x != -1)
      img[img.length-2].src = img[img.length-2].src.substring(0, x) + "_plus.gif";
  }
}

function CollapseAll(){
  var rootDiv = document.getElementById("SiteMap");
  if(rootDiv){
    var childs = rootDiv.getElementsByTagName("DIV");
    for(var i=0; i<childs.length; i++){
        if(childs[i].getAttribute("expanded") == "true"){
          CollapseVisual(childs[i].childNodes.item(0));
          childs[i].setAttribute("expanded", "false")
        }
        if(childs[i].parentNode != rootDiv){
          childs[i].style.display="none";
          childs[i].style.visibility = "hidden";
        }
    }
  }
}

function switchTab(id){
	var tab_table = document.getElementById(id).parentNode;
	var tabs = tab_table.childNodes;
	for(i=0; i<tabs.length; i++)
		if(tabs[i].className=="selected"){
			tabs[i].className="";
			document.getElementById(tabs[i].id+"_div").style.display="none";
			break;
		}
	document.getElementById(id).className="selected";
	document.getElementById(id+"_div").style.display="block";
}

function checkClear(obj, mask) {

	if (obj.value=mask) {
		obj.value = '';
	}
}

function EnlargePhoto(id, width, height){
	var div = document.createElement("DIV");
	div.id = "coverdiv";
	div.style.zIndex = 1000;
	div.style.position = "absolute";
	div.style.top = 0;
	div.style.left = 0;
	div.style.width = document.body.scrollWidth;
	div.style.height = document.body.scrollHeight;
	div.style.backgroundImage = "url(/images/semitransparent.png)";
	div.style.filter ="progid:DXImageTransform.Microsoft.BasicImage(Opacity=0.75, GrayScale=1)";
	if(window.addEventListener)
		div.addEventListener("mouseup", HidePhoto, false);
	else if(window.attachEvent)
		div.attachEvent("onmouseup", HidePhoto);
	document.body.appendChild(div);
	
	div = document.createElement("DIV");
	div.id = "photodiv";
	div.style.zIndex = 1001;
	div.style.display = "block";
	div.style.position = "absolute";
	div.style.borderWidth = "1px";
	div.style.borderColor = "#000";
	div.style.borderStyle = "solid";
	div.style.backgroundColor = "#FFF";
	div.style.padding = "10px";
	div.style.filter = "progid:DXImageTransform.Microsoft.Shadow(color='#606060', Direction=135, Strength=2)";
	div.style.top =  document.body.scrollTop + (document.body.clientHeight - height)/2 - 11; 
	div.style.left =  document.body.scrollLeft + (document.body.clientWidth - width)/2 - 14;
	div.style.width = width;
	div.style.height = height;
	if(window.addEventListener)
		div.addEventListener("mouseup", HidePhoto, false);
	else if(window.attachEvent)
		div.attachEvent("onmouseup", HidePhoto);

	var img = document.createElement("IMG");
	img.src = "/img.asp?"+ id;
	div.appendChild(img);
	
	var href = document.createElement("A");
	href.href="#";
	href.style.position = "absolute";
	href.style.top = 13;
	href.style.left = width - 9;
	href.style.float = "right";
	href.style.clear = "left";
	
	var img = document.createElement("IMG");
	img.src = "/images/i-close.gif";
	img.style.border = 0;
	
	href.appendChild(img)
	div.appendChild(href);
	document.body.appendChild(div);
	
	if(window.addEventListener){
		window.addEventListener("scroll", PositionPhoto, false);
		window.addEventListener("resize", PositionPhoto, false);
	}
	else if(window.attachEvent){
		window.attachEvent("onscroll", PositionPhoto);
		//window.attachEvent("onresize", PositionPhoto);
		document.body.onresize = PositionPhoto;
	}
}

function HidePhoto(){
	var div = document.getElementById("coverdiv");
	document.body.removeChild(div);
	var div = document.getElementById("photodiv");
	document.body.removeChild(div);
	if(window.addEventListener){
		window.removeEventListener("scroll", PositionPhoto, false);
		window.removeEventListener("resize", PositionPhoto, false);
	}
	else if(window.attachEvent){
		window.detachEvent("onscroll", PositionPhoto);
		window.detachEvent("onresize", PositionPhoto);
	}
}



function PositionPhoto(){
	var div = document.getElementById("coverdiv");
	div.style.width = document.body.scrollWidth;
	div.style.height = document.body.scrollHeight;
	//div.style.width = document.body.scrollLeft + document.body.clientWidth;
	//div.style.height = document.body.scrollTop + document.body.clientHeight;
	var div = document.getElementById("photodiv");
	div.style.top =  document.body.scrollTop + (document.body.clientHeight - parseInt(div.style.height))/2 - 11; 
	div.style.left =  document.body.scrollLeft + (document.body.clientWidth - parseInt(div.style.width))/2 - 14;
}









function  vr(id)
{ sid='';
   //id='';
setFlRegion(id);

if (window.top.document.getElementById("vr"+id).className!='mo')
{
r=id;




if (id==0)
{o=0;				// сброс обьектов

Tid=''
document.getElementById('rounded3').style.visibility='hidden';
document.getElementById('region').style.paddingRight='401px' 
}
else
{
if (p!=0)
{
document.getElementById('rounded3').style.visibility='visible';
document.getElementById('region').style.paddingRight='121px'
} 
}




for(var i = 1; i <= TitleVid; i++)
{ 
if (window.top.document.getElementById("vo"+i))
{
window.top.document.getElementById("vo"+i).className=='moo'
}
}

o=0


//alert("qqq")

reo()


//layer = new google.maps.FusionTablesLayer(370663); //
//layer.setMap(cm_map);

document.getElementById('vr').style.visibility='hidden'; 
if (id==0)
{
document.getElementById('bal2').style.visibility='visible'; document.getElementById("start_map").style.visibility = "visible" 
}else{
document.getElementById('bal2').style.visibility='hidden'; 
//document.getElementById("start_map").style.visibility = "hidden" 
}


 }

}








function  vo1(id)
{ sid='';
  //id='';
if (window.top.document.getElementById("vo"+id).className!='mo')
{

o=o+','+id;
reo() 
document.getElementById('vo').style.visibility='hidden';
}

}


function  vo(id)
{ sid='';
   //id='';
oo=0
if (window.top.document.getElementById("vo"+id).className!='mo') 
{
if (window.top.document.getElementById("vo"+id).className=='m1')
{
window.top.document.getElementById("vo"+id).className='moo'
}
else
{window.top.document.getElementById("vo"+id).className='m1'}

for(var i = 1; i <= TitleVid; i++)
		{ 
if (window.top.document.getElementById("vo"+i))
{
if (window.top.document.getElementById("vo"+i).className=='m1') oo=oo+','+i
}
}
//o=oo.replace(',','')
//alert (oo)
o=oo
reo() 
}
}


function  vp(id)
{ sid='';

setFlbanner(id)

if (window.top.document.getElementById("vp"+id).className!='mo')
{
p=id;




for(var i = 1; i <= TitleVid; i++)
{ 
if (window.top.document.getElementById("vo"+i))
{
window.top.document.getElementById("vo"+i).className=='moo'
}
}

o=0




if (id==0)
{o=0;				// сброс обьектов
document.getElementById('rounded3').style.visibility='hidden';
document.getElementById('region').style.paddingRight='401px' 
}
else
{
if (r!=0)
{
document.getElementById('rounded3').style.visibility='visible';
document.getElementById('region').style.paddingRight='121px'
} 
}

reo() 


document.getElementById('vp').style.visibility='hidden';
}

if (id==7) 
		{
document.getElementById('calen').style.visibility='visible';
document.getElementById('bal3').style.visibility='visible';
		}

else
		{
document.getElementById('calen').style.visibility='hidden';
document.getElementById('bal3').style.visibility='hidden';
		}




if (id==0)
{
document.getElementById('bal1').style.visibility='visible'; 
}else{
document.getElementById('bal1').style.visibility='hidden'; 
}












pOld=p
}





function  reoo(dvp,dvr,dvo,RZ,fr, d, r00) // включает выключает обьекты в зависимости от вида туризма
{


if (r00==0)
{
if (document.getElementById("newstxt")) window.top.document.getElementById("newstxt").innerHTML ='';
document.getElementById('sidebarDIV').innerHTML='<div class="vidt">'+d+'</div>';
document.getElementById("sidebarDIV").style.display="block";
document.getElementById("sidebarDIV").style.visibility = "visible";
}


RegionZoom=RZ

//alert (RegionZoom)





try
{


var flashObj; 
	if (navigator.appName.indexOf("Microsoft") != -1) {
		 flashObj = window["interactiveMap"]; 
	} else { 
		flashObj = document["interactiveMap"]; 
	 } 

flashObj.enableAllRegions(false);
flashObj.enableMultipleRegions(fr, true);
flashObj.setRegion(r)

}
catch(Error){}








cd=dvp.split(",")


   
  for(i=0;i<cd.length-1;i++) 
{
sd=cd[i].split(".")
if (document.getElementById("vp"+sd[0]))
{

if (window.top.document.getElementById("vp"+sd[0]).className!='m0') document.getElementById("vp"+sd[0]).className=sd[1];
}
}

cd=dvr.split(",")
  for(i=0;i<cd.length-1;i++) 
{
sd=cd[i].split(".")
if (document.getElementById("vr"+sd[0]))
{
if (window.top.document.getElementById("vr"+sd[0]).className!='m0') document.getElementById("vr"+sd[0]).className=sd[1];
}
}

cd=dvo.split(",")
  for(i=0;i<cd.length-1;i++) 
{
sd=cd[i].split(".")
if (document.getElementById("vo"+sd[0]))
{
if (window.top.document.getElementById("vo"+sd[0]).className!='m0') document.getElementById("vo"+sd[0]).className=sd[1];
}
}


}



// вызывает скрипт уделения из Моё путешествие (5)







function  delmainP(did)
{
src='/js/delP.asp?i='+did
	var script = document.createElement('script');
	script.setAttribute('src', src);
	script.setAttribute('id', 'jsonScript');
	script.setAttribute('type', 'text/javascript');
	document.documentElement.firstChild.appendChild(script);
}


function  delmain_scriptP(n,t1)
{

document.getElementById('regName').innerHTML=n
document.getElementById('regBody').innerHTML=t1;
place_center("regi")
sch('regi',1)
}



function  delmain(did)
{
src='/js/del.asp?i='+did
	var script = document.createElement('script');
	script.setAttribute('src', src);
	script.setAttribute('id', 'jsonScript');
	script.setAttribute('type', 'text/javascript');
	document.documentElement.firstChild.appendChild(script);
}


//  вызывается из /js/del.asp после удаления путешествия

function  delmain_script(n,t1)
{
if(t1!='')
{
document.getElementById('regName').innerHTML=n
document.getElementById('regBody').innerHTML=t1;

relod=true // глобальная переменная для релоада всей страницы после закрытия окошка regi

sch('regi',0)
}
}



// вызывает скрипт добавления из Моё путешествие (5)

function  addmain(did)
{
src='/js/add.asp?id='+did
	var script = document.createElement('script');
	script.setAttribute('src', src);
	script.setAttribute('id', 'jsonScript');
	script.setAttribute('type', 'text/javascript');
	document.documentElement.firstChild.appendChild(script);
}



function  addmain_script(n,t1,c,cook)
{

if (cook=="0") 
{target='js'


top.frames[target].location.href='/secure/login.asp'

}
else
{

try
{
document.getElementById('colmain').innerHTML=c;
}
catch(Error){}

document.getElementById('regName').innerHTML=n
document.getElementById('regBody').innerHTML=t1;
place_center("regi")
sch('regi',1)

}
}

 function  schregi0()
{
sch('regi',0)
}

 function  reo() // 
{//document.cookie=''+p+','+r+','+o


src='/js/v.asp?p='+p+'&r='+r+'&o='+o

//alert (asp)
//sid='';
//window.frames["js"].location=asp;

	var script = document.createElement('script');
	script.setAttribute('src', src);
	script.setAttribute('id', 'jsonScript');
	script.setAttribute('type', 'text/javascript');
	document.documentElement.firstChild.appendChild(script);


if (p==0)
{
if (document.getElementById('bal1')) document.getElementById('bal1').style.visibility='visible'; 
}else{
if (document.getElementById('bal1')) document.getElementById('bal1').style.visibility='hidden'; 
}


if (r==0)
{
if (document.getElementById('bal2')) document.getElementById('bal2').style.visibility='visible';  document.getElementById("start_map").style.visibility = "visible" ;
}else{
if (document.getElementById('bal2')) document.getElementById('bal2').style.visibility='hidden';  //document.getElementById("start_map").style.visibility = "hidden" ;
}



if (p!=0 && r!=0 ) remap();

}


function  remap()
{//alert ('p='+p+' o='+o+' r='+r)

w='';
//sid='';
region=false;
title=false;
cm_load()
}


var regS=0;

function  svsRsel (sel)
{
regS=sel.options[sel.selectedIndex].value

}


function  svss (sel)
{
//alert(sel.options[sel.selectedIndex].value)



id=sel.options[sel.selectedIndex].value

svss1 (id)
}


function  svss1 (id)
{



if (id!=0)
{





if (document.getElementById('rsClas_10')) document.getElementById('rsClas_10').className='chbox'
if (document.getElementById('rsClas_20')) document.getElementById('rsClas_20').className='chbox'
if (document.getElementById('rsClas_30')) document.getElementById('rsClas_30').className='chbox'






  for(i=0;i<TitleVid+1;i++) 
{

if (document.getElementById('rsClas'+i))
{
document.getElementById('rsClas'+i).className='chbox';
}
}





cd=rsTY[id].split(",")
  for(i=0;i<cd.length-1;i++) 
{

if (document.getElementById(cd[i]))
{
document.getElementById(cd[i]).className='chboxS';
}
}



p_p='r'





if (document.getElementById('rsClas_10'+p_p)) document.getElementById('rsClas_10'+p_p).className='chbox'
if (document.getElementById('rsClas_20'+p_p)) document.getElementById('rsClas_20'+p_p).className='chbox'
if (document.getElementById('rsClas_30'+p_p)) document.getElementById('rsClas_30'+p_p).className='chbox'






  for(i=0;i<TitleVid+1;i++) 
{

if (document.getElementById('rsClas'+i+p_p))
{
document.getElementById('rsClas'+i+p_p).className='chbox';
}
}





cd=rsTY[id].split(",")
  for(i=0;i<cd.length-1;i++) 
{

if (document.getElementById(cd[i]+p_p))
{
document.getElementById(cd[i]+p_p).className='chboxS';
}
}








  for(i=0;i<TitleOB+1;i++) 
{



if (document.getElementById('rsType'+i+p_p))
{
document.getElementById('rsType'+i+p_p).className='chbox';
}


}

document.getElementById('rsType'+id+p_p).className='chboxS';












}else{


  for(i=0;i<TitleVid+1;i++) 
{

if (document.getElementById('rsClas'+i))
{
document.getElementById('rsClas'+i).className='chbox';
}
}


p_p='r'

  for(i=0;i<TitleVid+1;i++) 
{

if (document.getElementById('rsClas'+i+p_p))
{
document.getElementById('rsClas'+i+p_p).className='chbox';
}
}


  for(i=0;i<TitleOB+1;i++) 
{



if (document.getElementById('rsType'+i+p_p))
{
document.getElementById('rsType'+i+p_p).className='chbox';
}


}


}




}













function  svs (id,q)
{



p_p='r'

oldd=document.getElementById('rsType'+id+p_p).className

if (document.getElementById('rsClas_10'+p_p)) document.getElementById('rsClas_10'+p_p).className='chbox'
if (document.getElementById('rsClas_20'+p_p)) document.getElementById('rsClas_20'+p_p).className='chbox'
if (document.getElementById('rsClas_30'+p_p)) document.getElementById('rsClas_30'+p_p).className='chbox'


if (document.getElementById('rsClas_10')) document.getElementById('rsClas_10').className='chbox'
if (document.getElementById('rsClas_20')) document.getElementById('rsClas_20').className='chbox'
if (document.getElementById('rsClas_30')) document.getElementById('rsClas_30').className='chbox'


  for(i=0;i<TitleOB+1;i++) 
{


if (document.getElementById('rsType'+i+p_p))
{
document.getElementById('rsType'+i+p_p).className='chbox';
}


if (document.getElementById('rsType'+i))
{
document.getElementById('rsType'+i).className='chbox';
}


}








  for(i=0;i<TitleVid+1;i++) 
{

if (document.getElementById('rsClas'+i+p_p))
{
document.getElementById('rsClas'+i+p_p).className='chbox';
}

if (document.getElementById('rsClas'+i))
{
document.getElementById('rsClas'+i).className='chbox';
}
}



if (oldd=='chbox')
{
document.getElementById('rsType'+id+p_p).className='chboxS'








for (i=0;i<document.getElementById("TypeID").options.length;i++) 
{
			if ((""+document.getElementById("TypeID").options[i].value)==""+id)	
			{
				document.getElementById("TypeID").options[i].selected=true
				
			}


}












cd=rsTY[id].split(",")
  for(i=0;i<cd.length-1;i++) 
{

if (document.getElementById(cd[i]+p_p))
{
document.getElementById(cd[i]+p_p).className='chboxS';
}




if (document.getElementById(cd[i]))
{
document.getElementById(cd[i]).className='chboxS';
}


}

}else{

document.getElementById('rsType'+id+p_p).className='chbox'




for (i=0;i<document.getElementById("TypeID").options.length;i++) 
{
			if ((""+document.getElementById("TypeID").options[i].value)=="0")	
			{
				document.getElementById("TypeID").options[i].selected=true
				
			}


}



}




}


function  svc (id,q)
{
p_p=''
 

if (document.getElementById('rsClas'+id+p_p).className=='chboxS')
{
document.getElementById('rsClas'+id+p_p).className='chbox'
}else{
document.getElementById('rsClas'+id+p_p).className='chboxS'
}

p_p='r'
if (document.getElementById('rsClas'+id+p_p).className=='chboxS')
{
document.getElementById('rsClas'+id+p_p).className='chbox'
}else{
document.getElementById('rsClas'+id+p_p).className='chboxS'
}

}




function  svc1 (id,q)
{

p_p=''
if (document.getElementById('rsClas_'+id+p_p).className=='chboxS')
{

cd=rsCl[id].split(",")
  for(i=0;i<cd.length-1;i++) 
{

if (document.getElementById(cd[i]+p_p))
{
document.getElementById(cd[i]+p_p).className='chbox';
}
}


document.getElementById('rsClas_'+id+p_p).className='chbox'
}else{




cd=rsCl[id].split(",")
  for(i=0;i<cd.length-1;i++) 
{

if (document.getElementById(cd[i]+p_p))
{
document.getElementById(cd[i]+p_p).className='chboxS';
}
}




document.getElementById('rsClas_'+id+p_p).className='chboxS'
}














p_p='r'
if (document.getElementById('rsClas_'+id+p_p).className=='chboxS')
{

cd=rsCl[id].split(",")
  for(i=0;i<cd.length-1;i++) 
{

if (document.getElementById(cd[i]+p_p))
{
document.getElementById(cd[i]+p_p).className='chbox';
}
}


document.getElementById('rsClas_'+id+p_p).className='chbox'
}else{




cd=rsCl[id].split(",")
  for(i=0;i<cd.length-1;i++) 
{

if (document.getElementById(cd[i]+p_p))
{
document.getElementById(cd[i]+p_p).className='chboxS';
}
}




document.getElementById('rsClas_'+id+p_p).className='chboxS'
}

}



function  SEARCHH(pp,s)
{ w='search'
page=pp





if (s=='qs')  q=document.getElementById('qs').value;

if (s=='q1')  q=document.getElementById('q1').value;


document.getElementById("rsearch").className="hid"
document.getElementById("search").className="vis"

cm_load();

}

function  clalMove(w)
{
ww=document.getElementById('caldiv0').style.marginLeft
ww=ww.replace('px', '')
//alert (ww)
if (w==1)
{
if (ww<=-1)
{
 document.getElementById('caldiv0').style.marginLeft=(ww-1+1)+181+'px';
}else{
 document.getElementById('caldiv0').style.marginLeft='0px';
}

 }


if (w==0)
{
//if (ww>=-1266) document.getElementById('caldiv0').style.marginLeft=(ww)-181+'px';
if (ww>=-1628) document.getElementById('caldiv0').style.marginLeft=(ww)-181+'px';
 }


}












function setFlbanner(pId){ 

try
{


	var flashObj; 
	if (navigator.appName.indexOf("Microsoft") != -1) {
		 flashObj = window["banner"]; 
	} else { 
		flashObj = document["banner"]; 
	 } 



flashObj.SetWorkMode(pId);
}
catch(Error){}


}





function setRegion(regionId){


if (w=='region')
{
document.location.href='/russia/?id='+rmap[regionId];
}
else
{
vr(regionId);
}


				return false;
			}
			
			function setFlRegion2(regionId){

				document.interactiveMap.setRegion(regionId);
}

function setFlRegion(regionId){ 
	var flashObj; 
	if (navigator.appName.indexOf("Microsoft") != -1) {
		 flashObj = window["interactiveMap"]; 
	} else { 
		flashObj = document["interactiveMap"]; 
	 } 

try
{
flashObj.setRegion(regionId);
}
catch(Error){}


}


function jumpToLangSite(lang){
var newLocation = window.location.href;
var startChar = window.location.href.indexOf("welcome2russia.ru");

	if(lang && lang.length > 1)
		newLocation = window.location.protocol + "//" + lang + "." + window.location.href.substr(startChar, window.location.href.length);
	else
		newLocation = window.location.protocol + "//" + window.location.href.substr(startChar, window.location.href.length);
	window.location.href = newLocation;
}
