// JavaScript Document

<!--

if	(navigator.appName == "Netscape")

{

 layerRef="document.layers";

 styleSwitch="";

 visibleVar="block";

}

else if (navigator.appName == "Microsoft Internet Explorer")

{

 layerRef="document.all";

 styleSwitch=".style";

 visibleVar="block";

}

 

function changeSearchForm(){

var nform = document.changeForm.searchCategory.options[document.changeForm.searchCategory.selectedIndex].value;

for(i=0; i<document.all("searchTbl").length; i++) document.all("searchTbl",i).style.display="none"; 

document.all("searchTbl",nform).style.display="block";

} 



function topLinkHover(obj, type)

{	

 if (obj == null) return;

 if(type==1)

 { 

  obj.style.border="#a1c6eb 1px solid";

  obj.style.backgroundColor="#3484d7";

 }

 else

 {

  obj.style.border="#1e77d3 1px solid";

  obj.style.backgroundColor="#1e77d3";

 }

}

function leftHover(type,obj)

{

 if(obj==null) return;

 if(type==1)

 { 

 // obj.style.backgroundColor="rgb(221,238,255)";
  obj.style.background = URL("http://www.skags.ru/Images/head/bg2.jpg");

 }

 else

 {

//  obj.style.backgroundColor="#6b7a8d";
  obj.style.background = URL("http://www.skags.ru/Images/head/bg2.jpg");
 }

}

function Right_Change(num)

{
  var browser_name = navigator.appName;
  var browser_version = parseFloat(navigator.appVersion);

 if (browser_name == "Microsoft Internet Explorer")
 {
  for(i=0; i<document.all("right_info").length; i++)

  {  document.all("right_info",i).style.display="none"; }

  document.all("right_info",num-1).style.display="block";
 }

 else
 {
    if (window.location.href.indexOf('&left') == -1)
    {
	if (window.location.href.indexOf('&extra=') != -1) {window.location.href = window.location.href.replace(/&extra=[0-9]+/, "&extra="+num);}
        else {window.location.href += "&extra="+num;}
    }
    else
    {
	if (window.location.href.indexOf('&extra=') != -1) {var str = window.location.href.replace(/&extra=[0-9]+/, "&extra="+num); window.location.href = str.replace(/&left=[0-9]+/,"");}
        else {var str = window.location.href.replace(/&left=[0-9]+/,""); window.location.href = str + "&extra=" + num;}
    }
 }
  // cmslink url change  
  if (window.location.href.indexOf('skags.ru/cms') != -1) { document.getElementById("cmslink").href="http://www.skags.ru/cms?extra="+num;}
}

function Open_Puls(puls_id)

{
	obj = document.getElementById(puls_id);

	if (obj.style.display == "none")

	{  obj.style.display="block"; }

	else

	{ obj.style.display="none"; }

}


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

function Left_Change(num, num_r, num_nd)

{
 if (navigator.appName == "Microsoft Internet Explorer")
 {
   if(document.all("left_menu",num-1).style.display=='block')

   {

     document.all("left_menu",num-1).style.display='none';

     document.all("left_menu_image",num-1).src="./Images/plus.gif";

     if (num_nd == 1) {document.all("no_data",0).style.display='none';}

   }

   else

   {

     document.all("left_menu",num-1).style.display='block';

     document.all("left_menu_image",num-1).src="./Images/minus.gif";

     if (num_nd == 1) {document.all("no_data",0).style.display='block';}

   } 
   Right_Change(num_r);
 }

else
    {
      if (window.location.href.indexOf('&extra=') == -1)
      {
	if (window.location.href.indexOf('&left=') != -1) {window.location.href = window.location.href.replace(/&left=[0-9]+/, "&extra="+num_r+"&left="+num);}
	else window.location.href += "&extra="+num_r+"&left="+num;
      }
      else
      {
	if (window.location.href.indexOf('&left=') != -1) {var str = window.location.href.replace(/&extra=[0-9]+/,"&extra="+num_r); window.location.href = str.replace(/&left=[0-9]+/, "&left="+num);}
	else {var str = window.location.href.replace(/&extra=[0-9]+/,"&extra="+num_r); window.location.href = str + "&left="+num;}
      }
    }

}

function ChangeColor(obj)

{

 if (obj.style.backgroundColor=="lightgrey") {obj.style.backgroundColor="#d9e6f2"}

 else {obj.style.backgroundColor="lightgrey";}   

}



function showLayer2(layerName, obj)

{

 eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.display=""+visibleVar');

 obj.style.backgroundColor="lightgrey";

};



function hideLayer2(layerName, obj)

{

 eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.display="none"');

 obj.style.backgroundColor="#d9e6f2";

};



function showLayer(layerName, obj)

{

 eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.display=""+visibleVar');	   

};



function hideLayer(layerName, obj)

{

 eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.display="none"');

};

/*
function leftShow(layerName,type,obj)

{

 if(obj==null) return;

 if(type==1)

 {

  obj.style.backgroundColor="rgb(221,238,255)";

  eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.display=""+visibleVar');

 }

 else

 {

  eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.display="none"');

  obj.style.backgroundColor="#d9e6f2";

 }  

}
*/

function unspace( qs_element ) {
 return qs_element.split( '+' ).join( ' ' );
}

function enterExtra() {
	var extra = "";
	if ( location.search.length > 1 ) {
		var qs_query = location.search.substring( 1, location.search.length );
	 	var qs_pairs = qs_query.split( '&' );

	 	for ( var qs_index = 0; qs_index < qs_pairs.length; qs_index++ ) {
	  		var qs_element = qs_pairs[qs_index].split( '=' );
			if (qs_element[0] == "extra") extra = unspace( unescape( qs_element[1] ) );
	 	}
	}
	if (extra == "") return;

	if (document.all("right_info",extra-1) == null) {
		setTimeout('enterExtra()', 100);
	} else {
	 	Right_Change(extra);
	}
}

if (navigator.appName == "Microsoft Internet Explorer") enterExtra();

-->
