var isHtml = 0;
 
if(typeof deconcept == "undefined") var deconcept = new Object();
if(typeof deconcept.util == "undefined") deconcept.util = new Object();
if(typeof deconcept.SWFPrototypeUtil == "undefined") deconcept.SWFPrototypeUtil = new Object();

deconcept.SWFPrototype = function(swf, id, w, h, ver, c, quality, xiRedirectUrl, redirectUrl, detectKey) {
	if (!document.getElementById) { return; }
	this.DETECT_KEY = detectKey ? detectKey : 'detectflash';
	this.skipDetect = deconcept.util.getRequestParameter(this.DETECT_KEY);
	this.params = new Object();
	this.variables = new Object();
	this.attributes = new Array();
	if(swf) { this.setAttribute('swf', swf); }
	if(id) { this.setAttribute('id', id); }
	if(w) { this.setAttribute('width', w); }
	if(h) { this.setAttribute('height', h); }
	if(ver) { this.setAttribute('version', new deconcept.PlayerVersion(ver.toString().split("."))); }
	this.installedVer = deconcept.SWFPrototypeUtil.getPlayerVersion();
	if (!window.opera && document.all && this.installedVer.major > 7) {
		// only add the onunload cleanup if the Flash Player version supports External Interface and we are in IE
		deconcept.SWFPrototype.doPrepUnload = true;
	}
	if(c) { this.addParam('bgcolor', c); }
	var q = quality ? quality : 'high';
	this.addParam('quality', q);
	this.setAttribute('useExpressInstall', false);
	this.setAttribute('doExpressInstall', false);
	var xir = (xiRedirectUrl) ? xiRedirectUrl : window.location;
	this.setAttribute('xiRedirectUrl', xir);
	this.setAttribute('redirectUrl', '');
	if(redirectUrl) { this.setAttribute('redirectUrl', redirectUrl); }
}
deconcept.SWFPrototype.prototype = {
	useExpressInstall: function(path) {
		this.xiSWFPath = !path ? "expressinstall.swf" : path;
		this.setAttribute('useExpressInstall', true);
	},
	setAttribute: function(name, value){
		this.attributes[name] = value;
	},
	getAttribute: function(name){
		return this.attributes[name];
	},
	addParam: function(name, value){
		this.params[name] = value;
	},
	getParams: function(){
		return this.params;
	},
	addVariable: function(name, value){
		this.variables[name] = value;
	},
	getVariable: function(name){
		return this.variables[name];
	},
	getVariables: function(){
		return this.variables;
	},
	getVariablePairs: function(){
		var variablePairs = new Array();
		var key;
		var variables = this.getVariables();
		for(key in variables){
			variablePairs[variablePairs.length] = key +"="+ variables[key];
		}
		return variablePairs;
	},
	getSWFHTML: function() {
		var swfNode = "";
		if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) { // netscape plugin architecture
			if (this.getAttribute("doExpressInstall")) {
				this.addVariable("MMplayerType", "PlugIn");
				this.setAttribute('swf', this.xiSWFPath);
			}
			swfNode = '<embed type="application/x-shockwave-flash" src="'+ this.getAttribute('swf') +'" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'" style="'+ this.getAttribute('style') +'"';
			swfNode += ' id="'+ this.getAttribute('id') +'" name="'+ this.getAttribute('id') +'" ';
			var params = this.getParams();
			 for(var key in params){ swfNode += [key] +'="'+ params[key] +'" '; }
			var pairs = this.getVariablePairs().join("&");
			 if (pairs.length > 0){ swfNode += 'flashvars="'+ pairs +'"'; }
			swfNode += '/>';
		} else { // PC IE
			if (this.getAttribute("doExpressInstall")) {
				this.addVariable("MMplayerType", "ActiveX");
				this.setAttribute('swf', this.xiSWFPath);
			}
			swfNode = '<object id="'+ this.getAttribute('id') +'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'" style="'+ this.getAttribute('style') +'">';
			swfNode += '<param name="movie" value="'+ this.getAttribute('swf') +'" />';
			var params = this.getParams();
			for(var key in params) {
			 swfNode += '<param name="'+ key +'" value="'+ params[key] +'" />';
			}
			var pairs = this.getVariablePairs().join("&");
			if(pairs.length > 0) {swfNode += '<param name="flashvars" value="'+ pairs +'" />';}
			swfNode += "</object>";
		}
		return swfNode;
	},
	write: function(elementId){
		if(this.getAttribute('useExpressInstall')) {
			// check to see if we need to do an express install
			var expressInstallReqVer = new deconcept.PlayerVersion([6,0,65]);
			if (this.installedVer.versionIsValid(expressInstallReqVer) && !this.installedVer.versionIsValid(this.getAttribute('version'))) {
				this.setAttribute('doExpressInstall', true);
				this.addVariable("MMredirectURL", escape(this.getAttribute('xiRedirectUrl')));
				document.title = document.title.slice(0, 47) + " - Flash Player Installation";
				this.addVariable("MMdoctitle", document.title);
			}
		}
		if(this.skipDetect || this.getAttribute('doExpressInstall') || this.installedVer.versionIsValid(this.getAttribute('version'))){
			var n = (typeof elementId == 'string') ? document.getElementById(elementId) : elementId;
		
			  return this.getSWFHTML();
		}else{
	
			if(this.getAttribute('redirectUrl') != "") {
				document.location.replace(this.getAttribute('redirectUrl'));
			}
		}
		return null;
	}
}

/* ---- detection functions ---- */
deconcept.SWFPrototypeUtil.getPlayerVersion = function(){
	var PlayerVersion = new deconcept.PlayerVersion([0,0,0]);
	if(navigator.plugins && navigator.mimeTypes.length){
		var x = navigator.plugins["Shockwave Flash"];
		if(x && x.description) {
			PlayerVersion = new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split("."));
		}
	}else if (navigator.userAgent && navigator.userAgent.indexOf("Windows CE") >= 0){ // if Windows CE
		var axo = 1;
		var counter = 3;
		while(axo) {
			try {
				counter++;
				axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+ counter);
//				document.write("player v: "+ counter);
				PlayerVersion = new deconcept.PlayerVersion([counter,0,0]);
			} catch (e) {
				axo = null;
			}
		}
	} else { // Win IE (non mobile)
		// do minor version lookup in IE, but avoid fp6 crashing issues
		// see http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/
		try{
			var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		}catch(e){
			try {
				var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
				PlayerVersion = new deconcept.PlayerVersion([6,0,21]);
				axo.AllowScriptAccess = "always"; // error if player version < 6.0.47 (thanks to Michael Williams @ Adobe for this code)
			} catch(e) {
				if (PlayerVersion.major == 6) {
					return PlayerVersion;
				}
			}
			try {
				axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			} catch(e) {}
		}
		if (axo != null) {
			PlayerVersion = new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));
		}
	}
	return PlayerVersion;
}
deconcept.PlayerVersion = function(arrVersion){
	this.major = arrVersion[0] != null ? parseInt(arrVersion[0]) : 0;
	this.minor = arrVersion[1] != null ? parseInt(arrVersion[1]) : 0;
	this.rev = arrVersion[2] != null ? parseInt(arrVersion[2]) : 0;
}
deconcept.PlayerVersion.prototype.versionIsValid = function(fv){
	if(this.major < fv.major) return false;
	if(this.major > fv.major) return true;
	if(this.minor < fv.minor) return false;
	if(this.minor > fv.minor) return true;
	if(this.rev < fv.rev) return false;
	return true;
}
/* ---- get value of query string param ---- */
deconcept.util = {
	getRequestParameter: function(param) {
		var q = document.location.search || document.location.hash;
		if (param == null) { return q; }
		if(q) {
			var pairs = q.substring(1).split("&");
			for (var i=0; i < pairs.length; i++) {
				if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
					return pairs[i].substring((pairs[i].indexOf("=")+1));
				}
			}
		}
		return "";
	}
}
/* fix for video streaming bug */
deconcept.SWFPrototypeUtil.cleanupSWFs = function() {
	var objects = document.getElementsByTagName("OBJECT");
	for (var i = objects.length - 1; i >= 0; i--) {
		objects[i].style.display = 'none';
		for (var x in objects[i]) {
			if (typeof objects[i][x] == 'function') {
				objects[i][x] = function(){};
			}
		}
	}
}
// fixes bug in some fp9 versions see http://blog.deconcept.com/2006/07/28/SWFPrototype-143-released/
if (deconcept.SWFPrototype.doPrepUnload) {
	if (!deconcept.unloadSet) {
		deconcept.SWFPrototypeUtil.prepUnload = function() {
			__flash_unloadHandler = function(){};
			__flash_savedUnloadHandler = function(){};
			window.attachEvent("onunload", deconcept.SWFPrototypeUtil.cleanupSWFs);
		}
		window.attachEvent("onbeforeunload", deconcept.SWFPrototypeUtil.prepUnload);
		deconcept.unloadSet = true;
	}
}
/* add document.getElementById if needed (mobile IE < 5) */
if (!document.getElementById && document.all) { document.getElementById = function(id) { return document.all[id]; }}

/* add some aliases for ease of use/backwards compatibility */
var getQueryParamValue = deconcept.util.getRequestParameter;
var FlashObject = deconcept.SWFPrototype; // for legacy support
var SWFPrototype = deconcept.SWFPrototype;


//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
// #preconfig
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
if(inviSound == 'undefined') var inviSound = true;
if(inviText1 == 'undefined') var inviText1 = '';
if(inviText2 == 'undefined') var inviText2 = '';
if(inviText3 == 'undefined') var inviText3 = '';
if(inviText4 == 'undefined') var inviText4 = '';
if(!inviStyle) var inviStyle = 1;

var winw;
var winh;

	 if(inviStyle == 1){ winw=352; winh=127;}
else if(inviStyle == 2){ winw=340; winh=163; }
else if(inviStyle == 3){ winw=356; winh=142; }
else if(inviStyle == 4){ winw=366; winh=128; }
else if(inviStyle == 5){ winw=346; winh=137; }
else if(inviStyle == 6){ winw=389; winh=142; }

var delay = "0"; 
var repeat = "1";

var ie=(document.all);
var ns=(document.layers);
var ns6=(document.getElementById && !ie);
var calculate=ns? "" : "px"

if(!userName) 		var userName = "unknown";
if(!pageName) 		var pageName = "unknown";
if(!codeID) 		var codeID = 0 ;
if(!chatWidth) 		var chatWidth = 500;
if(!chatHeight) 	var chatHeight = 350;
if(!chatStyle)		var chatStyle = null
if(!domain)			var	domain = null
if(!forceDomain)	var forceDomain = null
if(!defChatType)	var	defChatType = "LAYER"
if(!backGround) 	var backGround = "#FFFFFF"
if(!wmode)			var wmode ="window"

if(!chatDebug)		var chatDebug = 0
if(!bugDebug)		var bugDebug = 0

var chatOpened = false;
var chatActive = "NONE";
var invitation = false;
var storeID = -1;

//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
// # odpalanie monitora
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
function lcStartMonitor(){

	var divName = 'lcBugCon'
	var path  = "http://lc.web-anatomy.com/flash/lcMonitor.swf"
		path += "?codeID="+codeID
		path += "&userName=" + userName
		path += "&pageName=" + pageName 
		path += "&debugMode=" + bugDebug
		
	var so = new SWFPrototype(path, 'lcMonitor', 1,1, "8", "000000");
	so.addParam("allowScriptAccess", "always");
	so.addParam("wmode", "transparent");
 	so.addParam("allowFullScreen", "true");

	document.write('<div style="position: absolute; position:absolute; top:0; left:0;">')
	
	if(so.write(divName) != null)
		document.write(so.write(divName));
	
	document.write('</div>')
	
}
lcStartMonitor()

var NewXMLObject = new Object()
	NewXMLObject.wings = "0.3"
	//alert(NewXMLObject.general.wings)

//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
// # odpalanie chatu
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
function lcStartChat($width, $height, $returnCode){

	var divName = 'lcChatCon'
	var path = "http://lc.web-anatomy.com/flash/lcChat.swf"
	    path += "?codeID="+codeID
		path += "&userName=" + userName 
		path += "&pageName=" + pageName 
		path += "&chatType="+ chatActive
		path += "&forceDomain=" + forceDomain
		path += "&chatStyle=" + chatStyle
		path += "&debugMode=" + chatDebug
	
	var so = new SWFPrototype(path, 'lcChat', $width, $height, "8", backGround);
	so.addParam("allowScriptAccess", "always");
	so.addParam("wmode", wmode);
 	so.addParam("allowFullScreen", "true");
	
	if($returnCode)
		return so.write(divName);
	else 
		document.write(so.write(divName));
}

//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
// # odpalanie przycisku
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//

function showLCButton($title, $desc, $gradient1, $gradient2, $txtColor1, $txtColor2){
	var divName = 'lcButtonCon'
	var path  = "http://lc.web-anatomy.com/flash/button.swf?"
		path += "mainText=" + $title
		path += "&secondText=" + $desc
		path += "&gradient1=0x" + $gradient1
		path +="&gradient2=0x" + $gradient2
		path +="&txtColor1=0x" + $txtColor1
		path +="&txtColor2=0x" + $txtColor2
		
	var so = new SWFPrototype(path, 'lcButton', 193,58, "8", "000000");
	so.addParam("allowScriptAccess", "always");
	so.addParam("wmode", "transparent");
 	so.addParam("allowFullScreen", "true");
	
	if(so.write(divName) != null)
		document.write(so.write(divName));
}

//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
// # kontrola okienek
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//

function lcInvitation(id){

	if(!ns && !ie && !ns6) return;
	if(ie) popup=eval('document.all.elementDiv.style');
	else if(ns) popup=eval('document.layers["elementDiv"]');
	else popup=eval('document.getElementById("elementDiv").style');
	
	if (ie||ns6) popup.visibility = "visible";
	else popup.visibility = "show";
	displayElement('invitation');
	
	var divName = 'lcInvitation';
	var path = "http://lc.web-anatomy.com/flash/invitations/"+inviStyle+"/invitation.swf?sound="+inviSound+"&text1="+inviText1+"&text2="+inviText2+"&text3="+inviText3+"&text4="+inviText4;
	var so = new SWFPrototype(path, 'lcInvitation', winw,winh, "8", "000000");
	so.addParam("allowScriptAccess", "always");
	so.addParam("wmode", "transparent");
 	so.addParam("allowFullScreen", "true");
	
	document.getElementById('invitationDiv').innerHTML = so.write(divName);
	
	invitation = true
	storeID = id
}

function lcDeny(){
	lcCloseInvitation()
	lcBugEvent('denied',storeID)
	
}

function lcCloseInvitation(){
	if (ie||ns6) { popup.display="none"; } 
	else { popup.visibility ="hide"; }      
	
	invitation = false
}

function lcOpenChat(id, remote){

	var  is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
	
	if(!is_chrome){
		setTimeout(function(){
		if(defChatType == "LAYER")
			lcLayerChat(id)
			
		if(defChatType == "POPUP")
			lcPopUPChat()	
			},500)
	}else{
		if(remote){
			lcLayerChat(id)
		}else{
			if(defChatType == "LAYER")
				lcLayerChat(id)
				
			if(defChatType == "POPUP")
				lcPopUPChat()
		}
	}
	
	if(invitation == true)
		lcCloseInvitation()
}

//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
// # typy chatów
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//

function lcLayerChat(id){

	if(id == null)
		id = storeID

	if(chatOpened == false){
		chatOpened = true;
		chatActive = "LAYER"

		if(!ns && !ie && !ns6) return;
		if(ie) chatPopup=eval('document.all.chatContainer.style');
		else if(ns) chatPopup=eval('document.layers["chatContainer"]');
		else chatPopup=eval('document.getElementById("chatContainer").style');
		if (ie||ns6) chatPopup.visibility="visible";
		else chatPopup.visibility ="show";
		
		displayElement('chatDiv');

		document.getElementById('chatDiv').innerHTML = lcStartChat(chatWidth, chatHeight, true);
		
		lcBugEvent('started',id)
	} else {
		lcBugEvent('opened',id)
	}
}

function lcPopUPChat(){

	chatActive = "POPUP"
	
	if(chatOpened == false)
		chatOpened = true;
		
		

	var PUtest = window.open('','', "toolbar=0, location=0, resizable=1, directories=0, status=0, menubar=0,scrollbars = 0, top=10, left=10,width=1,height=1");
	setTimeout(function(){
		try { 
			PUtest.close(); 
		} catch(e) {
			lcBugEvent('blocked',0)
			chatOpened = false
			chatActive = null
		}},500)
	
	
		
	var webkitfix = false
	var newWindow = window.open('', 
								'liveConsultant', 
								"toolbar=0, location=0, resizable=1, directories=0, status=0, menubar=0,scrollbars = 0, height="+chatHeight+", width="+chatWidth+", top=10, left=10"
								);
								
								
									
	var htmlCode  = '<html><head><style type="text/css">body {margin:0;background-color:'+backGround+'}</style>' 
		
		htmlCode += '<script language="Javascript">'
		htmlCode += 'window.setInterval(testSize,1000);'
		htmlCode += 'var myWidth=0;var myHeight=0;'
		htmlCode += 'function testSize(){ var tempW; var tempH;'
		htmlCode += 'if (parseInt(navigator.appVersion)>3) {if (navigator.appName=="Netscape") {tempW= window.innerWidth;tempH= window.innerHeight;}'
		htmlCode += 'if (navigator.appName.indexOf("Microsoft")!=-1) {tempW= document.body.offsetWidth+1;tempH= document.body.offsetHeight-4;}}'
		htmlCode += 'if (navigator.userAgent.indexOf("pera")!=-1) {tempW= document.body.clientWidth;tempH= document.body.clientHeight;}'
		htmlCode += 'if(myWidth != tempW || myHeight != tempH){myWidth = tempW;myHeight = tempH;'
		htmlCode += 'if(myWidth < 430) myWidth= 430;'
		htmlCode += 'if(myHeight < 350) myHeight = 350;'
		htmlCode += 'if(document.getElementById("lcChat") != null){'
		htmlCode += 'document.getElementById("lcChat").width = myWidth;'
		htmlCode += 'document.getElementById("lcChat").height = myHeight;}'
		htmlCode += '}} </script> <title>liveConsultant</title></head><body>'
		if (navigator.userAgent.indexOf("pera")!=-1 || navigator.appName.indexOf("Microsoft")!=-1){
			htmlCode += '<div id="chatDiv">'+lcStartChat(chatWidth, chatHeight, true)+'</div>';
		} else {
			htmlCode += '<div id="chatDiv"></div>';
			webkitfix = true
		}
		htmlCode += '</body></html>' 
	
	
	newWindow.document.write(htmlCode)
	newWindow.focus();
	lcBugEvent("started",0)
	
		
	if (webkitfix){
		setTimeout(function(){
			newWindow.document.getElementById("chatDiv").innerHTML = lcStartChat(chatWidth, chatHeight, true);
		},1000) 
	}
	newWindow.document.close();
	
	windowCheck = window.setInterval(function(){

			
			if(newWindow.closed){
				clearInterval(windowCheck)
				lcBugEvent("closed",0)
				chatOpened = false
			}
		
	},2000);
}

function lcInlineChat(){

	chatActive = "INLINE"
	chatOpened = true;
	
	var cleanCookie = new Object
		cleanCookie.id = -1
		cleanCookie.time = 0
	
	lcStartChat(chatWidth, chatHeight, false)
	
}

function lcCloseChat(){
	chatOpened = false;
	chatActive = "NONE"
	if (ie||ns6) { //chatPopup.display="none"; 
	chatPopup.visibility ="hidden"; 
	} else { chatPopup.visibility ="hidden"; }    
}

//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
// # funkcje pomocnicze
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//

function lcBugEvent(msg,id){
	document.getElementById('lcMonitor').sendInfo(msg,id)
}

function lcCleanCookie(){
	document.getElementById('lcMonitor').clearCookie()
}

function lcReloadGUI(Object){
	document.getElementById('lcChat').reloadGUI(Object)
}

function lcForward(msg){
	location.href = msg
}

function lcOpenWindow(msg){
	window.open(msg,'Title','width=400,height=200')
}

var theCount = "x";
function giveMeCount(){
	return theCount
}

function lcReadCount(num){
		theCount = num
}

//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
// # kontrola aktywności
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//

var IE = document.all?true:false
if (!IE) document.captureEvents(Event.MOUSEMOVE)
document.onmousemove = getMouseXY;

var tempX = 0
var tempY = 0

function getMouseXY(e) {
  if (IE) {
    tempX = event.clientX + document.body.scrollLeft
    tempY = event.clientY + document.body.scrollTop
  } else {
    tempX = e.pageX
    tempY = e.pageY
  }  
  if (tempX < 0){tempX = 0}
  if (tempY < 0){tempY = 0}  
}

function returnMCords(){
	var Cords = new Object()
		Cords.x = tempX
		Cords.y = tempY

	return Cords
}

//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
// # okienko typu pop-up
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//

function displayElement(type){

	if(chatWidth < 430) chatWidth = 430
	if(chatHeight < 350) chatHeight = 350 
	
	if(type == 'invitation'){
		
		var wW = winw;
		var wH = winh;
		var p = popup;
	} else {
	
		var wW = chatWidth;
		var wH = chatHeight;
		var p = chatPopup;
	}
		
	
	var agent=navigator.userAgent.toLowerCase();
	if (ie){
		documentWidth = (centerElement().offsetWidth)/2+centerElement().scrollLeft-(wW/2);
		documentHeight = (centerElement().offsetHeight)/2+centerElement().scrollTop-(wH/2)-50;
	}
	else if (ns){
		documentWidth=window.innerWidth/2+window.pageXOffset-(wW/2);
		documentHeight=window.innerHeight/2+window.pageYOffset-(wH/2)-50;
	}
	else if (ns6){
		documentWidth=self.innerWidth/2+window.pageXOffset-(wW/2);
		documentHeight=self.innerHeight/2+window.pageYOffset-(wH/2)-50;
	}

	p.left = documentWidth+calculate;
	p.top = documentHeight+calculate;
	
	
	if(type == 'invitation'){ lcDInvit() } else { lcDPop() }
}

function lcDInvit(){setTimeout("displayElement('invitation')",100)}
function lcDPop(){setTimeout("displayElement()",100)}

function centerElement(){return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body }

var popupSource = '<div id="elementDiv" style="visibility:hidden; position:absolute; top:0; left:0;z-index:10000;">'
	popupSource += '<div id="invitationDiv"></div>';
	popupSource += '</div>';
	
var chatSource = '<div id="chatContainer" style="visibility:hidden; position:absolute; top:0; left:0;z-index:10000;">'
	chatSource += '<div id="chatDiv"></div>';
	chatSource += '</div>';

document.write(popupSource);
document.write(chatSource);
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
// # koniec
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//


