var incre = 0;
$('document').ready(function()
{
		
 $('a').each(function(){
     ahref = this.href;
     if(ahref.indexOf('#') != -1){
       arrhref = ahref.split('#');
       this.href = window.location+'#'+arrhref[1];
     }
   })


  $('.lightbox').lightBox({
		overlayBgColor:'#fff',
		overlayOpacity:0.8,
		fixedNavigation:true,
		imageLoading: path+"/images/lightbox-ico-loading.gif",
		imageBtnNext: path+"/images/lightbox-btn-next.gif",
		imageBtnPrev: path+"/images/lightbox-btn-prev.gif",
		imageBtnClose: path+"/images/lightbox-btn-close.gif"
	});

	$("#secLevel li").mouseover( function()
	{
		$("#secondLevel"+menuid).removeClass('active')
		if(this.id!='')
		{
		$("#"+this.id).addClass('active')
		}
		
	})
	$("#secLevel li").mouseleave( function()
	{
		if(this.id!='')
		{
			$("#"+this.id).removeClass('active');
		}
		
	})
	$(".menu").mouseleave( function()
	{
		if(secondlevel>0)
			selid= secondlevel
		else
			selid=menuid
		$("#secondLevel"+selid).addClass('active')		
	})
//		scroll: 4,
	jQuery('#mycarousel').jcarousel({
		animation: 'slow',
		auto: 4,
		easing: 'swing',
		initCallback: mycarousel_initCallback,
		wrap: 'circular',
		itemVisibleInCallback: {onBeforeAnimation: mycarousel_itemVisibleInCallback},
		itemVisibleOutCallback: {onAfterAnimation: mycarousel_itemVisibleOutCallback}
    });
	
	
	
})
  	/*{url: host+'/images/prod5.jpg', title: 'product5', link:''},
	{url: host+'/images/prod6.jpg', title: 'product6', link:''},
    {url: host+'/images/prod7.jpg', title: 'product7', link:''},
    {url: host+'/images/prod8.jpg', title: 'product8', link:''},
    {url: host+'/images/prod9.jpg', title: 'product9', link:''},
    {url: host+'/images/prod10.jpg', title: 'product10', link:''},
    {url: host+'/images/prod11.jpg', title: 'product11', link:''},
    {url: host+'/images/prod12.jpg', title: 'product12', link:''}*/
/*
var mycarousel_itemList = [
    {url: host+'/images/prod1.jpg', title: 'product1', link:'http://www.clubuniversum.com/shop/product.php?id_product=1'},
    {url: host+'/images/prod2.jpg', title: 'product2', link:'http://www.clubuniversum.com/shop/product.php?id_product=2'},
    {url: host+'/images/prod3.jpg', title: 'product3', link:'http://www.clubuniversum.com/shop/product.php?id_product=4'},
    {url: host+'/images/prod4.jpg', title: 'product4', link:'http://www.clubuniversum.com/shop/product.php?id_product=3'} 
    
]; */


function mycarousel_itemVisibleInCallback(carousel, item, i, state, evt)
{
    var idx = carousel.index(i, mycarousel_itemList.length);
    carousel.add(i, mycarousel_getItemHTML(mycarousel_itemList[idx - 1]));
};

function mycarousel_itemVisibleOutCallback(carousel, item, i, state, evt)
{
    carousel.remove(i);
};

function mycarousel_initCallback(carousel)
{
    carousel.buttonNext.bind('click', function() {
        carousel.startAuto(0);
    });

    carousel.buttonPrev.bind('click', function() {
        carousel.startAuto(0);
    });
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};
function mycarousel_getItemHTML(item)
{
    return '<a href="'+item.link+'"><img src="' + item.url + '" width="203" height="184" alt="' + item.title + '" /></a>';
};


    
ddaccordion.init({
	headerclass: "accordion_head", 
	contentclass: "accordion_content", 
	revealtype: "click",
	mouseoverdelay: 200,
	collapseprev: true, 
	defaultexpanded: [],
	onemustopen: false,
	animatedefault: false, 
	persiststate: true, 
	toggleclass: ["", "openpet"], 
	togglehtml: ["none", "", ""], 
	animatespeed: "fast", 
	oninit:function(expandedindices){ 
	},
	onopenclose:function(header, index, state, isuseractivated){ 
	}
})






 
 // video window center function
 window.size = function()
{
var w = 0;
var h = 0;
//IE
if(!window.innerWidth)
{
//strict mode
if(!(document.documentElement.clientWidth == 0))
{
w = document.documentElement.clientWidth;
h = document.documentElement.clientHeight;
}
//quirks mode
else
{
w = document.body.clientWidth;
h = document.body.clientHeight;
}
}
//w3c
else
{
w = window.innerWidth;
h = window.innerHeight;
}
return {width:w,height:h};
}
window.center = function()
{
var hWnd = (arguments[0] != null) ? arguments[0] : {width:0,height:0};
var _x = 0;
var _y = 0;
var offsetX = 0;
var offsetY = 0;
//IE
if(!window.pageYOffset)
{
//strict mode
if(!(document.documentElement.scrollTop == 0))
{
offsetY = document.documentElement.scrollTop;
offsetX = document.documentElement.scrollLeft;
}
//quirks mode
else
{
offsetY = document.body.scrollTop;
offsetX = document.body.scrollLeft;
}
}
//w3c
else
{
offsetX = window.pageXOffset;
offsetY = window.pageYOffset;
}
_x = ((this.size().width-hWnd.width)/2)+offsetX;
_y = ((this.size().height-hWnd.height)/2)+offsetY;
return{x:_x,y:_y};
}





function showCenter(point)
{
	
	document.getElementById('video1').style.display = "block";	
	
	var video=videoNmae+".flv";
	
	var video_filename='';
 	$('#video1').html('<div id="video-name" style="text-align:left"></div>  <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="840" height="600" id="player" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="allowFullScreen" value="false" /><param name="base" value="/clubuniversum/flash/videoplayer/" /><param name="movie" value="'+host+'/flash/videoplayer/player.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />	<embed src="'+host+'/flash/videoplayer/player.swf" quality="high" bgcolor="#ffffff" width="840" height="600" name="player" align="middle" allowScriptAccess="sameDomain" base="/clubuniversum/flash/videoplayer/" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>  <div id="close"><a href="javascript:void(0);" onclick="closevideo()" style="color:#58595B"> Fenster schliessen</a></div>');
 	
	$('#video1').expose();
}



function flv_player(videoNmae)
{  

	var point=	window.center({width:840,height:600});	
	document.getElementById('video1').style.position = "absolute";
	document.getElementById('video1').style.top = point.y + "px";
	document.getElementById('video1').style.left = point.x + "px";
	document.getElementById('video1').style.width = "840px";
	document.getElementById('video1').style.height = "600px";
	
	var video=videoNmae+".flv";

	document.getElementById("video1").style.display="block";		

	//newone
	$('#video1').html("<div id='video-name' style='text-align:left'></div><object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8' width='840' height='600' id='theMediaPlayer'><param name=movie value='"+host+"/video/mediaplayer.swf'><param name=quality value='high'><param name=wmode value='transparent'><param name=bgcolor value='#FFFFFF'><param name=allowFullScreen value='true'><param name=swLiveConnect value='true'><param name=allowScriptAccess value='always'><param name='FlashVars' value='file=../clientdata/multimedia/flvfiles/"+video+"&image="+host+"/clientdata/multimedia/flvimages/"+videoNmae+".jpg&shownavigation=true&playlist=right'><embed type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' width='840px' height='600px' wmode='transparent' bgcolor='#FFFFFF' name='theMediaPlayer'  src='"+host+"/video/mediaplayer.swf' flashvars='file=../clientdata/multimedia/flvfiles/"+video+"&image="+host+"/clientdata/multimedia/flvimages/"+videoNmae+".jpg&shownavigation=true&playlist=right'></embed></object><div id='close'><a href='javascript:void(0);' onclick='closevideo()' style='color:#58595B'>Fenster schliessen</a></div>"); 

	$('#video1').expose();
}
function closevideo()
{
    $.expose.close();
    document.getElementById("video1").style.display="none";
    document.getElementById("video1").innerHTML="";
}
 



