//window.onload = init ( );
//var d=document;

function gallery(id,reihe)
{	
	var l=(screen.availWidth-750)/2
	var t=(screen.availHeight-520)/2
	if(reihe==undefined) {
		var obj=window.open("gallery.php?id="+id+"&overview=1", "GALLERY", "fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,directories=no,location=no,width=750,height=530,left="+l+",top="+t)
	}
	else {
		var obj=window.open("gallery.php?id="+id+"&reihe="+reihe, "GALLERY", "fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,directories=no,location=no,width=750,height=530,left="+l+",top="+t)
	}
	obj.opener=top.window;
	obj.focus();
}

function galleryblog(id,reihe)
{	
	var l=(screen.availWidth-750)/2
	var t=(screen.availHeight-520)/2
	if(reihe==undefined) {
		var obj=window.open("galleryblog.php?id="+id+"&overview=1", "GALLERY", "fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,directories=no,location=no,width=750,height=530,left="+l+",top="+t)
	}
	else {
		var obj=window.open("galleryblog.php?id="+id+"&reihe="+reihe, "GALLERY", "fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,directories=no,location=no,width=750,height=530,left="+l+",top="+t)
	}
	obj.opener=top.window;
	obj.focus();
}


function galleryuser(id,reihe)
{
	var l=(screen.availWidth-750)/2
	var t=(screen.availHeight-520)/2
	var obj=window.open("galleryuser.php?id="+id+"&overview=1", "GALLERYUSER", "fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,directories=no,location=no,width=750,height=530,left="+l+",top="+t)
	obj.opener=top.window;
	obj.focus();
}


/**********************************************************************************************************************
** created by dave @> nov/24/2007-16:18:45																			 **
** reason: bug_report #153  ->>	toggle anchor text in blog content tree												 **
**********************************************************************************************************************/
function toggleDispMode ( arg )
{
	obj = document.getElementById ( arg );
	obj2 = document.getElementById ( "a"+arg );
	
	if ( obj.style.display == "none" )
	{
		obj.style.display = "block";
		obj2.innerHTML = "&raquo;&nbsp;ausblenden";
	}
	
	else
	{
		obj.style.display = "none";
		obj2.innerHTML = "&raquo;&nbsp;anzeigen";
	}
}
/**********************************************************************************************************************
** end of edit																										 **
**********************************************************************************************************************/


/**********************************************************************************************************************
** created by dave @> aug/22/2007-00:30:56																			 **
** reason: bug_report #93  ->>	generate javascript popup window with answer form									 **
**********************************************************************************************************************/
function answerMsg ( msgID, delMsg )
{
	var l = (screen.availWidth - 600) / 2;
	var t = (screen.availHeight - 260) / 2;
			
	var obj = window.open ( "answerMsg.php?msgid="+msgID+"&delmsg="+delMsg, "antworten", "fullscreen=no, toolbar=no, status=no, menubar=no, scrollbars=no, resizable=no, directories=no, location=no, width=600, height=260, left="+l+", top="+t );
	obj.focus ( );
	

 	/*if(document.getElementById(id).style.display == 'none')
 	{
  		document.getElementById(id).style.display = 'block';
 	}
 		else
 	{
  		document.getElementById(id).style.display = 'none';
 	}*/
}
/**********************************************************************************************************************
** end of edit																										 **
**********************************************************************************************************************/


/**********************************************************************************************************************
** edited by dave @> oct/11/2007-17:57:46																			 **
** reason: bug_report #133  ->>	select multiple messages to delete													 **
**********************************************************************************************************************/
function getSelectedMsgs ( profileID )
{	
	var i = 0;
	var generatedLink = "http://community.twoleftfeet.ch/profile__"+profileID+".html?action=delselmsg&MsgDelSel=";
	
	imgObj = document.getElementById("cimg"+i);
	
	while ( imgObj )
	{
		if ( imgObj.src.indexOf("chk_on2.gif")>-1 )
		{
			generatedLink = generatedLink+document.getElementById("chkbox"+i).value+"-";
		}
		
		i = i + 1;
		imgObj = document.getElementById("cimg"+i);
	}
	
	document.location.href = generatedLink;
}


function init ( )
{
	createCustomCheckBoxes ( );
}


function createCustomCheckBoxes ( )
{
	var i = 0;
	
	frm = document.getElementById("chkbox"+i)
	
	while ( frm )
	{
		frm.style.position = "absolute";
		frm.style.left = "-9000px";
		
		// create the replacement image
		n = document.createElement("img");
		n.setAttribute("class","chk");
		
		if ( frm.checked == false )
		{
			n.setAttribute("src","chk_off2.gif");
		}
		
		else
		{
			n.setAttribute("src","chk_on2.gif");
		}
		
		// assign the onclick event to the image
		n.onclick = function() { toggleCheckBox(this.id.substr(4),0);return false; };
		n.setAttribute("id","cimg"+i);
		
		n.style.cursor = "url('edding.png'), url('edding.cur'), pointer;";
		
		// insert the image into the DOM
		frm.parentNode.insertBefore(n,frm.nextSibling)
		
		i = i + 1;
		frm = document.getElementById("chkbox"+i)
	}
}


function toggleCheckBox ( cid )
{
	imgObj = document.getElementById("cimg"+cid);
	
	if ( imgObj.src.indexOf("chk_on2.gif")>-1 )
	{
		imgObj.setAttribute("src","chk_off2.gif");
	}
	
	else
	{
		imgObj.setAttribute("src","chk_on2.gif");
	}
}
/**********************************************************************************************************************
** end of edit																										 **
**********************************************************************************************************************/


function galleryparty(id,reihe)
{
	var l=(screen.availWidth-750)/2
	var t=(screen.availHeight-520)/2
	var obj=window.open("galleryparty.php?id="+id+"&overview=1", "GALLERYPARTY", "fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,directories=no,location=no,width=750,height=530,left="+l+",top="+t)
	obj.opener=top.window;
	obj.focus();
}
function comment(id)
{
	var l=(screen.availWidth-750)/2
	var t=(screen.availHeight-490)/2
	var obj=window.open("http://www.twoleftfeet.ch/comment.php?id="+id, "COMMENT", "fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,directories=no,location=no,width=750,height=500,left="+l+",top="+t)
	obj.opener=top.window;
	obj.focus();
}
function comment2(id)
{
	var l=(screen.availWidth-750)/2
	var t=(screen.availHeight-490)/2
	var obj=window.open("comment2.php?id="+id, "COMMENT", "fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,directories=no,location=no,width=750,height=500,left="+l+",top="+t)
	obj.opener=top.window;
	obj.focus();
}
function commentsh(id)
{
	var l=(screen.availWidth-750)/2
	var t=(screen.availHeight-490)/2
	var obj=window.open("http://www.twoleftfeet.ch/comment.php?id="+id, "COMMENT", "fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,directories=no,location=no,width=750,height=500,left="+l+",top="+t)
	obj.opener.location.href="http://www.twoleftfeet.ch/beitrag__"+id+".html";
	obj.opener=top.window;
	obj.focus();
}
function commentblog(id)
{
	var l=(screen.availWidth-750)/2
	var t=(screen.availHeight-490)/2
	var obj=window.open("commentblog2.php?id="+id, "COMMENT", "fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,directories=no,location=no,width=750,height=500,left="+l+",top="+t)
	obj.opener=top.window;
	obj.focus();
}
function inbox(url)
{
	var l=(screen.availWidth-750)/2
	var t=(screen.availHeight-490)/2
	var obj=window.open("inbox.php"+url, "INBOX", "fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,directories=no,location=no,width=750,height=500,left="+l+",top="+t)
	obj.opener=top.window;
	obj.focus();
}

function inbox2(url)
{
	var l=(screen.availWidth-750)/2
	var t=(screen.availHeight-490)/2
	var obj=window.open("inbox2.php"+url, "INBOX", "fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,directories=no,location=no,width=750,height=500,left="+l+",top="+t)
	obj.opener=top.window;
	obj.focus();
}

function zuo(id)
{
	var l=(screen.availWidth-300)/2
	var t=(screen.availHeight-50)/2
	var obj=window.open("zuordnung.php?id="+id, "ZUO", "fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,directories=no,location=no,width=300,height=60,left="+l+",top="+t)
	obj.opener=top.window;
	obj.focus();
}
function zuorel(id)
{
	var l=(screen.availWidth-300)/2
	var t=(screen.availHeight-50)/2
	var obj=window.open("zuorel.php?id="+id, "ZUOREL", "fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,directories=no,location=no,width=300,height=60,left="+l+",top="+t)
	obj.opener=top.window;
	obj.focus();
}
function zuonew(id,typ,back)
{
	var l=(screen.availWidth-320)/2
	var t=(screen.availHeight-100)/2
	var obj=window.open("zuonew.php?id="+id+"&typ="+typ+"&back="+back, "ZUONEW", "fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,directories=no,location=no,width=320,height=110,left="+l+",top="+t)
	obj.opener=top.window;
	obj.focus();
}
function relpic(id)
{
	var l=(screen.availWidth-300)/2
	var t=(screen.availHeight-50)/2
	var obj=window.open("relpic.php?id="+id, "ZUOREL", "fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,directories=no,location=no,width=300,height=60,left="+l+",top="+t)
	obj.opener=top.window;
	obj.focus();
}
function filebrowser(back)
{
	var l=(screen.availWidth-750)/2
	var t=(screen.availHeight-520)/2
	var obj=window.open("filebrowser.php?back="+back, "FILEBROWSER", "fullscreen=yes,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes,directories=no,location=no,width=750,height=530,left="+l+",top="+t)
	obj.opener=top.window;
	obj.focus();
}
function loadpic(wz)
{
	if(wz==true)
	{
		wm=1;
	}else{
		wm=0;
	}
	var l=(screen.availWidth-320)/2
	var t=(screen.availHeight-100)/2
	var obj=window.open("loadpic.php?wm="+wm, "LOADPIC", "fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,directories=no,location=no,width=320,height=110,left="+l+",top="+t)
	obj.opener=top.window;
	obj.focus();
}
function docountry(land)
{
	if(land!="")
	{
		objCH=document.getElementById("LCH");
		objOTHER=document.getElementById("LOTHER");
		objREST=document.getElementById("REST");
		if(land=="CH" || land=="FL")
		{
			objOTHER.style.visibility="hidden";
			objOTHER.style.position="absolute";
			objCH.style.position="static";
			objCH.style.visibility="visible";
			objREST.style.position="static";
			objREST.style.visibility="visible";
		}else{
			objCH.style.visibility="hidden";
			objCH.style.position="absolute";
			objOTHER.style.position="static";
			objOTHER.style.visibility="visible";
			objREST.style.position="static";
			objREST.style.visibility="visible";
		}
	}else{
			objOTHER.style.visibility="hidden";
			objOTHER.style.position="absolute";
			objCH.style.visibility="hidden";
			objCH.style.position="absolute";
			objREST.style.visibility="hidden";
			objREST.style.position="absolute";
	}
}
function popup(reslink,titel)
{
	var l=(screen.availWidth-500)/2
	var t=(screen.availHeight-300)/2
	var obj=window.open(reslink, titel, "fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes,directories=no,location=no,width=500,height=300,left="+l+",top="+t)
	obj.opener=top.window;
	obj.focus();
}

function report ( uid )
{
	var l=(screen.availWidth-410)/2
	var t=(screen.availHeight-220)/2
	obj = window.open ( "report_user.php?id="+uid, "user", "fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,directories=no,location=no,width=410,height=220,left="+l+",top="+t );
	obj.opener=top.window;
	obj.focus();
}
