/*
*	file:			global.js
*	content:		global functions
*	project:		Josito
*	version:		1.0
*	last update:	30.09.2006
*	developer:		dli
*	all rights at:	daniel.liebig@wevin.de 
*
*/

function showElement(elementId)
{
		document.getElementById(elementId).style.display	= 'block';
}
function hideElement(elementId)
{
		document.getElementById(elementId).style.display	= 'none';
}

function openDirections(lang)
{
	var	width = 630;
	var	heigth = 400;
	//Win = window.open('/popup/direction_' + lang + '.htm', 'popupFassade', 'resizable=no,width=' + width + ',height=' + heigth);
	Win = window.open('/popup/direction2_' + 'de' + '.htm', 'popupFassade', 'resizable=no,width=' + width + ',height=' + heigth);
	Win.focus();
}
function openBooking(lang)
{
	var	width = 530;
	var	heigth = 800;
	Win = window.open('/popup/booking_' + lang + '.php', 'popupFassade', 'resizable=no,width=' + width + ',height=' + heigth);
	Win.focus();
}
function openAd(width)
{
	//var	width = 820;
	var	heigth = 800;
	Win = window.open('/popup/course.htm', 'popupFassade', 'resizable=no,scrollbars, width=' + width + ',height=' + heigth);
	Win.focus();
}



function openNews(lang, id)
{
	var	width = 620;
	var	heigth = 450;
	Win = window.open('/popup/news.php5?lang=' + lang + '&id=' + id , 'popupNews', 'resizable=no, scrollbars=yes, width=' + width + ',height=' + heigth);
	Win.focus();
}

function openDisclaimer(lang)
{
	var	width = 395;
	var	heigth = 450;
	Win = window.open('/popup/disclaimer.php5?lang=' + lang, 'popupNews', 'resizable=no, width=' + width + ',height=' + heigth);
	Win.focus();
}
var timeout    = 500;
var closetimer = 0;
var ddmenuitem = 0;

function jsddm_open()
{  jsddm_canceltimer();
   jsddm_close();
   ddmenuitem = $(this).find('ul').css('visibility', 'visible');}

function jsddm_close()
{  if(ddmenuitem) ddmenuitem.css('visibility', 'hidden');}

function jsddm_timer()
{  closetimer = window.setTimeout(jsddm_close, timeout);}

function jsddm_canceltimer()
{  if(closetimer)
   {  window.clearTimeout(closetimer);
      closetimer = null;}}

$(document).ready(function()
{  $('#jsddm > li').bind('mouseover', jsddm_open)
   $('#jsddm > li').bind('mouseout',  jsddm_timer)});

document.onclick = jsddm_close;

