
// ************************ TITLES CONFIGURATION **************************************

var fixTitle = true;

var titles = {
	"beige-white":
	{
		"Дизайн интерьера": {"offset": -90, "height": 30}
	},
	
	"beige":
	{
		"Услуги": {"offset": 0, "height": 30},
		"Контакты": {"offset": -30, "height": 30}	
	},
	
	"white":
	{
		"Портфолио": {"offset": -60, "height": 30}
	},
	
	"brown":
	{
		"Услуги": {"offset": -120, "height": 60}
	}
}


// ************************ TITLES LOGIC **************************************

function fixTitles(){
	if(fixTitle){
		$("h1").each(function(i){
			var title = $(this).text();
			
			if(titles[$(this).attr("class")] && typeof titles[$(this).attr("class")][title] != "undefined"){
				$(this).replaceWith("<div class='title' style='height: " + titles[$(this).attr("class")][title]["height"] + "px;'><img class='png' src='/images/titles.png' width='300' height='480' border='0' alt='" + title + "' style='top: " + titles[$(this).attr("class")][title]["offset"] + "px;'></div>");
			}
		});
	}
}

