/*  Start /_templates/roottemplate/roottemplate.js */



/*  End /_templates/roottemplate/roottemplate.js */

/*  Start /_templates/menu/menu.js */

function showSubmenu(element, action) {
//	alert($(element).next(0).down(1).id);
/*	if($(element).up(0).previous(0).down(1).id == 'submenu_middle') {
		$(element).up(0).previous(0).toggle();
	}*/
	if($(element).down(0).next(0).down(1).id == 'submenu_middle') {
		$(element).down(0).next(0).style.display=action;
	}
}


/*  End /_templates/menu/menu.js */

/*  Start /_templates/roottemplate/roottemplate_product.js */

// BEGIN PRODUCT

var photoClass = Class.create({
	current: 1,
	photos: new Array()
});
		
photo = new photoClass();

function loadContent(url) {	
	// Page
	aParams = {};
	aParams.url = url;
	
	pgx('pageContainer', 'play.site.page', aParams);
	
	// Photo
	$('photoContainer').hide();
	
	aParams = {};
	aParams.action = 'photo';
	aParams.url = url;
	pgx('', 'local.cirkel', aParams);
	
	// Menu
	aURL = url.split('/');
	url = '/' + aURL[1] + '/' + aURL[2] + '/';
	//items = $('menuItems').childElements();
	$$('#menuItems a').each(function(n) {
		n.className = 'select_false';
		if (n.link == url) {
			n.className = 'select_true';
		}
	});
}

function showPhoto() {
	if(photo.photos.length > 0) {
		photo.current = 1;
//		alert(photo.photos[0]);
		$('photoSrc').src = photo.photos[0];
		$('photoContainer').show();
	}
}

function switchPhoto(n) {
	photo.current = (photo.current + n);
	
	if (photo.current < 1) {
		photo.current = photo.photos.length;
	}
	if (photo.current > photo.photos.length) {
		photo.current = 1;
	}
	
	$('photoSrc').src = photo.photos[(photo.current - 1)];
}

// EIND PRODUCT

/*  End /_templates/roottemplate/roottemplate_product.js */

