var ssInitialized = false;

if (self.parent.frames.length == 0) {
	if (isMain()) {
		initSS()
	}
}

var mainLayer = document.getElementById('contentMain');

function initSS() {
	if (ssInitialized) return;
	document.getElementById('contentMain').style.display = 'block'
	$('#slideshow').crossSlide({
		sleep: 2,
		fade : 2
	}, [
	    { src: sspath+'/1.jpg' },
	    { src: sspath+'/2.jpg' },
	    { src: sspath+'/3.jpg' },
	    { src: sspath+'/4.jpg' },
	    { src: sspath+'/5.jpg' },
	    { src: sspath+'/6.jpg' },
	    { src: sspath+'/7.jpg' }
	]);
	ssInitialized = true;
}

function slideStop() {
	mainLayer.style.display = 'none';
	$('#slideshow').crossSlideStop()
}

function slideStart() {
	initSS()
	mainLayer.style.display = 'block';
	$('#slideshow').crossSlideRestart()
}

function toggleMain() {
	if (mainLayer.style.display != 'none')
		slideStop();
	else
		slideStart();
}

function hideMain() {
	slideStop();
}

function forceMain() {
	document.getElementById('contentMain').style.display = 'block'
	document.getElementById('slideshowContainer').style.display = 'block'
	document.getElementById('contentMain').style.height = ''
	slideStart();
}

function showMain() {
	if (mainLayer.style.display == 'none') {
		slideStart();
	}
}

function ifMain() {
	if (!isMain()) slideStop(); else {
	}
}

function isMain() {
	var temp = window.location.toString().split('/').pop()
	if (temp != 'index.html' && temp != 'frontend_dev.php' && temp != 'index.php' && temp != '') return false;
	else return true;
}

