var sessionCache=false;
function getSession(session) {
if (session)
return '/' + session;
if (sessionCache)
return '/' + sessionCache;
if (typeof top.sessionId != 'undefined')
return '/' + top.sessionId;
var m=document.location.pathname.match(/^\/([0-9a-z]{32})\/.*/i);
if (m != null && m[1]) {
sessionCache=m[1];
return '/' + sessionCache;
}
return '';
}
function openUrl(url) {
var winName='_blank';
var width=336;
var height=450;
var screenHeight=(screen.height) ? screen.height : 900;
if (url.indexOf('myuser/') != -1) {
winName='myuser' + getParam(url, 'partnerId');
} else if (url.indexOf('jump.php') != -1) {
width=false;
height=false;
winName= 'ext' + getParam(url, 'jump');
winName=winName.replace(/%[0-9A-Fa-f]{2}|\./g, '');
} else if (url.indexOf('pix/popup.php') != -1) {
if(arguments && arguments.length > 1) {
if(arguments[1]) width=arguments[1];
if(arguments[2]) height=arguments[2];
}
winName= 'picpopup';
} else if (url.indexOf('market') != -1) {
width=336;
height=590;
winName= 'marketEntry' + getParam(url, 'id');
} else if (url.indexOf('links/index.php') != -1) {
width=336;
height=590;
winName= 'mylinks' + getParam(url, 'set');
} else if (	(url.indexOf('locationPopup.php?map=true') != -1) || 
(url.indexOf('maps/map.php') != -1) ||
(url.indexOf('selfPosition') != -1)) {
width=900;
height=700;
winName= 'location';
} else if (url.indexOf('locationPopup') != -1) {
width=500;
height=500;
winName= 'location';
} else if (url.indexOf('forum_thread') != -1) {
width=710;
height=595;
winName='thread' + getParam(url, 'thread');
} else if (url.indexOf('footprint.php') != -1) {
winName='footprint' + getParam(url, 'receiverId');
} else if (url.indexOf('setcard') != -1) {
if (url.indexOf('&t=3') != -1) {
width=800;
height=(screenHeight >= 768) ? 720 : 575;
} else {
width=470;
height=560;
if (screenHeight > 600) height=590;
if (screenHeight >= 800) height=680;
}
winName='setcard' + getParam(url, 'set');
} else if (url.indexOf('history') != -1) {
winName='history' + getParam(url, 'uid');
} else if (url.indexOf('msg') != -1) {
var uid=getParam(url, 'uid');
if (uid) {
winName='newmsg' + uid;
} else {
winName='msg' + getParam(url, 'id');
}
} else if (url.indexOf('album') != -1) {
width=1000;
height=730;
winName='album' + getParam(url, 'set');
} else if (url.indexOf('guestbook') != -1) {
height=590;
winName='guestbook' + getParam(url, 'empfaenger');
} else if (url.indexOf('maps/') != -1) {
width=screen.width;
height=screen.height - 150;
var user=getParam(url, 'guide');
if (!user) user='Self';
winName='map' + user;
} else if (url.indexOf('helpid') != -1) {
width=520;
height=500;
winName='help';
} else if (url.indexOf('newsId') != -1) {
width=570;
height=500;
winName='NewsPreview';
} else if (url.indexOf('complain_member') != -1) {
width=400;
height=572;
winName='advice' + getParam(url, 'id');
} else if (url.indexOf('settings') != -1) {
width=680;
height=510;
winName='Settings';	
} else if (url == 'fotzhobel') {
width=1240;
height=800;
url='about:blank';
winName='NewsPreview';
} else if (url == 'cm') {
width=570;
height=500;
url='about:blank';
winName='NewsPreview';
} else if (url.indexOf('/mitglieder/messenger/') != -1) {
winName='miniMessenger';
width=280;
height=320;
}
else if (url.indexOf('MovieCoverPage') != -1) {
winName='MovieCover';
width=900;
height=650;
}
if (url.indexOf('jump.php') != -1) {
var winParams='toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=yes';
} else if (url.indexOf('maps/') != -1) {
var winParams='toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no';
} else if (url.indexOf('pix/popup.php') != -1) {
var winParams='toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no';
} else {
var winParams='toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no';
}
if (width) winParams += ',width=' + width;
if (height) winParams += ',height=' + height;
window.open(url, winName, winParams);
return false;
}
function getParam(url, param) {
var start=url.indexOf(param + '=');
if (start == -1) return false;
start += param.length + 1;
var end=url.indexOf('&', start);
if (end == -1) {
return url.substr(start);
} else {
return url.substr(start, end - start);
}
}
function speed(target) {
window.setTimeout(function() {
var d=(target) ? top.frames[target].document : document;
var els=d.body.childNodes;
var elsL=els.length;
for (var i=0; i < elsL; i++) {
if (els[i].style)
els[i].style.display='none';
}
var waitEl=d.createElement('div');
waitEl.setAttribute('id','wait');
var divEl=d.createElement('div');
d.body.appendChild(waitEl);
}, 250);
}
function addEvent(el, ename, fn) {
if (!el) return false;
if (el.addEventListener) {
el.addEventListener(ename, fn, false);
return true;
} else if (el.attachEvent) {
var r=el.attachEvent('on' + ename, fn);
return r;
} else {
alert('Event-Fehler');
}
}
function hasCn(el, className) {
if (!el) return false;
var cn=' ' + el.className + ' ';
return (cn.indexOf(' ' +  className + ' ') > -1);
}
function openTopContent(url) {
win=window;
while (win.opener) {
win=win.opener;
}
if (win.top && win.top.frames && win.top.frames.mitte) {
win.top.frames.mitte.document.location.href=url;
} else {
window.open(url, "_new");
}
return false;
}
var picsOpen=false;
function addPics() {
if (!_el('picScript')) {
addScript('pic/mm', 'picScript');
picsOpen=true;
_el('addPics').style.display='';
} else {
if (picsOpen) {
_el('addPics').style.display='none';
picsOpen=false;
} else {
_el('addPics').style.display='';
picsOpen=true;
}
if (typeof msgResize != 'undefined') msgResize();
}
return false;
}
function posY(el) {
var curtop=0;
if (el.offsetParent)
{
while (el.offsetParent)
{
curtop += el.offsetTop;
el=el.offsetParent;
}
}
else if (el.y)
curtop += el.y;
return curtop;
}
function posX(el) {
var curleft=0;
if (el.offsetParent)
{
while (el.offsetParent)
{
curleft += el.offsetLeft;
el=el.offsetParent;
}
}
else if (el.x)
curleft += el.x;
return curleft;
}
function wHght(w) {
if (!w) w=window;
return (w.innerHeight) ? w.innerHeight : w.document.body.clientHeight;
}
function openWin(url, name, width, height) {
window.open(getSession() + url, name,
'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=' + width + ',height=' + height);
return false;
}
function openPicWin(url, name, width, height) {
window.open(getSession() + url, name,
'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=' + width + ',height=' + height);
return false;
}
function openTou() {
return openWin('/aboutme/regeln.php', 'termsOfUse', 530, 500);
}
function openSet(userId, type) {
if (this.href) alert(this.href);
if (type == 3) {
return openCluide(userId);
} else {
return openProfile(userId);
}
}
function openProfile(userId, session) {
var height=560;
if (screen.height) {
if (screen.height > 600) height=590;
if (screen.height >= 800) height=680;
}
return openWin('/auswertung/setcard/index.php?set=' + userId, 'setcard' + userId, 494, height);
}
function openCluide(userId) {
var height=(screen.height >= 768) ? 720 : 575;
return openWin('/auswertung/setcard/index.php?set=' + userId, 'setcard' + userId, 800, height);
}
function openProfilePreview(userId, style, mainPic) {
var url='/auswertung/setcard/index.php?set=' + userId + '&preview=1&style=' + style;
if (mainPic) url += '&mainPic=' + mainPic;
var height=560;
if (screen.height) {
if (screen.height > 600) height=590;
if (screen.height > 800) height=680;
}
return openWin(url, 'profilePreview', 494, height);
}
function openStylesPreview() {
var url='/style/preview/';
var height=560;
if (screen.height) {
if (screen.height > 600) height=590;
if (screen.height > 800) height=680;
}
return openWin(url, 'stylePreview', 700, height);
}
function openPicture(picHash, width, height, session) {
if (!width) {
width=400;
height=400;
}
return openPicWin('/auswertung/pix/popup.php/' + picHash + '.jpg', 'picpopup', width, height);
}
function openAttachedPicture(picHash, width, height, session) {
return openPicWin('/auswertung/pix/popup.php/' + picHash + '.jpg?message=1', 'picpopup', width, height);
}
function openAvs(session) {
window.open(getSession(session) + "/gemeinsam/php/avshinweis.php",
"avs",
"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=240,height=450");
return false;
}
function openAlbum(userId, folderId, userName, folderName, session) {
folderId=(folderId) ? folderId : 0;
window.open(getSession(session) + "/auswertung/album/?set=" + userId + "&id=" + folderId + "&user=" + userName,
"album" + userId,
"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=1000,height=730");
return false;
}
function openFotoAlbum(userId, albumId, edit, session) {
albumId=(albumId) ? albumId : 0;
window.open(getSession(session) + "/auswertung/album/album_index.php?set=" + userId + "&albumId=" + albumId,
"album" + albumId + userId,
"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=800,height=600");
return false;
}
function openMyuser(userId, cameFrom, session) {
return openWin('/gemeinsam/php/myuser/index.php?partnerId=' + userId + '&cameFrom=' + cameFrom, 'myuser' + userId, 336, 450);
}
function openMessage(msgId, session) {
window.open(getSession(session) + "/msg/?id=" + msgId,
"message" + msgId,
"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=336,height=450");
return false;
}
function markMessageAsRead(msgId) {
if ((opener) && (opener.top.persoenliches) && (opener.top.unten) && (opener.top.unten.decrMsg)) {
opener.top.unten.decrMsg();
el=opener.top.persoenliches.document.getElementById('msg'+msgId);
if (el && el.firstChild && el.firstChild.firstChild && el.firstChild.firstChild.src) {
el.className='row read';
el.firstChild.firstChild.src='/gemeinsam/grafiken/articons/message_black.gif';
}
}
}
function openNewMessage(userId, session) {
window.open(getSession(session) + "/msg/?uid=" + userId,
"newmsg" + userId,
"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=336,height=450");
return false;
}
function openSupportMessage(userId, session) {
window.open(getSession(session) + "/msg/?support=1&uid=" + userId,
"newmsg" + userId,
"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=336,height=450");
return false;
}
function openHistory(userId, session) {
window.open(getSession(session) + "/msg/history.php?uid=" + userId,
"history" + userId,
"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=336,height=450");
return false;
}
function openGuestbook(userId, session) {
return openWin('/gemeinsam/php/guestbook/lesen.php?empfaenger=' + userId, 'guestbook' + userId, 336, 590);
}
function openMyLinks(userId, session) {
return openWin('/gemeinsam/php/links/index.php?set=' + userId, 'mylinks' + userId, 336, 590);
}
function openHelp(topic, session) {
window.open(getSession(session) + "/service/kontakthilfe/keyword_suche.php?helpid=" + topic,
"hilfe",
"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=520,height=500");
return false;
}
function openClubThread(clubId, thread, session) {
window.open(getSession(session) + "/auswertung/setcard/club/forum_thread.php?set=" + clubId + "&thread=" + thread,
"thread" + thread,
"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=710,height=595");
return false;
}
function openClubAlbum(clubId, albumId, session) {
window.open(getSession(session) + "/auswertung/setcard/club/album/frameset.php?set=" + clubId + "&albumId=" + albumId,
"album" + albumId,
"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=1000,height=730");
return false;
}
function openAdvice(userId, session,typ) {
window.open(getSession(session) + "/mitglieder/supporter/complain_member.php?id=" + userId + "&typ=" + typ,
"advice" + userId,
"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=400,height=572");
return false;
}
function openComplain(userId, session, typ) {
var suspectType=(typ == 65) ? 'advert': 'member';
window.open(getSession(session) + "/mitglieder/supporter/complain_" + suspectType + ".php?id=" + userId + "&typ=" + typ,
"advice" + userId,
"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=400,height=572");
return false;
}
function openMarketEntry(id, cameFrom, session) {
window.open(getSession(session) + "/market/showMarketEntry.php?id=" + id + "&cameFrom=" + cameFrom,
"MarketEntry" + id,
"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=336,height=500");
return false;
}
function openProfileMarketEntries(userId, cameFrom, session) {
window.open(getSession(session) + "/market/profileMarketEntriesFrameset.php?userId=" + userId + "&cameFrom=" + cameFrom,
"ProfileMarketEntries" + userId,
"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=336,height=500");
return false;
}
function openFootprint(receiverId, cameFrom, session) {
window.open(getSession(session) + "/auswertung/setcard/romeo/footprint.php?receiverId=" + receiverId + "&cameFrom=" + cameFrom,
"footprint" + receiverId,
"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=336,height=450");
return false;
}
function loadPNGs() {
var imgs=document.getElementsByTagName('kbd');
if (!imgs) return false;
var ieHack=(typeof imgs[0].style.filter == 'string');
for (var i=0; i < imgs.length; i++) {
var el=imgs[i];
var src=el.getAttribute('src');
var size=el.className.slice(1);
if (src) {
if (ieHack) {
el.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=scale src='/img/" + size + '/' + src + '.png';
} else {
el.style.backgroundImage='url(/img/' + size + '/' + src + '.png)';
}
}
}
return true;
}
function loadSkin(id) {
if (id < 0 || id > 10) id=1;
if (id < 10 && top.links) {
var el=top.links.document.getElementById('catcher');
if (el && newGuys[id].width) {
el.style.background='url(' + newGuys[id].src + ') bottom right no-repeat';
el.style.width=newGuys[id].width + 'px';
el.style.height=newGuys[id].height + 'px';
}
el=top.oben.document.getElementById('pic');
if (el)	{ el.style.backgroundImage='url(/gemeinsam/skins/' + id + '/topskin/topskin.jpg?v=sv9)'; }
}
}
function confirmAction(text) {
return confirm(text);
}
function disableSubmit(elemId) {
var el=_el(elemId);
if (el) el.disabled=true;
return true;
}
function enableSubmit(elemId) {
var el=_el(elemId);
if (el) el.disabled=false;
return true;
}
function setCheckbox(elemId) {
var el=_el(elemId);
if (el) el.click();
return true;
}
function gtIE55() {
var ua=navigator.userAgent;
var pos=ua.indexOf('MSIE');
if (pos > -1) {
var ver=ua.substring(pos + 5);
var pos=ver.indexOf(';');
var ver=ver.substring(0,pos);
if ((ver == '5.5') || (ver == '6.01') || (ver == '6.0'))
return true;
}
return false;
}
function _el(i) {return document.getElementById(i); }
function addScript(src, id) {
var d=document;
var fuckIE=false;
if (!_el(id) && document.createElement) {
var ua=navigator.userAgent;
var pos=ua.indexOf('MSIE');
if (pos > -1) {
var ver=ua.substring(pos + 5);
var pos=ver.indexOf(';');
var ver=ver.substring(0,pos);
if ((ver == '5.01') || (ver == '5.0'))
fuckIE=true;
}
if (fuckIE) {
var el=d.createElement('script');
el.src=getSession() + '/js/js.php/' + src;
el.setAttribute('id',id);
el.setAttribute('name',id);
var ifram=d.body.appendChild(el);
} else {
d.body.style.cursor='wait';
var el=d.createElement('iframe');
el.src=getSession() + '/js/iframe.php/' + src;
el.setAttribute('id',id);
el.setAttribute('name',id);
el.width=0;
el.height=0;
var ifram=d.body.appendChild(el);
}
}
}
function stopPropagation(e) {
if (window.event) e=window.event;
if (!e) return false;
if (e.stopPropagation) {	
e.stopPropagation();
} else {					
e.cancelBubble=true;
}
}
function is_ws(el) {
return !(/[^\t\n\r ]/.test(el.data));
}
function is_ignorable(el) {
return (el.nodeType == 8) ||
((el.nodeType == 3) && is_ws(el) );
}
function node_after(el) {
while ((el=el.nextSibling)) {
if (!is_ignorable(el)) return el;
}
return null;
}
function node_before(el) {
while ((el=el.previousSibling)) {
if (!is_ignorable(el)) return el;
}
return null;
}
function cloneFunctionToString(_func) {
var functionString=_func.toString();
var bodyString=functionString.substring( functionString.indexOf("{")+1, functionString.lastIndexOf("}") );
var functionArg=functionString.substring( functionString.indexOf("(")+1, functionString.indexOf(")") );
var argArray=functionArg.split(",");
var retString="new Function(";
for (var i=0; i < argArray.length; i++) {
retString += "'" + argArray[i] + "',";
}
retString += "'" + bodyString + "')";
retString=retString.replace(/\n/g," ");
return retString;
}
function debug(msg) {
return true;
var dw=openDebug();
dw.write(msg+"\n");
}
var debugWin=false;
function openDebug() {
if (debugWin) return debugWin;
debugWin=window.open("",
"debug",
"left=0,top=0,width=300,height=700,scrollbars=yes,status=yes,resizable=yes");
debugWin=debugWin.document;
debugWin.open();
debugWin.write("<html><head><title>Debug ::..  ..:: GayRomeo.com ::..</title></head><body><pre>\n");
return debugWin;
}
if (!console) {
var console={
log: function(options) {
}
};
};
function removeWhitespace(item) {
var tmp="";
var item_length=item.length;
var item_length_minus_1=item.length - 1;
for (index=0; index < item_length; index++) {
if (item.charAt(index) != ' ') {
tmp += item.charAt(index);
} else {
if (tmp.length > 0) {
if (item.charAt(index+1) != ' ' && index != item_length_minus_1) {
tmp += item.charAt(index);
}
}
}
}
return tmp;
};
if (!Array.prototype.indexOf) { 
Array.prototype.indexOf=function(elt ) {
var len=this.length;
var from=Number(arguments[1]) || 0;
from=(from < 0) ? Math.ceil(from) : Math.floor(from);
if (from < 0) from += len;
for (; from < len; from++) {
if (from in this && this[from] === elt) return from;
}
return -1;
};
};
function _elByType (tag, type) {
var oInp=document.getElementsByTagName(tag);
var oOut=new Array();
var j=0;
for (var i=0; i < oInp.length; i++) {
if(oInp[i].getAttribute('type') == type) {
oOut[j]=oInp[i];
j++;
}
}
return oOut;
};