// @(#) $Id: main.js,v 1.1.1.1 2004/05/07 09:14:29 tom Exp $


var $j = jQuery.noConflict();

$j(document).ready(addNewZepterGoogleMapLink);
function addNewZepterGoogleMapLink(el) {
  if(el == 'undefined' || typeof(el) == 'function') {
    var menuEntries = $j(document).find(".MenuEntry");
    for(var i in menuEntries) if(typeof(menuEntries[i]) == 'object') {
      var menuEntry = menuEntries[i];
      var onmouseover = $j(menuEntry).attr('onmouseover');
      if(String(onmouseover).length > 0) {
        var onclick = $j(menuEntry).attr('onclick');
        //alert(onclick);
        if(String(onclick).indexOf('/map2/') > 0) {
          $j(menuEntry).attr('onclick', '');
          $j(menuEntry).click(function() {
            window.open("http://www.zepter.com/TreeMenu/Contact.aspx", "_blank");
            //alert(1);
          });
          //alert(onclick+' --- '+$j(menuEntry).attr('onclick'));
        }
      }
    }
  }
}

function WOpen(name,url,w,h,s,r)
{
	return(window.open(url,name,"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars="+s+",resizable="+r+",fullscreen=no,channelmode=no,width="+w+",height="+h));
}

function hiddenEm(name,domain) {
	window.location.href="mailto"+":"+name+"@"+domain;
}

function writeEm(name,domain) {
	emailE = (name + '@' + domain);
    document.write('<a href="mailto:' + emailE + '">' + emailE + '</a>');
}

function hiddenTx( str )
{
	str = str.replace( "*", "@" );
	var str_array = str.split("..");
	
	for(i=0;i<str_array.length;i++) document.write( str_array[i]+"<font><\/font>" );
}

var win=null;
function imgzoom(w,h,imgurl,infotext) {
	// Detect browser
	NN=(document.layers)? true:false;
	IE=(document.all)? true:false;

	var infotext;

	if (w<200)
	{
		w=w+100;
	}

	if (win!=null)
		if (!win.closed) { win.window.close(); }
	win=window.open('','win','status=no,scrollbars=no,width='+w+',height='+h+',left=20,top=20');

	Code="<HTML>\n"
		+"<HEAD>\n"
		+"<link rel='stylesheet' href='a.css' type='text/css'>"
		+"<TITLE>Zoom</TITLE>\n"
		+"</HEAD>\n"
		+"<BODY LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 STYLE='background-color:white'>\n"
		+"<br>"
		+"<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 ALIGN='center'><TR>"
		+"<TD onClick='window.close()' STYLE='cursor:hand' VALIGN='middle'>"
		+"<a href='#'><IMG SRC='"+imgurl+"' NAME='obrazek' border='0'></a>"
		+"</TD></TR></TABLE>\n";
		if (infotext)
		{
			Code+="<div id='infotext' class='zoominfotext' onClick='window.close()'>"+infotext+"</div>"
		}
		else
		{
			Code+="<script>resizeTo("+w+"+50,"+h+"+90)</script>";
		}
		Code+="</BODY>\n";
		if (infotext)
		{
			Code+="<script>resizeTo("+w+"+50,("+h+"+90+document.all['infotext'].scrollHeight))</script>";
			//+"<script>alert("+h+"+''+90+''+document.all['infotext'].scrollHeight)</script>";
			Code+="<script>resizeTo("+w+"+50,("+h+"+90+document.all['infotext'].scrollHeight))</script>";
		}
		Code+="</HTML>";
	win.document.write(Code);
	//win.location.reload();
}


