// JavaScript Document
var current_anonce_number = 1;
function switchanonce( anonce_number ) {
	if ( anonce_number == current_anonce_number) { return false; }
	offdiv = document.getElementById( "at" + current_anonce_number );
	ondiv = document.getElementById( "at" + anonce_number );
	
	offdiv.className = "op0";
	document.getElementById( "l" + anonce_number ).className = "textbold";
	document.getElementById( "l" + current_anonce_number ).className = "textnormal";
	
	setTimeout ( 'offdiv.className="op0 inviinitial"; ondiv.className = "op1";', 500);
	
	current_anonce_number = anonce_number;
	return false;
}



// for template gallery on first page
var threfs = new Array(
			"/templates/test1_r.png", "/templates/test2_r.png", "/templates/test3_r.png", "/templates/test4_r.png", "/templates/test1_r.png", "/templates/test2_r.png",
			"/templates/test2_r.png", "/templates/test2_r.png", "/templates/test2_r.png", "/templates/test2_r.png", "/templates/test2_r.png", "/templates/test2_r.png", 
			"/templates/test3_r.png", "/templates/test3_r.png", "/templates/test3_r.png", "/templates/test3_r.png", "/templates/test3_r.png", "/templates/test3_r.png"
			);

var tsrs = new Array (
			"/templates/test1_r.png", "/templates/test2_r.png", "/templates/test3_r.png", "/templates/test4_r.png", "/templates/test1_r.png", "/templates/test2_r.png", 
			"/templates/test2_r.png", "/templates/test2_r.png", "/templates/test2_r.png", "/templates/test2_r.png", "/templates/test2_r.png", "/templates/test2_r.png", 
			"/templates/test3_r.png", "/templates/test3_r.png", "/templates/test3_r.png", "/templates/test3_r.png", "/templates/test3_r.png", "/templates/test3_r.png"
			);
var num_of_6el_lines = 3;
var cur_block = 0;

function templates_go_forward ( go_direction ) {
		cur_block = cur_block + go_direction;
		if ( cur_block < 0 ) { cur_block = num_of_6el_lines -1 ; }
		if ( cur_block > num_of_6el_lines -1 ) { cur_block = 0;} 
		
		var i;
		for ( i = 1; i < 7; i ++ ) {
			var array_index = cur_block * 6 + i - 1;
			document.getElementById( "templ" + i ).src = tsrs[array_index];
			document.getElementById( "thref" + i ).href = threfs[array_index];
		}
		return false;
}



