﻿var currentTooltipTimeoutID=0;var currentTooltipWaitWithHide=false;var currentTooltipShowDelay=2000;var isMoving=false;function ShowMPLoginPopup(){$('#aMPLoginPopup').click();try{pageTracker._trackEvent('Wyniki_wyszukiwania','Link_Ulubione_Zaloguj','Ulubione_boks');}catch(e){}}
function returnPMap(){var pMap={};pMap={adr:null,tTInfo:null,tTimg:null,tTPos:null,arr:null,icon:null,map:null,marker:null,point:null,extPoint:new Array(),gdir:null,gMapI:null,geo:null,mngr:null,customId:"",gMapGlobalInstance:this,iter:null,fixed:null,listaMarkerow:new Array(),setDirections:function(gMapGIns,toAddress,fromAddress,locale){gMapGIns.gdir=new GDirections(gMapGIns.map,document.getElementById("directions"));GEvent.addListener(gMapGIns.gdir,"error",function(){gMapGIns.handleErrors(gMapGIns.gdir)});gMapGIns.gdir.clear();gMapGIns.gdir.load("from: "+fromAddress+" to: "+toAddress,{"locale":locale});return;},handleErrors:function(el){alert(el.getStatus().code);},ToolTip:function(gMapGIns,empPosition,empAddress,empName){var elEmpPosition,el,empLogo,elEmpLogo,elEmpName,elEmpAddress,elControls,elControlsZoomIn,elControlsZoomOut,elControlsOptions,elControlsDir,elControlsDirInput,elControlsDirGo=null;function gMapAddCon(m){m.addControl(new GSmallMapControl());m.addControl(new GMapTypeControl());m.addControl(new GScaleControl());}
if(document.getElementById('gMapInfoDomBranch')){document.getElementById('gMapInfoDomBranch').parentNode.removeChild(document.getElementById('gMapInfoDomBranch'));}
el=document.createElement('div');el.id="gMapInfoDomBranch";elEmpName=document.createElement('p');elEmpName.innerHTML=empName;elEmpName.className="gMapEmpName";elEmpAddress=document.createElement('p');elEmpAddress.innerHTML=empAddress;elEmpAddress.className="gMapEmpAddress";elEmpPosition=document.createElement('p');elEmpPosition.innerHTML=empPosition;elEmpPosition.className="gMapEmpPosition";elControls=document.createElement('div');elControlsZoomIn=document.createElement('span');elControlsZoomIn.innerHTML="zoom+";GEvent.addDomListener(elControlsZoomIn,"click",function(){gMapGIns.map.zoomIn();});elControlsZoomIn.className="gMapControls";elControlsZoomOut=document.createElement('span');elControlsZoomOut.innerHTML="zoom-";GEvent.addDomListener(elControlsZoomOut,"click",function(){gMapGIns.map.zoomOut();});elControlsZoomOut.className="gMapControls";elControlsDir=document.createElement('div');elControlsDir.innerHTML="<p>Pokaz dojazd do: </p>";elControlsDirInput=document.createElement('input');elControlsDirInput.style.width="200px";elControlsDirInput.value="";elControlsDirInput.id="gMapOptionsDir";elControlsDirGo=document.createElement('span');elControlsDirGo.innerHTML="GO";GEvent.addDomListener(elControlsDirGo,"click",function(){gMapGIns.setDirections(gMapGIns,new String(gMapGIns.adr),new String(document.getElementById('gMapOptionsDir').value),new String('pl_PL'));});elControlsDir.appendChild(elControlsDirInput);el.appendChild(elEmpPosition);el.appendChild(elEmpName);el.appendChild(elEmpAddress);el.appendChild(elControls);return el;},init2:function(customId){var el=document.body;this.customId=document.body;this.fixed=true;if(document.getElementById('gMapW')){document.getElementById('gMapW').parentNode.removeChild(document.getElementById('gMapW'));}
var gMapW=document.createElement('div');gMapW.id="gMapW";var elTmp=customId;while(elTmp.parentNode.parentNode.id!="NEWresultsList"){elTmp=elTmp.parentNode;}
gMapW.style.top=elTmp.offsetTop+10+"px";gMapW.style.left=50+"%";var close=document.createElement('div');close.id="gMapClose";close.innerHTML="<span>Zamknij</span> <img src='http://www.pracuj.pl/_images-app/close.gif' height='16' width='16'/>";GEvent.addDomListener(close,"click",(function(){var t=close.parentNode;close.parentNode.innerHTML="";t.parentNode.removeChild(t);}));gMapW.appendChild(close);var gTitle=document.createElement('p');gTitle.innerHTML="Miejsce pracy";gTitle.id="gMapTitle";gMapW.appendChild(gTitle);var gMapC=document.createElement('div');gMapC.id="gMapC";gMapW.appendChild(gMapC);if(this.fixed!=true){while(el.parentNode.id!="NEWresultsList"){el=el.parentNode;}}
if(customId=='body'){while(el.parentNode.id!="NEWresultsList"){el=el.parentNode;}}
el.appendChild(gMapW);this.adr=null;this.geo=new GClientGeocoder();var gIco=G_DEFAULT_ICON;this.icon=gIco;return;},init:function(customId){if(typeof customId=="undefined"){customId=document.body;this.customId=document.body;this.fixed=true;}else if
(typeof customId=="string"){if(customId=="body")
{var el=document.body;this.customId=document.body;this.fixed=true;}else{var el=document.getElementById(customId);this.customId=customId;this.fixed=true;}}
else if(typeof customId=="object"){var el=customId;this.customId=el.toString();}else{this.customId=customId;}
if(document.getElementById('gMapW')){document.getElementById('gMapW').parentNode.removeChild(document.getElementById('gMapW'));}
var gMapW=document.createElement('div');gMapW.id="gMapW";var close=document.createElement('div');close.id="gMapClose";close.innerHTML="Zamknij <img src='http://www.pracuj.pl/_images-app/close.gif' height='16' width='16'/>";GEvent.addDomListener(close,"click",(function(){var t=close.parentNode;close.parentNode.innerHTML="";t.parentNode.removeChild(t);}));gMapW.appendChild(close);var gMapC=document.createElement('div');gMapC.id="gMapC";gMapW.appendChild(gMapC);if(this.fixed!=true){while(el.parentNode.id!="NEWresultsList"){el=el.parentNode;}}
if(customId=='body'){while(el.parentNode.id!="NEWresultsList"){el=el.parentNode;}}
gMapW.style.top=1836+"px";gMapW.style.left=691+"px";el.appendChild(gMapW);this.adr=null;this.geo=new GClientGeocoder();var gIco=G_DEFAULT_ICON;this.icon=gIco;return;},go:function(gMapLocals,gMapXYPos){var call=this;if(typeof gMapLocals!='undefined'){call.arr=gMapLocals;}else{call.arr=new Array([call.tTInfo,call.adr]);}
call.iter=null;var t="gMapW";document.getElementById(t).style.display="block";call.tmpMarker=new Array();for(call.iter=0;call.iter<call.arr.length;call.iter++){if(call.map==null){call.map=new GMap2(document.getElementById("gMapC"),{backgroundColor:"white"});call.map.setCenter(new GLatLng(52.219002,21.002002),10);call.map.enableScrollWheelZoom();call.map.addControl(new GSmallMapControl());call.map.addControl(new GMapTypeControl());call.map.addControl(new GScaleControl());}
call.adr=(call.arr[call.iter])[1];call.tTInfo=(call.arr[call.iter])[0];call.tTPos=(call.arr[call.iter])[2];if(!gMapXYPos)
{this.resolveAddress(call.adr,call,this.gMapTTipDescription(call.tTInfo),call.tTPos);}
else
{this.resolveAddress(call.adr,call,this.gMapTTipDescription(call.tTInfo),call.tTPos,gMapXYPos);}}
return;},resolveAddress:function(address,call,opis,posi,coord){if(!coord)
{var listaMarkerowTemp=null;call.geo.getLocations(address,function(result){if(result.Status.code=="200"){var p=result.Placemark[0].Point.coordinates;var markerOptions={};markerOptions.icon=call.icon;var mark=new GMarker(new GLatLng(p[1],p[0]),markerOptions);GEvent.addDomListener(mark,"click",function(){mark.openInfoWindow(call.ToolTip(call,posi,address,opis))});call.map.addOverlay(mark);call.map.setCenter(new GLatLng(p[1],p[0]),13);mark.openInfoWindow(call.ToolTip(call,posi,address,opis));}});}else{var p=coord;var markerOptions={};markerOptions.icon=call.icon;var mark=new GMarker(new GLatLng(p[1],p[0]),markerOptions);GEvent.addDomListener(mark,"click",function(){mark.openInfoWindow(call.ToolTip(call,posi,address,opis))});call.map.addOverlay(mark);call.map.setCenter(new GLatLng(p[1],p[0]),13);mark.openInfoWindow(call.ToolTip(call,posi,address,opis));}
return this.listaMarkerow;},gMapTTipLogo:function(input){var img=null;if(typeof input=="undefined")
{img=new Image(1,1);}else if(typeof input=="object")
{img=input;}else if(typeof input=="string")
{img=document.createElement('img');img.src=input;}
return img;},gMapTTipDescription:function(input){var desc=null;if(typeof input=="undefined")
{desc="default opis";}else if(typeof input=="object")
{desc=input;}else if(typeof input=="string")
{desc=document.createElement('p');desc.innerHTML=input;desc=desc.innerHTML;}
return desc;}};return pMap;}
function PopUnderJaInit(){var winfeatures="width=800,height=510,scrollbars=1,resizable=0,toolbar=0,location=0,menubar=0,status=0,directories=0";my_window_open("/praca/PopUnderJA.aspx"+location.search,"popunder",winfeatures);window.focus();}
