// JavaScript Document
function pageStart()
{
	//Flashheader
	try
	{
		var flCont = document.getElementById('flash_container');
		Set_AC_FL_RunContent_GET('');
		flCont.innerHTML = AC_FL_RunContent( "codebase","http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0","width","800","height","280","src","flash/top","quality","high","pluginspage","http://www.macromedia.com/go/getflashplayer","movie","flash/top", "wmode", "transparent" );
		Set_AC_FL_RunContent_GET('');
	}catch(e){}
	//Bildergalerie
	try
	{
		hurra_addEvent(document.getElementById('gal_1'),'click',show_gallery_1);	
	}catch(e){}
	try
	{
		hurra_addEvent(document.getElementById('gal_2'),'click',show_gallery_2);	
	}catch(e){}
	//Impressum
	try
	{
		document.getElementById('imprint').href="javascript:void(e());"
		hurra_addEvent(document.getElementById('imprint'),'click',show_imprint);	
	}catch(e){}
	
	
	preload();
}
hurra_registerOnLoad(pageStart);

function e(){};

function show_imprint()
{
	var html = '';
	html += '<div style="width:300px; position:relative;">';
	html += '<div style="position:relative; padding:28px;">';
	html += 'Claus Spitzbart GmbH & CO KG<br />';
	html += 'HEUPLATZ 1 / WIENERGASSE 10<br />';
	html += '9020 KLAGENFURT<br />';
	html += '<br />';
	html += 'Tel <span>+43 (0) 676 470 0676</span><br />';
	html += 'FAX <span>+43 (0) 1804 805 329 32</span><br />';
	html += 'MAIL <a href="mailto:klagenfurt@princs.com">KLAGENFURT@PRINCS.COM</a><br />';
	html += '<br />';
	html += 'UID <span>ATU 63627089</span><br />';
	//html += 'Firmenbuch <span>xxxxxx</span><br />';
	html += 'Wirtschaftskammer <span>Kärnten</span><br />';
	html += 'Gerichtsstand <span>Klagenfurt</span><br />';
	html += '</div>';
	html += '<img src="pix/galerieClose.gif" alt="Impressum schließen" title="Impressum schließen" id="galerieClose" onclick="hurra_unlockPage_firstLevel()"/>';
	html += '</div>';
	hurra_create_2ndWindow(300,html);	
}


var ScrollInterval = false;
var WindowHeight = 159;
var contentBigDefault_top = 0;
var contentBig_top = 0;
function _scroll_up(add)
{
	var ob = document.getElementById("galerieThumbContent");
	if(WindowHeight > ob.offsetHeight + add + contentBig_top)
	{
		window.clearInterval(ScrollInterval);
		contentBig_top = WindowHeight - ob.offsetHeight;
		ob.style.top = contentBig_top + "px";
		ScrollInterval = false;
	}
	else
	{
		contentBig_top = contentBig_top + add;
		ob.style.top = contentBig_top + "px";
	}
}
function _scroll_down(add)
{
	var ob = document.getElementById("galerieThumbContent");
	if(0 <= contentBig_top + add)
	{
		window.clearInterval(ScrollInterval);
		contentBig_top = 0;
		ob.style.top = contentBig_top + "px";
		ScrollInterval = false;
	}
	else
	{
		contentBig_top = contentBig_top + add;
		ob.style.top = contentBig_top + "px";
	}
}
function scroll_content(direction)
{
	if(document.getElementById("galerieThumbContent").offsetHeight < WindowHeight){return false;}
	if(ScrollInterval !== false){ window.clearInterval(ScrollInterval); ScrollInterval = false;}
	switch(direction)
	{
		case "down":
			ScrollInterval = window.setInterval("_scroll_up(-2)", 5);
			break;
		case "up":
			ScrollInterval = window.setInterval("_scroll_down(2)", 5);
			break;
	}
}
function content_stop_scroll()
{
	window.clearInterval(ScrollInterval);
	ScrollInterval = false;
}

function show_gallery_1()
{
	ImgArray = Gal_1_ar;
	show_gallery();
}
function show_gallery_2()
{
	ImgArray = Gal_2_ar;
	show_gallery();
}
var ImgArray = new Array();
function show_gallery()
{
	var html = '';
	html += '<div id="galerieBack">';
	//html += '<img src="pix/galerieTitleStveit.gif" alt="" class="galerieTitle" />';
	html += '<img src="pix/galerieClose.gif" alt="Galerie schließen" title="Galerie schließen" id="galerieClose" onclick="hurra_unlockPage_firstLevel()"/>';
	html += '<div id="galeriePicContainer"><img src="pix/t.gif" alt="" class="t" /><img src="pix/galerieDummyBig2.jpg" alt="" id="galeriePic" /></div>';
	html += '<img src="pix/galerieArrowLeft.gif" onclick="last_img()" alt="" class="galerieArrowHor" style="top:195px; left:13px;" />';
	html += '<img src="pix/galerieArrowRight.gif" onclick="next_img()" alt="" class="galerieArrowHor" style="top:195px; right:13px;" />';
	html += '<div id="galerieThumbsContainer" >';
	html += '<div id="galerieThumbContent" style=" position:relative; top:0px"><div class="clear_both">&nbsp;</div>';

	for(var i  = 0; i < ImgArray.length; i++)
	{
		html += "<div class='galerieThumbContainer' onclick='swap_img("+i+")'><img src='pix/t.gif' alt='' class='t' ><img src='"+ImgArray[i].Thumb.src+"' alt='' class='galerieThumb' /></div>";
	}

	html += '<div class="clear_both">&nbsp;</div></div>';
	html += '</div>';
	html += '<img src="pix/galerieArrowUp.gif" onmouseover="scroll_content(\'up\')" onmouseout="content_stop_scroll()" alt="" class="galerieArrowVer" style="top:437px; right:13px;" />';
	html += '<img src="pix/galerieArrowDown.gif" onmouseover="scroll_content(\'down\')" onmouseout="content_stop_scroll()" alt="" class="galerieArrowVer" style="top:455px; right:13px;" />';
	html += '</div>';
	hurra_create_2ndWindow(549,html);	
	swap_img(0);
}
function Img(thumb, img)
{
	this.thumb = thumb;
	this.img = img;
	this.Thumb = null;
	this.Img = null;
	this.preload = function()
	{
		this.Thumb = new Image();
		this.Thumb.src = this.thumb;
		this.Img = new Image();
		this.Img.src = this.img;
	}
}
var currentIndex = 0;
function swap_img(index)
{
	currentIndex = index;
	document.getElementById("galeriePic").src = ImgArray[index].Img.src;
}
function next_img()
{
	if(currentIndex == ImgArray.length-1){currentIndex = 0;}
	else{currentIndex++;}
	swap_img(currentIndex);
}
function last_img()
{
	if(currentIndex == 0){currentIndex = ImgArray.length-1;}
	else{currentIndex--;}
	swap_img(currentIndex);
}

var Gal_1_ar = new Array();
Gal_1_ar.push(new Img("princs_heuplatz/1_tn.jpg","princs_heuplatz/1_pic.jpg"));
Gal_1_ar.push(new Img("princs_heuplatz/2_tn.jpg","princs_heuplatz/2_pic.jpg"));
Gal_1_ar.push(new Img("princs_heuplatz/3_tn.jpg","princs_heuplatz/3_pic.jpg"));
Gal_1_ar.push(new Img("princs_heuplatz/4_tn.jpg","princs_heuplatz/4_pic.jpg"));
Gal_1_ar.push(new Img("princs_heuplatz/5_tn.jpg","princs_heuplatz/5_pic.jpg"));
Gal_1_ar.push(new Img("princs_heuplatz/6_tn.jpg","princs_heuplatz/6_pic.jpg"));
Gal_1_ar.push(new Img("princs_heuplatz/7_tn.jpg","princs_heuplatz/7_pic.jpg"));
Gal_1_ar.push(new Img("princs_heuplatz/8_tn.jpg","princs_heuplatz/8_pic.jpg"));
Gal_1_ar.push(new Img("princs_heuplatz/9_tn.jpg","princs_heuplatz/9_pic.jpg"));
Gal_1_ar.push(new Img("princs_heuplatz/10_tn.jpg","princs_heuplatz/10_pic.jpg"));
Gal_1_ar.push(new Img("princs_heuplatz/11_tn.jpg","princs_heuplatz/11_pic.jpg"));
Gal_1_ar.push(new Img("princs_heuplatz/12_tn.jpg","princs_heuplatz/12_pic.jpg"));
Gal_1_ar.push(new Img("princs_heuplatz/13_tn.jpg","princs_heuplatz/13_pic.jpg"));
Gal_1_ar.push(new Img("princs_heuplatz/14_tn.jpg","princs_heuplatz/14_pic.jpg"));
Gal_1_ar.push(new Img("princs_heuplatz/15_tn.jpg","princs_heuplatz/15_pic.jpg"));
Gal_1_ar.push(new Img("princs_heuplatz/16_tn.jpg","princs_heuplatz/16_pic.jpg"));

var Gal_2_ar = new Array();
Gal_2_ar.push(new Img("princs_nostalgie/1_tn.jpg","princs_nostalgie/1_pic.jpg"));
Gal_2_ar.push(new Img("princs_nostalgie/2_tn.jpg","princs_nostalgie/2_pic.jpg"));
Gal_2_ar.push(new Img("princs_nostalgie/3_tn.jpg","princs_nostalgie/3_pic.jpg"));
Gal_2_ar.push(new Img("princs_nostalgie/4_tn.jpg","princs_nostalgie/4_pic.jpg"));
Gal_2_ar.push(new Img("princs_nostalgie/5_tn.jpg","princs_nostalgie/5_pic.jpg"));
Gal_2_ar.push(new Img("princs_nostalgie/6_tn.jpg","princs_nostalgie/6_pic.jpg"));
Gal_2_ar.push(new Img("princs_nostalgie/7_tn.jpg","princs_nostalgie/7_pic.jpg"));
Gal_2_ar.push(new Img("princs_nostalgie/8_tn.jpg","princs_nostalgie/8_pic.jpg"));
Gal_2_ar.push(new Img("princs_nostalgie/9_tn.jpg","princs_nostalgie/9_pic.jpg"));
Gal_2_ar.push(new Img("princs_nostalgie/10_tn.jpg","princs_nostalgie/10_pic.jpg"));
Gal_2_ar.push(new Img("princs_nostalgie/11_tn.jpg","princs_nostalgie/11_pic.jpg"));
Gal_2_ar.push(new Img("princs_nostalgie/12_tn.jpg","princs_nostalgie/12_pic.jpg"));
Gal_2_ar.push(new Img("princs_nostalgie/13_tn.jpg","princs_nostalgie/13_pic.jpg"));
Gal_2_ar.push(new Img("princs_nostalgie/14_tn.jpg","princs_nostalgie/14_pic.jpg"));
Gal_2_ar.push(new Img("princs_nostalgie/15_tn.jpg","princs_nostalgie/15_pic.jpg"));
Gal_2_ar.push(new Img("princs_nostalgie/16_tn.jpg","princs_nostalgie/16_pic.jpg"));
Gal_2_ar.push(new Img("princs_nostalgie/17_tn.jpg","princs_nostalgie/17_pic.jpg"));
Gal_2_ar.push(new Img("princs_nostalgie/18_tn.jpg","princs_nostalgie/18_pic.jpg"));

function preload()
{
	for(var i = 0; i < Gal_1_ar.length; i++)
	{
		Gal_1_ar[i].preload();
	}
	for(var i = 0; i < Gal_2_ar.length; i++)
	{
		Gal_2_ar[i].preload();
	}
}

/* Funktionen für die 2te Inhaltsebene */
var Hurra2ndWindow = null;
function hurra_create_2ndWindow(width, html)
{
	hurra_lockPage_firstLevel();
	var pageSize = hurra_getPageSize();
	var pageScroll = hurra_getPageScroll();
	
	Hurra2ndWindow  = document.createElement('div');
	Hurra2ndWindow.id = 'hurra2ndWindow';
	document.body.appendChild(Hurra2ndWindow);
	Hurra2ndWindow.innerHTML =
	'<div id="hurra2ndWindow_contentContainer">'+html+'</div>';
	//+'<div onmouseover="this.style.textDecoration = \'none\'" onmouseout="this.style.textDecoration = \'\'" class="close_hurra2ndWindow" onclick="hurra_unlockPage_firstLevel()">schließen</div>';
	Hurra2ndWindow.style.width = width + 'px';
	Hurra2ndWindow.style.top = (pageScroll.yScroll + (pageSize.windowHeight - Hurra2ndWindow.offsetHeight) / 2) + 'px';
	Hurra2ndWindow.style.left = ((pageSize.pageWidth - Hurra2ndWindow.offsetWidth) / 2) + 'px';
	//Hinzufügen zu den zu schließenden Elementen
	HurraLockPageFirstLevelChilds[HurraLockPageFirstLevelChilds.length] = Hurra2ndWindow;
}

var HurraLockPageFirstLevelChilds = new Array();

var HurraLockPageFirstLevelOpacity = 80;
var HurraLockPageFirstLevel = null;
function hurra_lockPage_firstLevel()
{
	var pageSize = hurra_getPageSize();
	HurraLockPageFirstLevel = document.createElement('div');
	HurraLockPageFirstLevel.id = 'page_lock_firstLevel';
	HurraLockPageFirstLevel.style.display = 'block';
	document.body.appendChild(HurraLockPageFirstLevel);
	HurraLockPageFirstLevel.style.filter = 'alpha(opacity='+HurraLockPageFirstLevelOpacity +')';
	HurraLockPageFirstLevel.style.opacity = HurraLockPageFirstLevelOpacity/100;
	HurraLockPageFirstLevel.style.height = pageSize.pageHeight + 'px';
	HurraLockPageFirstLevel.style.width = '100%';
	hurra_addEvent(HurraLockPageFirstLevel,'click',hurra_unlockPage_firstLevel);
}
function hurra_lockPage_firstLevel_fix()
{
	var pageSize = hurra_getPageSize();
	HurraLockPageFirstLevel = document.createElement('div');
	HurraLockPageFirstLevel.id = 'page_lock_firstLevel';
	HurraLockPageFirstLevel.style.display = 'block';
	document.body.appendChild(HurraLockPageFirstLevel);
	HurraLockPageFirstLevel.style.filter = 'alpha(opacity='+HurraLockPageFirstLevelOpacity +')';
	HurraLockPageFirstLevel.style.opacity = HurraLockPageFirstLevelOpacity/100;
	HurraLockPageFirstLevel.style.height = pageSize.pageHeight + 'px';
	HurraLockPageFirstLevel.style.width = '100%';
}
function hurra_unlockPage_firstLevel()
{
	try
	{
		hurra_removeNode(HurraLockPageFirstLevel);
		HurraLockPageFirstLevel = null;
		for(var i = 0; i < HurraLockPageFirstLevelChilds.length; i++)
		{
			hurra_removeNode(HurraLockPageFirstLevelChilds[i]);
		}
		HurraLockPageFirstLevelChilds = new Array();
	}
	catch(e){}
}
