function picture(FileName,size){     
	try { pw.close(); }	catch (exception) {};

	 winOpt="toolbar=0,location=0,"+size;

	 pw=window.open("","pw",winOpt);
     pw.document.open();
     pw.document.writeln("<HTML><TITLE>Рентакаров: прокат автомобилей в Сочи, аренда автомобиля в Сочи, аренда авто Краснодар, прокат автомобилей - Анапа, Новороссийск, Геленджик</TITLE>");  
     pw.document.writeln("<BODY BGCOLOR=#FFFFFF TEXT=#000000 LINK=#000000 leftmargin=0 topmargin=0 marginwidth=0 marginheight=0>");
     pw.document.writeln("<CENTER><P>");
     pw.document.writeln("<IMG SRC='"+FileName+"' BORDER=0>");
     pw.document.writeln("</P></CENTER>");
     pw.document.writeln("</BODY>");
     pw.document.writeln("</HTML>");
}

/*function LoadScript(addr){  
      
   document.getElementById("_ajax").innerHTML="<script></"+"script>";  
  
   setTimeout(
	function(){  
		scr=document.getElementById("_ajax").getElementsByTagName("script")[0];  
		scr.language="javascript";
		if(scr.setAttribute) scr.setAttribute("src",addr);
		else scr.src=addr;  
	},
	10);  
} */


function ChangeStations(select_id, data)
{    
	// поле SELECT в переменную в виде объекта	
    var select = document.getElementById(select_id);
    // очищаем SELECT
    select.options.length = 0;
    // если данных нет - не делаем больше ничего
    if(data.length == 0) return;
    // в массиве arr - строки полученной таблицы
    //var arr = data.split('n');
    // для каждой строки
    for(var i=0; i<data.length; i++){
        // в массиве val - поля полученной таблицы
        val = data[i];
        // добавляем новый объект OPTION к нашему SELECT
        select.options[select.options.length] = new Option(val, val, false, false);
    }	
}


function ScrollPhoto(PhotoId)
{
	if(PhotoId > CarCount - 1 || PhotoId < 0) return;
	if(CarCount <= CellCount) PhotoId = 0; 
	else if(PhotoId > CarCount - CellCount) PhotoId = CarCount - CellCount;
	FirstPhotoId = PhotoId;
	
	for(var i=0; i<PhotoId; i++) document.getElementById("car"+i).style.display = "none";
	for(var i=PhotoId; i<=PhotoId+5; i++) document.getElementById("car"+i).style.display = "";
	for(var i=PhotoId+5; i<CarCount; i++) document.getElementById("car"+i).style.display = "none";
	
}

 
/*function ScrollPhoto(PhotoId)
{
	if(PhotoId > Photo_list.length - 1 || PhotoId < 0) return;
	if(Photo_list.length <= CellCount) PhotoId = 0; 
	else if(PhotoId > Photo_list.length - CellCount) PhotoId = Photo_list.length - CellCount;
	
	//if(PhotoId == FirstPhotoId) return;
	
	var j = PhotoId;
	var aclass;
	for(var i=1; i<=CellCount; i++) {		
		
		if(j >= Photo_list.length) document.getElementById('imgbox'+i).innerHTML = ''; 
		else { 
			aclass = (j == CurrentPhotoId) ? 'class="imgsel"' : '';
			document.getElementById('imgbox'+i).innerHTML = '<a href="ajax/?mode=showcar&car_id='+Photo_list[j][3]+'" rel="lyteframe" title="" rev="width: 600px; height: 350px; scrolling: no;"><img src="'+Photo_list[j][0]+'" width="'+Photo_list[j][1]+'" height="'+Photo_list[j][2]+'" border="0" id="smphoto'+j+'" /></a>';
			// LoadScript(\'ajax/?mode=showcar&car_id='+Photo_list[j][3]+'\');showLayer();
		}
		j++;
	}
	
	FirstPhotoId = PhotoId; 
	return;
}*/

