//cached as Millos_TravelAgent_8

//----------------
//core.js
/*Comments erased*/ 
window.iw = {
isIE: (navigator.appVersion.indexOf("MSIE") != -1) ? true : false,
isFF: (navigator.userAgent.toLowerCase().indexOf("firefox") != -1) ? true : false,
isSafari: (navigator.userAgent.toLowerCase().indexOf("safari") != -1) ? true : false,
isLinux: (navigator.userAgent.toLowerCase().indexOf("linux") != -1) ? true : false,
isWin: (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false,
isMac: (navigator.userAgent.toLowerCase().indexOf("macintosh") != -1) ? true : false,	
isOpera: (navigator.userAgent.indexOf("Opera") != -1) ? true : false
};
//----------------------------------------------------------------------------
/*Comments erased*/ 
iw.Core = {
SPECIAL_PROPERTIES: ["SuperClass", "toString"],
isSpecialProperty: function(p1){
return this.isOneOf(this.SPECIAL_PROPERTIES, p1);
},
isOneOf: function(p2, p3){
if(p2 == undefined || !p2.length)
return false;
for(var i = 0; i < p2.length; i++){
if(p2[i] == p3)
return true;
}
return false;
},
definePackage: function(p4, p5){
if(typeof p4 != 'string')
return null;
if(!p5)
p5 = window;
if(p4.indexOf(".") > 0){
var v1 = p4.substr(0, p4.indexOf("."));
p4 = p4.substr(p4.indexOf(".") +1);
if(p5[v1] == null)
p5[v1] = {};
p5 = p5[v1];
if(p4)
return iw.Core.definePackage(p4, p5);
return p5;
}
if(p5[p4] == null){
p5[p4] = {};
}
return p5[p4];
},
defineClass: function(p6){
var v2 = function(){			
this.toString = function(){
return p6?"[object "+p6+"]":"[object InteliWISE]";
}
this.__className = p6;
iw.Core.bindAllMethods(this);
iw.Core.applyInheritance(this);
if(typeof this.initialize == 'function') this.initialize.apply(this, arguments);
};
v2.toString = function(){
return "[class "+p6+"]";
}
v2.__className = p6;
return v2;
},
bind: function(p7, p8, p9, p10){
if(typeof p7 != 'function')
return null;
//iw.Core.reportError("binding " + p10 + "");
var boundMethod = function(){
var tempSuper = p8.Super;
if(p9)
p8.Super = p9;
//iw.Core.reportError("calling " + p10 + "... (this.Super = " + (p9 ? p9.__className : "none") + ")");
var v3 = p7.apply(p8, arguments);
p8.Super = tempSuper;
return v3;
}
return boundMethod;
},
bindAllMethods: function(p11){
//iw.Core.reportError("binding all methods of " + p11 + "...");
var v4 = null;
if(p11.SuperClass != undefined && p11.Super == undefined){
p11.Super = {__className: p11.SuperClass.__className};
}
for(property in p11){ 
//bind native methods only (skip all inherited) 
//iw.Core.reportError("checking " + property + " of "+p11, p11[property]);
var v5 = "checking "+p11+"."+property+"...";
v5 += "(" + (typeof p11[property]) + "/" + !this.isOneOf(this.SPECIAL_PROPERTIES, property) + "/" + (p11[property] ? p11[property].__originClass : "null property" )+ ")";
if(typeof p11[property] == "function" && !this.isOneOf(this.SPECIAL_PROPERTIES, property) && (p11[property].__originClass == undefined || p11[property].__originClass == p11.__className)){				
p11[property] = this.bind(p11[property], p11, p11.Super, p11 + "." + property);
v5 += " ok";
}
else
v5 += " not qualified";
//iw.Core.reportError(v5);
}
},
applyInheritance: function(p11){
//iw.Core.reportError("applying inheritance for" + p11 + "...");
var v6 = p11.SuperClass;
var v7 = p11;
if(v7.Super == undefined)
v7.Super = {}
var v8 = "Super";
while(v6){
v7.Super.Super = v6.prototype.SuperClass != undefined ? {} : null;
v7.Super.__className = v6.__className;
for(var v9 in v6.prototype){
//skip special properties
if(iw.Core.isSpecialProperty(v9))
continue;
//bind a method of Super
if(typeof v6.prototype[v9] == 'function'){
v7.Super[v9] = iw.Core.bind(v6.prototype[v9], p11, v7.Super.Super, p11 + "." + v8 + "." + v9 + " from " + v7.Super.__className);
}
//copy a property to Super
else
v7.Super[v9] = v6.prototype[v9];
//bind an inherited method
if(typeof p11[v9] == "function" && p11[v9].__originClass == v6.__className){
p11[v9] = iw.Core.bind(p11[v9], p11, v7.Super.Super, p11 + "." + v9 + " from " + v6);
}
}
v6 = v6.prototype.SuperClass;
v7 = v7.Super;
v8 += ".Super";
}
},
extendDefinition: function(p12, p13){
if(typeof p13 != 'function' || typeof p12 != 'function'){
return;
}
p12.prototype.SuperClass = p13;
for(v9 in p13.prototype){
if(p12.prototype[v9] == undefined){
//asign method's origin
if(typeof p13.prototype[v9] == "function" && p13.prototype[v9].__originClass == undefined)
p13.prototype[v9].__originClass = p13.__className;
p12.prototype[v9] = p13.prototype[v9];
}
}
return p12;
},
setProperties: function(p14, p15){
var v9;
//iw.Core.reportError("seting properties for " + p14, p15);
for (v9 in p15){
var v10 = "set"+v9.substr(0,1).toUpperCase()+v9.substr(1);
if (p14[v10]){
//iw.Core.reportError(p14 + "." + v10 + " = " + p15[v9]);
p14[v10](p15[v9]);
}
}
},
reportError: function(p10, p16){
if(document.location.href.indexOf("iw_debug=true") == -1)
return;
var v11 = p10?p10+":\n":"Error :\n";
for(var v9 in p16)
v11 += v9 + ": "+p16[v9]+"\n ";
if(window.console){
console.log(v11);
}
//else
//alert(v11);
}
};
//----------------------------------------------------------------------------
/*Comments erased*/ 
iw.Cookies = {
setCookie: function(p17, p18, p19){
if(p19){
var v12 = new Date();
v12.setTime(v12.getTime() + parseInt(p19));
var v13 = "; expires=" + v12.toGMTString();
}
else var v13 = "";
document.cookie = p17 + "=" + p18+v13 + "; path=/";
},
readCookie: function(p17){
var v14 = p17 + "=";
var v15 = document.cookie.split(';');
for(var i=0;i < v15.length;i++) {
var v16 = v15[i];
while (v16.charAt(0) == ' ') 
v16 = v16.substring(1, v16.length);
if (v16.indexOf(v14) == 0) 
return v16.substring(v14.length, v16.length);
}
return null;
},
eraseCookie: function(p17){
this.createCookie(p17 ,"", -1);
}
}
//----------------------------------------------------------------------------
/*Comments erased*/ 
iw.DOMFactory = {
appendHTML: function(p20, p21){
if(!p20 || !p20.tagName)
return;
var v17 = document.createElement("div");
v17.innerHTML = p21;
if(v17.childNodes.length>0)
for(var i=0; i<v17.childNodes.length; i++)
p20.appendChild(v17.childNodes[i]);
},
getElement: function(p22){
if(typeof p22 == "string")
return document.getElementById(p22);
return null;
},
getFormField: function(p23, p24){
if(!p23 || p23.tagName.toLowerCase() != "form")
return null;
//if(p23[p24])
//	return p23[p24];
if(p23.elements[0]){
var v18 = 0;
var v19 = 0;
var v20 = [];
var v21;
while(v21 = p23.elements[v18++])
if(v21.name == p24)
v20[v19++] = v21;
return v20.length > 1 ? v20 : v20[0];
}
return null;
},
addCSSClass: function(p20, p25){
if(typeof p20 != "object" || p20.className == undefined || typeof p25 != "string")
return;
if(p20.className.indexOf(p25) == -1)
p20.className += " " + p25;
},
removeCSSClass: function(p20, p25){
if(typeof p20 != "object" || p20.className == undefined || typeof p25 != "string")
return;
if(p20.className.indexOf(p25) > -1)
p20.className = p20.className.replace(p25, "");
},
getElementPosition: function(p20) {
var v22 = 0, v75Left = 0;
var v23 = p20;
do {
v22 += v23.offsetTop  || 0;
v75Left += v23.offsetLeft || 0;
v23 = v23.offsetParent;
if (v23) {
if (v23.tagName.toUpperCase() == 'BODY') break;
if (v23.style.position !== 'static') break;
}
} while (v23);
return [v75Left, v22];
},
getWidth: function(p20){
if(!p20 || !p20.tagName)
return NaN;
var v24 = parseInt(this.getElementStyle(p20, "paddingLeft")) + parseInt(this.getElementStyle(p20, "paddingRight"));
var v25 = parseInt(this.getElementStyle(p20, "borderLeftWidth")) + parseInt(this.getElementStyle(p20, "borderRightWidth"));
if(isNaN(v24) || v24 <= 0)
v24 = 0;
if(isNaN(v25) || v25 <= 0)
v25 = 0;
return p20.offsetWidth - v24 - v25;
},
getHeight: function(p20){
if(!p20 || !p20.tagName)
return NaN;
var v24 = parseInt(this.getElementStyle(p20, "paddingTop")) + parseInt(this.getElementStyle(p20, "paddingBottom"));
var v25 = parseInt(this.getElementStyle(p20, "borderTopWidth")) + parseInt(this.getElementStyle(p20, "borderBottomWidth"));
if(isNaN(v24) || v24 <= 0)
v24 = 0;
if(isNaN(v25) || v25 <= 0)
v25 = 0;
return p20.offsetHeight - v24 - v25;
},
getElementStyle: function(p20, p26){
if(p20 == undefined || p20.tagName == undefined || typeof p26 != "string")
return "";
var v26 = typeof p20.currentStyle != 'undefined' ? 
p20.currentStyle : document.defaultView.getComputedStyle(p20, null);
return v26[p26] ? v26[p26] : "";
},
newElement: function(p27, p28){
if(typeof p27 != 'string')//wrong element type
return null;
if(p27.toLowerCase() == 'text'){//text node
return document.createTextNode(p28);
}
//other elements
var v23 = document.createElement(p27.toLowerCase());
for(var v27 in p28){
if(v27 == 'style' && typeof p28[v27] == 'string')
v23.style.cssText = p28[v27];
else
v23[v27] = p28[v27];
}
return v23;
},
newStyleSheet: function(p29, p30){
if(!p30)
p30 = "screen";
var v28 = iw.DOMFactory.newElement("style", {"type": "text/css", "media": p30});
if (v28.styleSheet){  
v28.styleSheet.cssText = p29;
}
else {  
v28.innerHTML = p29;
}
return v28;
},
updateStyleSheet: function(p31, p29){
if(!p31 || typeof p29 != "string")
return;
var v29 = false;
if(p31.parentNode){
p31.parentNode.removeChild(p31);
v29 = true;
}
p31 = iw.DOMFactory.newElement("style", {"type": "text/css", "media": p31.media});
if (p31.styleSheet){  
p31.styleSheet.cssText = p29;
}
else {  
p31.innerHTML = p29;
}
if(v29)
iw.DOMFactory.applyStyleSheet(p31);
return p31;
},
applyStyleSheet: function(p31){
if(!p31)
return;
var v30 = document.getElementsByTagName("head")[0];
v30.appendChild(p31);
},
printContent: function(p22, p32, p26){
//there are styles for printing on page. Need to open history in separate window		
var v31 = window.open('');
//filling new window with history content and styles
v31.document.open("text/html", "replace");
v31.document.write("<html><head><title>"+p32+"</title>\n");
v31.document.write("<style media=\"print\">"+p26+"</style>");
v31.document.write("</head><body>\n");
if(iw.DOMFactory.getElement(p22)){
v31.document.write(iw.DOMFactory.getElement(p22).innerHTML);
}
v31.document.write("</body></html>\n");
v31.document.close();
v31.print();
}
};
//----------------------------------------------------------------------------
/*Comments erased*/ 
iw.DOMEvents = {
getTarget: function (event){
if(event)
return event.target || event.srcElement;
if(window.event)
return window.event.srcElement;
return null;
},
pointerX: function (event) {
event = event || window.event;
var docElement = document.documentElement,
body = document.body || { scrollLeft: 0 };
return event.pageX || (event.clientX +
(docElement.scrollLeft || body.scrollLeft) -
(docElement.clientLeft || 0));
},
pointerY: function(event) {
event = event || window.event;
var docElement = document.documentElement,
body = document.body || { scrollTop: 0 };
return  event.pageY || (event.clientY +
(docElement.scrollTop || body.scrollTop) -
(docElement.clientTop || 0));
},
keyCode: function(event) {
if(event)
return event.which || event.keyCode;
if(window.event)
return  window.event.keyCode;
return -1;
},
stopPropagation: function(event) {
var v32 = event || window.event;
if(v32 && event.stopPropagation)
event.stopPropagation();
else if(v32)
v32.cancelBubble = true;
},
addEventListener: function(p14, p33, p34){
if(p14.addEventListener){
p14.addEventListener(p33, p34, false);
}
else if(p14.attachEvent){
p14.attachEvent("on"+p33, p34);
}
//event || window.event
},
removeEventListener: function(p14, p33, p34){
//alert("remove "+p33)
if(p14.removeEventListener){
p14.removeEventListener(p33, p34, false);
}
else if(p14.detachEvent){
p14.detachEvent("on"+p33, p34);
}
}
}
//----------------------------------------------------------------------------
/*Comments erased*/ 
iw.FlashFactory = {
controlVersion: function ()
{
var version;
var axo;
var e;
// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
try {
// version will be set for 7.X or greater players
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
version = axo.GetVariable("$version");
} catch (e) {
}
if (!version)
{
try {
// version will be set for 6.X players only
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
// installed player is some revision of 6.0
// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
// so we have to be careful. 
// default to the first public version
version = "WIN 6,0,21,0";
// throws if AllowScripAccess does not exist (introduced in 6.0r47)		
axo.AllowScriptAccess = "always";
// safe to call for 6.0r47 or greater
version = axo.GetVariable("$version");
} catch (e) {
}
}
if (!version)
{
try {
// version will be set for 4.X or 5.X player
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
version = axo.GetVariable("$version");
} catch (e) {
}
}
if (!version)
{
try {
// version will be set for 3.X player
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
version = "WIN 3,0,18,0";
} catch (e) {
}
}
if (!version)
{
try {
// version will be set for 2.X player
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
version = "WIN 2,0,0,11";
} catch (e) {
version = -1;
}
}
return version;
},
getVersionString: function(){
var v33 = String(iw.FlashFactory.getSwfVer());
v33 = v33.replace(/,/g, ".").replace(/[a-z]+\s/i, "");
arrParts = v33.split(".");
if(arrParts.length > 3)
v33 = v33.substr(0, v33.indexOf(arrParts[3]) - 1);
return v33;
},
// JavaScript helper required to detect Flash Player PlugIn version information
getSwfVer: function (){
// NS/Opera version >= 3 check for Flash plugin in plugin array
var flashVer = -1;
if (navigator.plugins != null && navigator.plugins.length > 0) {
if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
var descArray = flashDescription.split(" ");
var tempArrayMajor = descArray[2].split(".");
var versionMajor = tempArrayMajor[0];
var versionMinor = tempArrayMajor[1];
var versionRevision = descArray[3];
if (versionRevision == "") {
versionRevision = descArray[4];
}
if (versionRevision[0] == "d") {
versionRevision = versionRevision.substring(1);
} else if (versionRevision[0] == "r") {
versionRevision = versionRevision.substring(1);
if (versionRevision.indexOf("d") > 0) {
versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
}
}
var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
}
}
// MSN/WebTV 2.6 supports Flash 4
else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
// WebTV 2.5 supports Flash 3
else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
// older WebTV supports Flash 2
else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
else if ( iw.isIE && iw.isWin && !iw.isOpera ) {
flashVer = iw.FlashFactory.controlVersion();
}	
return flashVer;
},
// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
detectFlashVer: function(reqMajorVer, reqMinorVer, reqRevision)
{
versionStr = iw.FlashFactory.getSwfVer();
if (versionStr == -1 ) {
return false;
} else if (versionStr != 0) {
if(iw.isIE && iw.isWin && !iw.isOpera) {
// Given "WIN 2,0,0,11"
tempArray         = versionStr.split(" "); 	// ["WIN", "2,0,0,11"]
tempString        = tempArray[1];			// "2,0,0,11"
versionArray      = tempString.split(",");	// ['2', '0', '0', '11']
} else {
versionArray      = versionStr.split(".");
}
var versionMajor      = versionArray[0];
var versionMinor      = versionArray[1];
var versionRevision   = versionArray[2];
// is the major.revision >= requested major.revision AND the minor version >= requested minor
if (versionMajor > parseFloat(reqMajorVer)) {
return true;
} else if (versionMajor == parseFloat(reqMajorVer)) {
if (versionMinor > parseFloat(reqMinorVer))
return true;
else if (versionMinor == parseFloat(reqMinorVer)) {
if (versionRevision >= parseFloat(reqRevision))
return true;
}
}
return false;
}
},
_f1: function(src, ext)
{
if (src.indexOf('?') != -1)
return src.replace(/\?/, ext+'?');
else
return src + ext;
},
_f2: function(objAttrs, params, embedAttrs) 
{ 
var str = '';
if (iw.isIE && iw.isWin && !iw.isOpera)
{
str += '<object ';
for (var i in objAttrs)
{
str += i + '="' + objAttrs[i] + '" ';
}
str += '>';
for (var i in params)
{
str += '<param name="' + i + '" value="' + params[i] + '" /> ';
}
str += '</object>';
}
else
{
str += '<embed ';
for (var i in embedAttrs)
{
str += i + '="' + embedAttrs[i] + '" ';
}
str += '/>';//'></embed>';
}
return str;
},
_f3: function(args, ext, srcParamName, classid, mimeType){
var ret = new Object();
ret.embedAttrs = new Object();
ret.params = new Object();
ret.objAttrs = new Object();
for (var i=0; i < args.length; i=i+2){
var currArg = args[i].toLowerCase();
switch (currArg){	
case "classid":
break;
case "pluginspage":
ret.embedAttrs[args[i]] = args[i+1];
break;
case "src":
case "movie":	
args[i+1] = iw.FlashFactory._f1(args[i+1], ext);
ret.embedAttrs["src"] = args[i+1];
ret.params[srcParamName] = args[i+1];
break;
case "onafterupdate":
case "onbeforeupdate":
case "onblur":
case "oncellchange":
case "onclick":
case "ondblclick":
case "ondrag":
case "ondragend":
case "ondragenter":
case "ondragleave":
case "ondragover":
case "ondrop":
case "onfinish":
case "onfocus":
case "onhelp":
case "onmousedown":
case "onmouseup":
case "onmouseover":
case "onmousemove":
case "onmouseout":
case "onkeypress":
case "onkeydown":
case "onkeyup":
case "onload":
case "onlosecapture":
case "onpropertychange":
case "onreadystatechange":
case "onrowsdelete":
case "onrowenter":
case "onrowexit":
case "onrowsinserted":
case "onstart":
case "onscroll":
case "onbeforeeditfocus":
case "onactivate":
case "onbeforedeactivate":
case "ondeactivate":
case "type":
case "codebase":
case "id":
ret.objAttrs[args[i]] = args[i+1];
break;
case "width":
case "height":
case "align":
case "vspace": 
case "hspace":
case "class":
case "title":
case "accesskey":
case "name":
case "tabindex":
ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
break;
default:
ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
}
}
ret.objAttrs["classid"] = classid;
if (mimeType) ret.embedAttrs["type"] = mimeType;
return ret;
},
newObjectString: function(){
var ret = 
iw.FlashFactory._f3
(  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
, "application/x-shockwave-flash"
);
return iw.FlashFactory._f2(ret.objAttrs, ret.params, ret.embedAttrs);
},
getFlashObject: function(p17){
if (iw.isIE) {
return document.getElementById(p17);
}
return document[p17];
}	
}
//----------------
//event.js
try{
iw.Core.definePackage("ichr.events");
/*Comments erased*/ 
ichr.events.Event = iw.Core.defineClass("ichr.events.Event");
ichr.events.Event.m_arrIchrToDOM = {
mouseClick:"click", 
mouseOver:"mouseover", 
mouseOut: "mouseout", 
suggestedAnswer: "click",
valueChange: "change", 
focusIn: "focus", 
focusOut: "blur", 
suggestedAnswer: "click",
keyUp: "keyup",
keyDown: "keydown"
};
ichr.events.Event.getDOMEventType = function(p35, p14){
return this.m_arrIchrToDOM[p35];
};
ichr.events.Event.prototype = {
EVENT_SUCCESS: "eventSuccess",
EVENT_ERROR: "eventError",
type: "",
result: "eventSuccess",
sourceId: "",
sourceValue: "",
source: null,
initialize: function(p27, p36, p37, p18){
this.type = p27 ? p27 : "";
this.result = p36 ? p36 : this.EVENT_SUCCESS;
this.sourceId = p37 ? p37 : "";
this.sourceValue = p18 ? p18 : "";
},
getData: function(){
return {type: this.type, result: this.result, sourceId: this.sourceId, sourceValue: this.sourceValue};
}
}
}
catch(err){
iw.Core.reportError("ichr.events.Event class definition error", err);
}
//----------------
//event_dispatcher.js
try{	
iw.Core.definePackage("ichr.events");
/*Comments erased*/  
ichr.events.EventDispatcher = iw.Core.defineClass("ichr.events.EventDispatcher");
ichr.events.EventDispatcher.instanceCount = 0;
ichr.events.EventDispatcher.prototype = {
m1: window.location.href.indexOf("iw_debug=true") > -1 ? true : false,
m2: null,
m3: null,
/*Comments erased*/ 
addEventListener: function(p33, p34){
if(!this.m2)
this.m2 = {};
if(!this.m2[p33])
this.m2[p33] = new Array();
this.log("addEventListener: " + p33);
var v34 = this.m2[p33];
v34.push(p34);
},
/*Comments erased*/ 
removeEventListener: function(p33, p34){
if(!this.m2)
this.m2 = {};
var v35 = this.m2[p33];
if(v35){
for(var i=0; i<v35.length; i++){
var v36 = v35[i];
if(p34 == v36){
if(i == 0){
//alert("0 "+p34);
this.m2[p33] = v35.slice(1);
}
else if(i == v35.length - 1){
//alert("max "+p34);
this.m2[p33] = v35.slice(0, i - 1);
}
else{
//alert("middle "+p34);
this.m2[p33] = v35.concat(v35.slice(0, i-1), v35.slice(i+1));
}
}
}
}
},
/*Comments erased*/ 
dispatchEvent: function(p38){
if(!this.m2)
this.m2 = {};
if(p38){
this.log("dispatchEvent: " + p38.type + "/" + p38.result);
p38.source = this;
var v35 = this.m2[p38.type];
if(v35){
for(var i=0; i<v35.length; i++){
var v36 = v35[i];
if(typeof v36 == "function" && !p38.m_bStop)
v36(p38);
}
}
}
},
/*Comments erased*/ 
hasEventListener: function(p33, p34){
if(!this.m2)
this.m2 = {};
var v37 = this.m2[p33];
if(v37 == null || !v37.length)
return false;
if(typeof p34 == "function")
for(var i = 0; i < v37.length; i++)
if(v37[i] == p34)
return true;
return this.m2[p33].length ? true : false;
},
setLogConsole: function(p39){
this.m3 = p39;
if(this.m3 && this.m1){
this.m_strNotifyId = this.__className + " [#" + (ichr.events.EventDispatcher.instanceCount++) + "@" + this._f5() + "]";
//this._f6();
}
},
getLogConsole: function(){
return this.m3;
},
log: function(p40, p41){
if(!this.m1)
return;
if(p41 === undefined)
p41 = 3;
var v38 = "[p" + p41
+ " " + this._f5() + "] "
+ this.__className + ": "
+ p40;
this._f4(v38);
},
raiseException: function(p40){		
var v38 = "[p0 " + this._f5() + "] Exception at "
+ this.__className + ": "
+ p40;
this._f4("");
this._f4(v38);
this._f4("");
},
_f4: function(p40){
if(this.m3){
this.m3.log([p40]);
return;
}
if(window.console)
window.console.log(p40);
},
_f5: function(p42){
var tCurrentDate = p42 ? p42 : new Date();
//miliseconds string
var v39 = String(tCurrentDate.getMilliseconds());
v39 = v39.length == 1 ? "00"+v39 : (v39.length == 2 ? "0"+v39 : v39);
//time string
var v40 = tCurrentDate.toLocaleTimeString();
v40 = v40.substr(0,8)+":"+v39+v40.substr(8);
return v40;
},
_f6: function(){	
if(this.m3){
this.m3.getInstanceMonitor().notify(this.m_strNotifyId);
//window.setTimeout(this._f6, 1000);
}
}
}
}
catch(err){
iw.Core.reportError("ichr.events.EventDispatcher class definition error", err);
}
//----------------
//object_factory.js
try{
iw.Core.definePackage("ichr.core");
/*Comments erased*/ 
ichr.core.ObjectFactory = iw.Core.defineClass("ichr.core.ObjectFactory");
ichr.core.ObjectFactory.prototype = {
m4: null,
m5: null,
initialize: function(){
this.m4 = {};
},
getWindowWrapper: function(){
return this.m5;
},
setWindowWrapper: function(p43){
this.m5 = p43;
},
addObserver: function(p44, p22){
if(p44 == null || typeof p44.getId != "function")
return;
if(this.m4[p22] == p44 || this.m4[p44.getId()] == p44)
return;
if(!p22)
p22 = p44.getId();
this.log("new observer (" + p22 + ") added");
p44.addEventListener("removed", this._f7)
this.m4[p22] = p44;
},
getObserverById: function(p22){
return this.m4[p22];
},
_f7: function(event){
//alert(this.m4[event.source.getId()]);
if(event.source && event.source.getId)
delete this.m4[event.source.getId()];
}
};
iw.Core.extendDefinition(ichr.core.ObjectFactory, ichr.events.EventDispatcher);
}
catch(err){
iw.Core.reportError("ichr.core.ObjectFactory class definition error", err);
}
//----------------
//character_base.js
try{	
iw.Core.definePackage("ichr");
/*Comments erased*/  
ichr.CharacterBase = iw.Core.defineClass("ichr.CharacterBase");
ichr.CharacterBase.prototype = {
READY: "ready",
FORM_FIELDS: ["INPUT", "SELECT", "TEXTAREA"],
LOADING_INFO_ID: "ichr-loading-info",
m5: null,
m6: "auto",
m7: "auto",
m8: null,
/*Comments erased*/ 
initialize: function(p45){
this.m8 = p45;
},
/*Comments erased*/ 
getWindowWrapper: function(){
return this.m5;
},
getWrapperHTML: function(p46){
if(typeof p46 != "string")
p46 = "";
return "<div id=\""+this.m8+"_win_wrapper\" style=\"position: relative; width: "+this.m6+"; height: "+this.m7+";\">"+p46+"</div>";
},
/*Comments erased*/ 
setSize: function(p47, p48){
this.m6 = !isNaN(p47) ? p47+"px" : this.m6;
this.m7 = !isNaN(p48) ? p48+"px" : this.m7;
if(this.m5){
this.m5.style.width = this.m6;
this.m5.style.height = this.m7;
}
},
/*Comments erased*/ 
exportElementEvent: function(p33, p20){		
var v41 = p20.id;
var v42 = p20.innerHTML;
if(iw.Core.isOneOf(this.FORM_FIELDS, p20.tagName.toUpperCase())){//element is a form field
if(p20.tagName.toUpperCase() == 'INPUT' && p20.type.toUpperCase() == 'CHECKBOX'){
v42 = p20.checked?'true':'false';
}
else{
v42 = p20.value;
}
var v43 = p20.form;
if(v43){
v41 = v43.id+":"+p20.name;
}
}
this.dispatchEvent(new ichr.events.Event(p33, "eventSuccess", v41, v42));
}
}
iw.Core.extendDefinition(ichr.CharacterBase, ichr.events.EventDispatcher);
}
catch(err){
iw.Core.reportError("ichr.CharacterBase class definition error", err);
}
//----------------
//character.js
/*Comments erased*/ 
iw.Core.definePackage("ichr");
//----------------------------------------------------------------------------
try{
/*Comments erased*/  
ichr.Character = iw.Core.defineClass("ichr.Character");
ichr.Character.instances = [];
ichr.Character.prototype = {
m9: null,
m10: null,
m11: "1px",
m12: "1px",
m13: 0,
m14: 0,
m15: false,
m16: "",
m17: '<span style="font-family: Arial, Helvetica, sans-serif; font-size: 12px;" >Please <a href="http://www.macromedia.com/go/getflash/" target="_blank">update</a> your Adobe Flash Player to see our <strong><nobr>Virtual Assistant</nobr></strong></span>.',
m18: null,	
m19: null,
m20: false,
factory: null,
/*Comments erased*/ 
initialize: function(p45, p49, p50){
if(typeof p45 != "string"){
this.raiseException("Instance name is required");
return;
}
if(typeof p49 != "string"){
this.raiseException("Character flash application path is required");
return;
}
this.Super.initialize(p45);
if(typeof p50 != "object") 
p50 = {};
this.factory = new ichr.core.ObjectFactory();
this.setSize(p50.width, p50.height);
if(p50.alternateContent)
this.m17 = p50.alternateContent;
var v44 = "instanceName=ichr.Character.instances['"+p45+"']&";
for(var v45 in p50){
v44 += v45 + "=" + encodeURIComponent(p50[v45]) + "&";
}
v44 = v44.substr(0, v44.length - 1);
this.m18 = iw.FlashFactory.getFlashObject(p45);
if(this.m18){//nested mode - character app is nested in other SWF object
this.m18.setIWConfiguration(v44);
if(this.m18.parentNode){
this.m10 = iw.DOMFactory.newElement("div", {"id": this.m8+"_win"});
this.m5 = iw.DOMFactory.newElement("div", {"id": this.m8+"_win_wrapper", "style":"position: relative;"});
this.m5.appendChild(this.m10);
this.m18.parentNode.insertBefore(this.m5, this.m18);
this.m15 = true;
}
} 
else if(iw.FlashFactory.detectFlashVer(10, 0, 0)){//standard embedded mode
var v46 = p49.indexOf("https://") != -1 ? "https" : "http";
this.m16 = iw.FlashFactory.newObjectString(
'codebase', v46+'://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0',
'width', '100%',
'height', '100%',
'src', p49,
'quality', 'high',
'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
'align', 'middle',
'play', 'true',
'loop', 'true',
'scale', 'noscale',
'wmode', 'transparent',
'devicefont', 'false',
'id', p45,
'bgcolor', '#ffffff',
'name', p45,
'menu', 'true',
'allowFullScreen', 'false',
'allowScriptAccess','always',
'movie', p49,
'salign', 'tl',
'flashVars', v44
);
}
ichr.Character.instances[p45] = this;
this.m9 = new Array();
},
/*Comments erased*/ 
embed: function(p51){
if(this.m5){
this.raiseException("Error while invoking embed() method. Module is already embedded");
return false;
}
if(this.m16){
var v47 = "<div id=\""+this.m8+"_win\" style=\"position: absolute; left: 0; top: 0; width: "+this.m11+"; height: "+this.m12+";\">";
v47 += this.m16 + "</div>";
v47 = this.getWrapperHTML(v47);
if(!p51){
document.write(v47);
this.m18 = iw.FlashFactory.getFlashObject(this.m8);
this.m10 = iw.DOMFactory.getElement(this.m8+"_win");
this.m5 = iw.DOMFactory.getElement(this.m8+"_win_wrapper");
return true;
}
return v47;
}
else if(!p51){
document.write(this.m17);
}
return p51 ? this.m17 : false;
},
/*Comments erased*/ 
getInstance: function(){
if(this.m18 == null){
return this.m18 = iw.FlashFactory.getFlashObject(this.m8);
}
return this.m18;
},
/*Comments erased*/ 
getWindowWrapper: function(){
this.m5 = iw.DOMFactory.getElement(this.m8+"_win_wrapper");
this.m10 = iw.DOMFactory.getElement(this.m8+"_win");
if(this.m16 && !this.m5 && !this.m10){			
this.m10 = iw.DOMFactory.newElement("div", {"id": this.m8+"_win", "style":"position: absolute; left: 0; top: 0; width: "+this.m11+"; height: "+this.m12+";"});
this.m5 = iw.DOMFactory.newElement("div", {"id": this.m8+"_win_wrapper", "style":"position: relative; left: 0; top: 0; width: "+this.m6+"; height: "+this.m7+";"});
this.m5.appendChild(this.m10);
this.m10.innerHTML = this.m16;
}
return this.m5;
},
/*Comments erased*/ 
getWindow: function(){
return this.m10;
},
/*Comments erased*/ 
setSize: function(p52, p53, p47, p48, p54, p55){
p52 = parseInt(p52);
p53 = parseInt(p53);
p47 = parseInt(p47);
p48 = parseInt(p48);
if(isNaN(p47))
p47 = p52;
if(isNaN(p48))
p48 = p53;
this.m13 = !isNaN(p54) ? p54 + "px" : this.m13;
this.m14 = !isNaN(p55) ? p55 + "px" : this.m14;
this.m11 = !isNaN(p52) ? p52+"px" : this.m11;
this.m12 = !isNaN(p53) ? p53+"px" : this.m12;
this.Super.setSize(p47, p48);
if(this.m5 && this.m10 && !this.m15){
this.m10.style.width = this.m11;
this.m10.style.height = this.m12;
this.m10.style.left = this.m13;
this.m10.style.top = this.m14;
this.Super.setSize(p47, p48);
}
},
/*Comments erased*/ 
addLoadListener: function(p34){
this.m9.push(p34);
},
getWindowSize: function(){
if(this.m18 && this.m10 && this.m10.style.width && this.m10.style.height){
try{				
return [parseInt(this.m10.style.width), parseInt(this.m10.style.height)];
}
catch(error){					
this.raiseException("Error while appling browser scale", error);
}
}
return [];
},
/*Comments erased*/ 
defineUserAction: function(p56, p57){
var v48 = this.factory.getObserverById(p57);
if(v48)
v48.addEventListener(p56, this._f8);
},
/*Comments erased*/ 
runUserAction: function(p56, p57){
var v48 = this.factory.getObserverById(p57);
if(v48)
v48.dispatchEvent(new ichr.events.Event(p56));
},
/*Comments erased*/ 
createDocker: function(p58){
var v2 = ichr.dock[p58.type];
if(v2){
try{				
var v41 = p58.id;
var v49 = p58.parentId;
if(v41 == this.LOADING_INFO_ID && !iw.DOMFactory.getElement(v41)){
p58.id += "-" + this.m8;
}
if(v49 == this.LOADING_INFO_ID && !iw.DOMFactory.getElement(v41)){
p58.parentId += "-" + this.m8;
}
var v50 = new v2(p58, this.factory);
iw.Core.setProperties(v50, p58);
this.factory.addObserver(v50, v41);
return "factory.getObserverById('"+v41+"').";
}
catch(error){
this.raiseException("Docker ("+p58.id+") class definition error", error);
}
}
return "";
},
modifyDocker: function(p58){
var v50 = this.factory.getObserverById(p58.id);
if(v50){
iw.Core.setProperties(v50, p58);
return true;
}
return false;
},
setLoadingInfoVisible: function(p59){
this.log("loading info " + p59 + " " + this.factory.getObserverById(this.LOADING_INFO_ID));
if(this.factory.getObserverById(this.LOADING_INFO_ID))
this.factory.getObserverById(this.LOADING_INFO_ID).setVisible(p59);
this.m20 = p59;
},
getLoadingInfoVisible: function(){
return this.m20;
},
_f8: function(event){
this.log("user event", event.getData());
try{
this.m18.dispatchEvent(event.getData());
}
catch(err){
this.raiseException("error while exporting user event", err);
}
},
loadComplete: function(p60){
if(this.m18 == null)
this.m18 = iw.FlashFactory.getFlashObject(this.m8);
if(this.m5 == null)		
this.m5 = iw.DOMFactory.getElement(this.m8+"_win_wrapper");
this.factory.setWindowWrapper(this.m5);
if(this.m10 == null)
this.m10 = iw.DOMFactory.getElement(this.m8+"_win");
for (var i = 0; i < this.m9.length; i++){
try{
this.m9[i](this.m18);
}
catch(error){					
this.raiseException("Load listener error", error);
}
}
this.dispatchEvent(new ichr.events.Event(this.READY));
}
}
iw.Core.extendDefinition(ichr.Character, ichr.CharacterBase);
}
catch(err){
iw.Core.reportError("ichr.Character class definition error", err);
}
//----------------
//element_observer.js
try{	
iw.Core.definePackage("ichr.dom");
/*Comments erased*/  
ichr.dom.ElementObserver = iw.Core.defineClass("ichr.control.ElementObserver");
ichr.dom.ElementObserver.prototype = {
ENTER_KEY: 13,
USER_EVENT_HANDLER_PREFIX: "onDomElement",
SELECTOR_ELEMENT_HAS_LISTENER: "ichrHasEventListener",
ICHR_TO_DOM: {
mouseClick:"click", 
mouseOver:"mouseover", 
mouseOut: "mouseout", 
suggestedAnswer: "click",
valueChange: "change", 
focusIn: "focus", 
focusOut: "blur", 
suggestedAnswer: "click",
keyUp: "keyup",
keyDown: "keydown"
},
FORM_FIELDS: ["INPUT", "SELECT", "TEXTAREA"],
m21: null,
m22: "",
m23: "",
m24: "",
m25: "",
m26: false,
m27: false,
m28: false,
initialize: function(p57){
if(typeof p57 != "string")
return;
if(p57.indexOf(":") > -1){
var v51 = p57.split(":");
this.m25 = iw.DOMFactory.getElement(v51[0]);
if(this.m25 && this.m25.tagName && this.m25.tagName.toUpperCase() == "FORM"){
this.m24 = v51[0];
this.m23 = iw.DOMFactory.getFormField(this.m25, v51[1]);
if(this.m23 && !this.m23.tagName && this.m23.length)
this.m27 = true;
if(this.m23 && this.m23.type && this.m23.type.toUpperCase() == "CHECKBOX"){
this.m26 = true;
}
if(this.m23 && this.m23.tagName && this.m23.tagName.toUpperCase() == "SELECT")
this.m28 = true;
}
}
else{
this.m23 = iw.DOMFactory.getElement(p57);
}
this.m21 = {};
this.m22 = p57;
},
getElement: function(){
return this.m23;
},
getId: function(){
return this.m22;
},
getValue: function(){
if(!this.m23)
return null;
if(this.m24 && this.m26)
return this.m23.checked ? 'true' : 'false';
if(this.m24 && this.m27){			
for(var i = 0; i < this.m23.length; i++)
if(this.m23[i].checked){
return this.m23[i].value;
}
}
if(this.m24 && !this.m26)
return this.m23.value;
return this.m23.innerHTML !== undefined ? this.m23.innerHTML : null;
},
setValue: function(p18){
if(!this.m23)
return;
if(this.m24 && !this.m26 && p18 != null)
this.m23.value = p18;
if(this.m24 && this.m26)
this.m23.checked = (p18 == "true" || p18 === true);
if(this.m24 && this.m27){
for(var i = 0; i < this.m23.length; i++)
this.m23[i].checked = (this.m23[i].value == p18);
}
},
setSelectedIndex: function(p61){
if(!this.m23)
return ;
if(this.m24 && this.m27){
for(var i = 0; i < this.m23.length; i++)
this.m23[i].checked = i == p61 ? true : false;
}
if(this.m24 && this.m28)
this.m23.selectedIndex = p61;
},
getSelectedIndex: function(){
if(!this.m23)
return -1;
if(this.m24 && this.m27){
for(var i = 0; i < this.m23.length; i++)
if(this.m23[i].checked)
return i;
}
if(this.m24 && this.m28)
return this.m23.selectedIndex;
return -1;
},
log: function(p40, p41){
if(!this.m1)
return;
if(p41 === undefined)
p41 = 4;
var v38 = "[p" + p41
+ " " + this._f5() + "] "
+ this.__className + "(" + this.m22 + "): "
+ p40;
this._f4(v38);
},
/*Comments erased*/ 
addEventListener: function(p33, p34){	
this.Super.addEventListener(p33, p34);
if(!this.m23)
return;
if(this.m27){
for(var i = 0; i < this.m23.length; i++)
this._f9(p33, this.m23[i]);
}
else
this._f9(p33);
},
update: function(){
this.log("updating observer " + this.m22);
var v51 = this.m22.split(":");
this.m23 = iw.DOMFactory.getFormField(this.m25, v51[1]);
for(var v52 in this.m2){
if(this.m27){
for(var i = 0; i < this.m23.length; i++)
this._f9(v52, this.m23[i]);
}
else
this._f9(v52);
}
},
_f9: function(p33, p14){
if(p14 == undefined)
p14 = this.m23;
if(!p14 || !p14.tagName)
return;
var v53 = this.ICHR_TO_DOM[p33];
if(!v53)
return;
if(p14[this.SELECTOR_ELEMENT_HAS_LISTENER] == undefined)
p14[this.SELECTOR_ELEMENT_HAS_LISTENER] = {};
var v54 = p14.tagName.toUpperCase();
if(v53 == "change" && v54 == "INPUT" && iw.Core.isOneOf(["RADIO", "CHECKBOX"], p14.type.toUpperCase()))
v53 = "click";
var v55 = v53.substr(0, 1).toUpperCase() + v53.substr(1);
//p14
if(!p14[this.SELECTOR_ELEMENT_HAS_LISTENER][v53] && this[this.USER_EVENT_HANDLER_PREFIX + v55]){
p14[this.SELECTOR_ELEMENT_HAS_LISTENER][v53] = true;
iw.DOMEvents.addEventListener(p14, v53, this[this.USER_EVENT_HANDLER_PREFIX + v55]);
}
},
/*Comments erased*/ 
removeEventListener: function(p33, p34){
this.Super.removeEventListener(p33, p34);
if(!this.m23)
return;
if(this.m27){
for(var i = 0; i < this.m23.length; i++)
this._f10(p33, this.m23[i]);
}
else
this._f10(p33);
},
_f10: function(p33, p14){
if(p14 == undefined)
p14 = this.m23;
if(!p14 || !p14.tagName)
return;
var v53 = this.ICHR_TO_DOM[p33];
if(!v53)
return;
if(p14[this.SELECTOR_ELEMENT_HAS_LISTENER] == undefined)
p14[this.SELECTOR_ELEMENT_HAS_LISTENER] = {};
var v54 = p14.tagName.toUpperCase();
if(v53 == "change" && v54 == "INPUT" && iw.Core.isOneOf(["RADIO", "CHECKBOX"], p14.type.toUpperCase()))
v53 = "click";
var v55 = v53.substr(0, 1).toUpperCase() + v53.substr(1);
if(p14[this.SELECTOR_ELEMENT_HAS_LISTENER][v53] && this[this.USER_EVENT_HANDLER_PREFIX + v55]){
iw.DOMEvents.removeEventListener(p14, v53, this[this.USER_EVENT_HANDLER_PREFIX + v55]);
p14[this.SELECTOR_ELEMENT_HAS_LISTENER][v53] = false;
}
},
onDomElementClick: function(event){
if(this.m23.tagName && this.m23.tagName.toUpperCase() == "A")
this.dispatchEvent(new ichr.events.Event("suggestedAnswer", "eventSuccess", this.getId(), this.getValue()));
if(this.m26 || this.m27){
this.dispatchEvent(new ichr.events.Event("valueChange", "eventSuccess", this.getId(), this.getValue()));
}
this.dispatchEvent(new ichr.events.Event("mouseClick", "eventSuccess", this.getId(), this.getValue()));
},
onDomElementMouseover: function(event){
this.dispatchEvent(new ichr.events.Event("mouseOver", "eventSuccess", this.getId(), this.getValue()));
},
onDomElementMouseout: function(event){
this.dispatchEvent(new ichr.events.Event("mouseOut", "eventSuccess", this.getId(), this.getValue()));
},
onDomElementKeyup: function(event){
this.dispatchEvent(new ichr.events.Event("keyUp", "eventSuccess", this.getId(), this.getValue()));
},
onDomElementKeydown: function(event){			
this.dispatchEvent(new ichr.events.Event("keyDown", "eventSuccess", this.getId(), this.getValue()));
},
onDomElementChange: function(event){
this.dispatchEvent(new ichr.events.Event("valueChange", "eventSuccess", this.getId(), this.getValue()));
},
onDomElementFocus: function(event){
this.dispatchEvent(new ichr.events.Event("focusIn", "eventSuccess", this.getId(), this.getValue()));
},
onDomElementBlur: function(event){
this.dispatchEvent(new ichr.events.Event("focusOut", "eventSuccess", this.getId(), this.getValue()));
}
}
iw.Core.extendDefinition(ichr.dom.ElementObserver, ichr.events.EventDispatcher);
}
catch(err){
iw.Core.reportError("ichr.dom.ElementObserver class definition error", err);
}
//----------------
//external_form.js
try{
iw.Core.definePackage("ichr.dom");
/*Comments erased*/ 
ichr.dom.ExternalForm = iw.Core.defineClass("ichr.dom.ExternalForm");
ichr.dom.ExternalForm.prototype = {
m25: null,
m4: null,
m29: null,
m22: "",
initialize: function(p62, p63, p64){
this.m29 = p64;
this.m25 = iw.DOMFactory.getElement(p63);
if(!this.m25){
this.m25 = iw.DOMFactory.newElement("form", {"id": p63});
this.m25.onsubmit = function(){return false};
p62.appendChild(this.m25);
}
this.Super.initialize(p63);
this.m25 = this.getElement();
this.m4 = {};
},
getId: function(){
return this.m22;
},
addHtml: function(p65){
if(this.m25){	
var v56 = iw.DOMFactory.newElement("span", {"className" : "standard", "innerHTML": p65});
this.m25.appendChild(v56);
}
},
addCheckBox: function(p66, p67, p18){
if(!this.m25)
return;
var v21 = iw.DOMFactory.getFormField(this.m25, p66);
var v48 = this.m4[p66];
if(!v21){
var v57 = iw.DOMFactory.newElement("label");
v57.appendChild(iw.DOMFactory.newElement("input", {"name": p66, "type":"checkbox"}));
v57.appendChild(iw.DOMFactory.newElement("text", p67?p67:""));
this.m25.appendChild(v57);
}
if(v48 == null){
v48 = this.m4[p66] = new ichr.dom.ElementObserver(this.m22 + ":" + p66);
v48.setLogConsole(this.getLogConsole());
}
else{
v48.update();
}
v48.setValue(p18);
this.m29.addObserver(v48);
//return v48;
},
addComboBox: function(p68, p69, p70) {
if(!this.m25)
return;
var v58;
var v59;
var v60 = iw.DOMFactory.getFormField(this.m25, p68);
var v48 = this.m4[p68];
if(!v60){
v60 = iw.DOMFactory.newElement("select", {"name": p68});
this.m25.appendChild(v60);
}
if(p69){
var v61 = v60.getElementsByTagName("option");
var v62 = p69.length > v61.length ? p69.length : v61.length;
var v63 = 0;
for(v58 = 0; v58 < v62; v58++) {
v59 = p69[v58];
if(v61[v58] && v58 < p69.length){//option already exists
//v61[v58].selected = v58 == p70;
v61[v58].value = v59.value;
v61[v58].innerHTML = v59.label?v59.label:v59.value;
}
else if(v59 && v58 < p69.length){//option needs to be created
v60.appendChild(iw.DOMFactory.newElement("option", {/*"selected": v58 == p70,*/ "value": v59.value, "innerHTML": v59.label}));
}
else if(v61[v62 + p69.length - v58 - 1]){//existing but already redundant option element
v63++;
v60.removeChild(v61[v62 + p69.length - v58 - 1]);
}
}
}
if(v48 == null){
v48 = this.m4[p68] = new ichr.dom.ElementObserver(this.m22 + ":" + p68);
v48.setLogConsole(this.getLogConsole());
}
else{
v48.update();
}
v48.setSelectedIndex(p70);
this.m29.addObserver(v48);
//return v48;
},
addRadioGroup: function(p71, p69, p70) {
if(!this.m25)
return;
var v58;
var v59;
var v57;
var v64 = iw.DOMFactory.getFormField(this.m25, p71);
var v48 = this.m4[p71];
if(!v64)
v64 = [];
if(p69){
var v62 = p69.length > v64.length?p69.length:v64.length;
for(v58 = 0; v58 < v62; v58++) {				
v59 = p69[v58];
if(v64[v58] && v58 < p69.length){//radio button already exists	
v64[v58].value = p69[v58].value;
v57 = v64[v58].parentNode;
if(v57 && v57.tagName.toLowerCase() == "label"){//update label
v57.removeChild(v64[v58]);
v57.innerHTML = "";//clear node
v57.appendChild(v64[v58]);//append button to empty label
v57.appendChild(iw.DOMFactory.newElement("text", p69[v58].label?p69[v58].label:p69[v58].value));
} 
}
else if(v59 && v58 < p69.length){//radio button needs to be created
v57 = iw.DOMFactory.newElement("label");
v57.appendChild(iw.DOMFactory.newElement("input", {"type":"radio", "name":p71, "value":p69[v58].value}));
v57.appendChild(iw.DOMFactory.newElement("text", p69[v58].label?p69[v58].label:p69[v58].value));
this.m25.appendChild(v57);
}
else if(v64[v58] && v64[v58].parentNode.tagName.toLowerCase() == "label"){//existing but already redundant labeled radio button
v57 = v64[v58].parentNode;
v57.parentNode.removeChild(v57);
}
else if(v64[v58]){//existing but already redundant not labeled radio button
v64[v58].parentNode.removeChild(v64[v58]);
}
}
}
if(v48 == null){
v48 = this.m4[p71] = new ichr.dom.ElementObserver(this.m22 + ":" + p71);
v48.setLogConsole(this.getLogConsole());
}
else{
v48.update();
}
v48.setSelectedIndex(p70);
this.m29.addObserver(v48);
//return v48;
},
addTextField: function(p72, p73, p74, p75, p76){
if(!this.m25)
return;
var v21 = iw.DOMFactory.getFormField(this.m25, p72);
var v48 = this.m4[p72];
if(!v21){
var v65 = {"name": p72};
if(p74){
this.m25.appendChild(iw.DOMFactory.newElement("textarea", v65));
}
else{
v65["type"] = "text";
if(p75)
v65["maxlength"] = p75;
this.m25.appendChild(iw.DOMFactory.newElement("input", v65));
}
}
if(v48 == null){
v48 = this.m4[p72] = new ichr.dom.ElementObserver(this.m22 + ":" + p72);
v48.setLogConsole(this.getLogConsole());
}
else{
v48.update();
}
v48.setValue(p73);
this.m29.addObserver(v48);
//return v48;
},
getField: function(p22){
return this.m4[p22];
},
clear: function(){
for(var v41 in this.m4){
if(this.m4[v41].__className == undefined){
this.log("native item (" + v41 + "): " + this.m4[v41]);
continue;
}
this.m4[v41].dispatchEvent(new ichr.events.Event("removed"));
}
if(this.m25){
this.m25.innerHTML = '';
}
this.m4 = {};
}
}
iw.Core.extendDefinition(ichr.dom.ExternalForm, ichr.dom.ElementObserver);
}
catch(err){
iw.Core.reportError("ichr.dom.ExternalForm class definition error", err);
}
//----------------
//external_docker.js
try{
iw.Core.definePackage("ichr.dock");
/*Comments erased*/  
ichr.dock.ExternalDocker = iw.Core.defineClass("ichr.dock.ExternalDocker");
ichr.dock.ExternalDocker.dockerStyle = iw.DOMFactory.newStyleSheet(".ichr-caption{display: block !important; margin: 0 !important; border: none !important; font-size: 14px; font-weight: bold; font-family: Arial, sans-serif}");
iw.DOMFactory.applyStyleSheet(ichr.dock.ExternalDocker.dockerStyle);
ichr.dock.ExternalDocker.prototype = {
CAPTION_CLASS: "ichr-caption",
m30: null,
m31: null,
m32: null,
m33: null,
m34: "l",
m35: "t",
m21: null,
m36: 0,
m29: null,
m37: true,
/*Comments erased*/ 
initialize: function(p58, p64){		
this.m33 = {};
this.m30 = iw.DOMFactory.getElement(p58.id);
this.m29 = p64;
if(!this.m30 && this.m29){
this.m30 = iw.DOMFactory.newElement("DIV", {"id":p58.id});
this.m32 = iw.DOMFactory.newElement("DIV", {"className": this.CAPTION_CLASS});
this.m30.appendChild(this.m32);
this.setParentId(p58.parentId);
}
this.Super.initialize(p58.id);
//this.m21 = {};
},
getContainer: function(){
return this.m30;
},
setId: function(p22){
this.m33.id = p22;
this.m30.id = p22;
},
getId: function(){
return this.m30.id;
},
setEnabled: function(p77){
this.m37 = p77;
},
getEnabled: function(){
return this.m37;
},
setValue: function(p18){
this.m33.value = p18;
},
getValue: function(){
return this.m33.value;
},
setParentId: function(p78){		
var v66 = iw.DOMFactory.getElement(p78);
if(!v66 && this.m29){
v66 = this.m29.getWindowWrapper();
p78 = v66.id;
}
if(v66 && this.m33.parentId != p78){
this.m33.parentId = p78;
v66.appendChild(this.m30);
}			 
},
getParentId: function(){
return this.m33.parentId;
},
setX: function(p_iX){		
if(!isNaN(p_iX)){
this.m33.x = p_iX;
this.m30.style.position = "absolute";
this._f13();
}
else{
this.m33.x = undefined;
this.m30.style.position = "";
this.m30.style.left = "";
}
},
getX: function(){
return this.m33.x;
},
getBoundX: function(){
return this.m30.offsetLeft;
},
setY: function(p_iY){
if(!isNaN(p_iY)){
this.m33.y = p_iY;
this.m30.style.position = "absolute";
this._f14();
}
else{
this.m33.y = undefinded;
this.m30.style.position = "";
this.m30.style.top = "";
}
},
getY: function(){
return this.m33.y;
},
getBoundY: function(){
return this.m30.offsetTop;
},
setWidth: function(p52){
if(!isNaN(p52)){
this.m33.width = parseInt(p52);
this.m30.style.width = p52+"px";
//this.m30.style.overflowX = "hidden";
this._f13();
}
else{
this.m33.width = undefined;
this.m30.style.width = "";
//this.m30.style.overflowX = "";
}
},
getWidth: function(){
return this.m33.width !== undefined ? this.m33.width : this.m30.clientWidth;
},
setHeight: function(p53){
if(!isNaN(p53)){
this.m33.height = parseInt(p53);
this.m30.style.height = p53+"px";
//this.m30.style.overflowY = "hidden";
this._f14();
}
else{
this.m33.height = undefined;
this.m30.style.height = "";
//this.m30.style.overflowY = "";
}
this.log("ExternalDocker height: " + this.m33.height + "/" +p53);
},
getHeight: function(){
return this.m33.height !== undefined ? this.m33.height : this.m30.clientHeight;
},
setAlign: function(p79){
this.m33.align = p79;
this.m34 = "l";
this.m35 = "t";
if(p79){
var v67 = p79.indexOf("t") > -1;
var v68 = p79.indexOf("b") > -1;
if(v68)
this.m35 = "b";
var v69 = p79.indexOf("l") > -1;
var v70 = p79.indexOf("r") > -1;
if(v70)
this.m34 = "r";
var v71 = p79.indexOf("cc") > -1;
var v72 = v71 || (p79.indexOf("c") > - 1 && (v67 || v68));
if(v72)
this.m34 = "c";
var v73 = v71 || (p79.indexOf("c") > - 1 && (v69 || v70));
if(v73)
this.m35 = "c";
this._f14();
this._f13();
}
},
getAlign: function(){
return this.m33.align;
},
setCaption: function(p80){
this.m33.caption = p80;
if(this.m32){
this.m32.innerHTML = p80;
this._f14();
this._f13();
}
},
getCaption: function(){
return this.m33.caption;
},
setVisible: function(p59){
if(p59 && p59 != "false") {
this.m33.visible = true;
this.m30.style.display = "";
if(this.m30.style.visibility == "hidden"){
this.m30.style.visibility = "show";
}
} else {
this.m33.visible = false;
this.m30.style.display = "none";
}
},
getVisible: function(){
return this.m33.visible === undefined ? true : this.m33.visible;
},
setAlpha: function(p_numAlpha){
this.m33.alpha = p_numAlpha;
if(iw.isIE && !isNaN(p_numAlpha)){
this.m30.style.filter = "alpha(opacity = "+Math.round(p_numAlpha*100)+")";
}
else if(!isNaN(p_numAlpha)){
this.m30.style.opacity = p_numAlpha;
}
},
getAlpha: function(){
this.m33.alpha;
},	
setBackgroundSkin: function(p_backgroundSkin){
if(p_backgroundSkin){
this.m33.backgroundSkin = p_backgroundSkin;
this.m30.style.backgroundImage = "url("+p_backgroundSkin+")";
this.m30.style.backgroundPosition = "top left";
}
else{
this.m33.backgroundSkin = "";
this.m30.style.backgroundImage = "";
this.m30.style.backgroundPosition = "";
}
},
getBackgroundSkin: function(){
return this.m33.backgroundSkin;
},
setBackgroundColor: function(p81){
if(typeof p81 == 'string' && p81.indexOf("#") === 0 && p81.length == 7){
this.m33.backgroundColor = p81;
this.m30.style.backgroundColor = p81;
}
else{
this.m33.backgroundColor = "";
this.m30.style.backgroundColor = "";
}
},
getBackgroundColor: function(){
return this.m33.backgroundColor;
},
setPadding: function(p82){
if(!isNaN(p82) && p82 >= 0){
this.m33.padding = p82;
this.m30.style.padding = p82+"px";
}
else{
this.m33.padding = undefined;
this.m30.style.padding = "";
}
},
getPadding: function(){
return this.m33.padding;
},
setBorderWidth: function(p52){
if(!isNaN(p52) && p52 > 0){
this.m33.borderWidth = p52;
this.m30.style.borderStyle = "solid";
this.m30.style.borderWidth = p52+"px";
}
else{
this.m33.borderWidth = 0;
this.m30.style.borderStyle = "";
this.m30.style.borderWidth = "";
}
},
getBorderWidth: function(){
return this.m33.borderWidth;
},
setBorderColor: function(p81){
if(typeof p81 == 'string' && p81.indexOf("#") === 0 && p81.length == 7){
this.m33.borderColor = p81;
this.m30.style.borderColor = p81;
if(!this.m33.borderWidth){
this.m30.style.borderStyle = "solid";
this.m30.style.borderWidth = "1px";
}
}
else{
this.m33.borderColor = "";
this.m30.style.borderColor = "";
}
this._f13();
this._f14();
},
getBorderColor: function(){
return this.m33.borderColor;
},
getStyleSheet: function(){
return this.m33.styleSheet;
},
setStyleSheet: function(p26){
this.m33.styleSheet = p26;
if(this.getId()){	
var v74 = this._f11(p26);
this._f12(v74);
this._f14();
this._f13();
}
},
/*Comments erased*/ 
dispatchEvent: function(p38){
if(this.m37)
this.Super.dispatchEvent(p38);
},
getActualStyle: function(p26){
var v75 = iw.DOMFactory.getElementStyle(this.m30, p26);
return isNaN(v75) ? 0 : v75;
},
_f11: function(p26){
if(this.getId()){	
var v74 = p26.replace(/\n/g, " ");//removing new line marks
v74 = v74.replace(/\t/g, "");//removing tabs
v74 = v74.replace(/\}/g, "}\n#" + this.getId() + " ");//adding dockerId prefixes
v74 = v74.substr(0, v74.lastIndexOf("#" + this.getId()));//remove added id from the end
v74 = v74.replace(/\,/g, ", #" + this.getId() + " ");//adding dockerId prefixes to multiple selectors
v74 = "\n#" + this.getId() + " " + v74;//adding dockerId prefix to first selector
v74 = v74.replace(/\s{2,}/g, " ");
v74 = v74.replace(/caption\s?\{/g, "." + this.CAPTION_CLASS + " {");
return v74;
}
return p26;
},
_f12: function(p26){
if(!this.m41){			
this.m41 = iw.DOMFactory.newStyleSheet(p26);
iw.DOMFactory.applyStyleSheet(this.m41);
}
else 
this.m41 = iw.DOMFactory.updateStyleSheet(this.m41, p26);
},
_f13: function(p52){
if(!isNaN(this.m33.x) && this.m30.style.position == "absolute"){
if(p52 == undefined || isNaN(p52))
p52 = iw.DOMFactory.getWidth(this.m30);
switch(this.m34){
case "r":
this.m30.style.left = (this.m33.x - p52 ) + "px";
break;
case "c":
this.m30.style.left = (this.m33.x - Math.round(p52/2)) + "px";
break;
default:
this.m30.style.left = this.m33.x + "px";
}
this.m30.style.right = "";
}
},
_f14: function(p53){
if(!isNaN(this.m33.y) && this.m30.style.position == "absolute"){
if(p53 == undefined || isNaN(p53))
p53 = iw.DOMFactory.getHeight(this.m30);
switch(this.m35){
case "b":
this.m30.style.top = (this.m33.y - p53) + "px";
break;
case "c":
this.m30.style.top = (this.m33.y - Math.round(p53/2)) + "px";
break;
default:
this.m30.style.top = this.m33.y + "px";
}
this.m30.style.bottom = "";
}
}
}
iw.Core.extendDefinition(ichr.dock.ExternalDocker, ichr.dom.ElementObserver);
}
catch(err){
iw.Core.reportError("ichr.dock.ExternalDocker class definition error", err);
}
//----------------
//external_button.js
try{
iw.Core.definePackage("ichr.dock");
/*Comments erased*/  
ichr.dock.ExternalButton = iw.Core.defineClass("ichr.dock.ExternalButton");
ichr.dock.ExternalButton.buttontyle = iw.DOMFactory.newStyleSheet(".ichr-button{cursor: pointer}");
iw.DOMFactory.applyStyleSheet(ichr.dock.ExternalButton.buttontyle);
ichr.dock.ExternalButton.prototype = {
BUTTON_CLASS: "ichr-button",
m38: null,
initialize: function(p58, p64){
this.Super.initialize(p58, p64);
this.m38 = {};
if(this.m32){
this.m30.className += " "+this.BUTTON_CLASS;
}
}
}
iw.Core.extendDefinition(ichr.dock.ExternalButton, ichr.dock.ExternalDocker);
}
catch(err){
iw.Core.reportError("ichr.dock.ExternalButton class definition error", err);
}
//----------------
//external_window.js
try{
iw.Core.definePackage("ichr.dock");
/*Comments erased*/  
ichr.dock.ExternalWindow = iw.Core.defineClass("ichr.dock.ExternalWindow");
ichr.dock.ExternalWindow.windowStyle = iw.DOMFactory.newStyleSheet(".ichr-content{display: block !important; margin: 0 !important; overflow-x: hidden;}");
iw.DOMFactory.applyStyleSheet(ichr.dock.ExternalWindow.windowStyle);
ichr.dock.ExternalWindow.prototype = {
CONTENT_CLASS: "ichr-content",
m39: null,
m40: null,
initialize: function(p58, p64, p83){
this.Super.initialize(p58, p64);
this.m40 = {};
if(this.m32 && p83 == undefined){
this.m39 = iw.DOMFactory.newElement("div", {"className": this.CONTENT_CLASS});
this.m30.appendChild(this.m39);
}
else if(p83 != undefined){
this.m39 = p83;
}
else{
this.m39 = this.m30;
}
},
setCaption: function(p80){
this.Super.setCaption(p80);
this._f15();
},
setMaxHeight: function(p84){
this.m40.maxHeight = !isNaN(p84) ? parseInt(p84) : undefined;
this.log(this + " maxheight: " + this.m40.maxHeight);
this._f15();
this._f14();
},
getMaxHeight: function(){
return this.m40.maxHeight;
},
setHeight: function(p53){
this.Super.setHeight(p53);
this.m40.height = !isNaN(p53) ? parseInt(p53) : undefined;
this.log(this + " height: " + this.m40.height + "/" +p53);
this._f15();
},
getHeight: function(){
return this.m40.height;
},
getActualHeight: function(){
return iw.DOMFactory.getHeight(this.m30);
},
setWidth: function(p52){
this.Super.setWidth(p52);
this.log(this + " width: " + p52);
this._f15();
},
getActualWidth: function(){
return iw.DOMFactory.getHeight(this.m30);
},
setScrollbarVisible: function(p85){
this.m33.scrollbarVisible = p85;
this._f15();
},
getScrollbarVisible: function(){
return this.m33.scrollbarVisible;
},
setStyleSheet: function(p26){
this.Super.setStyleSheet(p26);
this._f15();
},
_f11: function(p26){
if(this.getId()){	
var v74 = this.Super._f11(p26);
v74 = v74.replace(/\.content\s?\{/g, "." + this.CONTENT_CLASS + " {");
return v74;
}
return p26;
},
_f15: function(){
if(this.m40.height == undefined && this.m40.maxHeight == undefined)
return;
this.m39.style.height = "auto";
this.m39.style.overflowY = "hidden";
var v76 = 0;
var v77 = Math.max(this.m39.offsetHeight, this.m39.scrollHeight);
var v78 = v77;
var v79 = parseInt(iw.DOMFactory.getElementStyle(this.m39, "paddingTop")) + parseInt(iw.DOMFactory.getElementStyle(this.m39, "paddingBottom"));
if(isNaN(v79))
v79 = 0;
var v80 = parseInt(iw.DOMFactory.getElementStyle(this.m39, "borderTopWidth")) + parseInt(iw.DOMFactory.getElementStyle(this.m39, "borderBottomWidth"));
if(isNaN(v80))
v80 = 0;
if(this.m32){
v76 = this.m32.offsetHeight;
v78 += v76;
}
var v81 = this.m40.height != undefined ? this.m40.height : 0;
var v82 = this.m40.maxHeight != undefined && this.m40.maxHeight > v81 ? this.m40.maxHeight : 0;
this.log(this.getId() + " adjusted height: " + v81 + "/" + v78 + "/" + v82 + " ( " + v76 + " / " + v77 + " / " + v79 + " / " + v80 + ")");
//fit content fill the rest of docker
if(v81 && !v82){		
var v83 = this.m40.height - v76 - v79 - v80;
if(v83 <= 0)
v83 = NaN;
if(!isNaN(v83))
this.m39.style.height =  v83 + "px";
}
//extend docker height 
else if(v82){
var v84 = Math.max(v81, Math.min(v78, v82));
this.m39.style.height = (v84 - v76 - v79 - v80) + "px";
//iw.Core.reportError(this + ".Super: " + this.Super.__className);
this.Super.setHeight(v84);
}
if(this.m33.scrollbarVisible == "true" || 
(this.m33.scrollbarVisible == "auto" && v78 >= Math.max(v81, v82)))
this.m39.style.overflowY = "scroll";
}
}
iw.Core.extendDefinition(ichr.dock.ExternalWindow, ichr.dock.ExternalDocker);
}
catch(err){
iw.Core.reportError("ichr.dock.ExternalWindow class definition error", err);
}
//----------------
//external_output_window.js
try{
iw.Core.definePackage("ichr.dock");
/*Comments erased*/  
ichr.dock.ExternalOutputWindow = iw.Core.defineClass("ichr.dock.ExternalOutputWindow");
ichr.dock.ExternalOutputWindow.outputStyle = iw.DOMFactory.newStyleSheet(".ichr-output{font-family: Arial, sans-serif; font-size: 12px;} .ichr-output a{text-decoration: none; cursor: pointer; color: #4C89BB} .ichr-output  a:hover{text-decoration: underline}");
iw.DOMFactory.applyStyleSheet(ichr.dock.ExternalOutputWindow.outputStyle);
ichr.dock.ExternalOutputWindow.prototype = {
OUTPUT_CLASS: "ichr-output",
TEXT_CLASS: "ichr-output-text",
m41: null,
m39: null,
m4: null,
/*Comments erased*/ 
initialize: function(p58, p64){	
this.Super.initialize(p58, p64);
this.m39.className += " " + this.OUTPUT_CLASS;
this.m4 = {};
},
addHtml: function(p65){
if(!this.m30)
return;
var v56 = iw.DOMFactory.newElement("span", {"className" : this.TEXT_CLASS, "innerHTML": p65});
this.m39.appendChild(v56);
this._f15();
},
addLink: function(p73, p86){
if(!this.m30)
return;
var v48 = this.getReference(p86);
if(v48){
this.log("element " + p86 + " already exist.");
v48.setValue(p73);
return;
}
var v85 = iw.DOMFactory.getElement(p86);
if(!v85){
this.m39.appendChild(iw.DOMFactory.newElement("A", {id: p86, innerHTML: p73}));
}
else{
v85.innerHTML = p73;
}
v48 = new ichr.dom.ElementObserver(p86);
v48.setLogConsole(this.getLogConsole());
this.m29.addObserver(v48);
this.m4[p86] = v48;
this._f15();
},
addImage: function(p87, p88 , p52, p53){		
if(!this.m30)
return;
var v48 = this.getReference(p88)
if(v48){
this.log("element " + p88 + " already exist.");
if(v48.getElement().tagName.toLowerCase() == "img")
v48.getElement().src = p87;
return;
}
var v86 = iw.DOMFactory.getElement(p88);
if(!v86){
if(p87.indexOf(".swf") != -1){
var v44 = p87.indexOf("?") > 0?p87.split("?")[1]:"";
p87 = p87.split("?")[0];
p87 = p87.substr(0, p87.lastIndexOf(".swf"));
var v46 = p87.indexOf("https://") != -1 ? "https" : "http";
var v87 = iw.FlashFactory.newObjectString(
'codebase', v46+'://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0',
'width', p52?p52:"100%",
'height', p53?p53:"100%",
'src', p87,
'quality', 'high',
'pluginspage', v46+'://www.macromedia.com/go/getflashplayer',
'align', 'middle',
'play', 'true',
'loop', 'true',
'scale', 'noscale',
'wmode', 'transparent',
'devicefont', 'false',
'id', p88,
'bgcolor', '#ffffff',
'name', p88,
'menu', 'true',
'allowFullScreen', 'true',
'allowScriptAccess','always',
'movie', p87,
'FlashVars', v44,
'salign', 'tl'
); //end AC code	
iw.DOMFactory.appendHTML(this.m39, v87);
}
else{
v86 = iw.DOMFactory.newElement("img", {"id":p88, "src": p87});
if(this.m39)
this.m39.appendChild(v86);
}
this._f15();
}
else if(v86.tagName.toLowerCase() == "img"){
v86.src = p87;
}
v48 = new ichr.dom.ElementObserver(p88);
v48.setLogConsole(this.getLogConsole());
this.m29.addObserver(v48);
this.m4[p88] = v48;
},
addForm: function(p63){
if(!this.m30)
return "getReference(null).";
if(this.getReference(p63)){
this.raiseException("element " + p63 + " already exist.");
return "getReference(\"" + p63 + "\").";
}
var v43 = new ichr.dom.ExternalForm(this.m39, p63, this.m29);
v43.setLogConsole(this.getLogConsole());
this.m4[p63] = v43;
this.m29.addObserver(v43);
this._f15();
//alert("getReference(" + p63 + ").");
return "getReference(\"" + p63 + "\").";
},
getReference: function(p22){
return this.m29.getObserverById(p22);
},
clear: function(){		
for(var v41 in this.m4){
if(this.m4[v41].__className == undefined){
this.log("native item (" + v41 + "): " + this.m4[v41]);
continue;
}
this.m4[v41].dispatchEvent(new ichr.events.Event("removed"));
if(typeof this.m4[v41].clear == "function")
this.m4[v41].clear();
}
if(this.m39)
this.m39.innerHTML = "";
this.m4 = {};
this._f15();
},
_f11: function(p26){
if(this.getId()){	
var v74 = this.Super._f11(p26);
v74 = v74.replace(/\.(text|standard)\s?\{/g, "." + this.TEXT_CLASS + " {");
return v74;
}
return p26;
}
}
iw.Core.extendDefinition(ichr.dock.ExternalOutputWindow, ichr.dock.ExternalWindow);
}
catch(err){
iw.Core.reportError("ichr.dock.ExternalOutputWindow class definition error", err);
}
//----------------------------------------------------------------------------
//----------------
//external_input_window.js
try{
iw.Core.definePackage("ichr.dock");
/*Comments erased*/  
ichr.dock.ExternalInputWindow = iw.Core.defineClass("ichr.dock.ExternalInputWindow");
ichr.dock.ExternalInputWindow.inputStyle = iw.DOMFactory.newStyleSheet(".ichr-input{display: block; margin: 0; padding: 0; resize: none; border-style: none; border-width: 0; background: none; font-family: Arial, sans-serif; font-size: 12px;}");
iw.DOMFactory.applyStyleSheet(ichr.dock.ExternalInputWindow.inputStyle);
ichr.dock.ExternalInputWindow.prototype = {
INPUT_CLASS: "ichr-input",
ENTER_KEY: 13,
EVENT_TYPE_HUMAN_RESPONSE: "humanResponse",
INPUT_TAGS: ["INPUT", "TEXTAREA"],
INPUT_EVENTS: ["keyUp", "keyDown", "valueChange", "focusIn", "focusOut"],
m42: null,
m43: null,
m44: [37, 38, 39, 40],
m45: false,
initialize: function(p58, p64){
this.m42 = iw.DOMFactory.getElement(p58.id);
if(!this.m42 || !iw.Core.isOneOf(this.INPUT_TAGS, this.m42.tagName.toUpperCase())){
this.m42 = iw.DOMFactory.newElement(
"textarea", 
{"className": this.INPUT_CLASS + " " + this.CONTENT_CLASS, "rows": 1}
);
this.Super.initialize(p58, p64, this.m42);
this.m30.appendChild(this.m42);
}
else{
this.Super.initialize(p58, p89);
}
iw.DOMEvents.addEventListener(this.m30, 'click', this._f17);
if(this.m42){
iw.DOMEvents.addEventListener(this.m42, 'keydown', this._f16);
window.setInterval(this._f18, 50);
}
},
getInput: function(){
return this.m42;
},
/*Comments erased*/ 
addEventListener: function(p33, p34){		
if(iw.Core.isOneOf(this.INPUT_EVENTS, p33)){//input specific events
this.Super.Super.Super.Super.addEventListener(p33, p34);//EventDispatcher.addEventListener
this._f9(p33, this.m42);
}
else if(p33 == this.EVENT_TYPE_HUMAN_RESPONSE){
this.Super.Super.Super.Super.addEventListener(p33, p34);//EventDispatcher.addEventListener
this._f9("keyDown", this.m42);
this._f9("keyUp", this.m42);
}
else{//standard docker events
this.Super.Super.addEventListener(p33, p34);//ExternalDocker.addEventListener
}
},
/*Comments erased*/ 
dispatchEvent: function(p38){
if(p38.type == "focusIn" && this.m42.focus){
this.m42.focus();
}
if(p38.type == "focusOut" && this.m42.blur){
this.m42.blur();
}
this.Super.dispatchEvent(p38);
},
setValue: function(p18){
this.Super.setValue(p18);
if(this.m42)
this.m42.value = p18;
this._f15();
},
getValue: function(){
return this.m42.value;
},
_f16: function(){
this.Super.setValue(this.m42.value);
},
_f17: function(){
if(this.m42 && this.m42.focus)
this.m42.focus();
},
_f18: function(){
if(this.m45)
this.m42.value = this.m42.value.replace(/[\n\r]+/g, "");
if(this.m43 != this.getValue()){
this._f15();
this.m43 = this.m42.value;
this.m42.scrollTop = this.m42.scrollHeight - this.m42.clientHeight;
}
},
_f15: function(){
var v79 = parseInt(iw.DOMFactory.getElementStyle(this.m39, "paddingLeft")) + parseInt(iw.DOMFactory.getElementStyle(this.m39, "paddingRight"));
if(isNaN(v79))
v79 = 0;
var v80 = parseInt(iw.DOMFactory.getElementStyle(this.m39, "borderLeftWidth")) + parseInt(iw.DOMFactory.getElementStyle(this.m39, "borderRightWidth"));
if(isNaN(v80))
v80 = 0;
var v88 = this.m33.width - v79 - v80;
if(v88 <= 0)
v88 = NaN;
if(!isNaN(v88))
this.m42.style.width = v88 + "px";
this.Super._f15();
},
onDomElementKeyup: function(event){
var v89 = iw.DOMEvents.keyCode(event);
if(iw.Core.isOneOf(this.m44, v89))
return;
if(v89 == this.ENTER_KEY && this.m37){
this.setValue("");
}
this.Super.onDomElementKeyup(event);
},
onDomElementKeydown: function(event){
var v89 = iw.DOMEvents.keyCode(event);
if(iw.Core.isOneOf(this.m44, v89))
return;
if(v89 == this.ENTER_KEY){
this.m45 = true;
this.dispatchEvent(new ichr.events.Event("humanResponse", "eventSuccess", this.getId(), this.getValue()));
}
else this.m45 = false;
this.Super.onDomElementKeydown(event);
}
}
iw.Core.extendDefinition(ichr.dock.ExternalInputWindow, ichr.dock.ExternalWindow);
}
catch(err){
iw.Core.reportError("ichr.dock.ExternalInputWindow class definition error", err);
}
//----------------
//external_selection_box.js
try{
iw.Core.definePackage("ichr.dock");
/*Comments erased*/  
ichr.dock.ExternalSelectionBox = iw.Core.defineClass("ichr.dock.ExternalSelectionBox");
ichr.dock.ExternalSelectionBox.selectionStyle = iw.DOMFactory.newStyleSheet(".ichr-selection{font-family: Arial, sans-serif; font-size: 12px;} a.ichr-selection-item{display: block; text-decoration: none; color: #000; cursor: pointer;} a.ichr-selection-active{background: blue; color: white}");
iw.DOMFactory.applyStyleSheet(ichr.dock.ExternalSelectionBox.selectionStyle);
ichr.dock.ExternalSelectionBox.prototype = {
SELECTION_CLASS: "ichr-selection",
ITEM_CLASS: "ichr-selection-item",
ACTIVE_ITEM_CLASS: "ichr-selection-active",
TEXT_CLASS: "ichr-selection-text",
KEY_ARROW_UP: 38,
KEY_ARROW_DOWN: 40,
m46: null,
m47: null,
m42: null,
m48: -1,
m49: null,
m50: "",
m51: [37, 38, 39, 40],
m52: null,
initialize: function(p58, p64){
this.m47 = iw.DOMFactory.getElement(p58.id);
this.m46 = [];
this.Super.initialize(p58, p64);
this.m49 = [];
if(!this.m47){
this.m47 = this.m39;
this.m47.className += " " + this.SELECTION_CLASS;
}
},
setInputId: function(p90){
if(this.m29 && this.m29.getObserverById(p90)){
this.m33.inputId = p90;
this.m42 = this.m29.getObserverById(p90);
//alert(this.m42.addEventListener);
var v90 = this.m42.getInput();
if(v90){
iw.DOMEvents.addEventListener(v90, "keydown", this._f19);
iw.DOMEvents.addEventListener(v90, "keyup", this._f20);
}
this._f23();
}
else{
this.m33.inputId = "";
this.m42 = null;
}
},
getInputId: function(){
return this.m33.inputId;
},
setX: function(p_iX){
this.m46.x = p_iX;
if(this.m42){
this._f23();
}
else{
this.Super.setX(p_iX);
}
},
setY: function(p_iY){
this.m46.y = p_iY;
if(this.m42){
this._f23();
}
else{
this.Super.setY(p_iY);
}
},
addLink: function(p73, p86){
if(!this.m30)
return;
if(this.getReference(p86)){
this.raiseException("element " + p86 + " already exist.");
return;
}
if(!iw.DOMFactory.getElement(p86)){
this.m47.appendChild(iw.DOMFactory.newElement("A", {id: p86, innerHTML: p73}));
}
var v91 = new ichr.dom.ElementObserver(p86);
v91.setLogConsole(this.getLogConsole());
v91.addEventListener("mouseClick", this._f22);
v91.addEventListener("mouseOver", this._f21);
iw.DOMFactory.addCSSClass(v91.getElement(), this.ITEM_CLASS);
v91.selectionIndex = this.m49.length;
this.m49.push(v91);
this.m29.addObserver(v91);
this.log("total items: "+this.m49);
this._f15();
},
addHtml: function(p73){
if(!this.m30)
return;
var v56 = iw.DOMFactory.newElement("span", {"className" : this.TEXT_CLASS, "innerHTML": p73});
//alert(v56);
this.m39.appendChild(v56);
this._f15();
},
getReference: function(p22){
return this.m29.getObserverById(p22);
},
clear: function(){
for(var v41 in this.m49){
var v91 = this.m49[v41];
if(v91.__className == undefined){
this.log("native item (" + v41 + "): " + v91);
continue;
}
v91.dispatchEvent(new ichr.events.Event("removed"));
v91.removeEventListener("mouseClick", this._f22);
v91.removeEventListener("mouseOver", this._f21);
}
if(this.m39)
this.m39.innerHTML = "";
this.m49 = [];
this.m48 = -1;
this.m52 = null;
this._f15();
},
_f19: function(event){
var v89 = iw.DOMEvents.keyCode(event);
if(iw.Core.isOneOf(this.m51, v89) && this.m49.length && this.getVisible()){
switch(v89){
case this.KEY_ARROW_UP:
this.m48 = (this.m48 - 1) % (this.m49.length + 1);
break;
case this.KEY_ARROW_DOWN:
this.m48 = (this.m48 + 1) % (this.m49.length + 1);
break;
}
this.log("index: "+this.m48);
if(v89 == this.KEY_ARROW_UP || v89 == this.KEY_ARROW_DOWN){
if(this.m48 < 0)
this.m48 += this.m49.length + 1;
var v92 = this.m49[this.m48];
if(v92 && v92.getElement())
iw.DOMFactory.addCSSClass(v92.getElement(), this.ACTIVE_ITEM_CLASS);
if(this.m52 && this.m52.getElement())
iw.DOMFactory.removeCSSClass(this.m52.getElement(), this.ACTIVE_ITEM_CLASS);
this.log("activate: " + v92 + "(last: " + this.m52 + ")");
this.m52 = v92;
this.m42.setValue(v92 ? v92.getValue() : this.m50);
}
iw.DOMEvents.stopPropagation(event);
}
},
_f20: function(event){
var v89 = iw.DOMEvents.keyCode(event);
if(iw.Core.isOneOf(this.m51, v89)){				
if(this.m49.length && this.getVisible()){
iw.DOMEvents.stopPropagation(event);
}
}
else{
this.m50 = this.m42.getValue();
}
},
_f21: function(event){
var v92 = event.source;
if(v92){
this.m48 = v92.selectionIndex;
if(v92.getElement())
iw.DOMFactory.addCSSClass(v92.getElement(), this.ACTIVE_ITEM_CLASS);
if(this.m52 && this.m52.getElement())
iw.DOMFactory.removeCSSClass(this.m52.getElement(), this.ACTIVE_ITEM_CLASS);
this.m52 = v92;
}
},
_f22: function(event){
var v92 = event.source;
if(this.m42 && v92){
this.m42.setValue(v92.getValue());
}
},
_f15: function(){
this.Super._f15();
this._f23();
},
_f23: function (){
if(this.m42){
if(this.m42.getParentId() != this.getParentId()){
if(this.m46.x)
this.Super.setX(this.m46.x);
if(this.m46.y)
this.Super.setY(this.m46.y);
return;
}
this.Super.setX(this.m42.getBoundX());
var v93 = this.m30.offsetHeight;//this.getActualHeight()+this.thispadding*2+borderWidth*2;
var v94 = this.m42.getBoundY() + this.m42.getActualHeight();//m42Window.boundY+m42Window.actualHeight;
this.Super.setY(v94 - this.getActualStyle("paddingBottom") - this.getActualStyle("borderBottomWidth"));
}
},
_f11: function(p26){
if(this.getId()){	
var v74 = this.Super._f11(p26);
v74 = v74.replace(/option\s?\{/g, "." + this.ITEM_CLASS + " {");
v74 = v74.replace(/\.selected\s?\{/g, "." + this.ACTIVE_ITEM_CLASS + " {");
v74 = v74.replace(/\.(text|standard)\s?\{/g, "." + this.TEXT_CLASS + " {");
return v74;
}
return p26;
}
}
iw.Core.extendDefinition(ichr.dock.ExternalSelectionBox, ichr.dock.ExternalWindow);
}
catch(err){
iw.Core.reportError("ichr.dock.ExternalSelectionBox class definition error", err);
}
//----------------
//log.js
try{
/*Comments erased*/  
ichr.Log = iw.Core.defineClass("ichr.Log");
ichr.Log.instances = [];
ichr.Log.OUTPUT_STYLE = "text-align: left; background-color: #fff; border-top: 1px solid #777; border-left: 1px solid #777; border-bottom: 1px solid #ddd; border-right: 1px solid #ddd; cursor: text; margin-bottom: 2px; font-family: \"Courier New\", Courier, monospace !important; font-size: 11px !important; padding: 0 10px; ";
ichr.Log.LOG_OUTPUT_STYLE = ichr.Log.OUTPUT_STYLE+"overflow-y: scroll; ";
ichr.Log.CM_OUTPUT_STYLE = ichr.Log.OUTPUT_STYLE+"overflow: scroll;";
ichr.Log.PROFILER_OUTPUT_STYLE = ichr.Log.OUTPUT_STYLE+"overflow-y: scroll; ";
ichr.Log.DETAILS_STYLE = "font-family: \"Courier New\", Courier, monospace; border: 1px solid #bbb; margin: 2px 0; background: #fff; padding: 2px 5px; ";
ichr.Log.prototype = {
m18: null,
m53: null,
m54: null,
m55: null,
m56: null,
m57: null,
m58: false,
m59: null,
m60: null,
m61: null,
m62: null,
m63:null,
m64: null,
m65: null,
m66: null,
m67: null,
m68: null,
m69: null,
m70: null,
m71: null,
m72: null,
m73: null,
m74: null,
m8: null,
m11: 800,
m12: 300,
m75: false,
m76: null,
m77: null,
m78: null,
m79: null,
m80: 0,
m_activeCmdBox: null,
m81: null,
m82: null,
m83: null,
m84: null,
m85: null,
m86: 0,
initialize: function(p91, p45, p52, p53){
this.m8 = p45;
if(p91 && p91.getInstance){			
this.m18 = p91.getInstance();
}
else if(p91 && p91.setLogConsole){
p91.setLogConsole(this);
}
p91.addEventListener("ready", this._f38);
this.m53 = p91;
if(p52)
this.m11 = p52;
if(p53)
this.m12 = p53;
iw.DOMEvents.addEventListener(window, "load", this._f28);
this.m77 = new Array();
this.m79 = new Array();
this.m78 = new Array();
this.m54 = new Array();
this.m55 = new Array();
this.m56 = new Array();
this.m68 = new Array();
this.m69 = new Array();
this.m82 = new Array();
this.m83 = new Array();
},
getInstanceMonitor: function(){
return this.m85;
},
_f24: function(){
this.showInstances(this.m85.getInstances());
},
/*Comments erased*/ 
log: function(p92){
if(this.m62 && this.m58 && this.m71.checked){
this.m80 = this.m77.length - 1;
this.m77 = this.m77.concat(p92);
this.writeMessages(p92);
}
else{
if(this.m81 == null)
this.m81 = new Array();
this.m81 = this.m81.concat(p92);
}
},
/*Comments erased*/ 
showInstances: function(p92){
if(this.m62 && this.m58 && this.m71.checked){
this.m62.innerHTML = "";
var v95 = "";
var v96 = 1;
var v97 = null;
for(var i = 0; i < p92.length; i++){
var v27 = p92[i];
var v40 = v27;
v27 = v27.substr(0, v27.indexOf(" "));
v40 = v40.substr(v27.length);
if(v27 != v95){
if(v97)
v97.appendChild(document.createTextNode(v95+" ("+v96+")"));
v96 = 1;
v97 = document.createElement("b");
if(i>0){
this.m62.appendChild(document.createElement("br"));
this.m62.appendChild(document.createElement("br"));
}
this.m62.appendChild(v97);
this.m62.appendChild(document.createElement("br"));
v95 = v27;
}
else{
v96++;
}
this.m62.appendChild(document.createTextNode(v40));
//this.m62.appendChild(document.createElement("br"));
}
if(v97)
v97.appendChild(document.createTextNode(v95+" ("+v96+")"));
}
else{
this.m82 = p92;
}
},
/*Comments erased*/ 	
showControlStatus: function(p92){
if(this.m63 && this.m58 && this.m71.checked){
for(var i = 0; i < p92.length; i++){
this._f26(p92[i]);
}
}
else{
this.m83 = this.m83.concat(p92);
}
},
_f25: function(event){
if(this.m71.checked){
this.log(this.m81);
this.showInstances(this.m82);
this.showControlStatus(this.m83);
this.m81 = new Array();
this.m82 = new Array();
this.m83 = new Array();
}			
},
_f26: function(p93){
if(p93 && this.m63 && this.m58 && this.m71.checked){
var v41 = "procCell"+p93.procId;
if(this.m66 == null || this.m67 == null){
var v98 = iw.DOMFactory.newElement("table", {"style":"table-layout:fixed; border-spacing: 0;"});
this.m67 = iw.DOMFactory.newElement("tr");
v98.appendChild(this.m67);
this.m66 = iw.DOMFactory.newElement("tr");
v98.appendChild(this.m66);
this.m63.appendChild(v98);
}
var v99  = this.m55[v41];
if(!v99){
v99 = iw.DOMFactory.newElement("th", {"style":"text-align: left; padding: 5px; margin: 0; border-right: 1px solid #cfcfcf; white-space:nowrap;"});
this.m67.appendChild(v99);
this.m55[v41] = v99;
}
v99.innerHTML = "#"+(p93.procId?p93.procId:"default")+" ("+p93.pointer+"/"+p93.commandCount+")";
var v100  = this.m56[v41];
if(!v100){
v100 = iw.DOMFactory.newElement("td", {"style":"vertical-align: top; margin: 0; border-right: 1px solid #cfcfcf; white-space:nowrap;"});
this.m66.appendChild(v100);
this.m56[v41] = v100;
}
if(this.m69[v41] != p93.resetCount){
this.m69[v41] = p93.resetCount;
v100.innerHTML = "";
}
if(p93.activeCommands){
//alert(p93.activeCommands);
for(var i = 0; i < p93.activeCommands.length; i++){
var v101 = p93.activeCommands[i];
if(v101){
var v102 = v100.childNodes[v101.id];
var v103 = p93.procId+"_"+v101.id;
if(!v102){
v102 = iw.DOMFactory.newElement("div", {"style":"color: #666; cursor: pointer; padding: 2px 5px;"});
v100.appendChild(v102);
v102.innerHTML = v101.type+" #"+v101.id+" "+(v101.synchronous?"[S]":"")+(v101.waitAfter?"["+v101.waitAfter+"]":"");
v102.id = v103;
iw.DOMEvents.addEventListener(v102, "click", this._f27);
}
if(v101.startTime){
v102.style.fontWeight = "bold";
}
if(v101.startTime && !v101.endTime)
v102.style.color = "red";
else if(v101.endTime)
v102.style.color = "#000000";
if(v101.terminated){
v102.style.textDecoration = "line-through";
v102.style.color = "#666";
}
this.m68[v103] = v101;
}
}
}
}
},
_f27: function(event){
var v102 = event.target || window.event.srcElement;
if(!v102)
return;
if(this.m_activeCmdBox)
this.m_activeCmdBox.style.backgroundColor = "";
v102.style.backgroundColor = "#cccccc";
this.m_activeCmdBox = v102;
var v104 = this.m68[v102.id];
if(v104){
var v105 = v104.startTime?(v104.startTime+" - "+(v104.endTime?v104.endTime:"still running")):"awaiting";
var v8 = "<div style='padding: 0 10px 0 0'>Command <b>"+v104.type+" #"+v104.id+"</b> on processor <b>#"+(v104.procId?v104.procId:"default")+"</b> ["+v105+"] :</div>";
v8 +="<div style='"+ichr.Log.DETAILS_STYLE+"'>";
for(v9 in v104.properties){				
var v106 = v104.properties[v9];
if(typeof v106 == "string")
v106 = v106.replace(/\&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/\n/g, "\\n");
else if(typeof v106 == "object"){
var v107 = v106;
v106 = "";
for(var v108 in v107){
v106 += v107[v108]["label"] ? "\""+v107[v108]["label"]+"\":\""+v107[v108]["value"]+"\", " : v107[v108]+", ";
}
v106 = v106.substr(0, v106.lastIndexOf(","));
}
v8 += "<div style='float: left; padding: 0 10px 2px 0'><b>"+v9+":</b> <code>"+v106+"</code>;</div>";
}
v8 +="<div style='clear: both'></div></div>";
this.m65.innerHTML = v8;
}
},
writeMessages: function(p92){
if(this.m60 && this.m58){
//alert(p92);
//var v109 = "";
for(var i = 0; i < p92.length; i++){
var v110 = p92[i];
var v111 = parseInt(v110.charAt(2));
if(v110 == "" || (this.isFiltered(v110) && v111 <= this.m72.value)){
//alert(v110);
var v112 = v110.substr(0, v110.indexOf(":", 21));
var v113 = v110.substr(v112.length);
var v114 = v113.split("\n");
var v115 = document.createElement("b");
if(v111 == 0)
v115.style.color = "red";
v115.appendChild(document.createTextNode(v112));
this.m60.appendChild(v115);
if(v114.length > 1){
for(var v116 = 0; v116 < v114.length; v116++){
this.m60.appendChild(document.createTextNode(v114[v116]));
this.m60.appendChild(document.createElement("br"));
}
}
else
this.m60.appendChild(document.createTextNode(v113));
this.m60.appendChild(document.createElement("br"));
}
}
this.m60.scrollTop = this.m60.scrollHeight - this.m60.clientHeight;
this.m60.style.display = "";
}
},
isFiltered: function (p60){
if(!this.m79.length)
return true;
var v117 = 0;
for (var i = 0; i < this.m79.length; i++){
var v118 = this.m79[i];
if(p60.indexOf(v118) > -1 && v118.length > 0)
v117++;
}
return v117 == this.m79.length ? true : false;
},
clear: function(){
if(this.m60 && this.m58){
this.m60.style.display = "none";
this.m60.innerHTML = "";
this.m60.scrollTop = 0;//this.m60.scrollHeight - this.m60.clientHeight;
}
},
_f28: function(event){
},
_f29: function(){
this.m70.style.top = "";
if(this.m75){
this.m70
this.m70.style.height = this.m12+"px";
this.m75 = false;
this.m76.style.display = "";
this.m70.style.bottom = "-1px";
this.m70.style.left = "-1px";
this.m70.style.width = this.m11+"px";
this.m84.style.display = "";
this.m_v30erText.style.display = "";
this.m_objMinimizedInfo.style.display = "none";
}
else{
this.m70.style.height = "25px";
this.m76.style.display = "none";
this.m75 = true;
this.m70.style.top = "";
this.m70.style.left = "-1px";
this.m70.style.bottom = "-1px";
this.m70.style.width = "230px";
this.m84.style.display = "none";
this.m_v30erText.style.display = "none";
this.m_objMinimizedInfo.style.display = "";
}
},
_f30: function(event){
this.clear();
this.writeMessages(this.m77);
},
_f31: function(event){
if(this.m73.value){
this.m79 = this.m73.value.split(" ");
}
else
this.m79 = [];
this.clear();
this.writeMessages(this.m77);
},
_f32: function(event){	
if(!this.m75){	
this.m_v128gable = true;
var v119 = iw.DOMFactory.getElementPosition(this.m70);
//alert(v119);
this.m_startX = iw.DOMEvents.pointerX(event || window.event) - v119[0];
this.m_startY = iw.DOMEvents.pointerY(event || window.event) - v119[1];
iw.DOMEvents.addEventListener(document, "mousemove", this._f34);
}
},
_f33: function(event){
this.m_v128gable = false;
iw.DOMEvents.removeEventListener(document, "mousemove", this._f34);
},
_f34: function(event){
var v120 = iw.DOMEvents.pointerX(event || window.event) - this.m_startX;
var v121 = iw.DOMEvents.pointerY(event || window.event) - this.m_startY;
//this.log(v120+"/"+v121);
this.m70.style.left = v120+"px";
this.m70.style.top = v121+"px";
},
_f35: function(event){
this._f36(this.m59.value);
},
_f36: function(p22){
var v122 = this.m54[p22];
if(v122 && v122 != this.m57){
if(this.m57)
this.m57.style.display = "none";
v122.style.display = "block";
this.m57 = v122;
}
},
_f37: function(p22, p26, p52, p53, p94){
if(p52)
p26 += "width: "+p52+"px; ";
if(p53)
p26 += "height: "+p53+"px; ";
if(p94)
p26 += "display: none; ";
var v23 = iw.DOMFactory.newElement("div", {"id":p22, "style":p26});
this.m54[p22] = v23;
return v23;
},
_f38: function(p38){
if(p38.source.getInstance)
this.m18 = p38.source.getInstance();
//alert(this.m18.setLog);
this.m70 = iw.DOMFactory.newElement("div", {"id" : this.m8, "style" : "position: fixed; z-index: 10000; overflow: hidden; bottom: 0px; font-family: Arial, Helvetica, sans-serif !important; font-size: 11px !important; border-top: 1px solid #ddd; border-left: 1px solid #ddd; border-bottom: 1px solid #777; border-right: 1px solid #777; background-color: #ababab; width: "+this.m11+"px; height: "+this.m12+"px"})
if(window.XMLHttpRequest == undefined && ActiveXObject != undefined)
this.m70.style.position = "absolute";
this.m_v30er = iw.DOMFactory.newElement("div", {"style" : "cursor: move; height: 21px; padding: 3px 5px 0 5px; font-size: 15px"});
this.m59 = iw.DOMFactory.newElement("select", {"style":"float: right; margin: 0"});
this.m59.appendChild(iw.DOMFactory.newElement("option", {"value" : "LogWindow", "innerHTML": "Log console"}));
this.m59.appendChild(iw.DOMFactory.newElement("option", {"value" : "IMWindow", "innerHTML": "Profiler"}));
this.m59.appendChild(iw.DOMFactory.newElement("option", {"value" : "CSWindow", "innerHTML": "Processors"}));
//this.m_v30er.appendChild(this.m59);
this.m71 = iw.DOMFactory.newElement("input", {"type" : "checkbox", "style":"vertical-align: middle;"});
this.m84 = iw.DOMFactory.newElement("span", {"style" : "float: right; padding: 0 0 0 20px; font-family: Arial, Helvetica, sans-serif !important; font-size: 11px !important;"})
this.m84.appendChild(this.m71);
this.m84.appendChild(this.m59);
iw.DOMFactory.appendHTML(this.m84,"enable &nbsp;&nbsp;&nbsp;&nbsp; ");
this.m_v30er.appendChild(this.m84);
this.m_v30erText = iw.DOMFactory.newElement("span", {"innerHTML": "<b>InteliWISE CHARACTER 3.0.3 - Debug Console</b> <span style='font-size: 11px'>[<b>dbclick</b> to hide, <b>press</b> and hold to drag]</span>"});
this.m_objMinimizedInfo = iw.DOMFactory.newElement("span", {"innerHTML": "<b>dbclick</b> to open Debug Console</span>", "style": "display: none"});
this.m_v30er.appendChild(this.m_v30erText);
this.m_v30er.appendChild(this.m_objMinimizedInfo);
this.m70.appendChild(this.m_v30er);
this.m76 = iw.DOMFactory.newElement("div");
this.m70.appendChild(this.m76);
var v123 = this._f37("LogWindow", "");
this.m60 = this._f37("LogOutput",  ichr.Log.LOG_OUTPUT_STYLE, null, this.m12 - 55);
v123.appendChild(this.m60);
this.m76.appendChild(v123);
this._f36(v123.id);
var v124 = this._f37("IMWindow", "", null, null, true);
this.m62 = this._f37("IMOutput", ichr.Log.PROFILER_OUTPUT_STYLE, null, this.m12 - 26);
v124.appendChild(this.m62);
this.m76.appendChild(v124);
var v125 = this._f37("CSWindow", "", null, null, true);
this.m63 = this._f37("CSOutput", ichr.Log.CM_OUTPUT_STYLE, null/*this.m11 - 20*/, this.m12 - 100);
v125.appendChild(this.m63);
this.m76.appendChild(v125);
var v126 = "<div style='float: left; width: 120px; padding: 0 10px;'><b>Legend:</b>";
v126 += "<div style='"+ichr.Log.DETAILS_STYLE+"'> - <span style='color: #666;'>awaiting</span>";
v126 += "<br/> - <span style='color: red; font-weight:bold;'>in progress</span>";
v126 += "<br/> - <span style='font-weight:bold;'>finished</span>";
v126 += "<br/> - <span style='color: #666; text-decoration: line-through; font-weight:bold;'>terminated</span>";
v126 += "</div></div>";
iw.DOMFactory.appendHTML(v125, v126);
var v127 = "<b>Command details:</b><br/><br/>Click on any command label to see its details."
this.m65 = iw.DOMFactory.newElement("div", {"style":"float: left; height: 75px; width: "+(this.m11-150)+"px; overflow-y: auto;"});
iw.DOMFactory.appendHTML(this.m65, v127);
v125.appendChild(this.m65);
//this.log(this.m71.value);
this.m72 = iw.DOMFactory.newElement("select");
this.m72.appendChild(iw.DOMFactory.newElement("option", {"value" : 0, "innerHTML": "0 - exceptions"}));
this.m72.appendChild(iw.DOMFactory.newElement("option", {"value" : 1, "innerHTML": "1 - very high"}));
this.m72.appendChild(iw.DOMFactory.newElement("option", {"value" : 2, "innerHTML": "2 - high"}));
this.m72.appendChild(iw.DOMFactory.newElement("option", {"value" : 3, "selected" : true, "innerHTML": "3 - medium"}));
this.m72.appendChild(iw.DOMFactory.newElement("option", {"value" : 4, "innerHTML": "4 - low"}));
this.m72.appendChild(iw.DOMFactory.newElement("option", {"value" : 5, "innerHTML": "5 - very low"}));
this.m73 = iw.DOMFactory.newElement("input", {"type" : "text", "style" : "width: 400px"});
this.m74 = iw.DOMFactory.newElement("input", {"type" : "button", "value" : "filter"});
var v57 = iw.DOMFactory.newElement("label", {"style" : "font-family: Arial, Helvetica, sans-serif !important; padding-left: 5px; font-size: 11px !important;"});
v57.appendChild(iw.DOMFactory.newElement("text", "Priority filter: "));
v57.appendChild(this.m72);
v123.appendChild(v57);
var v57 = iw.DOMFactory.newElement("label", {"style" : "font-family: Arial, Helvetica, sans-serif !important; padding-left: 30px; font-size: 11px !important;", "innerHTML": "Keyword filter: "});
v57.appendChild(this.m73);
v123.appendChild(v57);
v123.appendChild(this.m74);
this.m53.getWindowWrapper().appendChild(this.m70);
iw.DOMEvents.addEventListener(this.m59, "change", this._f35);
iw.DOMEvents.addEventListener(this.m71, "click", this._f25);
iw.DOMEvents.addEventListener(this.m72, "change", this._f30);
iw.DOMEvents.addEventListener(this.m74, "click", this._f31);
iw.DOMEvents.addEventListener(this.m_v30er, "dblclick", this._f29);
iw.DOMEvents.addEventListener(this.m_v30er, "mousedown", this._f32);
iw.DOMEvents.addEventListener(document, "mouseup", this._f33);
ichr.Log.instances[this.m8] = this;
this.m58 = true;
//this.writeMessages(this.m77);
this.m71.checked = true;
if(this.m71 && this.m18){
try{		
this.m18.setLog("ichr.Log.instances['"+this.m8+"']");
}
catch(error){
alert('Log init error: \n'+error);
}
}
this._f29();
}
}
}
catch(err){
iw.Core.reportError("ichr.Log class definition error", err);
}
//----------------
//json.js
iw.Core.definePackage("ichr.json.JSON");
try{
(function () {
"use strict";
function f(n) {
// Format integers to have at least two digits.
return n < 10 ? '0' + n : n;
}
if (typeof Date.prototype.toJSON !== 'function') {
Date.prototype.toJSON = function (key) {
return isFinite(this.valueOf()) ?
this.getUTCFullYear()   + '-' +
f(this.getUTCMonth() + 1) + '-' +
f(this.getUTCDate())      + 'T' +
f(this.getUTCHours())     + ':' +
f(this.getUTCMinutes())   + ':' +
f(this.getUTCSeconds())   + 'Z' : null;
};
String.prototype.toJSON =
Number.prototype.toJSON =
Boolean.prototype.toJSON = function (key) {
return this.valueOf();
};
}
var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
gap,
indent,
meta = {    // table of character substitutions
'\b': '\\b',
'\t': '\\t',
'\n': '\\n',
'\f': '\\f',
'\r': '\\r',
'"' : '\\"',
'\\': '\\\\'
},
rep;
function quote(string) {
// If the string contains no control characters, no quote characters, and no
// backslash characters, then we can safely slap some quotes around it.
// Otherwise we must also replace the offending characters with safe escape
// sequences.
escapable.lastIndex = 0;
return escapable.test(string) ?
'"' + string.replace(escapable, function (a) {
var c = meta[a];
return typeof c === 'string' ? c :
'\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
}) + '"' :
'"' + string + '"';
}
function str(key, holder) {
// Produce a string from holder[key].
var i,          // The loop counter.
k,          // The member key.
v,          // The member value.
length,
mind = gap,
partial,
value = holder[key];
// If the value has a toJSON method, call it to obtain a replacement value.
if (value && typeof value === 'object' &&
typeof value.toJSON === 'function') {
value = value.toJSON(key);
}
// If we were called with a replacer function, then call the replacer to
// obtain a replacement value.
if (typeof rep === 'function') {
value = rep.call(holder, key, value);
}
// What happens next depends on the value's type.
switch (typeof value) {
case 'string':
return quote(value);
case 'number':
// JSON numbers must be finite. Encode non-finite numbers as null.
return isFinite(value) ? String(value) : 'null';
case 'boolean':
case 'null':
// If the value is a boolean or null, convert it to a string. Note:
// typeof null does not produce 'null'. The case is included here in
// the remote chance that this gets fixed someday.
return String(value);
// If the type is 'object', we might be dealing with an object or an array or
// null.
case 'object':
// Due to a specification blunder in ECMAScript, typeof null is 'object',
// so watch out for that case.
if (!value) {
return 'null';
}
// Make an array to hold the partial results of stringifying this object value.
gap += indent;
partial = [];
// Is the value an array?
if (Object.prototype.toString.apply(value) === '[object Array]') {
// The value is an array. Stringify every element. Use null as a placeholder
// for non-JSON values.
length = value.length;
for (i = 0; i < length; i += 1) {
partial[i] = str(i, value) || 'null';
}
// Join all of the elements together, separated with commas, and wrap them in
// brackets.
v = partial.length === 0 ? '[]' :
gap ? '[\n' + gap +
partial.join(',\n' + gap) + '\n' +
mind + ']' :
'[' + partial.join(',') + ']';
gap = mind;
return v;
}
// If the replacer is an array, use it to select the members to be stringified.
if (rep && typeof rep === 'object') {
length = rep.length;
for (i = 0; i < length; i += 1) {
k = rep[i];
if (typeof k === 'string') {
v = str(k, value);
if (v) {
partial.push(quote(k) + (gap ? ': ' : ':') + v);
}
}
}
} else {
// Otherwise, iterate through all of the keys in the object.
for (k in value) {
if (Object.hasOwnProperty.call(value, k)) {
v = str(k, value);
if (v) {
partial.push(quote(k) + (gap ? ': ' : ':') + v);
}
}
}
}
// Join all of the member texts together, separated with commas,
// and wrap them in braces.
v = partial.length === 0 ? '{}' :
gap ? '{\n' + gap + partial.join(',\n' + gap) + '\n' +
mind + '}' : '{' + partial.join(',') + '}';
gap = mind;
return v;
}
}
// If the JSON object does not yet have a encode method, give it one.
if (typeof ichr.json.JSON.encode !== 'function') {
ichr.json.JSON.encode = function (value, replacer, space) {
// The encode method takes a value and an optional replacer, and an optional
// space parameter, and returns a JSON text. The replacer can be a function
// that can replace values, or an array of strings that will select the keys.
// A default replacer method can be provided. Use of the space parameter can
// produce text that is more easily readable.
var i;
gap = '';
indent = '';
// If the space parameter is a number, make an indent string containing that
// many spaces.
if (typeof space === 'number') {
for (i = 0; i < space; i += 1) {
indent += ' ';
}
// If the space parameter is a string, it will be used as the indent string.
} else if (typeof space === 'string') {
indent = space;
}
// If there is a replacer, it must be a function or an array.
// Otherwise, throw an error.
rep = replacer;
if (replacer && typeof replacer !== 'function' &&
(typeof replacer !== 'object' ||
typeof replacer.length !== 'number')) {
throw new Error('ichr.json.JSON.encode');
}
// Make a fake root object containing our value under the key of ''.
// Return the result of stringifying the value.
return str('', {'': value});
};
}
// If the JSON object does not yet have a decode method, give it one.
if (typeof ichr.json.JSON.decode !== 'function') {
ichr.json.JSON.decode = function (text, reviver) {
// The decode method takes a text and an optional reviver function, and returns
// a JavaScript value if the text is a valid JSON text.
var j;
function walk(holder, key) {
// The walk method is used to recursively walk the resulting structure so
// that modifications can be made.
var k, v, value = holder[key];
if (value && typeof value === 'object') {
for (k in value) {
if (Object.hasOwnProperty.call(value, k)) {
v = walk(value, k);
if (v !== undefined) {
value[k] = v;
} else {
delete value[k];
}
}
}
}
return reviver.call(holder, key, value);
}
// Parsing happens in four stages. In the first stage, we replace certain
// Unicode characters with escape sequences. JavaScript handles many characters
// incorrectly, either silently deleting them, or treating them as line endings.
text = String(text);
cx.lastIndex = 0;
if (cx.test(text)) {
text = text.replace(cx, function (a) {
return '\\u' +
('0000' + a.charCodeAt(0).toString(16)).slice(-4);
});
}
// In the second stage, we run the text against regular expressions that look
// for non-JSON patterns. We are especially concerned with '()' and 'new'
// because they can cause invocation, and '=' because it can cause mutation.
// But just to be safe, we want to reject all unexpected forms.
// We split the second stage into 4 regexp operations in order to work around
// crippling inefficiencies in IE's and Safari's regexp engines. First we
// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we
// replace all simple value tokens with ']' characters. Third, we delete all
// open brackets that follow a colon or comma or that begin the text. Finally,
// we look to see that the remaining characters are only whitespace or ']' or
// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.
if (/^[\],:{}\s]*$/
.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@')
.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']')
.replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
// In the third stage we use the eval function to compile the text into a
// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
// in JavaScript: it can begin a block or an object literal. We wrap the text
// in parens to eliminate the ambiguity.
j = eval('(' + text + ')');
// In the optional fourth stage, we recursively walk the new structure, passing
// each name/value pair to a reviver function for possible transformation.
return typeof reviver === 'function' ?
walk({'': j}, '') : j;
}
// If the text is not JSON parseable, then a SyntaxError is thrown.
throw new SyntaxError('ichr.json.JSON.decode');
};
}
}());
}
catch(err){
iw.Core.reportError("ichr.json.JSON class definition error", err);
}
//----------------
//calendar.js
var oGlobalArray = new Array();
function fnInitCalendar(oTarget, sInputID, sCustom)
{
//var oEvent = arguments.callee.caller.arguments[0] || window.event;
//var oTarget = oEvent.target || oEvent.srcElement;
oTarget.style.cursor = 'pointer';
oTarget.onclick = function(e) {
_fnSetCalendar(e, sInputID, sCustom);
};
}
function _fnSetCalendar(e, sInputID, sCustom)
{
var oCalendarArray	= new Array();
var oInput			= window.document.getElementById(sInputID);
var oEvent			= e || window.event;
var sDivId			= '_div' + sInputID;
var oDiv			= window.document.getElementById(sDivId);
var oDay			= _fnGetWeekDays();
var oDate			= new Date();
var v128			= true;
var v129			= false;
var v130			= false;
var v131		= 0;
var v132		= false;
var v133		= 0;
var v134		= false;
var oDropArray		= new Array();
var v135			= 5;
var v136			= 5;
if(!oDiv)
{
oDiv			= window.document.createElement('div');
oDiv.id			= sDivId;
oDiv.className	= 'mainDiv_';
oDiv.name		= 'calendar';
oDiv.style.position	= 'absolute';
window.document.body.appendChild(oDiv);
}
if(sCustom != undefined || sCustom != '')
{
sCustom = String(sCustom).toLowerCase();
if(sCustom.indexOf('year') != -1)
{
var sYear = _fnGetValue(sCustom, 'year');
if(sYear.length == 4 && !isNaN(Number(sYear)))
oDate.setFullYear(sYear);
}
if(sCustom.indexOf('month') != -1)
{
var sMonth = _fnGetValue(sCustom, 'month');
if(sMonth.length < 3 && sMonth > 0 && !isNaN(Number(sMonth)))
oDate.setMonth(sMonth - 1);
}
if(sCustom.indexOf('top') != -1)
{
var sTop = _fnGetValue(sCustom, 'top');
if(!isNaN(Number(sTop)))
v135 = Number(sTop);
}
if(sCustom.indexOf('left') != -1)
{
var sLeft = _fnGetValue(sCustom, 'left');
if(!isNaN(Number(sLeft)))
v136 = Number(sLeft);
}
if(sCustom.indexOf('drag') != -1)
{
var sDrag = _fnGetValue(sCustom, 'drag');
if(sDrag == 'true' || sDrag == 'false')
{
v128 = window.eval(sDrag);
}
}
if(sCustom.indexOf('close') != -1)
{
var sClose = _fnGetValue(sCustom, 'close');
if(sClose == 'true' || sClose == 'false')
{
v129 = window.eval(sClose);
}
}
if(sCustom.indexOf('expiry') != -1)
{
var v130 = _fnGetValue(sCustom, 'expiry');
if(v130 == 'true' || v130 == 'false')
{
v130 = window.eval(v130);
}
}
if(sCustom.indexOf('elapse') != -1)
{
var sDayElapse = _fnGetValue(sCustom, 'elapse');
if(!isNaN(Number(sDayElapse)))
v131 = Number(sDayElapse);
}
if(sCustom.indexOf('restrict') != -1)
{
var v132 = _fnGetValue(sCustom, 'restrict');
if( v132 == 'true' ||  v132 == 'false')
{
v132 = window.eval( v132);
}
}
if(sCustom.indexOf('limit') != -1)
{
var sDayLimit = _fnGetValue(sCustom, 'limit');
if(!isNaN(Number(sDayLimit)))
v133 = Number(sDayLimit);
}
if(sCustom.indexOf('style') != -1)
{
var sStyle = _fnGetValue(sCustom, 'style');
if(sStyle.indexOf('.css') != -1)
{
var oLink = window.document.getElementsByTagName('link');
var oStyle;
for(var v96 = 0; v96 < oLink.length; v96++)
{
if(oLink[v96].title == 'calendar')
{
oStyle = oLink[v96];
break;
}
}
var sStylePath = '';
if(String(oStyle.href).lastIndexOf('/') != -1)
{
var v137	= String(oStyle.href).lastIndexOf('/');
sStylePath		= String(oStyle.href).substring(0, v137+1);
}
oStyle.href = sStylePath + sStyle;
}
}
if(sCustom.indexOf('instance') != -1)
{
var sInstance = _fnGetValue(sCustom, 'instance');
if(sInstance == 'single')
{
var oDivs = window.document.getElementsByTagName('div');
for(var v96 = 0; v96 < oDivs.length; v96++)
{
if(oDivs[v96].name == 'calendar')
{
oDivs[v96].style.display = 'none';
}
}
}
}
if(sCustom.indexOf('dropdown') != -1)
{
if(String(window.navigator.appName).indexOf('Microsoft') != -1)
{
var sDrop = _fnGetValue(sCustom, 'dropdown');
if(sDrop == 'hide')
{
var oElements = window.document.getElementsByTagName('select');
for(var v96 = 0; v96 < oElements.length; v96++)
{
if(oElements[v96].style.display != 'none')
{
oElements[v96].style.display = 'none';
oDropArray.push(oElements[v96]);
}
}
v134 = true;
}
}
}
}
if(window.document.documentElement.scrollTop > 0)
{
oDiv.style.top  = (parseInt(oEvent.clientY) + parseInt(window.document.documentElement.scrollTop)  + parseInt(v135))  + 'px';
oDiv.style.left = (parseInt(oEvent.clientX) + parseInt(window.document.documentElement.scrollLeft) + parseInt(v136)) + 'px';
}
else
{
oDiv.style.top  = (parseInt(oEvent.clientY) + parseInt(window.document.body.scrollTop)  + parseInt(v135))  + 'px';
oDiv.style.left = (parseInt(oEvent.clientX) + parseInt(window.document.body.scrollLeft) + parseInt(v136)) + 'px';
}	
if(v128)
{
Drag.init(oDiv);
}
oCalendarArray['Input']		= oInput;
oCalendarArray['Div']		= oDiv;
oCalendarArray['Date']		= oDate;
oCalendarArray['Day']		= oDay;
oCalendarArray['Drag']		= v128;
oCalendarArray['Close']		= v129;
oCalendarArray['Expiry']	= v130;
oCalendarArray['Elapse']	= v131;
oCalendarArray['Restrict']	= v132;
oCalendarArray['Limit']		= v133;
oCalendarArray['Drop']		= v134;
oCalendarArray['Selects']	= oDropArray;
var v138 = _fnAddCalendarArray(oCalendarArray);
_fnCreateCalendar(v138);
//iw.DOMEvents.addEventListener
}
function _fnCreateCalendar(v138)
{
var oCalendarArray	= oGlobalArray[v138];
var sYear			= oCalendarArray['Date'].getFullYear();
var sMonth			= oCalendarArray['Date'].getMonth();
var oLayout			= new Array();
oLayout.push(_fnGetTitleRow(v138));
oLayout.push(_fnGetYearRow(v138));
oLayout.push(_fnGetMonthRow(v138));
oLayout.push(_fnGetCalendarRows(v138));
oLayout.push("</table>");
oCalendarArray['Div'].innerHTML = oLayout.join('');
oCalendarArray['Div'].style.display = 'inline';
oCalendarArray, sYear, sMonth, oLayout = null;
}
function _fnGetTitleRow(v138)
{
var oCalendarArray	= oGlobalArray[v138];
var oRowLayout		= new Array();
var sCursor			= 'cursor:move';
if(!oCalendarArray['Drag'])
sCursor			= 'cursor:default';
oRowLayout.push("<table class='calendarTable_' onMouseDown=\"_fnMoveDivAbove('"+v138+"')\">");
return oRowLayout.join('');
oCalendarArray = null;
}
function _fnGetYearRow(v138)
{
return "";//oRowLayout.join('');
}
function _fnGetMonthRow(v138)
{
var oCalendarArray	= oGlobalArray[v138];
var v139			= parseInt(oCalendarArray['Date'].getMonth(), 10);
var v140			= window.parseInt(oCalendarArray['Date'].getFullYear(), 10);
var sPreviousMonth	= _fnGetCalendarMonth(v139 - 1);
var sNextMonth		= _fnGetCalendarMonth(v139 + 1);
var sCurrentMonth	= _fnGetCalendarMonth(v139);
var oRowLayout		= new Array();
oRowLayout.push("<tr class='monthHeadingRow_'>");
oRowLayout.push("<td>");
if(sPreviousMonth == undefined)
{
sPreviousMonth = _fnGetCalendarMonth(11);
}
oRowLayout.push("<a href=\"javascript:_fnGetSelectedMonth('"+v138+"', '"+(v139 - 1)+"')\"");
oRowLayout.push(" title='Previous Month "+sPreviousMonth+"' class='linksCalendar_'>&lt;</a>");
oRowLayout.push("</td>");
oRowLayout.push("<td colspan='"+(oCalendarArray['Day'].length - 2)+"'>");
oRowLayout.push(sCurrentMonth + " " + v140);
oRowLayout.push("</td>");
oRowLayout.push("<td>");
if(sNextMonth == undefined)
{
sNextMonth = _fnGetCalendarMonth(0);
}
oRowLayout.push("<a href=\"javascript:_fnGetSelectedMonth('"+v138+"', '"+(v139 + 1)+"')\"");
oRowLayout.push(" title='Next Month "+sNextMonth+"' class='linksCalendar_'>&gt;</a>");
oRowLayout.push("</td>");
oRowLayout.push("</tr>");
return oRowLayout.join('');
}
function _fnGetCalendarRows(v138)
{
var oCalendarArray	= oGlobalArray[v138];
var oRowLayout 		= new Array();
oRowLayout.push("<tr class='daysHeadingRow_'>");
for(counter = 0; counter < oCalendarArray['Day'].length; counter++)
{
oRowLayout.push("<td class='daysHeadingCell_'>");
oRowLayout.push(oCalendarArray['Day'][counter].substring(0, 2) + "</td>");
}
oRowLayout.push("</tr>");
var oDate		= new Date();
var v141	= oDate.getFullYear();
var v142	= oDate.getMonth();
var v143	= oDate.getDate();
var v131	= (60 * 60 * 24 * 1000) * oCalendarArray['Elapse']; //No of Day
var v144	= window.parseInt(oDate.getTime()) + v131;
var v133	= (60 * 60 * 24 * 1000) * oCalendarArray['Limit']; //No of Day
var v145	= window.parseInt(oDate.getTime()) + v133;
var v140	= oCalendarArray['Date'].getFullYear();
var v139	= oCalendarArray['Date'].getMonth();
var oTmpDate	= new Date();
oTmpDate.setDate(1);
oTmpDate.setMonth(v139);
oTmpDate.setFullYear(v140);
var v146			= oTmpDate.getDay();
var v147		= _fnGetDaysCount(v139, v140);
var v148	= Math.ceil((v146 + v147) / oCalendarArray['Day'].length);
var v149 = 0;
var v150 = 0;
var v151 = 0;
for(counter = 0; counter < v148; counter++)
{
oRowLayout.push("<tr>");
for(count = 0; count < oCalendarArray['Day'].length; count++)
{
if(v149 < v146 || v150 >= v147)
{
oRowLayout.push("<td class='blankCell_'>");
oRowLayout.push("&nbsp;</td>");
}
else
{
v150++;
v151 = v150;
oTmpDate.setDate(v150);
if(oCalendarArray['Expiry'] == true && oCalendarArray['Restrict'] == true) //for Range
{
if(v144 <= oTmpDate.getTime() && v145 >= oTmpDate.getTime())
{
if(v140 == v141 && v139 == v142 && v150 == v143)
oRowLayout.push("<td class='todayDateCell_' onMouseOver=this.className='dateOver_' onMouseOut=this.className='todayDateCell_'");
else if(count == 0)	
oRowLayout.push("<td class='sundayDateCell_' onMouseOver=this.className='dateOver_' onMouseOut=this.className='sundayDateCell_'");
else
oRowLayout.push("<td class='normalDateCell_' onMouseOver=this.className='dateOver_' onMouseOut=this.className='normalDateCell_'");
oRowLayout.push(" onclick=\"_fnAssignDate('"+v138+"', this.innerHTML)\"");
oRowLayout.push(">" + v150 + "</td>");
}
else
{
oRowLayout.push("<td class='disabledCell_'>");
oRowLayout.push(v150 + "</td>");
}	
}
else if(oCalendarArray['Expiry'] == true) //for Expiry
{
if(v144 <= oTmpDate.getTime())
{
if(v140 == v141 && v139 == v142 && v150 == v143)
oRowLayout.push("<td class='todayDateCell_' onMouseOver=this.className='dateOver_' onMouseOut=this.className='todayDateCell_'");
else if(count == 0)	
oRowLayout.push("<td class='sundayDateCell_' onMouseOver=this.className='dateOver_' onMouseOut=this.className='sundayDateCell_'");
else
oRowLayout.push("<td class='normalDateCell_' onMouseOver=this.className='dateOver_' onMouseOut=this.className='normalDateCell_'");
oRowLayout.push(" onclick=\"_fnAssignDate('"+v138+"', this.innerHTML)\"");
oRowLayout.push(">" + v150 + "</td>");
}
else
{
oRowLayout.push("<td  class='disabledCell_'>");
oRowLayout.push(v150 + "</td>");
}	
}
else if(oCalendarArray['Restrict'] == true) //for Limit
{
if(v145 >= oTmpDate.getTime())
{
if(v140 == v141 && v139 == v142 && v150 == v143)
oRowLayout.push("<td class='todayDateCell_' onMouseOver=this.className='dateOver_' onMouseOut=this.className='todayDateCell_'");
else if(count == 0)	
oRowLayout.push("<td class='sundayDateCell_' onMouseOver=this.className='dateOver_' onMouseOut=this.className='sundayDateCell_'");
else
oRowLayout.push("<td class='normalDateCell_' onMouseOver=this.className='dateOver_' onMouseOut=this.className='normalDateCell_'");
oRowLayout.push(" onclick=\"_fnAssignDate('"+v138+"', this.innerHTML)\"");
oRowLayout.push(">" + v150 + "</td>");
}
else
{
oRowLayout.push("<td class='disabledCell_'>");
oRowLayout.push(v150 + "</td>");
}	
}
else
{
if(v140 == v141 && v139 == v142 && v150 == v143)
oRowLayout.push("<td class='todayDateCell_' onMouseOver=this.className='dateOver_' onMouseOut=this.className='todayDateCell_'");
else if(count == 0)	
oRowLayout.push("<td class='sundayDateCell_' onMouseOver=this.className='dateOver_' onMouseOut=this.className='sundayDateCell_'");
else
oRowLayout.push("<td class='normalDateCell_' onMouseOver=this.className='dateOver_' onMouseOut=this.className='normalDateCell_'");
oRowLayout.push(" onclick=\"_fnAssignDate('"+v138+"', this.innerHTML)\"");
oRowLayout.push(">" + v150 + "</td>");
}	
}
v149++;
}
oRowLayout.push("</tr>");
}
return oRowLayout.join('');
}
function _fnGetSelectedYear(v138, v140)
{
var oCalendarArray		= oGlobalArray[v138];
var oDate				= oCalendarArray['Date'];
oDate.setFullYear(v140);
oCalendarArray['Date']	= oDate;
oGlobalArray[v138]	= oCalendarArray;
_fnCreateCalendar(v138);
oCalendarArray			= null;
}
function _fnGetSelectedMonth(v138, v139)
{
var oCalendarArray		= oGlobalArray[v138];
var oDate				= oCalendarArray['Date'];
if(Number(oDate.getDate()) == 31)
oDate.setDate(oDate.getDate()+1)
else
oDate.setMonth(v139);
oCalendarArray['Date']	= oDate;
oGlobalArray[v138]	= oCalendarArray;
_fnCreateCalendar(v138);
oCalendarArray			= null;
}
function _fnShowYears(v138, sPrevious, sNext)
{
var oCalendarArray	= oGlobalArray[v138];
var v152	= 3;
var v153		= 0;
var v154			= 15;
var v155;
if(sPrevious == undefined && sNext == undefined)
{
v155 = oCalendarArray['Date'].getFullYear();
}
else
{
v155 = (sPrevious == undefined) ? sNext : sPrevious;
}
v155 = parseInt(v155, 10);
//if(v155 < 1900) v155 = 2000;
//else if(v155 > 2100) v155 = 2000;
sPrevious	= v155 - 15;
sNext		= v155 + 15;
var oLayout	= new Array();
oLayout.push(_fnGetTitleRow(v138));
oLayout.push(_fnGetYearRow(v138));
oLayout.push(_fnGetSelectedYearRows(v138, sPrevious, sNext));
for(v96 = 0; v96 < v154; v96++)
{
if(v153 % v152 == 0) oLayout.push("<tr>");
oLayout.push("<td width='"+Math.floor((v154 / v152) * 100)+"' class='yearCell_' onmouseover=\"this.className='yearOver_'\" onmouseout=\"this.className='yearCell_'\" onclick=\"_fnGetSelectedYear('"+v138+"', this.innerHTML)\">");
oLayout.push(v155 + "</td>");
v155++;
v153++;
if(v153 % v152 == 0) oLayout.push("</tr>");
}
oLayout.push("</table>");
oCalendarArray['Div'].innerHTML		= oLayout.join('');
oCalendarArray['Div'].style.display	= 'inline';
oCalendarArray, v152, v153, v154, v155, oLayout = null;
}
function _fnGetSelectedYearRows(v138, sPrevious, sNext)
{
var oCalendarArray	= oGlobalArray[v138];
var oLayout			= new Array();
oLayout.push("<tr>");
oLayout.push("<td align='center' valign='middle' colspan='"+oCalendarArray['Day'].length+"' class='monthHeadingRow'>");
oLayout.push("<table cellspacing='0' cellpadding='1' border='0' width='100%'>");
oLayout.push("<tr class='monthHeadingRow_'>");
oLayout.push("<td align='center' valign='middle' width='15'>");
oLayout.push("<a href=\"javascript:_fnShowYears('"+v138+"', '"+sPrevious+"', undefined)\"");
oLayout.push(" title='Previous 15 Years' class='linksCalendar_'>&lt;</a>");
oLayout.push("</td>");
oLayout.push("<td align='center' valign='middle'>Select Year</td>");
oLayout.push("<td align='center' valign='middle' width='15'>");
oLayout.push("<a href=\"javascript:_fnShowYears('"+v138+"', undefined, '"+sNext+"')\"");
oLayout.push(" title='Next 15 Years' class='linksCalendar_'>&gt;</a>");
oLayout.push("</td>");
oLayout.push("</tr>");
oLayout.push("</table>");
oLayout.push("</td>");
oLayout.push("</tr>");
return oLayout.join('');
}
function _fnShowAllMonths(v138)
{
var oCalendarArray	= oGlobalArray[v138];
var v152	= 3;
var v153		= 0;
var v156			= 12;
var oLayout			= new Array();
oLayout.push(_fnGetTitleRow(v138));
oLayout.push(_fnGetYearRow(v138));
oLayout.push(_fnGetMonthRow(v138));
for(v96 = 0; v96 < v156; v96++)
{
if(v153 % v152 == 0) oLayout.push("<tr>");
oLayout.push("<td width='"+Math.floor((v156 / v152) * 100)+"' class='monthCell_' onmouseover=\"this.className='monthOver_'\" onmouseout=\"this.className='monthCell_'\" onclick=\"_fnGetSelectedMonth('"+v138+"', _fnGetMonthNumber(this.innerHTML))\">");
oLayout.push(_fnGetCalendarMonth(v96).substring(0,3) + "</td>");
v153++;
if(v153 % v152 == 0) oLayout.push("</tr>");
}
oLayout.push("</table>");
oCalendarArray['Div'].innerHTML		= oLayout.join('');
oCalendarArray['Div'].style.display	= 'inline';
oCalendarArray, v152, v153, v156, oLayout = null;
}
function _fnAssignDate(v138, sDay)
{
var oCalendarArray	= oGlobalArray[v138];
var oDay			= oCalendarArray['Day'];
var oDate			= oCalendarArray['Date'];
oDate.setDate(sDay);
var	oDateFormat		= new Array();
var sMonth			= oDate.getMonth();
var sDate			= oDate.getDate();
var sHours			= oDate.getHours();
var sMinutes		= oDate.getMinutes();
var sSeconds		= oDate.getSeconds();
sMonth				= (++sMonth) < 10 ? '0' + sMonth : sMonth;
sDate				= sDate < 10 ? '0' + sDate : sDate;
sHours				= sHours < 10 ? '0' + sHours : sHours;
sMinutes			= sMinutes < 10 ? '0' + sMinutes : sMinutes;
sSeconds			= sSeconds < 10 ? '0' + sSeconds : sSeconds;
oDateFormat['FullYear']			= String(oDate.getFullYear());
oDateFormat['Year']				= oDateFormat['FullYear'].substring(2,4);
oDateFormat['FullMonthName']	= _fnGetCalendarMonth(oDate.getMonth());
oDateFormat['MonthName']		= oDateFormat['FullMonthName'].substring(0,3);
oDateFormat['Month']			= sMonth;
oDateFormat['Date']				= sDate;
oDateFormat['FullDay']			= oDay[oDate.getDay()];
oDateFormat['Day']				= oDateFormat['FullDay'].substring(0, 3);
oDateFormat['Hours']			= sHours;
oDateFormat['Minutes']			= sMinutes;
oDateFormat['Seconds']			= sSeconds;
var sDateString;
try
{
sDateString = fnSetDateFormat(oDateFormat);
if(!sDateString)
sDateString = oDateFormat['MonthName'] +"-"+ oDateFormat['Date'] +"-"+ oDateFormat['FullYear'];
}
catch(e)
{
sDateString = oDateFormat['FullYear'] +"-"+ oDateFormat['Month'] +"-"+ oDateFormat['Date'];
}
oCalendarArray['Input'].value = sDateString;
if(oCalendarArray['Drop'])
_fnShowsSelects(v138);
if(oCalendarArray['Close'])
_fnCloseCalendar(v138);
if(window._fnAfterSelect != undefined){
window._fnAfterSelect(oCalendarArray['Input']);
}
}
//**********************************************************
function _fnAddCalendarArray(oCalendarArray)
{
var v157 = oGlobalArray.length;
oGlobalArray.push(oCalendarArray);
return v157;
}
function _fnGetValue(sCustom, sValue)
{
try
{
var oValue;
var oCustom = sCustom.split(',');
for(var v96 = 0; v96 < oCustom.length; v96++)
{
oValue = oCustom[v96].split('=');
if(oValue[0] == sValue)
return oValue[1];
}
}
catch(e)
{
return null;
}
}
function _fnClearValue(v138)
{
var oCalendarArray	= oGlobalArray[v138];
var oInput			= oCalendarArray['Input'];
oInput.value		= '';
}
function _fnCloseCalendar(v138)
{
var oCalendarArray		= oGlobalArray[v138];
var oDiv				= oCalendarArray['Div'];
if(oCalendarArray['Drop'])
_fnShowsSelects(v138);
oDiv.innerHTML			= '';
oDiv.style.display		= 'none';
oGlobalArray[v138]	= null;
}
function _fnShowsSelects(v138)
{
var oCalendarArray		= oGlobalArray[v138];
var oSelects			= oCalendarArray['Selects'];
for(var counter = 0; counter < oSelects.length; counter++)
{
oSelects[counter].style.display = 'inline';
}
}
var v158 = 500;
function _fnMoveDivAbove(v138)
{
var oCalendarArray	= oGlobalArray[v138];
var oDiv			= oCalendarArray['Div'];
oDiv.style.zIndex	= ++v158;
}
function _fnShowStatus(sMsg)
{
window.status = sMsg;
return false;
}
function _fnGetDaysCount(v139, v140)
{
var oDaysCount = new Array();
oDaysCount.push(31);
oDaysCount.push(_fnIsLeapYear(v140) ? 29 : 28);
oDaysCount.push(31);
oDaysCount.push(30);
oDaysCount.push(31);
oDaysCount.push(30);
oDaysCount.push(31);
oDaysCount.push(31);
oDaysCount.push(30);
oDaysCount.push(31);
oDaysCount.push(30);
oDaysCount.push(31);
return oDaysCount[v139];
}
function _fnIsLeapYear(v140)
{
var v159;
((v140%4 == 0) && (v140%100 != 0) || (v140%400 == 0)) ? v159 = true : v159 = false;
return v159;
}
//Drag
var Drag = {
obj : null,
init : function(o, oRoot, minX, maxX, minY, maxY, bSwapHorzRef, bSwapVertRef, fXMapper, fYMapper)
{
o.onmousedown	= Drag.start;
o.hmode			= bSwapHorzRef ? false : true ;
o.vmode			= bSwapVertRef ? false : true ;
o.root = oRoot && oRoot != null ? oRoot : o ;
if (o.hmode  && isNaN(parseInt(o.root.style.left  ))) o.root.style.left   = "0px";
if (o.vmode  && isNaN(parseInt(o.root.style.top   ))) o.root.style.top    = "0px";
if (!o.hmode && isNaN(parseInt(o.root.style.right ))) o.root.style.right  = "0px";
if (!o.vmode && isNaN(parseInt(o.root.style.bottom))) o.root.style.bottom = "0px";
o.minX	= typeof minX != 'undefined' ? minX : null;
o.minY	= typeof minY != 'undefined' ? minY : null;
o.maxX	= typeof maxX != 'undefined' ? maxX : null;
o.maxY	= typeof maxY != 'undefined' ? maxY : null;
o.xMapper = fXMapper ? fXMapper : null;
o.yMapper = fYMapper ? fYMapper : null;
o.root.onDragStart	= new Function();
o.root.onDragEnd	= new Function();
o.root.onDrag		= new Function();
},
start : function(e)
{
var o = Drag.obj = this;
e = Drag.fixE(e);
var y = parseInt(o.vmode ? o.root.style.top  : o.root.style.bottom);
var x = parseInt(o.hmode ? o.root.style.left : o.root.style.right );
o.root.onDragStart(x, y);
o.lastMouseX	= e.clientX;
o.lastMouseY	= e.clientY;
if (o.hmode) {
if (o.minX != null)	o.minMouseX	= e.clientX - x + o.minX;
if (o.maxX != null)	o.maxMouseX	= o.minMouseX + o.maxX - o.minX;
} else {
if (o.minX != null) o.maxMouseX = -o.minX + e.clientX + x;
if (o.maxX != null) o.minMouseX = -o.maxX + e.clientX + x;
}
if (o.vmode) {
if (o.minY != null)	o.minMouseY	= e.clientY - y + o.minY;
if (o.maxY != null)	o.maxMouseY	= o.minMouseY + o.maxY - o.minY;
} else {
if (o.minY != null) o.maxMouseY = -o.minY + e.clientY + y;
if (o.maxY != null) o.minMouseY = -o.maxY + e.clientY + y;
}
document.onmousemove	= Drag.drag;
document.onmouseup	= Drag.end;
return false;
},
drag : function(e)
{
e = Drag.fixE(e);
var o = Drag.obj;
var ey	= e.clientY;
var ex	= e.clientX;
var y = parseInt(o.vmode ? o.root.style.top  : o.root.style.bottom);
var x = parseInt(o.hmode ? o.root.style.left : o.root.style.right );
var nx, ny;
if (o.minX != null) ex = o.hmode ? Math.max(ex, o.minMouseX) : Math.min(ex, o.maxMouseX);
if (o.maxX != null) ex = o.hmode ? Math.min(ex, o.maxMouseX) : Math.max(ex, o.minMouseX);
if (o.minY != null) ey = o.vmode ? Math.max(ey, o.minMouseY) : Math.min(ey, o.maxMouseY);
if (o.maxY != null) ey = o.vmode ? Math.min(ey, o.maxMouseY) : Math.max(ey, o.minMouseY);
nx = x + ((ex - o.lastMouseX) * (o.hmode ? 1 : -1));
ny = y + ((ey - o.lastMouseY) * (o.vmode ? 1 : -1));
if (o.xMapper)		nx = o.xMapper(y)
else if (o.yMapper)	ny = o.yMapper(x)
Drag.obj.root.style[o.hmode ? "left" : "right"] = nx + "px";
Drag.obj.root.style[o.vmode ? "top" : "bottom"] = ny + "px";
Drag.obj.lastMouseX	= ex;
Drag.obj.lastMouseY	= ey;
Drag.obj.root.onDrag(nx, ny);
return false;
},
end : function()
{
document.onmousemove = null;
document.onmouseup   = null;
Drag.obj.root.onDragEnd(	parseInt(Drag.obj.root.style[Drag.obj.hmode ? "left" : "right"]), 
parseInt(Drag.obj.root.style[Drag.obj.vmode ? "top" : "bottom"]));
Drag.obj = null;
},
fixE : function(e)
{
if (typeof e == 'undefined') e = window.event;
if (typeof e.layerX == 'undefined') e.layerX = e.offsetX;
if (typeof e.layerY == 'undefined') e.layerY = e.offsetY;
return e;
}
};
//----------------
//calendar_pl.js
function _fnGetWeekDays()
{
var oDays = new Array();
oDays.push('Niedziela');
oDays.push('Poniedziałek');
oDays.push('Wtorek');
oDays.push('Środa');
oDays.push('Czwartek');
oDays.push('Piątek');
oDays.push('Sobota');
return oDays;
}
function _fnGetCalendarMonth(v139)
{
var oMonths = new Array();
oMonths.push('Styczeń');
oMonths.push('Luty');
oMonths.push('Marzec');
oMonths.push('Kwiecień');
oMonths.push('Maj');
oMonths.push('Czerwiec');
oMonths.push('Lipiec');
oMonths.push('Sierpień');
oMonths.push('Wrzesień');
oMonths.push('Październik');
oMonths.push('Listopad');
oMonths.push('Grudzień');
return oMonths[v139];
}
function _fnGetMonthNumber(sMonthName)
{
var oMonths = new Array();
oMonths['Sty'] = '0';
oMonths['Lut'] = '1';
oMonths['Mar'] = '2';
oMonths['Kwi'] = '3';
oMonths['Maj'] = '4';
oMonths['Cze'] = '5';
oMonths['Lip'] = '6';
oMonths['Sie'] = '7';
oMonths['Wrz'] = '8';
oMonths['Paź'] = '9';
oMonths['Lis'] = '10';
oMonths['Gru'] = '11';
return oMonths[sMonthName];
}


if(window.objICHR_MillosTravelAgent == undefined){
var objICHR_MillosTravelAgent = new ichr.Character("MillosTravelAgent",  "http://client.inteliwise.com/ichr/v_3.0.3/CharacterApplication",  {"revision":8,"preloaderColor":"#666666","preloaderHTML":"Loading...","sourcePath":"http:\/\/client.inteliwise.com\/services\/gateway\/v_3.0\/?params=%7B%22applicationPath%22%3A%22http%3A%5C%2F%5C%2Fclient.inteliwise.com%5C%2Fproxy%5C%2FMillos%5C%2FTravelAgent%22%7D","assistantId":"Millos\/TravelAgent\/index","skinFile":"http:\/\/client.inteliwise.com\/proxy\/Millos\/TravelAgent\/skins\/skin.swf"});

if(document.location.href.indexOf("iw_debug=true") != -1) 
	var objICHRLog_MillosTravelAgent = new ichr.Log(objICHR_MillosTravelAgent, "log_MillosTravelAgent");

}
function IW_init_module(){
	var objWrap = document.createElement("div");	
	document.body.insertBefore(objWrap, document.body.firstChild);
	objWrap.innerHTML = objICHR_MillosTravelAgent.embed(true);
	var objHeader = document.getElementsByTagName("head")[0];
	var objLink = document.createElement("link");
	objLink.type = "text/css";
	objLink.rel = "stylesheet";
	objLink.href = "http://client.inteliwise.com/proxy/Millos/TravelAgent/calendar.css?rev=8";
	//alert(objHeader);
	objHeader.appendChild(objLink);
}

iw.DOMEvents.addEventListener(window, "load", IW_init_module);

function IW_init_promotion(action, arrPromo){

	var switchEl = document.getElementById('dc_promotion_switch');
	setTimeout( function() {switchEl.style.display = 'block';}, 200);
	iw.DOMEvents.addEventListener(switchEl, 'click', IW_toggle_promotion);
	
	var promoHtml = []; 
	promoHtml.push('<div class="promo-content">');
	
	iw.promoCount = arrPromo.length;
	iw.promoNo = 0;
	iw.arrPromo = arrPromo;
	
	for(var i=0; i < arrPromo.length; i++){
		if(i==0) promoHtml.push('<div class="promo-item active">');
		else promoHtml.push('<div class="promo-item">');
		//promoHtml.push('<h3>'+ arrPromo[i].stext +'</h3>');
		promoHtml.push('<div class="promo-descr">'+  arrPromo[i].btext +'</div>');
		promoHtml.push('</div>'); 
	}
	promoHtml.push('</div>'); //end .promo-content
	promoHtml.push('<div class="promo-footer">');
	
	promoHtml.push('<div class="promo-footer-left"><img alt="poprzednia" src="http://client.inteliwise.com/proxy/Millos/TravelAgent/images/promo-paging-left.png"/>');
	promoHtml.push('</div>');  
	promoHtml.push('<div class="promo-footer-right"><img alt="następna" src="http://client.inteliwise.com/proxy/Millos/TravelAgent/images/promo-paging-right.png"/>');
	promoHtml.push('</div>'); 
	
	promoHtml.push('<div class="promo-footer-center">');
	promoHtml.push('Oferta:');
	for(var i=0; i < arrPromo.length; i++){
		if(i==iw.promoNo) promoHtml.push('<a class="promo-paging current">'+ (i+1) +'</a>');
		else promoHtml.push('<a class="promo-paging">'+ (i+1) +'</a>');
	}
	promoHtml.push('</div>');
	
	promoHtml.push('</div>'); //end of .promo-footer
	
	var promoEl = document.getElementById('dc_promotion');
	
	promoEl.innerHTML = promoHtml.join('');
	
	
	$('#dc_promotion .promo-footer-right').add('#dc_promotion .promo-footer-left').add('#dc_promotion .promo-paging').click(IW_promo_change_page);
	
}

function IW_promo_change_page(evt, idx){

	if(evt){
		var idx;
	
		if( $(this).hasClass('promo-footer-left') ) idx = iw.promoNo - 1;
		else if( $(this).hasClass('promo-footer-right') ) idx = iw.promoNo + 1;
		else if ( $(this).text() ) idx = parseInt( $(this).text() ) - 1;
		
		window.clearInterval(iw.interval);
	}
	
	if( idx<0 || idx>iw.promoCount-1 || idx==iw.promoNo) return;
	else{
		var promoItems = $('.promo-item');
		var pagingItems = $('.promo-paging');
		promoItems.eq(iw.promoNo).removeClass('active');
		pagingItems.eq(iw.promoNo).removeClass('current');
		iw.promoNo = idx;
		promoItems.eq(iw.promoNo).addClass('active');
		pagingItems.eq(iw.promoNo).addClass('current');
		
		iw.photoEl.css('background-image', 'url('+ iw.arrPromo[iw.promoNo].img_url +')');
		
		
		objICHR_MillosTravelAgent.getInstance().useSynth(iw.arrPromo[iw.promoNo].stext);
	}
}

function IW_toggle_promotion( switchOn){
	
	var switchInner = $('#dc_promotion_switch #switch-inner');
	if(!iw.photoEl){
		iw.photoEl = $('#headerSubPhoto');
		if(iw.photoEl.length == 0) iw.photoEl = $('#bannersCnt .slideshow div');
	}
	if(!iw.seachConfig)
		iw.seachConfig = $("#dc_step_edit");
	
	if( switchInner.hasClass('on') || typeof switchOn == 'string' ){
		switchInner.removeClass('on');
		switchInner.addClass('off');
		iw.seachConfig.css("visibility", "hidden");
		
		
		iw.promoOriginalImage = iw.photoEl.css('background-image');
		iw.photoEl.css('background-image', 'url('+ iw.arrPromo[iw.promoNo].img_url +')');
		$('#dc_promotion').show();
		objICHR_MillosTravelAgent.getInstance().promoOn("");
		objICHR_MillosTravelAgent.getInstance().useSynth(iw.arrPromo[iw.promoNo].stext);
		
		iw.interval = window.setInterval(function(){
			var pageNo;
			if(iw.promoNo == (iw.arrPromo.length - 1) ) pageNo = 0;
			else pageNo = iw.promoNo + 1;
			
			IW_promo_change_page(null, pageNo);
		}, 10000); 
		
	}else{
		
		window.clearInterval(iw.interval);
		
		var promoItems = $('.promo-item');
		var pagingItems = $('.promo-paging');
		
		promoItems.eq(iw.promoNo).removeClass('active');
		pagingItems.eq(iw.promoNo).removeClass('current');
		
		iw.promoNo = 0;
		
		promoItems.eq(iw.promoNo).addClass('active');
		pagingItems.eq(iw.promoNo).addClass('current');
		
		switchInner.removeClass('off');
		switchInner.addClass('on');
		iw.seachConfig.css("visibility", "");
	
		
		iw.photoEl.css('background-image',  iw.promoOriginalImage );
		$('#dc_promotion').hide();
		objICHR_MillosTravelAgent.getInstance().promoOff("");
		objICHR_MillosTravelAgent.getInstance().reset('');
	}
	
}


function IW_adjust_init(){
	var strConfig = "";
	try{
		var strConfig = get_search_config();
		
		if(!strConfig){
			strConfig = '{"step": 0}';
		}
		
	}
	catch(err){
		strConfig = '{"step": 0}';
		iw.Core.reportError("search config error", err);
	}
	/*if(window.console)
		window.console.log("search config: " + strConfig);*/
	//alert(strConfig);
	if(typeof strConfig == "object")
		strConfig = ichr.json.JSON.encode(strConfig);
	//alert(strConfig);
	objICHR_MillosTravelAgent.getInstance().initAdjust(strConfig);
	
}

function IW_initDateField(p_strFormId, p_strInputName, p_strInitValue){
	try{
		
		var objForm = iw.DOMFactory.getElement(p_strFormId);		
		var objInput = iw.DOMFactory.getFormField(objForm, p_strInputName);
		var objInitTime = new Date(p_strInitValue);
		objInput.id = p_strFormId + ":" + p_strInputName;
		objInput.readOnly = true;
		var strMonth = (objInitTime.getMonth()+1);
		strMonth = strMonth < 10 ? "0" + strMonth : strMonth + "";
		var strDay = objInitTime.getDate();
		strDay = strDay < 10 ? "0" + strDay : strDay + "";
		objInput.value = objInitTime.getFullYear() + "-" + strMonth + "-" + strDay;
		var strFormat = 'instance=single,close=true,expiry=true,year='+objInitTime.getFullYear()+',month='+(objInitTime.getMonth()+1);
		fnInitCalendar(objInput, objInput.id, strFormat);
	
	}catch(err){iw.Core.reportError("Field init error", err)}
}

function _fnAfterSelect(p_objInput){
	objICHR_MillosTravelAgent.getInstance().storeTimestamp(p_objInput.form.id+":"+p_objInput.name+":"+IW_getTimestamp(p_objInput));
}


function IW_getTimestamp(p_objInput) {
	if(p_objInput != undefined && p_objInput.value){
		var termin = p_objInput.value;
		var years = termin.substr(0,4);
		var months = termin.substr(5,2);
		var days = termin.substr(8,2);
		timestamp = Math.round(((new Date()).setFullYear(years,months-1,days))/1000);
		return timestamp;
	}
	return "";
}


function IW_openTab(p_strId){
	try{
		open_tab(p_strId);
	}
	catch(err){
	}
}

function IW_openFlightDetails(){
	try{
		open_flight_details();
	}
	catch(err){
	}
}

