function _activateLinkBtn(id, pressed)
{
	if(pressed == true)
		document.getElementById(id).src = '/global/images/link_submit_active.gif';
	else
		document.getElementById(id).src = '/global/images/link_submit.gif';
}

function doSearch(siteID, siteHTTP, stepID, isEventHandler)
{
	if (!document.searchform.searchkeyword.value)
	{
		document.searchform.searchkeyword.focus();
		return;
	}
	
	var searchStr = new String(document.searchform.searchkeyword.value);
	var searchBranch = new Number(document.searchform.searchbranch.value);
	if (searchStr.length < 2)
	{
		document.searchform.searchkeyword.focus();
		return;
	}
	openWin(siteHTTP + '/search.asp?siteid=' + siteID + '&sitehttp=' + siteHTTP + '&stepid=' + stepID + '&searchbranch=' + searchBranch + '&searchkeyword=' + searchStr,'search',550,380,50,300);
	
	if (isEventHandler == true)
		return false;
}

function openWin(link, name, height, width, top, left)
{
	window.open(link, name , 'height=' + height + ',width=' + width + ',top=' + top + ',left=' + left + ',scrollbars=yes,resizable=yes');
	this.navigate ='';
}

function _v()
{
	return true;
}

function navigateMain(url)
{
	window.opener.location = url;
}

function openGallery(galleryID, _width, _height, _name)
{
	var name = (_name) ? _name : "Gallery";
	var uri = "/global/include/gallery.asp?galleryID=" + galleryID + "&name=" + name;
	var width = _width + 10;
	var height = _height + 40;
	var winProp = "width="+width+",height="+height+",left=0,top=0";
	window.open(uri, "Gallery", winProp);
	this.navigate ='';
}

function openPopup(name, url, width, height, top, left, scrolling, resizable, buttons)
{
	var optionArr = new Array();
	if(width) optionArr[optionArr.length] = 'width=' + width;
	if(height) optionArr[optionArr.length] = 'height=' + height;
	if(top) optionArr[optionArr.length] = 'top=' + top;
	if(left) optionArr[optionArr.length] = 'left=' + left;
	if(scrolling) optionArr[optionArr.length] = 'scrollbars=' + scrolling;
	if(resizable) optionArr[optionArr.length] = 'resizable=' + resizable;
	if(buttons) optionArr[optionArr.length] = 'menubar=' + buttons + ',toolbar=' + buttons + ',status=' + buttons;
	window.open(url, 'AudiCDPortal', optionArr.join(','));
	this.navigate ='';
}


function openMediaplayer(name, width, height, top, left, scrolling, resizable, buttons, mediaURI)
{
	var optionArr = new Array();
	if(width) optionArr[optionArr.length] = 'width=' + width;
	if(height) optionArr[optionArr.length] = 'height=' + height;
	if(top) optionArr[optionArr.length] = 'top=' + top;
	if(left) optionArr[optionArr.length] = 'left=' + left;
	if(scrolling) optionArr[optionArr.length] = 'scrollbars=' + scrolling;
	if(resizable) optionArr[optionArr.length] = 'resizable=' + resizable;
	if(buttons) optionArr[optionArr.length] = 'menubar=' + buttons + ',toolbar=' + buttons + ',status=' + buttons;
	uri = "/global/include/mediaplayer.asp?mediaURI=" + mediaURI + "&width=" + width + "&height=" + height;
	window.open(uri, 'AudiCDPortalMediaplayer', optionArr.join(','));
	this.navigate ='';
}

function showPopup()
{
	var x=(screen.availWidth/2)-230;
	var y=(screen.availHeight/2)-85;

	var fenster = window.open("Umfrage.asp", "Umfrage", "width=460,height=170,status=yes,scrollbars=yes,resizable=yes");
	fenster.moveTo(x,y);
	fenster.focus();
}


function checkPopupTime()
{	try{
	if(loginDateTime < new Date().getTime())
	{
		if(umfrageID != -1)
			showPopup();
	}
	else
	{
		setTimeout("checkPopupTime()", 1000);
	}
	}catch(e){}
}


function _i()
{
	checkPopupTime();
	var _a = new Array(111,110,99,111,110,116,101,120,116,109,101,110,117,0,111,110,115,101,108,101,99,116,115,116,97,114,116,0,111,110,100,114,97,103,115,116,97,114,116,0,111,110,109,111,117,115,101,100,111,119,110,0);
	var _d = document;
	var _e = new Array();
	var _s = '';
	
	for (var _i = 0;_i<_a.length;++_i)
	{
		if(_a[_i] != 0)_s +=String.fromCharCode(_a[_i]);
		else
		{
			_e[_e.length]=_s;_s='';
		}
	}
	for(var _i=0;_i<_e.length;++_i)
		_d[_e[_i]]=_v;_d.getElementById("_bid").style.visibility='visible';
	
}


function thumbPopup(imageURI)
{
	var uri = "/global/include/loadImage.asp?imageURI="+imageURI;
	var width = 800 + 20;
	var height = 600 + 30;
	var winProp = "width="+width+",height="+height+",left=100,top=100,scrollbars=yes";
	
	var win = window.open(uri, "thumb_popup", winProp);
	
	this.navigate ='';
}
