/*
javascripts
*/
function ausblenden()
{
	document.getElementById(arguments[0]).style.display = 'none';
}


function doMail(m)
{
	e = str_replace(' [at] ', '@', m);
	e = str_replace(' [dot] ', '.', e);
	
	document.location.href='mailto:'+e;
}

function str_replace(search, replace, subject) {
	return subject.split(search).join(replace);
}

function trim(s)
{
    while (s.substring(0,1) == ' ')
    {
        s = s.substring(1,s.length);
    }
    while (s.substring(s.length-1,s.length) == ' ') {
        s = s.substring(0,s.length-1);
    }
    return s;
}

function playVideo(id)
{

	//if(document.all) img = document.images['playbtn_'+id];
	//else img = document.getElementById('playbtn_'+id);
	img = document.images['playbtn_'+id];
	
	if(img.src.indexOf('pause') > -1)
	{
		document[id].Stop();
		img.src='../resources/images/play.gif';
	}
	else
	{
		document[id].Play();
		img.src='../resources/images/pause.gif';
	}
	
	// für ie6
	//alert(navigator.appVersion);
	//this.blur();
	//return false;
}

function stopVideo(id)
{
	if(document.all) img = document.images['playbtn_'+id];
	else img = document.getElementById('playbtn_'+id);
	img.src='../resources/images/play.gif';

	document[id].Stop();
	document[id].Rewind();
	
	// für ie
	this.blur();
	return false;
}

function volumeVideo(id, mode)
{
	film = document[id];
	if(mode == 'plus') 
	{
		if(film.GetVolume() < 256) film.SetVolume(film.GetVolume()+64);
		else film.SetVolume(256);
	}
	else
	{
		if(film.GetVolume() > 0) film.SetVolume(film.GetVolume()-64);
		else film.SetVolume(0);	
	}
}

function big()
{
	url = '../resources/php/big.php?contentId='+arguments[0];
	
	
	f = 'height=100,';
	f+= 'width=100,';
	f+= 'top=0,';
	f+= 'left=0,';
	f+= 'resizable=no,';
	f+= 'scrollBar=no,';
	f+= 'status=no,';
	f+= 'menubar=no,';
	f+= 'location=no';

	
	pop = open(url, 'Loading', f);
	pop.focus();
}

function resizeWindow()
{
	img = document.getElementById('bild');
	w = img.width + 85;
	h = img.height;

	if(document.all) h+=170;
	else h+=130;

	top.resizeTo(w,h);
	
}
