




picss=new Array();


function displayImg(){
	 var length=displayImg.arguments.length; 
	 for (i=0; i<length; i++)
	 picss[i]=arguments[i];
	if (length==1){
	 document.getElementById('3').style.visibility='visible'; 
	 document.getElementById('3').style.display='block'; 
	 document.getElementById('3').style.backgroundImage='url('+arguments[0]+')'; 
	 document.getElementById('2').style.visibility='hidden';  
	 document.getElementById('2').style.display='none';  
	 document.getElementById('1').style.visibility='hidden';  
	 document.getElementById('1').style.display='none';
	 document.getElementById('rStr').style.visibility='hidden';
	 imgBg=1;
	 return 1;
	}else{
		if(length==2)
		{ document.getElementById('rStr').style.visibility='hidden';}
	 document.getElementById('1').style.backgroundImage='url('+arguments[0]+')'; 
	 document.getElementById('2').style.backgroundImage='url('+arguments[1]+')'; 
	 i=1;
	 imgBg=i;
	 return length;
	 }
	 // document.getElementById('imga').style.backgroundImage = "../web/hs_1.jpg;
	 //document.write("<img src='/web/"+arguments[i]+"' alt=''>");
	 //alert (arguments[1]);
  }



function next(){
	if (flag==1){
	imgBg=1;
		return;
	}
	f=flag;
	
	
	if (count>2 ){
	
	count=count-2;
	if (count==1){
	
	 i++;
	 document.getElementById('3').style.visibility='visible'; 
	 document.getElementById('3').style.display='block'; 
	 document.getElementById('3').style.backgroundImage='url('+picss[i]+')'; 
	 document.getElementById('2').style.visibility='hidden';  
	 document.getElementById('2').style.display='none';  
	 document.getElementById('1').style.visibility='hidden';  
	 document.getElementById('1').style.display='none';
	 document.getElementById('rStr').style.visibility='hidden';
	 document.getElementById('lStr').style.visibility='visible';
	 
	 //i--;
	 imgBg=i+1;
	 count=2;

	 return;
	}
	
	
	i++;
	document.getElementById('1').style.backgroundImage='url('+picss[i]+')';
	i++; 
	document.getElementById('2').style.backgroundImage='url('+picss[i]+')'; 
	imgBg=i;
	
	document.getElementById('lStr').style.visibility='visible';
	

	
	if (i==f-1){
	 //i--;
	document.getElementById('rStr').style.visibility='hidden';
	 }
	//alert(count);
	}
	
	
}

function prev(){
	
	if (flag==1){
	
	return ;
	}
	if (document.getElementById('3').style.visibility=='visible'){
	 document.getElementById('3').style.visibility='hidden'; 
	 document.getElementById('3').style.display='none'; 
	 document.getElementById('2').style.visibility='visible';  
	 document.getElementById('2').style.display='block';  
	 document.getElementById('1').style.visibility='visible';  
	 document.getElementById('1').style.display='block';
	 count=1;
	
	}
	
	if (flag!=count){
		if (count!=1)i--;
	}
	
	if (count<flag ){
	
	//if (i==3)i=2;
	count=count+2;
	i--;
	imgBg=i;
	document.getElementById('2').style.backgroundImage='url('+picss[i]+')'; 
	i--;  
	document.getElementById('1').style.backgroundImage='url('+picss[i]+')';
	document.getElementById('rStr').style.visibility='visible';
	i++;
	if (i==1) {
	//i=1;
	 document.getElementById('lStr').style.visibility='hidden';
	}
	//alert(count);
	}
}



function bigJpg1(imgBg,urls){
//var OpenWindow=window.open("", "newWin", "height="+300+",width="+900+",scrollbars="+1);

pathImg=urls+'/'+imgBg+'.jpg';
//var OpenWindow=window.open("", "newWin", "height=300, width=400, top=0, left=220, menubar=0, resizable=0, status=0, tollbar=0, scrollbars=1");
//var OpenWindow=window.open("", "newwin");
var OpenWindow=window.open ('', 'newwin', config='height=250,width=300,top=10,left=20,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no')

OpenWindow.document.write("<HTML>");
OpenWindow.document.write("<TITLE></TITLE>");
OpenWindow.document.write('<HEAD><script language="JavaScript1.2">');
OpenWindow.document.write('function preladImg1(newIms){');
OpenWindow.document.write('var d=document;'); 
OpenWindow.document.write(' if (d.images) {');
OpenWindow.document.write('picss=new Image();');
OpenWindow.document.write('picss.src=newIms;');
OpenWindow.document.write('}');
//OpenWindow.document.write('x=1;');
//OpenWindow.document.write('while(picss.complete==false){');
//OpenWindow.document.write('}');
//OpenWindow.document.write('alert(picss.complete);');
OpenWindow.document.write('	if (self.screen) {    ');
OpenWindow.document.write('        widthSCR = screen.width;');
OpenWindow.document.write('        heightSCR = screen.height;');
OpenWindow.document.write('}');
OpenWindow.document.write(' 	var picHeigh = picss.height+70;');
OpenWindow.document.write('	var picWidth = picss.width+50;');
OpenWindow.document.write('	if (picHeigh>heightSCR)');
OpenWindow.document.write('	{');
OpenWindow.document.write('		var picWidth = picss.width+26;');
OpenWindow.document.write('		picHeigh=heightSCR-150;');
OpenWindow.document.write('	}');
OpenWindow.document.write('	self.resizeTo(picWidth,picHeigh);');
OpenWindow.document.write('}');
//OpenWindow.document.write("function preladImg1(newIms){"); <meta http-equiv='Content-Type' content='text/html; charset=windows-1251'>
//OpenWindow.document.write("alert (newIms);}");
OpenWindow.document.write("</script></HEAD>");


OpenWindow.document.write('<BODY rightmargin="0" leftmargin="0" onload="'+"preladImg1('"+pathImg+"')"+'"topmargin="0" bottommargin="0" BGCOLOR="white">');
OpenWindow.document.write("<center>");
OpenWindow.document.write("<img src='"+pathImg+"'  alt=''><br>");
OpenWindow.document.write("<a href='' style='color:#000000' onClick='self.close()'>закрыть окно</a><br>");
OpenWindow.document.write("</center>");
OpenWindow.document.write("</BODY>");
OpenWindow.document.write("</HTML>");
OpenWindow.focus();
OpenWindow.document.close();
}



function bigAvi1(imgBg,urls){
pathImg=urls+'/'+imgBg+'.wmv';
var OpenWindow=window.open ('', 'newwin', config='height=300,width=372,top=10,left=20,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no')
OpenWindow.document.write("<HTML>");
OpenWindow.document.write("<TITLE></TITLE>");
OpenWindow.document.write('<HEAD><script language="JavaScript1.2">');
OpenWindow.document.write("</script></HEAD>");
OpenWindow.document.write('<BODY rightmargin="0" leftmargin="0" "topmargin="0" bottommargin="0" BGCOLOR="white">');
OpenWindow.document.write("<center>");
OpenWindow.document.write('<EMBED SRC="'+pathImg+'" HEIGHT="240" WIDTH="320"  ALIGN="center"');
OpenWindow.document.write('</EMBED><br><br>');
OpenWindow.document.write("<a href='' style='color:#000000' onClick='self.close()'>закрыть окно</a><br>");
OpenWindow.document.write("</center>");
OpenWindow.document.write("</BODY>");
OpenWindow.document.write("</HTML>");
OpenWindow.focus();
OpenWindow.document.close();
}

function kont()
{
document.getElementById('kontakt').innerHTML='телефон: 722-55-92<br>почта: <a href="mailto:info@freeagency.ru">info@freeagency.ru</a>';
}

pics = new Array();

function ChangeImg(name) {    
 if(document.images) {
 	for (k=0; k<df; k++){
	 if (name == pics[k][2]){
	 document.images[name].src=pics[k][0].src;
 	}
  }
 }
}

function ChangeImgOff(){
	if (document.images){
		for (k=0; k<df; k++){
			document.images[pics[k][2]].src=pics[k][1].src;
		}
	
	}

}

var df = 0;
function preload(name, first, second) {
 var d=document; 
  if (d.images) {
    pics[df]=new Array();
    pics[df][0]=new Image();
    pics[df][0].src= first;
    pics[df][1]=new Image();
    pics[df][1].src= second;
    pics[df][2]= name; 
    //document.write(pics[i][1].src);
    df++;
  }
}



function loader(){ 
preload('right','images/right_active.gif','images/right.gif');
preload('left','images/left_active.gif','images/left.gif');
preload('one','images/shine.gif','images/spacer.gif');
preload('two','images/shine.gif','images/spacer.gif');
preload('tri','images/shine.gif','images/spacer.gif');
document.getElementById('lStr').style.visibility='hidden';
}