var user_id=0;
var jsgallery=0;
var ismobile=0;

function centerPop() {
	if($("#popPlaceholder").length > 0) {
		$("#popPlaceholder").css('left', ($(window).width()/2-
$("#popimg").width()/2)-60); 
	}
}

function hidePop() {
	$("#popPlaceholder").fadeOut("fast");
}

function lbrs(width,height) {

	width = parseInt(width);
	height = parseInt(height);
	if(height != 0) {
		$("#lba").css("height", (height+2) +'px');
		$("#lba").css("width", (width+2) +'px');
	} else {
		$("#lba").hide();
	}
}

function resizeAllImages(parentclass) {

	if(parentclass == undefined) parentclass = 'postOverflow';

	$('.'+ parentclass +' img').each(function(index) {
		if($(this).attr("class") != 'smiley') {
			if($(this).parent().parent().get(0).className != 'quotetext' && !$.browser.opera) { $(this).css("display", "none"); }
			
			if($(this).attr("complete") == false) {
				$(this).bind("load",function() { 
					
					if($(this).width() > 650) {
						$(this).css('width', '99%');
					}
					$(this).css("display", "inline");
				});
			} else {
				if($(this).width() > 650) {
					$(this).css('width', '99%');
				}
				$(this).css("display", "inline");
			}
		}
	});
}

// Skyscraper ausblenden
function hideSkyscraper() {
		
	if($(window).width() <= 1008) { 
		$("#adds").parent().css("width",0);
		$("#adds img").css("width",0);
		$("#adds div").css("display","none");
		$("#adds").animate({width:0,opacity:0},200);
	} else {
		$("#adds").animate({opacity:0},200);
	}	
}

function switchlayer(id) {
	if( $('#t_'+ id).is(':hidden') ) {
		$('#comlayers .trans').each(function(index) {
			if($(this).is(":visible")) {
				$(this).hide();
			}
		});
		$('#t_'+ id).fadeIn();
	} 

}

function imgToggle(id) {
	if(document.getElementById(id).style.display=='none') {
		show(id);
		document.getElementById(id+'_pic').src='http://www.fs-location.de/img/tpl/1/minus.gif';
	}
	else {
		hide(id);
		document.getElementById(id+'_pic').src='http://www.fs-location.de/img/tpl/1/plus.gif';
	}
}

function imgTRToggle(id) {
	if(document.getElementById(id).style.display=='none') {
		obj = document.getElementById(id);
		obj.style.display = '';
		obj = obj.nextSibling;
		while(obj.id == id) {
			obj.style.display = '';
			obj = obj.nextSibling;
		}
		document.getElementById(id+'_pic').src='http://www.fs-location.de/img/tpl/1/minus.gif';
	}
	else {
		obj = document.getElementById(id);
		obj.style.display = 'none';
		obj = obj.nextSibling;
		while(obj.id == id) {
			obj.style.display = 'none';
			obj = obj.nextSibling;
		}

		document.getElementById(id+'_pic').src='http://www.fs-location.de/img/tpl/1/plus.gif';
	}
}

var l = 0;
function gmc(args) {

	if(l == 0) {
		$("#konversation").html('<img src="http://www.fs-location.de/img/tpl/1/ajaxload.gif" style="margin: 13px 13px">');
		$.get('/community/pm/konversation_only.php',args,function(r) { $("#konversation").html(r); initFancy(); });

		l = 1;
	}
}

var lgbe = 0;
function gbe(args) {

	if(lgbe == 0) {
		$("#lastGBentries").html('<img src="http://www.fs-location.de/img/tpl/1/ajaxload.gif">');
		$.get('/admin/penalty/last_gb_entries.php',args,function(r) { $("#lastGBentries").html(r);  });
		lgbe = 1;
	}
}

function helper(entry_id, text) {
	if($("#helper"+entry_id)) {
		$("#helper"+entry_id).text(text);
	}
	return true;
	//if($("#helper'. $entry_id .'").text("Nachricht&nbsp;l&ouml;schen")
}

function cv(id,val,type,res,vtc) {
	var minVoteNeed = 9;
	
	if(type == 1 || type == 4) {
		
		if(res > 0) res = "+"+ res;
		$("#vote"+ id).html('<span class="voteResult">'+ res +'</span>');
		helper(id,"");
		$.post('/trigger/_vote.php',{'id':id,'et':type,'v':val,'vtc':vtc},function(r){});//if(r!="")alert(r);
	}

	if(type == 2 || type == 3 || type == 5 || type == 7 || type == 9 || type == 10 || type == 11) {

		var toPost = $("#countBar"+ id).serialize();
		// Fix für den Review-Pic-Viewer
		if(type == 10) { $(".myVoteArrows").css("text-align", "center"); }
		
		$("#countBar"+ id).html('<img src="http://www.fs-location.de/img/tpl/1/ajaxload.gif">');
		
		$.post("/trigger/_vote.php",
			toPost,
			function(r){
				if(type != 3 || (vtc+1) < minVoteNeed) {
					//$("#countBar"+ id).html('<span class="medium"><img src="http://www.fs-location.de/img/tpl/1/icons/true.gif" align="absmiddle"> abgestimmt!</span>');
					$("#countBar"+ id).hide();
				} else {
					$("#countBar"+ id).parent().hide("fast");
					$("#voteBox"+ id).css("margin-top", "0px");
				}
				
				if(r!="") { $("#voteBox"+ id).html(r); $("#voteBox"+ id).show(); }
				if(type == 3) $("#voteBox"+ id).css("display", "block");
		});
	}
}

String.prototype.htmlEntities = function()
{
  var chars = new Array ('&','à','á','â','ã','ä','å','æ','ç','è','é',
                         'ê','ë','ì','í','î','ï','ð','ñ','ò','ó','ô',
                         'õ','ö','ø','ù','ú','û','ü','ý','þ','ÿ','À',
                         'Á','Â','Ã','Ä','Å','Æ','Ç','È','É','Ê','Ë',
                         'Ì','Í','Î','Ï','Ð','Ñ','Ò','Ó','Ô','Õ','Ö',
                         'Ø','Ù','Ú','Û','Ü','Ý','Þ','€','\"','ß','<',
                         '>','¢','£','¤','¥','¦','§','¨','©','ª','«',
                         '¬','­','®','¯','°','±','²','³','´','µ','¶',
                         '·','¸','¹','º','»','¼','½','¾');

  var entities = new Array ('amp','agrave','aacute','acirc','atilde','auml','aring',
                            'aelig','ccedil','egrave','eacute','ecirc','euml','igrave',
                            'iacute','icirc','iuml','eth','ntilde','ograve','oacute',
                            'ocirc','otilde','ouml','oslash','ugrave','uacute','ucirc',
                            'uuml','yacute','thorn','yuml','Agrave','Aacute','Acirc',
                            'Atilde','Auml','Aring','AElig','Ccedil','Egrave','Eacute',
                            'Ecirc','Euml','Igrave','Iacute','Icirc','Iuml','ETH','Ntilde',
                            'Ograve','Oacute','Ocirc','Otilde','Ouml','Oslash','Ugrave',
                            'Uacute','Ucirc','Uuml','Yacute','THORN','euro','quot','szlig',
                            'lt','gt','cent','pound','curren','yen','brvbar','sect','uml',
                            'copy','ordf','laquo','not','shy','reg','macr','deg','plusmn',
                            'sup2','sup3','acute','micro','para','middot','cedil','sup1',
                            'ordm','raquo','frac14','frac12','frac34');

  newString = this;
  for (var i = 0; i < chars.length; i++)
  {
    myRegExp = new RegExp();
    myRegExp.compile(chars[i],'g')
    newString = newString.replace (myRegExp, '&' + entities[i] + ';');
  }
  return newString;
}
function showNickPopup(obj,uid,nickname,nicktitle,sex,age,info_lastaction,banned,info_has_album,nickicon,thumb_extension,is_online) {
	hidePopup();
	showPopupClicker();
	//jsgallery = '';

	/*
	trust = '';
	if(trust_lvl) trust = '&nbsp;<img src="http://pics.fs-location.de/tpl/1/trust/t'+ trust_lvl +'.gif" align="absmiddle" hspace="3">';
	title="'+((is_online == 'Offline') ? is_online : 'Letzte Aktion vor '+is_online) +'
	*/

	if(window.t) window.clearTimeout(t);
	with(document.getElementById('nickPopup')) {
//"javascript:fullsizePic(\'http://www.fs-location.de/img/community/user/profile/'+uid+thumb_extension+'\', \'0\', \'0\');"
	innerHTML = '<table class="nickPopup"><tr class="main"><th style="text-align:left; width:200px; height:20px" class="top"><table class="trans" style="width:200px;"><tr><td style="text-align:left"><span class="nickname">'+ ((banned == 0) ? '<a href="/community/user/profile.php?id='+uid+'">'+nickname+'</a>' : nickname) +'</span>'+((nickicon!=0)?('&nbsp;<img src="http://www.fs-location.de/img//community/user/nickicon/'+nickicon+'.gif">'):'') +'&nbsp;'+ ((sex!=2)?('<img src="http://www.fs-location.de/img/tpl/1/i'+(sex?'female':'male')+'.gif">'):'') +'&nbsp;'+(age<99&&age>0?age:'')+'&nbsp;<img src="http://www.fs-location.de/img/tpl/1/trans.gif" align="absmiddle" hspace="3" id="timg"></td><td rowspan="2" style="text-align:right; vertical-align:top; padding:2px;">	<img src="http://www.fs-location.de/img/tpl/1/wioload.gif" align="absmiddle" id="oimg" class="online" width="34" height="10"><img src="" id="oTmpImg" align="absmiddle" class="online" style="width:0px; height:0px;display:none"></td></tr><tr><td style="text-align:left">'+(nicktitle==''?'':'<span class="nicktitle">'+nicktitle.htmlEntities()+'</span>')+'</td></tr></table></th>'+ ((thumb_extension != '' && banned == 0) ? '<td style="text-align:left; vertical-align:top;padding:0px" rowspan="2" class="main">'+ ((jsgallery==1)?'<a id="single_image" href="http://www.fs-location.de/img/community/user/profile/'+uid+thumb_extension+'">':'<a href="javascript:fullsizePic(\'http://www.fs-location.de/img/community/user/profile/'+uid+thumb_extension+'\', \'0\', \'0\');">') +'<img src="http://www.fs-location.de/img/community/user/profile/t_'+uid+thumb_extension+'"></a></td>' : '') +'</tr><tr><td style="vertical-align:top;'+((thumb_extension!='')?'height:100px':'')+'" class="main">'+ ((banned == 0) ? ('<table class="trans" style="text-align:left;width:100%"><tr><td style="text-align:left;"><a href="/community/user/profile.php?id='+uid+'" class="imgLink"><span class=\"imgLink\"><img src="http://www.fs-location.de/img/tpl/1/profile.gif" align="absmiddle" class="icon">&nbsp;Profil</span></a></td></tr><tr><td><a href="/community/user/blogs.php?id='+uid+'" class="imgLink"><span class=\"imgLink\"><img src="http://www.fs-location.de/img/tpl/1/blog.gif" align="absmiddle" class="icon">&nbsp;Blogs</span></a></td></tr><tr><td><a href="/community/user/guestbook.php?id='+uid+'" class="imgLink"><span class=\"imgLink\"><img src="http://www.fs-location.de/img/tpl/1/gb.gif" align="absmiddle" class="icon">&nbsp;Gästebuch</span></a></td></tr>'+((info_has_album==1)?'<tr><td><a href="/community/user/album.php?id='+uid+'" class="imgLink"><span class=\"imgLink\"><img src="http://www.fs-location.de/img/tpl/1/gallery.gif" align="absmiddle" class="icon">&nbsp;Fotoalbum</a></span></td></tr>':'') + ((user_id != 0) ? ((uid == user_id) ? '<tr><td><a href="/settings/index.php" class="imgLink"><span class=\"imgLink\"><img src="http://www.fs-location.de/img/tpl/1/icons/settings.gif" align="absmiddle" class="icon">&nbsp;Einstellungen</a></span></td></tr>' : ('<tr><td><a href="/community/pm/form_pm.php?resc='+uid+'" class="imgLink"><span class=\"imgLink\"><img src="http://www.fs-location.de/img/tpl/1/icons/pm.gif" align="absmiddle" class="icon">&nbsp;PM schreiben</a></span></td></tr><tr><td><a href="/settings/buddy/buddy_add.php?id='+uid+'" class="imgLink"><span class=\"imgLink\"><img src="http://www.fs-location.de/img/tpl/1/icons/buddy.gif" align="absmiddle" class="icon">&nbsp;In Freundesliste aufnehmen</a></span></td></tr><tr><td><a href="/settings/ignore/add.php?id='+uid+'" class="imgLink"><span class=\"imgLink\"><img src="http://www.fs-location.de/img/tpl/1/icons/ignore.gif" align="absmiddle" class="icon">&nbsp;User ignorieren</a></span></td></tr>')) : '') +'</table>') : '<p style=\"padding:2px; font-weight:bold; text-align:center\">Account wurde deaktiviert.</p>') +'</td></tr><tr><th class="bottom"'+ ((thumb_extension != '') ? ' colspan="2"' : '') +'></th></tr></table>';

		style.top = findPosY(obj) - 3 + 'px';
		if((document.body.clientWidth - findPosX(obj)) < (206 + ((thumb_extension != '') ? 145 : 0))) {
			style.left = document.body.clientWidth - (206 + ((thumb_extension != '') ? 145: 0)) + 'px';			
		} else {
			style.left = findPosX(obj) - 3 + 'px';
		}
		initFancy();
		iframe_style = document.getElementById('iframePopup').style;
		iframe_style.width = offsetWidth;
		iframe_style.height = offsetHeight;
		iframe_style.top = style.top;
		iframe_style.left = style.left;
		$("#nickPopup").fadeIn('normal');
		/*
		if(is_online > 0) { document.getElementById("oTmpImg").src = "/onlineimage.php?uid="+ uid; }
		else {	document.getElementById("oTmpImg").src = "http://www.fs-location.de/img/tpl/1/wio_off.gif"; }
		document.getElementById("oTmpImg").onLoad = document.getElementById("oimg").src = document.getElementById("oTmpImg").src;

		if(is_online > 0) { document.getElementById("oimg").src = "/onlineimage.php?uid="+ uid; }
		else {	document.getElementById("oimg").src = "http://www.fs-location.de/img/tpl/1/wio_off.gif"; }
		*/

		function changeOnlineImagesPrestep() {
			window.setTimeout("changeOnlineImages()",1000);
		}

		if(is_online > 0) { 
			document.getElementById("oTmpImg").src = "/onlineimage.php?uid="+ uid; 
			document.getElementById("oTmpImg").onLoad = changeOnlineImagesPrestep();
		} else {	
			document.getElementById("oTmpImg").src = "http://www.fs-location.de/img/tpl/1/wio_off.gif"; 
			document.getElementById("oTmpImg").onLoad = changeOnlineImages();
		}

		/*
		document.getElementById("timg").src = "/trustedimage.php?uid="+ uid;
		iframe_style.display = 'inline';
		*/
		
	}
}

function changeOnlineImages() {

	// || (typeof document.getElementById("oTmpImg").naturalWidth!= “undefined” && document.getElementById("oTmpImg").naturalWidth== 0)
	if (!document.getElementById("oTmpImg").complete) {
		window.setTimeout("changeOnlineImages()",500);

    } else {
		document.getElementById("oimg").style.height = "0px";
		document.getElementById("oimg").style.width = "0px";
		document.getElementById("oimg").style.display = "none";

		document.getElementById("oTmpImg").style.height = "10px";
		document.getElementById("oTmpImg").style.width = "34px";
		document.getElementById("oTmpImg").style.display = "inline";
	}
}

/*
function showNickPopup(obj,uid,nickname,nicktitle,sex,age,info_lastaction,banned,info_has_album,nickicon,thumb_extension,is_online) {
	hidePopup();
	showPopupClicker();

	if(window.t) window.clearTimeout(t);
	with(document.getElementById('nickPopup')) {

		innerHTML = '<table class="nickPopup"><tr class="main"><th style="text-align:left; width:200px; height:20px" class="top"><table class="trans" style="width:200px;"><tr><td style="text-align:left"><span class="nickname">'+ ((banned == 0) ? '<a href="/community/user/profile.php?id='+uid+'">'+nickname+'</a>' : nickname) +'</span>'+((nickicon!=0)?('&nbsp;<img src="http://www.fs-location.de/img//community/user/nickicon/'+nickicon+'.gif">'):'') +'&nbsp;'+ ((sex!=2)?('<img src="http://www.fs-location.de/img/tpl/1/i'+(sex?'female':'male')+'.gif">'):'') +'&nbsp;'+(age<99&&age>0?age:'')+'</td><td rowspan="2" style="text-align:right; vertical-align:top; padding:2px;">	<img src="http://www.fs-location.de/img/tpl/1/wio'+info_lastaction+'.gif" align="absmiddle" title="'+((is_online == 'Offline') ? is_online : 'Letzte Aktion vor '+is_online) +'" class="online"></td></tr><tr><td style="text-align:left">'+(nicktitle==''?'':'<span class="nicktitle">'+nicktitle.htmlEntities()+'</span>')+'</td></tr></table></th>'+ ((thumb_extension != '' && banned == 0) ? '<td style="text-align:left; vertical-align:top;padding:0px" rowspan="2" class="main"><a href="javascript:fullsizePic(\'http://www.fs-location.de/img/community/user/profile/'+uid+thumb_extension+'\', \'0\', \'0\');"><img src="http://www.fs-location.de/img/community/user/profile/t_'+uid+thumb_extension+'"></a></td>' : '') +'</tr><tr><td style="vertical-align:top;'+((thumb_extension!='')?'height:120px':'')+'" class="main">'+ ((banned == 0) ? ('<table class="trans"><tr><td><a href="/community/user/profile.php?id='+uid+'" class="imgLink"><span class=\"imgLink\"><img src="http://www.fs-location.de/img/tpl/1/profile.gif" align="absmiddle" class="icon">&nbsp;Profil</span></a></td></tr><tr><td><a href="/community/user/guestbook.php?id='+uid+'" class="imgLink"><span class=\"imgLink\"><img src="http://www.fs-location.de/img/tpl/1/gb.gif" align="absmiddle" class="icon">&nbsp;Gästebuch</span></a></td></tr>'+((info_has_album==1)?'<tr><td><a href="/community/user/album.php?id='+uid+'" class="imgLink"><span class=\"imgLink\"><img src="http://www.fs-location.de/img/tpl/1/gallery.gif" align="absmiddle" class="icon">&nbsp;Fotoalbum</a></span></td></tr>':'') + ((user_id != 0) ? ((uid == user_id) ? '<tr><td><a href="/settings/index.php" class="imgLink"><span class=\"imgLink\"><img src="http://www.fs-location.de/img/tpl/1/icons/settings.gif" align="absmiddle" class="icon">&nbsp;Einstellungen</a></span></td></tr>' : ('<tr><td><a href="/community/pm/form_pm.php?resc='+uid+'" class="imgLink"><span class=\"imgLink\"><img src="http://www.fs-location.de/img/tpl/1/icons/pm.gif" align="absmiddle" class="icon">&nbsp;PM schreiben</a></span></td></tr><tr><td><a href="/settings/buddy/buddy_add.php?id='+uid+'" class="imgLink"><span class=\"imgLink\"><img src="http://www.fs-location.de/img/tpl/1/icons/buddy.gif" align="absmiddle" class="icon">&nbsp;In Freundesliste aufnehmen</a></span></td></tr><tr><td><a href="/settings/ignore/add.php?id='+uid+'" class="imgLink"><span class=\"imgLink\"><img src="http://www.fs-location.de/img/tpl/1/icons/ignore.gif" align="absmiddle" class="icon">&nbsp;User ignorieren</a></span></td></tr>')) : '') +'</table>') : '<p style=\"padding:2px; font-weight:bold; text-align:center\">Account wurde deaktiviert.</p>') +'</td></tr><tr><th class="bottom"'+ ((thumb_extension != '') ? ' colspan="2"' : '') +'></th></tr></table>';

		style.top = findPosY(obj) - 3 + 'px';
		if((document.body.clientWidth - findPosX(obj)) < (206 + ((thumb_extension != '') ? 145 : 0))) {
			style.left = document.body.clientWidth - (206 + ((thumb_extension != '') ? 145: 0)) + 'px';			
		} else {
			style.left = findPosX(obj) - 3 + 'px';
		}

		style.display = 'inline';
		iframe_style = document.getElementById('iframePopup').style;
		iframe_style.width = offsetWidth;
		iframe_style.height = offsetHeight;
		iframe_style.top = style.top;
		iframe_style.left = style.left;
		//iframe_style.display = 'inline';
		
	}
}
*/
function showEntryPopup(eid,edit) {
	hidePopup();
	showPopupClicker();
	obj='p'+eid;
	obj=document.getElementById(obj);
	if(window.t) window.clearTimeout(t);
	with(document.getElementById('entryPopup')) {
		innerHTML = '<table class="entryPopup" style="text-align:left"><tr><th style="text-align:left; vertical-align:top;"><img src="http://www.fs-location.de/img/tpl/1/dropdown.gif" align="top" class="icon">&nbsp;Optionen</th></tr><tr><td class="main"><table class="trans" style="width:100%">'+ ((inJSArray("quote", entryPopupLinks) == true) ? '<tr><td><a href="'+entryPopupLinks["quote"]+eid+'#f" class="imgLink"><span class=\"imgLink\"><img src="http://www.fs-location.de/img/tpl/1/quote.gif" align="absmiddle" class="icon">&nbsp;zitieren</span></a></td></tr>':'')+((edit==1 && inJSArray("edit", entryPopupLinks) == true)?'<tr><td><a href="'+entryPopupLinks["edit"]+eid+'#f" class="imgLink"><span class=\"imgLink\"><img src="http://www.fs-location.de/img/tpl/1/edit.gif" align="absmiddle" class="icon">&nbsp;editieren</span></a></td></tr>':'')+'<tr><td><a href="'+entryPopupLinks["report"]+eid+'#f" class="imgLink"><span class=\"imgLink\"><img src="http://www.fs-location.de/img/tpl/1/report.gif" align="absmiddle" class="icon">&nbsp;melden</span></a></td></tr></table></td></tr>'+ ((inJSArray("delete", entryPopupLinks) == true) ? '<tr class="admin"><td><a href="'+entryPopupLinks["delete"]+eid+'#f" class="imgLink"><span class=\"imgLink\"><img src="http://www.fs-location.de/img/tpl/1/delete.gif" align="absmiddle" class="icon">&nbsp;löschen</span></a></td></tr>' : '') +'</table>';
		style.top = findPosY(obj) - 3 + 'px';
		style.left = findPosX(obj) - 3 + 'px';
		//style.display = 'inline';
		$("#entryPopup").fadeIn('normal');
		iframe_style = document.getElementById('iframePopup').style;
		iframe_style.width = offsetWidth;
		iframe_style.height = offsetHeight;
		iframe_style.top = style.top;
		iframe_style.left = style.left;
		//iframe_style.display = 'inline';
	}
}

function helpwindow(id) {

	var leftMargin = (window.screen.width - 700) / 2;
	var topMargin = (window.screen.height - 500) / 2;

	window.open("/help.php?"+ ((id == 'bbcode') ? "page=1" : ((id == 'inquiry') ? "page=2" : "id="+id +"#active")), "helpwindow", "width=700,height=500,left="+ leftMargin +",top="+ topMargin +",location=no,menubar=no,toolbar=no,resizable=yes,scrollbars=yes,status=no").focus();
}
function formpopup(id, type) {
	
		var leftMargin = (window.screen.width - 450) / 2;
	var topMargin = (window.screen.height - 400) / 2;

	window.open("/formpopup.php?id="+id +"&type="+type+"&show=2", "formpopup", "width=450,height=400,left="+ leftMargin +",top="+ topMargin +",location=no,menubar=no,toolbar=no,resizable=yes,scrollbars=yes,status=no").focus();
}
function formpopupMobile(id, id2, type) {

		var leftMargin = (window.screen.width - 450) / 2;
	var topMargin = (window.screen.height - 400) / 2;

	window.open("/formpopup.php?id="+id +"&id2="+ id2 +"&type="+type+"&show=3", "formpopup", "width=450,height=400,left="+ leftMargin +",top="+ topMargin +",location=no,menubar=no,toolbar=no,resizable=yes,scrollbars=yes,status=no").focus();
}
function reviewPic (id, width, height, userHotShotID) {

		var leftMargin = (window.screen.width - width) / 2;
	var topMargin = (window.screen.height - height) / 2;

	window.open("/party/review/viewer.php?id="+id+ ((userHotShotID != false) ? "&hotshots="+userHotShotID : ""), "reviewPic","width="+width+",height="+height+",left="+ leftMargin +",top="+ topMargin +",location=no,menubar=no,toolbar=no,resizeable=yes,status=no").focus();
}
function reviewVid (id, width, height) {

		var leftMargin = (window.screen.width - width) / 2;
	var topMargin = (window.screen.height - height) / 2;

	window.open("/party/review/video.php?id="+id, "reviewVid","width="+ width +",height="+height+",left="+ leftMargin +",top="+ topMargin +",location=no,menubar=no,toolbar=no,resizeable=yes,status=no").focus();
}
function fullsizePic (url, width, height) {

	var leftMargin = (window.screen.width - width) / 2;
	var topMargin = (window.screen.height - height) / 2;

	popupWin = window.open("/fullsize.php?pic="+url+"&width="+width+"&height="+height, "fullsize", "width="+((width == 0) ? 100 : width) +",height="+((height == 0) ? 100 : height) +",left="+ leftMargin +",top="+ topMargin +",location=no,menubar=no,toolbar=no,resizeable=yes,status=no").focus();
}

function fullsizeVid (video,video_src, width, height) {

	var leftMargin = (window.screen.width - width) / 2;
	var topMargin = (window.screen.height - height) / 2;

	popupWin = window.open("/fullsize.php?vid="+video+"&video_source="+video_src+"&width="+width+"&height="+height, "fullsize", "width="+((width == 0) ? 100 : width) +",height="+((height == 0) ? 100 : height) +",left="+ leftMargin +",top="+ topMargin +",location=no,menubar=no,toolbar=no,resizeable=yes,status=no").focus();
}

function formPreview (fieldName) {

	var leftMargin = (window.screen.width - 700) / 2;
	var topMargin = (window.screen.height - 500) / 2;

	window.open("/formpreview.php?id="+ encodeURIComponent(document.getElementById(fieldName).value), "formPreview", "width=700,height=500,left="+ leftMargin +",top="+ topMargin +",location=no,menubar=no,toolbar=no,resizable=yes,scrollbars=yes,status=no").focus();
}
function addNextSmsResc (prefix_id, suffix_id, location) {
	prefixValue = document.getElementById(prefix_id).value;
	suffixValue = document.getElementById(suffix_id).value;

	curLocationValue = document.getElementById(location).innerHTML;

	if(prefixValue != '' && suffixValue != '' && isNumeric(prefixValue) && isNumeric(suffixValue) && curLocationValue.indexOf(prefixValue + suffixValue) < 0) {
		document.getElementById(prefix_id).value='';
		document.getElementById(suffix_id).value='';		

		document.getElementById(location).innerHTML = curLocationValue + "<table class=\"trans\" id=\"resc_"+ prefixValue + suffixValue +"\"><input type=\"hidden\" name=\""+ prefix_id +"[]\" value=\""+ prefixValue +"\"><input type=\"hidden\" name=\""+ suffix_id +"[]\" value=\""+ suffixValue +"\"><tr><td>"+ prefixValue +"</td><td> / "+ suffixValue +"</td><td>&nbsp;&nbsp;<a href=\"javascript:deleteSmsResc('"+ prefixValue + suffixValue +"');\" class=\"imgLink\"><img src=\"http://www.fs-location.de/img/tpl/1/icons/delete.gif\" align=\"absmiddle\" title=\"Empfänger entfernen\">&nbsp;<span class=\"imgLink\">Empfänger entfernen</span></a></tr></table>";

		document.getElementById(location).style.display="inline";
	} else {
		alert('Die eingegebene Handynummer scheint nicht gültig zu sein und kann deshalb leider nicht zu der Liste der Empfänger hinzugefügt werden oder er wurde bereits einmal angegeben.');
	}
}

function setCount(count) {
	img_path = "http://www.fs-location.de/img/tpl/1/icons/";
	parent_obj = document.getElementById("countBar");
	document.getElementById("vote_count").value = count;
	stars = parent_obj.getElementsByTagName("img");
	for(i=0;i<stars.length;i++) { stars[i].src = img_path +"cam_gray.gif"; stars[i].parentNode.style.fontWeight = "normal";}
	stars[(count-1)].src = img_path +"cam_gold.gif";
	stars[(count-1)].parentNode.style.fontWeight = "bold";

	/*
	for(i=0;i<count;i++) { stars[i].src = img_path +"cam_gold.gif"; }
	for(i=count;i<stars.length;i++) { stars[i].src = img_path +"cam_gray.gif"; }
	*/
}
function setCountUserVoting(count,s,iStyle,id) {
	img_path = "http://www.fs-location.de/img/tpl/"+ s +"/profile/"+ iStyle +"/";
	parent_obj = document.getElementById("countBar"+ id);
	icons = parent_obj.getElementsByTagName("img");
	for(i=0;i<count;i++) { icons[i].src =  img_path + iStyle +"_small1.gif"; }
	for(i=count;i<icons.length;i++) { icons[i].src = img_path + iStyle +"_small0.gif"; }

	document.getElementById("v"+ id).value = count;
	
	document.getElementById("subbu"+ id).style.visibility = "visible";
	document.getElementById("subbu"+ id).style.color = "#000000";
	document.getElementById("subbu"+ id).disabled = false;
	document.getElementById("subbu"+ id).style.border = "1px black solid";
	document.getElementById("subbu"+ id).style.background = "#FFFFFF";
}