/* 
JavaScript-Bibliothek der Münchner EventCommunity
*/ 

function FensterOeffnen (Adresse) {
  Fenster1 = window.open(Adresse, "Zweitfenster", "width=980,height=655,left=265,top=116");
  Fenster1.focus();
}


function MVV (Adresse) {
  Fenster1 = window.open(Adresse, "MVV", "width=480,height=605,left=265,top=116,resizable=yes,scrollbars=yes");
  Fenster1.focus();
}


function TranslitFAQ (Adresse) {
  Fenster1 = window.open(url="http://www.munich-eventcomunity.de/TranslitFAQ.html", "TranslitFAQ", "width=275,height=760,left=800,top=116,resizable=yes,scrollbars=yes");
  Fenster1.focus();
}


function Chat (Adresse) {
  Fenster1 = window.open(Adresse, "Chat", "width=980,height=655,left=265,top=116");
  Fenster1.focus();
}


function Grusskarten (Adresse) {
  Fenster1 = window.open(Adresse, "Grusskarten", "width=980,height=655,left=265,top=190");
  Fenster1.focus();
}


function MP3Player (Adresse) {
  Fenster1 = window.open(url="http://www.munich-eventcomunity.de/music_box/skin6.html", "MP3Player", "width=500,height=450,left=265,top=190");
  Fenster1.focus();
}


function WebRadio (Adresse) {
  Fenster1 = window.open(url="http://www.munich-eventcomunity.de/webradio/skin9.html", "WebRadio", "width=550,height=450,left=5,top=116");
  Fenster1.focus();
}


function Chemiekasten (Adresse) {
  Fenster1 = window.open(Adresse, "Chemiekasten", "width=660,height=600,left=265,top=190");
  Fenster1.focus();
}


function Waehrungsumrechner (Adresse) {
  Fenster1 = window.open(Adresse, "Waehrungsumrechner", "width=250,height=220,left=265,top=190");
  Fenster1.focus();
}


function Stromvergleich (Adresse) {
  Fenster1 = window.open(Adresse, "Stromvergleich", "width=420,height=500,left=265,top=190");
  Fenster1.focus();
}


function Preisvergleich (Adresse) {
  Fenster1 = window.open(Adresse, "Preisvergleich", "width=250,height=240,left=265,top=190");
  Fenster1.focus();
}


function TelTarifRechner (Adresse) {
  Fenster1 = window.open(Adresse, "TelTarifRechner", "width=500,height=310,left=265,top=190");
  Fenster1.focus();
}


function Aktienkurse (Adresse) {
  Fenster1 = window.open(Adresse, "Aktienkurse", "width=430,height=220,left=265,top=190");
  Fenster1.focus();
}


function Musikbox (Adresse) {
  Fenster1 = window.open(Adresse, "Musikbox", "width=400,height=250,left=5,top=116");
  Fenster1.focus();
}



function checkSearch()
{
	if (document.search_block.search_engine.value == 'google')
		{
		window.open('http://www.google.de/search?q=' + document.search_block.search_keywords.value, '_google', '');
		return false;
		}
else

	if (document.search_block.search_engine.value == 'yahoo')
		{
		window.open('http://de.search.yahoo.com/search?q=' + document.search_block.search_keywords.value, '_yahoo', '');
		return false;
		}

else

	if (document.search_block.search_engine.value == 'lycos')
		{
		window.open('http://suche.lycos.de/cgi-bin/pursuit?query=' + document.search_block.search_keywords.value, '_lycos', '');
		return false;
		}

else

	if (document.search_block.search_engine.value == 'fireball')
		{
		window.open('http://suche.fireball.de/cgi-bin/pursuit?cat=fb_loc&query=' + document.search_block.search_keywords.value, '_fireball', '');
		return false;
		}

else

	if (document.search_block.search_engine.value == 'altavista')
		{
		window.open('http://de.altavista.com/web/results?itag=ody&q=' + document.search_block.search_keywords.value, '_altavista', '');
		return false;
		}

else

	if (document.search_block.search_engine.value == 'abacho')
		{
		window.open('http://search.abacho.com/de/abacho.de/index.cfm?q=' + document.search_block.search_keywords.value, '_abacho', '');
		return false;
		}


	{
	return true;
	}

}


// a small poupup window to show who's in the chat at the current time
function showInfo() {
	// the size of the popup window
	var width = 400;
	var height = 300;

	// the x,y position of the popup window
	// NOTE: this formula will auto-center the popup on the screen
	var y = (screen.height - height) / 2;
	var x = (screen.width - width) / 2;

	var url = 'http://www.munich-eventcomunity.de/chat/info.php';
	var options = 'width=' + width + ',height=' + height + ',top=' + y + ',left=' + x + ',resizable';

	// open the info window as a popup, instead of embedded in webpage
	window.open( url, 'info', options );
}





function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}




var objSave = null;

function friendsmenu(divid) {
  d=document;

  var bild = 'bild' + divid;

if(d.getElementById(divid).style.display == 'block'){
  d.getElementById(divid).style.display = 'none';
  d.getElementById(bild).src = 'templates/fisubice/images/plus.gif';
 }else{
  d.getElementById(divid).style.display = 'block';
  d.getElementById(bild).src = 'templates/fisubice/images/minus.gif';
 }
}




<!-- start of Trend Micro HouseCall code -->
var lkTXT=''
var subTXT=''
var useImage=false

var imgURL=''
var imgWD=''
var imgHT=''

var hcURL='http://housecall.trendmicro.com/housecall/start_frame.asp'
var options = 'scrollbars=yes,resizable=yes,width=500,height=420'
var popup
var p

function newWindow2(url) {
  url = url + '?ref=' + escape(document.location)
  if (!popup || popup.closed) {
    popup = window.open(url,"popup",options)
  } else {
    popup.location = url
    popup.focus()
  }
}

function writeHTML() {
  p='<font face="Verdana, Helvetica, sans-serif" size="-1">'
  p+='<a href="javascript:newWindow2(\''+hcURL+'\')" onMouseOver="window.status=\''+lkTXT+'\';return true" onMouseOut="window.status=\' \';return true">'
  if (useImage) {
    p+='<img src="'+imgURL+'" width="'+imgWD+'" height="'+imgHT+'" border="0"></a>'
  } else {
    p+='<b>'+lkTXT+'</b></a><br><font size="-2">'+subTXT+'</font></font>'
  }
  document.write(p)
}

writeHTML()



function setCheckboxes(theForm, elementName, isChecked)
{
    var chkboxes = document.forms[theForm].elements[elementName];
    var count = chkboxes.length;

    if (count) 
	{
        for (var i = 0; i < count; i++) 
		{
            chkboxes[i].checked = isChecked;
    	}
    } 
	else 
	{
    	chkboxes.checked = isChecked;
    } 

    return true;
} 




function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}




var win = null; 
function Gk_PopTart(mypage,myname,w,h,scroll) 
{ 
  LeftPosition = (screen.width) ? (screen.width-w)/2 : 0; 
  TopPosition = (screen.height) ? (screen.height-h)/2 : 0; 
  settings = 'height='+h+', width='+w+', top='+TopPosition+', left='+LeftPosition+',scrollbars='+scroll+', resizable=no'; 
  win = window.open(mypage,myname,settings); 
}



var win2 = null;
function Teleport_Popup(mypage,myname,w,h,scroll)
{
  LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
  TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
  settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable';
  win2 = window.open(mypage,myname,settings);
}


window.status = "{PRIVATE_MESSAGE_INFO}";


//
// Ôóíêöèè ïåðåâîäà òðàíñëèòà â íîðìàëüíûé ðóññêèé ÿçûê äîáàâëåíà 01/01/2002 Àíäðååì Ìàçëèíûì
//
var lat = new Array("je","jo","ayu","ay","aj","oju","oje","oja","oj","uj","yi","ya","ja","ju","yu","ja","juju","aja","y","zh","i'","shch","sch","ch","sh","ea","a","b","v","w","g","d","e","z","i","k","l","m","n","o","p","r","s","t","u","f","x","c","ea","'e","'","`","j","h");
var cyr = new Array("ý","¸","aþ","àé","àé","îþ","îå","îÿ","îé","óé","ûé","ÿ","ÿ","þ","þ","ÿ","þþ","àÿ","û","æ","é","ù","ù","÷","ø","ý","à","á","â","â","ã","ä","å","ç","è","ê","ë","ì","í","î","ï","ð","ñ","ò","ó","ô","õ","ö","ý","ý","ü","ú","é","õ");

var latcap = new Array("Yo","Jo","Ey","Je","Ay","Oy","Oj","Uy","Uj","Ya","Ja","Ju","Yu","Ja","Y","Zh","I'","Sch","Ch","Sh","Ea","Tz","A","B","V","W","G","D","E","Z","I","K","L","M","N","O","P","R","S","T","U","F","X","C","EA","J","H");
var cyrcap = new Array("¨","¨","Åé","Ý","Àé","Îé","Îé","Óé","Óé","ß","ß","Þ","Þ","ß","Û","Æ","É","Ù","×","Ø","Ý","Ö","À","Á","Â","Â","Ã","Ä","Å","Ç","È","Ê","Ë","Ì","Í","Î","Ï","Ð","Ñ","Ò","Ó","Ô","Õ","Ö","Ý","É","Õ");

function translit()
{
	var buf = new String;
	var selection = false;
	var txtarea = document.post.message;
	var regexp;
	var i;
	
	if (document.selection)
	{
		selection = document.selection.createRange().text;
	}
	
	if (selection)
	{
		buf = selection;
	}
	else
	{
		buf = txtarea.value;
	}
	
	for (i = 0; i < latcap.length; i++)
	{
		eval('regexp = /'+latcap[i]+'/g');
		buf = buf.replace(regexp, cyrcap[i]);
	}
	
	for (i = 0; i < lat.length; i++)
	{
		eval('regexp = /'+lat[i]+'/g');
		buf = buf.replace(regexp, cyr[i]);
	}

	if (selection)
	{
		eval('regexp = /'+selection+'/');
		txtarea.value = txtarea.value.replace(regexp, buf);
	}
	else
	{
		txtarea.value = buf;
	}
	
	selection = '';
	
	txtarea.focus();

	return;
}
