var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
var canshow=0;
var sss=document.location.href;
var totplit=0;
var stukflag=0;
var vikladFlag=0;
var haveTovars=0;
var plitid=[];
var resulta=0; //пока ничего нету...

var mouseX, mouseY;
	myns4 = (document.layers)? true:false
	myie4 = (document.all)? true:false
	if (myns4) {document.captureEvents(Event.MOUSEMOVE);}
	document.onmousemove=mousemove;
function mousemove(e) {
	if (myns4) {mouseX=e.pageX;mouseY=e.pageY}
	if (myie4) {mouseX=event.x;mouseY=event.y}
}

function bigMe(targ,bigurl,smallurl){
}

function smallMe(targ,bigurl,smallurl){
}


function setTop(loc){
	//надо сделать #top в конце, причём тока один
	if(loc.indexOf('#')>0){
		loc=loc.substring(0,loc.indexOf('#'));
	}
	loc=''+loc+'#top';
//	alert(loc);
	return loc;
}

// rub, hormenu_recall,  - три обьекта сцуконах..

function rubFUCK09fs_DoFSCommand(command, args) {
  var rubFUCK09fsObj = InternetExplorer ? rubFUCK09fs : document.rubFUCK09fs;
//  alert("function call = opening " add sss);
  if(command=="getInter"){
	  si(args); //срабатывает
  }else{
	  window.document.rubFUCK09fs.SetVariable("curURL",sss);
  }
}

function si(intr){
  if(typeof(interoHere)!='undefined'){
     if((intr!='')&&(intr!='#')){
	  window.document.intero1.SetVariable('urulli',intr);
     }
  }
}

if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && 
        navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	document.write('<SCRIPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('Sub rubFUCK09fs_FSCommand(ByVal command, ByVal args)\n');
	document.write('  call rubFUCK09fs_DoFSCommand(command, args)\n');
	document.write('end sub\n');
	document.write('</SCRIPT\> \n');
}








function plittosteno_DoFSCommand(command, args) {
  var plittostenoObj = InternetExplorer ? plittosteno : document.plittosteno;
  //
  // Place your code here...
  //
}
// Hook for Internet Explorer 
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && 
	  navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	document.write('<SCRIPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('Sub plittosteno_FSCommand(ByVal command, ByVal args)\n');
	document.write('  call plittosteno_DoFSCommand(command, args)\n');
	document.write('end sub\n');
	document.write('</SCRIPT\> \n');
}

function setUrl(){
	if(window.document.plittosteno==null){
	}else{
		if(location.href.indexOf('www')<0){
			//на onLoad - перенаправление на стр. с www - чтобы работало всё...
			location.href='http://www.'+location.href.substring(location.href.indexOf('//')+2);
		}
		var plittostenoObj = InternetExplorer ? plittosteno : document.plittosteno;
		window.document.plittosteno.SetVariable("urlo",document.location.href);
//		alert('allset');
	}
}






function starta(){ 
  //сообщаем верхушке, где мы находимся..
  //  var hormenu_recallObj = InternetExplorer ? hormenu_recall : document.hormenu_recall;
  //  window.document.hormenu_recall.SetVariable('urla',sss);
}








function intromovie_loadinterior_DoFSCommand(command, args) {
  var intromovie_loadinteriorObj = InternetExplorer ? intromovie_loadinterior : document.intromovie_loadinterior;
}
function setInt01(numbera) {
  var intromovie_loadinteriorObj = InternetExplorer ? intromovie_loadinterior : document.intromovie_loadinterior;
  window.document.intromovie_loadinterior.SetVariable("picUrlTxt",'/news/'+numbera+'.html&tpl=robomain&tpltovars=robotovars');
  window.document.intromovie_loadinterior.SetVariable("picUrlTxtShort",'/news/'+numbera+'.html');
}
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && 
	  navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	document.write('<SCRIPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('Sub intromovie_loadinterior_FSCommand(ByVal command, ByVal args)\n');
	document.write('  call intromovie_loadinterior_DoFSCommand(command, args)\n');
	document.write('end sub\n');
	document.write('</SCRIPT\> \n');
}






function checkperenoso(typo){
//	alert(''+masscountero+' переходит в '+typo);
	if((masscountero!="гранит")&&(masscountero!="напольная")&&((masscountero==typo)||((masscountero=="плитка")&&(typo=="спутник"))||((masscountero=="спутник")&&(typo=="напольная"))||((masscountero=="плитка")&&(typo=="напольная")))){
//		document.write('переноссссссссс');
	}else{
		document.write('</table><table class="tvr"><tr></tr>'); //продолжение направо
		masscountero=typo; 
	}
}


function showOne(myWx,myWy,myName,myMinPic,myBigPic,myType,myParent,myHref){
	//вычисляем высоту изображения
	resulta=1; //что-то нашли всётаки..
	var imgHo=0;
	var imgWo=0;
	if(myWx*myWy){
		//всё ненулевое - пробуем напрямую зарядить размеры исходя из пропорции 33=100
		imgWo=120*myWx/33;
		imgHo=120*myWy/33;
	}
	if(myWx==44){
		imgWo=160;
	}
	if(myWx==33.3){
		imgWo=120;
	}
	if(myWx==33){
		imgWo=120;
	}
	if(myWx==30){
		imgWo=108;
	}
	if(myWx==25){
		imgWo=90;
	}
	if(myWx==20){
		imgWo=72;
	}
	if(myWx==11){
		imgWo=40;
	}
	if(myWx==10){
		imgWo=36;
	}

	//высота вычисляется после ширины
	if(myWy==44){
		imgHo=160;
	}
	if(myWy==33.3){
		imgHo=120;
	}
	if(myWy==33){
		imgHo=120;
	}
	if(myWy==30){
		imgHo=108;
	}
	if(myWy==25){
		imgHo=90;
	}
	if(myWy==20){
		imgHo=72;
	}
	if(myWy==11){
		imgHo=40;
	}
	if(myWy==10){
		imgHo=36;
	}
	if(myWy==7){
		imgHo=25;
	}
	if(myWy==5){
		imgHo=18;
	}
	if(myWy==3){
		imgHo=11;
	}
	//допущения для специальных размеров...внутри разных коллекций разные размеры.
	if(imgHo*imgWo){
		if(vikladFlag){
		}else{  
			//если интерьера не было - выкладка не инициализирована. 
			// надо инициализировать. проверяем:
			run_movie('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ID="plittosteno" WIDTH="305" HEIGHT="345" ALIGN=""> <PARAM NAME=movie VALUE="/plittosteno0_vita.swf?v17"> <PARAM NAME=quality VALUE=high> <PARAM NAME=salign VALUE=T> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED src="/plittosteno0_vita.swf?v17" quality=high salign=T bgcolor=#FFFFFF  WIDTH="305" HEIGHT="345" swLiveConnect=true ID="plittosteno" NAME="plittosteno" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>');
			// создаём разделение, как если бы это был интерьер...
			masscountero='интерьер';
			checkperenoso(myType);
			document.write('</td></tr></table><table class="tvr"><tr><td style="height: 220px"><a href="'+myHref+'" onclick="aboutURL(\''+myHref+'\');return false;">');
			vikladFlag=1;
		}
		//оба ненулевые... ставим их.
		document.write('<img onMouseOut="document.getElementById(\'bigabiga\').src=\'/images/sandwatch.gif\';document.getElementById(\'mybigdiv\').style.display=\'none\';" onMouseOver="document.getElementById(\'mybigdiv\').style.display=\'block\';document.getElementById(\'abiga\').target=\'blank\';document.getElementById(\'abiga\').href=\''+myHref+'\';document.getElementById(\'bigabiga\').alt=\'керамическая плитка - '+myType+' '+myName+'\';document.getElementById(\'bigabiga\').src=\''+myBigPic+'\';" src="'+myMinPic+'" alt="керамическая плитка - '+myType+' '+myName+'" width='+imgWo+' height='+imgHo+'>');
		//document.write('<br>'+imgWo+'px*'+imgHo+'px ');
	}else if(imgHo){
		alert('нет ширины '+imgWo);
	}else if(imgWo){
		alert('нет высоты');
	}else{
		//оба размера нулевые - ВОЗМОЖНО ЭТО И НЕ ПЛИТКА ВОВОСЕ!
		document.write('<img onMouseOut="document.getElementById(\'bigabiga\').src=\'/images/sandwatch.gif\';document.getElementById(\'mybigdiv\').style.display=\'none\';" onMouseOver="document.getElementById(\'mybigdiv\').style.display=\'block\';document.getElementById(\'abiga\').target=\'blank\';document.getElementById(\'abiga\').href=\''+myHref+'\';document.getElementById(\'bigabiga\').alt=\'керамическая плитка - '+myType+' '+myName+'\';document.getElementById(\'bigabiga\').src=\''+myBigPic+'\';" src="'+myMinPic+'" alt="'+myName+'"><br>');
		if(vikladFlag){
		}else{
			run_movie('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ID="plittosteno" WIDTH="305" HEIGHT="345" ALIGN=""> <PARAM NAME=movie VALUE="/plittosteno0_vita.swf?v17"> <PARAM NAME=quality VALUE=high> <PARAM NAME=salign VALUE=T> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED src="/plittosteno0_vita.swf?v17" quality=high salign=T bgcolor=#FFFFFF  WIDTH="305" HEIGHT="345" swLiveConnect=true ID="plittosteno" NAME="plittosteno" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT><br>');
			vikladFlag=1;
		}
	}
	if((myType.indexOf("рдюр")>0)||(myType.indexOf("екор")>0)||(myType.indexOf("анно")>0)||(myType.indexOf("авка")>0)||(myType.indexOf("андаш")>0)){
		stukflag=1;	
	}else{
		stukflag=0;
	}
}



function showOneVita(myWx,myWy,myName,myMinPic,myBigPic,myType,myParent,myHref){
	//вычисляем высоту изображения
	var imgHo=0;
	var imgWo=0;
	if(myWx*myWy){
		//всё ненулевое - пробуем напрямую зарядить размеры исходя из пропорции 33=100
		imgWo=120*myWx/33;
		imgHo=120*myWy/33;
	}
	if(myWx==44){
		imgWo=160;
	}
	if(myWx==33.3){
		imgWo=120;
	}
	if(myWx==33){
		imgWo=120;
	}
	if(myWx==30){
		imgWo=108;
	}
	if(myWx==25){
		imgWo=90;
	}
	if(myWx==20){
		imgWo=72;
	}
	if(myWx==11){
		imgWo=40;
	}
	if(myWx==10){
		imgWo=36;
	}

	//высота вычисляется после ширины
	if(myWy==44){
		imgHo=160;
	}
	if(myWy==33.3){
		imgHo=120;
	}
	if(myWy==33){
		imgHo=120;
	}
	if(myWy==30){
		imgHo=108;
	}
	if(myWy==25){
		imgHo=90;
	}
	if(myWy==20){
		imgHo=72;
	}
	if(myWy==11){
		imgHo=40;
	}
	if(myWy==10){
		imgHo=36;
	}
	if(myWy==7){
		imgHo=25;
	}
	if(myWy==5){
		imgHo=18;
	}
	if(myWy==3){
		imgHo=11;
	}
	//допущения для специальных размеров...внутри разных коллекций разные размеры.
	if(imgHo*imgWo){
		//оба ненулевые... ставим их.
		document.write('<img  onMouseOut="document.getElementById(\'bigabiga\').src=\'/images/sandwatch.gif\';document.getElementById(\'mybigdiv\').style.display=\'none\';" onMouseOver="document.getElementById(\'mybigdiv\').style.display=\'block\';document.getElementById(\'abiga\').target=\'blank\';document.getElementById(\'abiga\').href=\''+myHref+'\';document.getElementById(\'bigabiga\').alt=\'керамическая плитка - '+myType+' '+myName+'\';document.getElementById(\'bigabiga\').src=\''+myBigPic+'\';" src="'+myMinPic+'" alt="керамическая плитка - '+myType+' '+myName+'" width='+imgWo+' height='+imgHo+'>');
		//document.write('<br>'+imgWo+'px*'+imgHo+'px ');
	}else if(imgHo){
		alert('нет ширины '+imgWo);
	}else if(imgWo){
		alert('нет высоты');
	}else{
		//оба размера нулевые - ВОЗМОЖНО ЭТО И НЕ ПЛИТКА ВОВОСЕ!
		document.write('<img onMouseOut="document.getElementById(\'bigabiga\').src=\'/images/sandwatch.gif\';document.getElementById(\'mybigdiv\').style.display=\'none\';" onMouseOver="document.getElementById(\'mybigdiv\').style.display=\'block\';document.getElementById(\'abiga\').target=\'blank\';document.getElementById(\'abiga\').href=\''+myHref+'\';document.getElementById(\'bigabiga\').alt=\'керамическая плитка - '+myType+' '+myName+'\';document.getElementById(\'bigabiga\').src=\''+myBigPic+'\';" src="'+myMinPic+'" alt="'+myName+'">');
//		document.write('<br> 5555 !!!');
	}
	if((myType.indexOf("рдюр")>0)||(myType.indexOf("екор")>0)||(myType.indexOf("анно")>0)||(myType.indexOf("авка")>0)||(myType.indexOf("андаш")>0)){
		stukflag=1;	
	}else{
		stukflag=0;
	}
}

function about(myid,myalias){
      window.open('/%D0%BA%D0%B0%D1%84%D0%B5%D0%BB%D1%8C_%D0%BF%D0%BB%D0%B8%D1%82%D0%BA%D0%B0/'+myalias+'/'+myid+'.html', '', 
			'width='+(screen.width-40)+',height='+(screen.height-140)+',top=10,left=20,resizable=yes,location=no,status=no,toolbar=no,directories=no,scrollbars=yes');
}

function aboutProfi(myid){
      window.open('/cms/view.php?load=one_news&id='+myid+'&tpl=profi_main_one', '', 
			'width='+(screen.width-40)+',height='+(screen.height-140)+',top=10,left=20,resizable=yes,location=no,status=no,toolbar=no,directories=no,scrollbars=yes');
}

function aboutURL(myHref){
      window.open(myHref, '', 
			'width='+(screen.width-40)+',height='+(screen.height-140)+',top=10,left=20,resizable=yes,location=no,status=no,toolbar=no,directories=no,scrollbars=yes');
}
