

/*   */
function getParams() {
    var idx = document.URL.indexOf('?');
    var tempParams = new Object();
    if (idx != -1) {
    	var pairs = document.URL.substring(idx+1, document.URL.length).split('&');
    	for (var i=0; i<pairs.length; i++) {
    			nameVal = pairs[i].split('=');
    			tempParams[nameVal[0]] = nameVal[1];
    	}
    }
 	return tempParams;
}


/*   */
var sections  = new Array();
		  sections ['kich_gorodok'] = ["stories","36","600"];    
		  sections ['gorelovka'] = ["stories","30","600"];  
		  sections ['karolina_kids'] = ["stories","16","600"]; 
		  sections ['portraits'] = ["stories","40","600"];
		  sections ['offbeat'] = ["stories","22","600"];
		  sections ['bolshoi'] = ["stories","20","600"];
		  sections ['izvestiya'] = ["stories","13","600"];
		  sections ['kids'] = ["stories","7","600"];
		  sections ['sharnavka'] = ["stories","27","600"];
 		
	
/*   */	
var section_texts  = new Array();
		  section_texts ['kich_gorodok'] = ["Portraits of local people living in dying villages around Kichmengsky Town (locals call it Kich Gorodok), a district center  in Vologda region, Russia."];
		  section_texts ['gorelovka'] = ["Gorelovka is small village in the middle of taiga in 800 km from Novosibirsk. This place is hard to find even in the Google Map. That's why it is the best place to escape and hide. Many years ago Christian Old Believers came here to avoid church reform. Then 'kulaks' (wealthy peasant) chose this place to escape from Soviet rule. Now many 'new world antagonists' came here to live without passports, internet, personal numbers and government. Special for Russian Reporter"];  
	section_texts ['karolina_kids'] = ["Portraits of kids in pioneer camps and at home."];
	section_texts ['portraits'] = ["Portraits<br><br>Personal and editorial portraits."];
	section_texts ['offbeat'] = ["In these portraits I tried to convey the complexity of adolescent identity and high intense feeling that adults will never be able to feel again. Both emotionally and physically these people feel like aliens, strangers, freaks. They like to change their appearance the more often the better as they want to escape from themselves, hide their real face. So at some point it becomes difficult to understand what they actually are. They practice in transgender, homosexuality, body modifications, pierce and cutting themselves. They prefer to use nicknames and to live in some kind of parallel reality, an intermediate area, which is alien to the geographical divisions and political laws, which is not part of any absolute reality or deliberately invented fiction, but is created by its own rituals and rules of behavior, where the boundary between good and evil, joy and sadness, innocence and perversity, real and unreal, as well as reality and fiction becomes very vague."];
	section_texts ['bolshoi'] =	["Bolshoi for Hemispheres mag<br><br>Moscow's Bolshoi Theater is the world's preeminent stage for ballet. In 2005, its doors shut for a nearly $1 billion renovation. Now, after six years of repair, the Bolshoi is back."];
	section_texts ['izvestiya'] =	["Izvestia for Bolshoi Gorod<br><br>One of the most famous newspaper in Russia (has been published since 1917) moved from it's historical building and 80% of employers were laid off. I shot last days if Izvestia in an old building and retired people."];
	section_texts ['kids'] =	["Kids 2000 for Russian Reporter<br><br>Portraits of kids who were born in early 2000-th in Russia."];
	section_texts ['sharnavka'] =	["Sharnavka for Russian Reporter<br><br>In summer 2010 wood fire destroyed a lot of villages in Russia. Thousands of people lost everything they had. Sharnavka was burned down too. Nine houses in ten were totally burned. But one house was survived. And all the people came in this house and began living together."];   
		
		  
var captions  = new Array();
		  captions ['kich_gorodok'] = ["Antonina, Tatiana and Nastya. Ploskovo", "Ksenia and Galya. Kich Gorodok", "At home. kich Gorodok", "Sergey. Saraevo", "Nina Alexeevna Lobanova. Zacharovo", "Red Corner. Kich Gorodok", "Vladimir and his daughter.Kich Gorodok", "Sasha, Valentina and Maxim. Kurilivo", "Brothers", "Kichmenga river", "Slava and Alxey. Kich Gorodok", "Galya and Sveta. Ploskovo", "House of culture. Nizhniy Enangsk", "Lera and Sonya. Kich Gorodok", "Vova. Kich Gorodok", "At home. Ploskovo", "Oleg. Nizhniy Enangsk", "Galya. Ploskovo", "At home. Kurilovo", "Dasha.Nizhniy Enangsk", "Cafe. Kich Gorodok", "Sergey and Nikolay. Kich gorodok", "At home. Zakharovo", "Flowers. Kurilovo", "Galina. Kich Gorodok", "Mat. Kurilivo", "Maxim. Kurilovo", "Lera. Zakharovo", "Nina Timofeevna. Zakharovo", "At home. Zakharovo", "Forest", "Family. Ploskovo", "Abandoned church", "Nastya. kich Gorodok", "Football on sunset. Kich gorodok", "Kich gorodok"];  		  
		  captions ['gorelovka'] = ["Vova and his cat", "Sheep", "Girls", "Motorbike", "Church", "Friends", "Church 2", "Local", "Mother's portrait", "Morning", "Lenin", "Alena", "Church", "Kitchen", "Couple", "Home", "Boots", "Carrots", "Nadya", "Pies", "Zaporozhets", "Sheep 2", "Football team", "Meat", "Barn", "Home flowers", "Ashtray", "Milk Farm", "Field", "Sky"];  
		  captions ['karolina_kids'] = ["Lera. Orlyonok. 2009", "Michael. Moscow. 2010", "Ira and Nastya. Moscow. 2011", "Lina. Orlyonok. 2009", "Vika. Karolina. 2010", "Grisha. Karolina. 2010", "Nelly. Moscow. 2011", "Sonya. Karolina. 2010", "Sisters in cafe. Orlyonok. 2010", "Inga. Orlyonok. 2009", "Vika. Karolina. 2010", "Girls in cafe. Orlyonok. 2009", "Masha and Lisa. Karolina. 2010", "Sasha. Moscow. 2011", "Angelina. Orlyonok. 2009", "Arseniy. Karolina. 2010", "Ira and Arseniy. Karolina", "Nina. Karolina. 2010", "Lena. Karolina. 2010", "Egor. Orlyonok. 2009"]; 
		  captions ['portraits'] = ["Polina Bramon with her hat", "Kate Budnik // for Ink Magazine", "Kate Budnik // for Ink Magazine", "Kate Budnik // for Ink Magazine", "Cold woman // for Psychologies", "Vegans // for Afisha", "Vegans // for Afisha", "Vegans // for Afisha", "Vegans // for Afisha", "Vegans // for Afisha", "Katya Chik", "Odin", "Emmanuel Gorda, dancer // for Big City", "Vadim in cheap hotel. Milan", "Varya", "Anna Dyulgerova // for Nowness", "Muhtar Gusengadzhiev // for book", "Yuriy Grymov, film director // for F5", "Jenny", "Jenny 2", "Kid with wishes // for Psychologies", "Kid with wishes // for Psychologies", "Kid with wishes // for Psychologies", "Irina Polin, artist // for Afisha", "Alexey Kozyr, architect // for Afisha", "Twins", "Artemiy Kotov, linguist // for Russian Reporter", "Anna Mikhalkova, actress and producer // for Black Square", "Svetlana Proskurina, film director // for Russian Reporter", "Sasha", "Zahar Prilepin, writer // for Black square", "Nastya", "Angelina Tareeva, blogger and writer // for F5", "Doctor Liza  for F5", "Max Sharov, bag designer", "Olga Tyson Shumova, DJ", "Tonya // for Big City", "Edik // for Big city", "Popov, the architect", "Lebedev, billionaire"];
		  captions ['offbeat'] = ["Pola Bramon", "Budnik", "Angel Thanatos", "Rita Ritina", "Yana Zombie", "Andrey Moryak", "Dead Bitch", "Tania Mur", "Ki Vi", "Magdana Merlinmon", "Mari Stamina", "Katia and Dima", "Pincher", "Christina Sklonnaya", "Enot", "Liza Agedonia", "Bizzi", "Katya Nenf", "Sabina", "Maddy", "Budnik", "Ello Vampire"];
		  captions ['bolshoi'] =[" ","","","","","","","","","","","","","","","","","","Iksanov, the main director of Bolshoi", "Nikolay Tsiskaridze, the principal dancer"];
		  captions ['izvestiya'] =[" ","","","","","","","","","","","",""];
		  captions ['kids'] =[" ","","","","","",""];
		  captions ['sharnavka'] =["Valeriy Nikolaevich","Wood after fire","Victor, the lumberjack","Greenery","Alexandrovna with her last chiken","Alexandrovna's photographies","Table before dinner","Nikolaevich's car","Nikolaevich at the table","The court","Bogdan, the master of the house","Alexey, the chief cook","Greenary becomes eatery at night","Nikolaevich and his lung cancer","Natasha","Place for the guests","Natasha with Bucha","Aramilya infront of her house","Dinner","In the middle of nowhere. The last house in the village","Deaf-mute Natasha, Bucha and thier new flat","New place for living","Victor is sleeping","Forest","Up", "Dinner","Irina doesn't like to be photographed"];
			
		  /*   */
		  function set(){   
		      var sec_name = getParams()['sec'];      
          	  //alert('set on load = '+sec_name);
			  
			  if(sec_name != null){
				set_section(sections[sec_name][0], sec_name, sections[sec_name][1],sections[sec_name][2]);
			  }
          }

		  /*   */
		  var sectionPath = 'imgs/foto\/';
		  var countersPath = 'counters/';
		  
		  /*   */
		  function set_section(sec_name,sub_sec_name,imgs_num, height){   		    
          	  
			  sec = document.getElementById('section');	
			  sec_text = document.getElementById('section_text');
			  sec_text.innerHTML = '<wrap>'+section_texts[sub_sec_name]+'</wrap>';
			  	 
			  imgs_list=''; 
			
			  imgs_list=imgs_list+'<table><tr>';			      
  			  for(i=1; i <= imgs_num; i++){
  			    	
  				  pic_small = escape(sectionPath+sec_name+'/'+sub_sec_name+'/'+sub_sec_name+'_small/'+""+i+'_resize.jpg');
				  pic_big = escape(sectionPath+sec_name+'/'+sub_sec_name+'/'+""+i+'.jpg');
  				  
     			  imgs_list=imgs_list+'<td valign="top">';
  
  				  pic_capture=captions[sub_sec_name][i-1]+'';		  
				  
  				  imgs_list=imgs_list+'<a href="'+pic_big+'" rel="lightbox['+sub_sec_name+']" title="'+pic_capture+'">'+'<img src="'+pic_small+'"  width="100" height="100" border="0">'+'</a>';
    				  
  				  imgs_list=imgs_list+'</td>';
    			  if (Math.floor(i/5)*5 == i){
    				  imgs_list=imgs_list+'</tr><tr>';
    			  }
  			  }
				
			  sec.innerHTML = imgs_list+'</tr></table>';
			  //alert(' full img_src  = ' + imgs_list);
			  			 
              h= sec.clientHeight;
              self.scrollTo(0,0);
			  
			
          }
