/*
    json.js
    2007-10-10

    Public Domain

    This file adds these methods to JavaScript:

        array.toJSONString(whitelist)
        boolean.toJSONString()
        date.toJSONString()
        number.toJSONString()
        object.toJSONString(whitelist)
        string.toJSONString()
            These methods produce a JSON text from a JavaScript value.
            It must not contain any cyclical references. Illegal values
            will be excluded.

            The default conversion for dates is to an ISO string. You can
            add a toJSONString method to any date object to get a different
            representation.

            The object and array methods can take an optional whitelist
            argument. A whitelist is an array of strings. If it is provided,
            keys in objects not found in the whitelist are excluded.

        string.parseJSON(filter)
            This method parses a JSON text to produce an object or
            array. It can throw a SyntaxError exception.

            The optional filter parameter is a function which can filter and
            transform the results. It receives each of the keys and values, and
            its return value is used instead of the original value. If it
            returns what it received, then structure is not modified. If it
            returns undefined then the member is deleted.

            Example:

            // Parse the text. If a key contains the string 'date' then
            // convert the value to a date.

            myData = text.parseJSON(function (key, value) {
                return key.indexOf('date') >= 0 ? new Date(value) : value;
            });

    It is expected that these methods will formally become part of the
    JavaScript Programming Language in the Fourth Edition of the
    ECMAScript standard in 2008.

    This file will break programs with improper for..in loops. See
    http://yuiblog.com/blog/2006/09/26/for-in-intrigue/

    This is a reference implementation. You are free to copy, modify, or
    redistribute.

    Use your own copy. It is extremely unwise to load untrusted third party
    code into your pages.
*/

/*jslint evil: true */

// Augment the basic prototypes if they have not already been augmented.

if (!Object.prototype.toJSONString) {

    Array.prototype.toJSONString = function (w) {
        var a = [],     // The array holding the partial texts.
            i,          // Loop counter.
            l = this.length,
            v;          // The value to be stringified.

// For each value in this array...

        for (i = 0; i < l; i += 1) {
            v = this[i];
            switch (typeof v) {
            case 'object':

// Serialize a JavaScript object value. Treat objects thats lack the
// toJSONString method as null. Due to a specification error in ECMAScript,
// typeof null is 'object', so watch out for that case.

                if (v && typeof v.toJSONString === 'function') {
                    a.push(v.toJSONString(w));
                } else {
                    a.push('null');
                }
                break;

            case 'string':
            case 'number':
            case 'boolean':
                a.push(v.toJSONString());
                break;
            default:
                a.push('null');
            }
        }

// Join all of the member texts together and wrap them in brackets.

        return '[' + a.join(',') + ']';
    };


    Boolean.prototype.toJSONString = function () {
        return String(this);
    };


    Date.prototype.toJSONString = function () {

// Eventually, this method will be based on the date.toISOString method.

        function f(n) {

// Format integers to have at least two digits.

            return n < 10 ? '0' + n : n;
        }

        return '"' + this.getUTCFullYear()   + '-' +
                   f(this.getUTCMonth() + 1) + '-' +
                   f(this.getUTCDate())      + 'T' +
                   f(this.getUTCHours())     + ':' +
                   f(this.getUTCMinutes())   + ':' +
                   f(this.getUTCSeconds())   + 'Z"';
    };


    Number.prototype.toJSONString = function () {

// JSON numbers must be finite. Encode non-finite numbers as null.

        return isFinite(this) ? String(this) : 'null';
    };


    Object.prototype.toJSONString = function (w) {
        var a = [],     // The array holding the partial texts.
            k,          // The current key.
            i,          // The loop counter.
            v;          // The current value.

// If a whitelist (array of keys) is provided, use it assemble the components
// of the object.

        if (w) {
            for (i = 0; i < w.length; i += 1) {
                k = w[i];
                if (typeof k === 'string') {
                    v = this[k];
                    switch (typeof v) {
                    case 'object':

// Serialize a JavaScript object value. Ignore objects that lack the
// toJSONString method. Due to a specification error in ECMAScript,
// typeof null is 'object', so watch out for that case.

                        if (v) {
                            if (typeof v.toJSONString === 'function') {
                                a.push(k.toJSONString() + ':' +
                                       v.toJSONString(w));
                            }
                        } else {
                            a.push(k.toJSONString() + ':null');
                        }
                        break;

                    case 'string':
                    case 'number':
                    case 'boolean':
                        a.push(k.toJSONString() + ':' + v.toJSONString());

// Values without a JSON representation are ignored.

                    }
                }
            }
        } else {

// Iterate through all of the keys in the object, ignoring the proto chain
// and keys that are not strings.

            for (k in this) {
                if (typeof k === 'string' &&
                        Object.prototype.hasOwnProperty.apply(this, [k])) {
                    v = this[k];
                    switch (typeof v) {
                    case 'object':

// Serialize a JavaScript object value. Ignore objects that lack the
// toJSONString method. Due to a specification error in ECMAScript,
// typeof null is 'object', so watch out for that case.

                        if (v) {
                            if (typeof v.toJSONString === 'function') {
                                a.push(k.toJSONString() + ':' +
                                       v.toJSONString());
                            }
                        } else {
                            a.push(k.toJSONString() + ':null');
                        }
                        break;

                    case 'string':
                    case 'number':
                    case 'boolean':
                        a.push(k.toJSONString() + ':' + v.toJSONString());

// Values without a JSON representation are ignored.

                    }
                }
            }
        }

// Join all of the member texts together and wrap them in braces.

        return '{' + a.join(',') + '}';
    };


    (function (s) {

// Augment String.prototype. We do this in an immediate anonymous function to
// avoid defining global variables.

// m is a table of character substitutions.

        var m = {
            '\b': '\\b',
            '\t': '\\t',
            '\n': '\\n',
            '\f': '\\f',
            '\r': '\\r',
            '"' : '\\"',
            '\\': '\\\\'
        };


        s.parseJSON = function (filter) {
            var j;

            function walk(k, v) {
                var i, n;
                if (v && typeof v === 'object') {
                    for (i in v) {
                        if (Object.prototype.hasOwnProperty.apply(v, [i])) {
                            n = walk(i, v[i]);
                            if (n !== undefined) {
                                v[i] = n;
                            }
                        }
                    }
                }
                return filter(k, v);
            }


// Parsing happens in three stages. In the first stage, we run the text against
// a regular expression which looks for non-JSON characters. We are especially
// concerned with '()' and 'new' because they can cause invocation, and '='
// because it can cause mutation. But just to be safe, we will reject all
// unexpected characters.

// We split the first stage into 4 regexp operations in order to work around
// crippling deficiencies in IE's and Safari's regexp engines. First we replace
// all 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(this.replace(/\\./g, '@').
                    replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(:?[eE][+\-]?\d+)?/g, ']').
                    replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {

// In the second 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('(' + this + ')');

// In the optional third stage, we recursively walk the new structure, passing
// each name/value pair to a filter function for possible transformation.

                return typeof filter === 'function' ? walk('', j) : j;
            }

// If the text is not JSON parseable, then a SyntaxError is thrown.

            throw new SyntaxError('parseJSON');
        };


        s.toJSONString = function () {

// If the string contains no control characters, no quote characters, and no
// backslash characters, then we can simply slap some quotes around it.
// Otherwise we must also replace the offending characters with safe
// sequences.

            if (/["\\\x00-\x1f]/.test(this)) {
                return '"' + this.replace(/[\x00-\x1f\\"]/g, function (a) {
                    var c = m[a];
                    if (c) {
                        return c;
                    }
                    c = a.charCodeAt();
                    return '\\u00' + Math.floor(c / 16).toString(16) +
                                               (c % 16).toString(16);
                }) + '"';
            }
            return '"' + this + '"';
        };
    })(String.prototype);
}
///<reference path="_intellisense.js" />

/* ******** USAGE DESCRIPTION ***********

### $OL ###

$OL holds all methods that should be executed after the document (and all javascripts)
are loaded this ensures that all required methods/objects are existing
Every list entry contains an array.
Parameters:
	[0] ... index to sort the list to be able to execute the commands in a controlled order
	[1] ... string or function that will be evaluated/executed
	[2] ... context/scope which will be referenced in the 'this' inside the called function
	[3] ... parameter list for the function
	[4] ... string that will be evaluated, if it returns false: the method won't be executed, optional
Example:
	$OL.push( [ 10, "CallMgr.Call", CallMgr, [ "972542384150", "972542384151" ] ] );

### $X ###

$X represents the Ajax interface
The ajax request can either been done using POST or GET, whereby the GET request could be cached if needed.
Parameters:
	url ............. the url to send the request to ($X.Url.Default, $X.Url.Call, ... or a custom)
	server_method ... which method should be called on the server
	params .......... the parameters sent to the server
		-) string
		-) array
		-) key-value-object (the value could also be an array)
	callback ........ the javascript method that should be called with the result from the ajax request
	usetoken ........ optional, enables/disables transmission of security token (default = true)
	async ........... optional, if the ajax-request should be asyncrounus or not (default = true)
Examples:
	$X.Post( $X.Url.Account, "CheckNicknameExistance", { nick : "roberkules" }, NickManager.NickCallBack.link( NickManager, nick ) ).Send();
	-> NickManager.NickCallBack( nick, ajax-result, success )
	$X.Get( $X.Url.Call, "GetRate", { from : "972542384150", to : "972542384175" }, CallMgr.ShowRate.link( CallMgr ), false ).Send();
	-> CallMgr.ShowRate( ajax-result, success ) -> this request could be cacheable
	$X.Get( "/ping.html", null, getCacheBuster(), function(r,ok){ alert(r); }, false ).Send( false );
	-> Gets the ping.html content syncrounusly, and alerts the result

*/



/* VARIABLES START */
var $d = document,
$b,
$un = "undefined",
$GA_url = $un == typeof $GA_url ? "" : $GA_url,
OLExecuted = false,
unknownDC,
chooseC,
dctimer = null,
myActiveTab,
specialDC = [ 39, 225, 228, 241, 250, 352 ],
$Tel,
CallMgr,
DestMgr,
ABMgr,
GroupMgr,
SmsMgr,
NrControlMgr,
AdsManager,
RedialManager,
RecentCallsRenderer,
DelayedCallListManager,
TabStrip,
ClickOnTab = false,
$notify = false;
/* VARIABLES END */



/* EXTEND METHODS FOR STRINGS, NUMBERS, ARRAYS AND OBJECTS START */
String.prototype.ltrim = function()
{
	return this.replace( /^\s+/g, "" );
};

String.prototype.rtrim = function()
{
	return this.replace( /\s+$/g, "" );
};

String.prototype.trim = function()
{
	return this.replace( /^\s+|\s+$/g, "" );
};

String.prototype.wrap = function( l )
{
	var reg = new RegExp( "(\\S{" + l + ",})", "g" );
	return this.replace( reg, function()
	{
		var r = "",
		s = arguments[0];
		while( s.length >  l)
		{
			r = r + s.substring( 0, l ) + "<wbr />";
			s = s.substring( l );
		}
		return r + s;
	} );
};

String.prototype.startsWith = Number.prototype.startsWith = function( s )
{
	return String( this ).substring( 0, String( s ).length ) == String( s );
};

Array.prototype.each = function()
{
	var args = $A(arguments),
	f = args.shift(),
	_this = args.shift();
	
	for( var i = 0, l = this.length; i < l; i++ )
	{
		f.apply( _this || this, [ this[ i ] ].concat( args ) );
	}
};

Array.prototype.hasKey = Object.prototype.hasKey = function( k )
{
	return $un != typeof( this[ k ] );
};

Array.prototype.contains = function( v )
{
	for( var i = 0, len = this.length; i < len; i++ )
	{
		if( this[i] == v )
		{
			return true;
		}
	}
	return false;
};

Array.prototype.clone = function( keepref )
{
	if( $un == typeof keepref )
	{
		keepref = false;
	}
	var arr;
	if( keepref )
	{
		arr = this.slice( 0 );
	}
	else
	{
		arr = [];
		for( var i = 0, len = this.length; i < len; i++ )
		{
			switch( typeof( this[i] ) )
			{
				case "object":
				case "array":
					arr.push( null == this[i] ? null : this[i].clone( keepref ) );
					break;
				default:
					arr.push( this[i] );
					break;
			}
		}
	}
	return arr;
};

Object.prototype.clone = function( keepref )
{
	if( $un == typeof( keepref ) )
	{
		keepref = false;
	}
	var o = {},
	k = GetKeys( this );
	for( var i = 0, len = k.length; i < len; i++ )
	{
		switch( typeof( this[k[i]] ) )
		{
			case "object":
			case "array":
				o[k[i]] = this[k[i]].clone( keepref );
				break;
			default:
				o[k[i]] = this[k[i]];
				break;
		}
	}
	return o;
};

function equals( a, b )
{
	if( typeof a != typeof b )
	{
		return false;
	}
	
	if( isFunction( a.toSource ) )
	{
		return a.toSource().toLowerCase() == b.toSource().toLowerCase();
	}
	
	if( isArray( a ) )
	{
		if( a.length != b.length )
		{
			return false;
		}
		for( var i = 0, l = a.length; i < l; i++ )
		{
			if( !equals( a[i], b[i] ) )
			{
				return false;
			}
		}
		return true;
	}
	
	if( isObject( a ) )
	{
		var k = GetKeys( a );
		
		if( !equals( k, GetKeys( b ) ) )
		{
			return false;
		}
		
		for( var i = 0, l = k.length; i < l; i++ )
		{
			if( !equals( a[k[i]], b[k[i]] ) )
			{
				return false;
			}
		}
		return true;
	}
	
	if( isFunction( a ) )
	{
		return a.toString() == b.toString();
	}
	
	return String( a ).toLowerCase() == String( b ).toLowerCase();
}

Function.prototype.link = function()
{
	var m = this,
	args = $A( arguments ),
	_this = args.shift();
	
	return function()
	{
		return m.apply( _this, args.concat( $A( arguments ) ) );
	};
};

Function.prototype.delay = function()
{
	var m = this,
	args = $A( arguments ),
	t = args.shift() || 1,
	_this = args.shift();
	
	return window.setTimeout( function() { m.apply( _this, args ); }, t );
};

function GetKeys( o )
{
	var k = [];
	for( var key in o )
	{
		if( o.hasOwnProperty( key ) )
		{
			k.push( key );
		}
	}
	return k;
}
/* EXTEND METHODS FOR STRINGS, NUMBERS, ARRAYS AND OBJECTS START */



/* FAKE TEXT MANAGER IF NOT EXISITNG */
if( typeof $T == $un )
{
	$T = function( id, v )
	{
		if( typeof TM != $un )
		{
			return TM.Get( id );
		}
		if( v )
		{
			return v;
		}
		else
		{
			return id.replace(/\./, " ");
		}
	}
}
/* END TEXT MANAGER */



/* EVENT MANAGER START
var EventManager = function()
{
	this.events = {};
}
EventManager.prototype =
{
	attach : function( o, e, f )
	{
		alert( "ole" );
	},
	
	detach : function( o, e, f )
	{
		
	},
	
	fire : function()
	{
	
	}
}
var Event = new EventManager();

var EventBroker = {
	events: {},
	invoke:function(eventKey, data) {
		var events = EventBroker.ensureEvents(eventKey);
		for(var i=0; i<events.length; ++i) {
			if(typeof(events[i])=="function") {
				events[i](data);
			}
		}
	},
	subscribe:function(eventKey, callback) {
		var events = EventBroker.ensureEvents(eventKey);
		events.push(callback);
	},
	ensureEvents:function(eventKey) {
		if(EventBroker.events[eventKey]==null)
			EventBroker.events[eventKey]=[];
		return EventBroker.events[eventKey];
	}
}
/* EVENT MANAGER END */



/* INIT START */
preload( "/images/animations/loading.gif" );

if ( $d.addEventListener )
{
	AttachEvent( $d, "DOMContentLoaded", OnContentLoad );
}
AttachEvent( window, "load", function(){ OnContentLoad(); OnLoad(); } );

function OnContentLoad()
{
	if( OLExecuted )
	{
		return;
	}
	
	OLExecuted = true;
	
	$b = $d.body;

	unknownDC = $T( "unknown.dialcode", "Invalid country code" );
	chooseC = $T( "country.choose", "Please select country" );

	TabStrip = new TabStripMgr();
	myActiveTab = 0;

	var init = [
		"PhoneNumberManager", function()
			{
				$Tel = new PhoneNumberManager();
			},
		"NrControlManager", function()
			{
				NrControlMgr = new NrControlManager();
			},
		"CallManager", function()
			{
				CallMgr = new CallManager( "CallMgr" );
			},
		"DestinationManager", function()
			{
				DestMgr = new DestinationManager();
			},
		"SmsManager", function()
			{
				SmsMgr = new SmsManager();
			},
		"ABManager", function()
			{
				ABMgr = new ABManager( "ABMgr" );
			},
		"GroupManager", function()
			{
				GroupMgr = new GroupManager( 'GroupMgr' );
			},
		"AdsMgr", function()
			{
				AdsManager = new AdsMgr();
			},
		"RedialMgr", function()
			{
				RecentCallsRenderer = new RecentCallsRendererMgr();
				RedialManager = new RedialMgr( "RedialManager", RecentCallsRenderer );
			},
		"ScheduleManager", function()
			{
				DelayedCallListManager = new ScheduleManager();
			},
		"clickHandler", function()
			{
				AttachEvent( $d, "click", clickHandler );
			}
	];
	
	for( var i = 0, len = init.length; i < len; i=i+2 )
	{
		if( eval( "$un != typeof(" + init[i] + ")" ) )
		{
			init[i+1]();
		}
	}
	
	ExecuteOL();
}

function OnLoad()
{
	if( CallMgr )
	{
		//PreLoadAnimations.delay( 5000, null );
	}
}

function ExecuteOL()
{
	if( $un == typeof( $OL ) )
	{
		return;
	}
	
	$OL.sort( function( a, b ){ return a[0] - b[0] } );
	
	for( var i = 0, len = $OL.length; i < len; i++ )
	{
		var valid = true;
		if( $OL[i].length > 4 )
		{
			try
			{
				valid = eval( $OL[i][4] );
			}
			catch( ex )
			{
				$Log( ex );
				valid = false;
			}
		}
		
		if( valid )
		{
			var f = eval( $OL[i][1] );
			if( isFunction( f ) )
			{
				f.apply( eval( $OL[i][2] ), $OL[i][3] || [] );
			}
		}
	}
	
	$OL = [];
}
/* INIT END */



/* AJAX START */
var Ajax = function()
{
	this.Methods =
	{
		Get : "GET",
		Post : "POST"
	};
	
	this.Timeout = 15; // in seconds
	
	this.Path = "/engine/ajax/";
	
	this.Url =
	{
		Account : this.Path + "account.ashx",
		Button : this.Path + "services/button.ashx",
		Call : this.Path + "services/call.ashx",
		Contacts : this.Path + "contacts.ashx",
		Default : this.Path + "default.ashx",
		Modal : this.Path + "ui/modal.ashx",
		Mobile : this.Path + "services/mobile.ashx",
		SMS: this.Path + "services/sms.ashx",
		Sync : this.Path + "sync.ashx"
	};
	
	this.defaultUrl = this.Url.Default;
	
	this.JSONDateRegex = new RegExp( "/Date\\((\\d+)([+-]\\d+)?\\)/", "gi" );
};

Ajax.prototype =
{
	Enabled : function()
	{
		return null != this.XHR();
	},
	
	XHR : function()
	{
		if( $un != typeof XMLHttpRequest )
		{
			return new XMLHttpRequest();
		}
		if( $un != typeof ActiveXObject )
		{
			try
			{
				return new ActiveXObject( "Msxml2.XMLHTTP" );
			}
			catch( e )
			{
			}
			
			try
			{
				return new ActiveXObject( "Microsoft.XMLHTTP" );
			}
			catch( e )
			{
			}
		}
		return null;
	},
	
	Send : function( method, url, server_func, params, cb, secure )
	{
		return new AjaxReq( this.XHR(), method, url, server_func, params, cb, secure, this );
	},
	
	Get : function()
	{
		return this.Send.apply( this, [ this.Methods.Get ].concat( $A( arguments ) ) );
	},
	
	Post : function()
	{
		return this.Send.apply( this, [ this.Methods.Post ].concat( $A( arguments ) ) );
	},
	
	ParseJSONDate : function( key, value )
	{
		if( null == value || !value.replace )
		{
			return value;
		}
		return this.JSONDateRegex.test( value ) ? new Date( parseInt( value.replace( this.JSONDateRegex, "$1" ) ) ) : value;
	}
};

function AjaxReq( xhr, method, url, server_func, params, cb, secure, base )
{
	this.base = base;
	this.XHR = xhr;
	this.method = method || this.base.Methods.Post;
	this.url = url || this.base.defaultUrl;
	this.server_func = server_func || "";
	this.params = params;
	this.cb = cb || null;
	this.secure = $un == typeof secure ? true : !!secure;
	this.cancelTimer = null;
	this.isTimeout = false;
}

AjaxReq.prototype =
{
	Send: function(async) {
		if (null == this.XHR) {
			return false;
		}

		if ($un == typeof async) {
			async = true;
		}

		try {
			this.XHR.open(this.method, this.url + this.GetQuery(), async);
			if (this.method == this.base.Methods.Post) {
				this.XHR.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
			}
			this.XHR.send(this.GetBody());

			var _this = this;
			this.cancelTimer = window.setTimeout(function() { _this.isTimeout = true; _this.XHR.abort(); }, this.base.Timeout * 1000);

			if (null != (this.cb || null)) {
				if (async) {
					this.OnStateChange.delay(1, this); // IE cache fix
					this.XHR.onreadystatechange = this.OnStateChange.link(this);
				}
				else {
					this.cb(this.GetResponse(), this.Ok());
					this.CleanUp();
				}
			}
		}
		catch (e) {
			this.CleanUp();
			return false;
		}

		return true;
	},

	OnStateChange: function() {
		if (null != this.XHR && 4 == this.XHR.readyState) {
			window.clearTimeout(this.cancelTimer);
			this.cb(this.GetResponse(), this.Ok());
			this.CleanUp();
		}
	},

	Ok: function() {
		var status = ((null != this.XHR ? this.XHR.status : null) || 0);
		return (200 <= status && 300 > status) || 1223 /* 204 in IE*/ == status;
	},

	GetQuery: function() {
		if (this.method == this.base.Methods.Get) {
			return ((this.url || this.base.defaultUrl).indexOf("?") > -1 ? "&" : "?") + this.GetParamQuery();
		}
		return "";
	},

	GetBody: function() {
		if (this.method == this.base.Methods.Post) {
			return this.GetParamQuery();
		}
		return "";
	},

	GetParamQuery: function() {
		var p = this.params,
		q = "_sf=" + this.server_func + (this.secure ? "&_sid=" + (typeof $sid != $un ? $sid : "") : "");

		if (null == p) {
			return q;
		}

		if (isArray(p)) {
			for (var i = 0, l = p.length; i < l; i++) {
				q += this.Prefix(q) + "_p=" + urlEncode(this.ToString(p[i]));
			}
		}
		else if (isObject(p)) {
			var k = GetKeys(p);
			for (var i = 0, l = k.length; i < l; i++) {
				if (null != p[k[i]] && isArray(p[k[i]]) && p[k[i]].length > 0) {
					q += this.Prefix(q) + this.ToString(p[k[i]], urlEncode(k[i]));
				}
				else {
					q += this.Prefix(q) + urlEncode(k[i]) + "=" + urlEncode(this.ToString(p[k[i]]));
				}
			}
		}
		else {
			q += ("" == q ? "" : "&") + this.ToString(p);
		}

		return q;
	},

	Prefix: function(q) {
		return ("" == q || q.match(/(\&|\?)$/i)) ? "" : "&";
	},

	ToString: function(v, n) {
		if (null == v) {
			return "";
		}
		if (isArray(v)) {
			var q = "";
			for (var i = 0, l = v.length; i < l; i++) {
				q += this.Prefix(q) + (n || "_p") + "=" + urlEncode(this.ToString(v[i]));
			}
			return q;
		}
		if (isFunction(v.toString)) {
			return v.toString();
		}
		return v;
	},

	GetResponse: function() {
		if (!this.Ok()) {
			if (403 == this.XHR.status) {
				var modal = /.+\(m:(.*)\)$/.exec(this.XHR.responseText);
				if (null != modal) {
					$M.Show(modal[1]);
				}
			}
			return this.isTimeout ? "timeout" : this.XHR.statusText;
		}

		if (204 == this.XHR.status || 1223 /* 204 in IE */ == this.XHR.status) {
			return "";
		}

		var ctype = this.XHR.getResponseHeader("Content-type");
		if (null != ctype && ctype.match(/^application\/json(;.*)?$/i)) {
			var re = null;
			hack = "while(1){};";
			txt = this.XHR.responseText.startsWith(hack) ? this.XHR.responseText.substring(hack.length) : this.XHR.responseText;

			try {
				re = txt.parseJSON(this.base.ParseJSONDate.link(this.base));
			}
			catch (ex) {
				//$Log( ex.message, location.href, "$X.GetResponse" );
				try {
					re = Eval(txt);
				}
				catch (ex) {
					$Log(ex.message, location.href, "$X.GetResponse");
				}
			}
			return re;
		}

		return this.XHR.responseText;
	},

	EmptyFunc: function() {
	},

	CleanUp: function() {
		if (null == this.XHR) {
			return;
		}
		// kill this xhr-object
		this.XHR.onreadystatechange = this.EmptyFunc;
		this.XHR = null;
	}
};

var $X = new Ajax();
/* AJAX END */



/* CHECK FOR SUPPORTED BROWSER START */
(function()
{
	if( -1 == window.location.href.indexOf( "\/mini" ) && "?nr" != window.location.search )
	{
		var bot = [ "bot", "yahoo", "crawler" ],
		nav = window.navigator;
		
		if( nav )
		{	
			for( var i=0, l=bot.length; i<l; i++ )
			{
				if( nav.userAgent.indexOf( bot[i] ) > -1 )
				{
					return;
				}
			}
		}
		
		if( !$X.Enabled() )
		{
			redirect( "http://mobile.jajah.com/" );
		}
	}
})();
/* CHECK FOR SUPPORTED BROWSER END */



/* GENERAL ERROR LOGGING START */
function $Log( msg, url, line, stack )
{
	// try/catch only needed because the 'new Image' breaks the vs2008-intellisense
	try
	{
		var a = $A( arguments );
		if( 1 == a.length )
		{
			msg = a[0].message;
			url = a[0].fileName;
			line = a[0].lineNumber;
			stack = a[0].stack;
		}
		
		var i = new Image();
		i.src = "/engine/log4js.ashx?msg=#m#&url=#u#&line=#l#&stack=#s#".replace( /#m#/, urlEncode( msg ) ).replace( /#u#/, urlEncode( url ) ).replace( /#l#/, urlEncode( line ) ).replace( /#s#/, urlEncode( stack ) );
		return false;
	}
	catch( e )
	{
	}
}
window.onerror = $Log;
/* GENERAL ERROR LOGGING END */



/* DOM METHODS START */
function el( id )
{
	return "string" == typeof( id ) ? $d.getElementById( id ) : id;
}

function create( tag )
{
	return $d.createElement( tag );
}

function elByTag( o, t )
{
	if( null == ( o = el( o || document.body ) ) )
	{
		return [];
	}
	return $A( o.getElementsByTagName( t ) );
}

function setText( c, t )
{
	var o = el( c );
	if( null == o )
	{
		return;
	}
	
	if( "clear" == t )
	{
		t = "";
	}

	if( "" == t.replace( /[\s]/g, "" ) )
	{
		t = "";
	}

	if( t != o.innerHTML )
	{
		o.innerHTML = t;
	}

	o.style.display = ( "" == t ? "none" : "" );
		
	if( "infobox" == c || "lowerinfobox" == c )
	{
		o = el( c + "line" );
		if( null != o )
		{
			o.style.display=(t==""?"none":"");
		}
	}
}

function isVisible( o )
{
	o = el( o );
	if( null == o )
	{
		return false;
	}
	return( ( "none" != o.style.display ) || ( o.getAttribute( "isVisible" ) && "true" == o.getAttribute( "isVisible" ) ) );
}

function $html( o, h )
{
	return $mod.apply( this, [ function( o ){ o.innerHTML = h || ""; } ].concat( [ o ] ) );
}

function $show()
{
	return $tog.apply( this, $A( arguments ).concat( [ true ] ) );
}

function $hide( id )
{
	return $tog.apply( this, $A( arguments ).concat( [ false ] ) );
}

function $tog()
{
	var args = $A( arguments ),
	show = args.pop();
	
	return $s.apply( this, args.concat( [ "display", show ? "" : "none" ] ) );
}

function $class( o, css )
{
	return $mod.apply( this, [ function( o ){ o.className = css; } ].concat( [ o ] ) );
}

function $s( o, k, s )
{
	///<summary>sets a style of an element</summary>
	///<param name="o" type="domElement|String">the element to apply the style to, or an id of an element</param>
	///<param name="k" type="String">the style key</param>
	///<param name="v" type="String">the style value</param>
	///<returns type="domElement" mayBeNull="true">the passed element to immediately use it again</returns>
	
	o = $A( arguments ),
	v = o.pop(),
	k = o.pop();
	
	return $mod.apply( this, [ function( o ){ o.style[ fixStyle( k ) ] = v; } ].concat( o ) );
	
	function fixStyle( n )
	{
		if( "float" == n )
		{
			// float x-browser-compatibility
			// ie : styleFloat
			// def: cssFloat
			return $un != typeof create( "DIV" ).style.styleFloat ? "styleFloat" : "cssFloat";
		}
		if( n.indexOf( "-" ) > -1 )
		{
			return n.replace( /-./gi, function( match )
			{
				return match.substr( 1 ).toUpperCase();
			});
		}
		return n;
	}
}

function $mod()
{
	var o = $A( arguments ),
	f = o.shift();
	
	for( var i = 0, len = o.length; i < len; i++ )
	{
		o[i] = el( o[i] );
		if( null != o[i] )
		{
			f( o[i] );
		}
	}
	
	return 1 == o.length ? o[0] : o;
}
/* DOM METHODS END */



/* CHECK FOR EXISTANCE... START */
function isFunction( f )
{
	return "function" == typeof f;
}

function isObject( o )
{
	return o && "object" == typeof o;
}

function isArray( o )
{
	return $un != typeof o && [].constructor == o.constructor;
}
/* CHECK FOR EXISTANCE... END */



/* MISC START */
function $A( a )
{
	if( !a )
	{
		return [];
	}
	
	if( a.toArray )
	{
		return a.toArray();
	}
	
	if( $un != typeof a.length )
	{
		try
		{
			return Array.prototype.slice.call( a, 0 );
		}
		catch( ex )
		{
			var r = [];
			for( var i = 0, l = a.length; i < l; i++ )
			{
				r.push( a[i] );
			}
			return r;
		}
	}
	
	return [ a ];
}

function fixE( e )
{
	return e || window.event;
}

function Eval( s )
{
	return eval( '(' + s.replace( /\r|\n/g, ' ' ) + ')' );
}

function urlEncode( s )
{
	if( encodeURIComponent )
	{
		return encodeURIComponent( s );
	}
	return encode( s );
}

function encode( t )
{
	return t.replace( /\"/, "&quot;" ).replace( /</, "&lt;" ).replace( />/, "&gt;" );
}

function redirect( url )
{
	window.location.href = url;
}

function foc( o )
{
	if( "string" == typeof( o ) )
	{
		o = el( o );
	}

	if( null != o )
	{
		if( $un != typeof focTimer && null != focTimer )
		{
			window.clearTimeout( focTimer );
			focTimer = null;
		}
		focTimer = setfocus.delay( 400, null, o );
	}
}

function setfocus( o )
{
	if( $un == typeof( o ) || null == o || $un == typeof( o.focus ) )
	{
		return;
	}
	o.focus();
}

function getMouseXY( e )
{
	e = fixE(e);
	if( $un != typeof( e.pageX ) )
	{
		return { x : e.pageX, y : e.pageY };
	}
	else if( e.clientX )
	{
		return { x : ( e.clientX + document.documentElement.scrollLeft ), y : ( e.clientY + document.documentElement.scrollTop ) };
	}
	return { x : 0, y : 0 };
}

function _parseFloat( v, g, d )
{
	return parseFloat( v.replace( eval( "/\\"+g+"/" ), "" ).replace( eval( "/\\" + d + "/" ), "." ) );
}

function CryptNumber( nr )
{
	return nr.substr( 0, 3 ) + "<span></span>" + nr.substr( 3 );
}

function onlyDigits( e, o, plusAllowed, extAllowed, numOnly )
{
	if( e.ctrlKey || e.altKey || e.metaKey )
	{
		return true;
	}

	var chars = ( numOnly ? "" : "- ,./\()" ) + "0123456789",
	key = e.which || e.keyCode;
	
	var ok = ( isSpecialKey( key ) || ( plusAllowed && key == 43 && o.value.indexOf( '+' ) == -1 ) || ( extAllowed && key == 120 && o.value.indexOf('x') == -1 ) || chars.indexOf( String.fromCharCode( key ) ) > -1 );
	
	if( !ok )
	{
		preventDefaultEvent( e );
	}
	
	return ok;
}

function isSpecialKey( k )
{
	return ( "|" + [ 8, 9, 13, 17, 18, 35, 36, 37, 38, 39 ].join( "|" ) + "|" ).indexOf( "|" + k + "|" ) > -1;
}

function CustomSubmit( f, url, method, target )
{
	var a = f.action,
	t = f.target,
	m = f.method;
	
	f.action = url;
	f.target = $un == typeof( target ) ? t : target;
	f.method = method;
	
	f.submit();
	
	f.action = a;
	f.target = t;
	f.method = m;
	
	return false;
}

function pop( u, n, w, h, s, r )
{
	if( $un == typeof( s ) )
	{
		s = true;
	}
	if( $un == typeof( r ) )
	{
		r = false;
	}
	( window.open( u, n, "width=" + w + ",height=" + h + ",resizable=" + ( r ? "yes" : "no" ) + ",scrollbars=" + ( s ? "yes" : "no" ) ) ).focus();
}

function togSWF( v, p )
{
	$s.apply( this, $swf( p || null ).concat( [ "visibility", v ? "visible" : "hidden" ] ) );
}

function $swf( p )
{
	return elByTag( p || $d.body, "OBJECT" ).concat( elByTag( p || $d.body, "EMBED" ) );
}
/* MISC END */



/* IMAGE PRELOADING START */
function preload( s )
{
	// try/catch only needed because the 'new Image' breaks the vs2008-intellisense
	try
	{
		if( $un == typeof( pre ) )
		{
			pre = [];
		}
		var img = new Image();
		img.src = s;
		pre.push( img );
	}
	catch( e )
	{}
}
function PreLoadAnimations()
{
	var ba = [ "call.gif", "call-2.gif", "call-3.gif" ];
	if( CallMgr.IsLoggedIn )
	{
		ba.push( "send_1.png", "send_2.png", "send_3.png", "set_green_1.gif", "set_green_2.gif", "set_green_3.gif", "set_orange_1.png", "set_orange_2.png", "set_orange_3.png" );
	}
	
	for( var i = 0; i < ba.length; i++ )
	{
		preload( "/images/en/" + ba[i] );
	}
	
	var ia = [ "phone_1.gif", "phone_2.gif", "laeuten_1.gif", "ruhend_2.gif", "connect_call.gif", "call_globe.gif", "abheben_1.gif", "laeuten_2.gif", "abheben_2.gif", "active_call.gif", "auflegen_1.gif", "besetzt_1.gif", "besetzt_2.gif", "auflegen_2.gif" ];
	if( CallMgr.IsLoggedIn )
	{
		ia.push( "sms_1.gif", "sms_2.gif", "sms_call.gif" );
	}
	
	for( var i = 0; i < ia.length; i++ )
	{
		preload( "/images/animations/" + ia[i] );
	}
}
/* IMAGE PRELOADING END */



/* LOADING START */
function ShowLoader( css, container )
{
	var l = '<div' + ( null != css ? ' class="' + css + '"' : ' style="margin:6px 0px;"' ) + ' align="center"><div class="loading">loading</div></div>';
	if( container )
	{
		return $html( container, l );
	}
	else
	{
		$d.write(l);
	}
}
/* LOADING END */



/* LANGUAGE SELECTION START */
function LanguageMgr()
{
	this.timer = null;
	this.id = "langlist";
	this.opened = false;
}

LanguageMgr.prototype =
{
	Open : function()
	{
		if( this.opened )
		{
			return;
		}
		
		$show( this.id );
		this.opened = true;
		fade( el( this.id ), 0, 100, 10, 5, null );
	},
	
	Close : function()
	{
		fade( el( this.id ), 100, 0, 10, 5, ( function(){ $hide( this.id ); this.opened = false; } ).link( this ) );
	},
	
	MouseOut : function()
	{
		if( this.opened )
		{
			this.timer = this.Close.delay( 500, this );
		}
	},
	
	MouseOver : function()
	{
		if( null != this.timer )
		{
			window.clearTimeout( this.timer );
			this.timer = null;
		}
	}
}
var LangMgr = new LanguageMgr();
/* LANGUAGE SELECTION END */



/* AJAX HELPER START */
function ExecuteAjaxJS(t)
{
	var regex = new RegExp( "<script[^>]*>(.*?)</scr"+"ipt>", "gi" ),
	res;
	while( res = regex.exec(t) )
	{
		try
		{
			eval( RegExp.$1 );
		}
		catch( e )
		{
		}
	}
}
function CleanAjaxJS(t)
{
	return t.replace( new RegExp( "<script[^>]*>(.*?)</scr"+"ipt>", "gi" ), "" );
}
/* AJAX HELPER END */



/* MESSAGES START */
function $msg( msg, typ, line, link, cont )
{
	var html = ( line ? '<div class="cboxline">&nbsp;</div>' : '' ) + '<div class="content">{link}<table cellpadding="0" cellspacing="0" width="100%"><tr><td class="infoimg"><img src="/images/icons/{img}" width="25" height="25" alt="" /></td><td>' + ( /^(error|e)$/.test( typ ) ? '<div class="jbx info"><div><div class="tl"><div class="tr"><div class="tm"></div></div></div></div><div class="ml"><div class="mr"><div style="padding: 2px 8px;" class="m">{msg}</div></div></div><div><div class="bl"><div class="br"><div class="bm"></div></div></div></div></div>' : '<div class=\"infomsg\">{msg}</div>' ) + '</td></tr></table></div>',
	img;

	switch( typ )
	{
		case "error":
		case "e":
			img = "fehler.gif";
			break;
		case "jajah":
		case "j":
			img = "jajah.gif";
			break;
		case "buddy":
		case "b":
			img = "buddy.gif";
			break;
		case "info":
		case "i":
		default:
			img = "hinweis.gif";
			break;
	}
	
	var l = "";
	if( null != link && "" != link )
	{
		l = '<div style="float:right;"><b class="bluebtn-li">&nbsp;</b><a href="{href}" class="bluebtnlink">{name}</a><b class="bluebtn-re">&nbsp;</b></div>'.replace( /\{href\}/g,link.href ).replace( /\{name\}/g, link.name );
	}
	html = html.replace( /\{msg\}/g, msg ).replace( /\{img\}/g, img ).replace( /\{link\}/g, l );
	if( $un != typeof( cont ) && null != cont )
	{
		cont = el( cont );
		cont.innerHTML = html;
		cont.style.display = "";
	}
	return html;
}
/* MESSAGES END */



/* EVENTS START */
function ExecuteWhenLoaded( requiredobj, call, t )
{
	var exist = false;
	t = t || 250;
	
	try
	{
		exist = $un != typeof( eval( requiredobj ) );
	}
	catch(e)
	{
	}
	
	if( !exist )
	{
		ExecuteWhenLoaded.delay( t, null, requiredobj, call, t );
	}
	else
	{
		if( isFunction( call ) )
		{
			call();
		}
		else
		{
			eval( call );
		}
	}
}
function ExecuteWhenRendered( element, call )
{
	if( null == el( element ) )
	{
		ExecuteWhenRendered.delay( 250, null, element, call );
	}
	else
	{
		if( isFunction( call ) )
		{
			call();
		}
		else
		{
			eval( call );
		}
	}
}
function LoadScript( src, id )
{
	var script = el( id );
	if( null == script )
	{
		script = create( "SCRIPT" );
		if( $un != id )
		{
			script.id = id;
		}
	}
	else if( src == script[ "relsrc" ] )
	{
		return;
	}
	script.src = src;
	script[ "relsrc" ] = src;
	script.type = "text/javascript";
	elByTag( $d, "head" )[0].appendChild( script );
}
function AttachEvent( o, e, f )
{
	if( "submit" == e )
	{
		var f2 = o.onsubmit;
		
		if( isFunction( f2 ) )
		{
			o.onsubmit = function( e ){ f2(); f(); };
		}
		else
		{
			o.onsubmit = f;
		}
	}
	else if( o.addEventListener )
	{
		o.addEventListener( e, f, false );
	}
	else
	{
		o.attachEvent( "on" + e, f );
	}
}
function DetachEvent( o, e, f )
{
	if( o.removeEventListener )
	{
		o.removeEventListener( e, f, false );
	}
	else
	{
		o.detachEvent( "on" + e, f );
	}
}
function getEventSource( e )
{
	e = fixE( e );
	return e.target || e.srcElement;
}
function preventDefaultEvent( e )
{
	e = fixE( e );

	e.returnValue = false;

	stopBubble( e );

	if( e.preventDefault )
	{
		e.preventDefault();
	}
	return false;
}
function stopBubble( e )
{
	if( e.stopPropagation )
	{
		e.stopPropagation();
	}
	else if( $un != typeof( e.cancelBubble ) )
	{
		e.cancelBubble = true;
	}
}
function Notify( start, cid, nid ) // cid = content placeholder id, nid = notification placeholder id
{
	$notify = start;
	if( cid )
	{
		notifyDefContent = cid;
		notifyArea = nid;
	}
	if( start )
	{
		DisLinks();
		$show( notifyArea );
		$hide( notifyDefContent );
	}
	else if( $un != typeof( notifyArea ) )
	{
		$hide( notifyArea );
		$show( notifyDefContent );
	}
}
function DisLinks()
{
	var l = document.links;
	for( var i = 0, len = l.length; i < len; i++ )
	{
		if( $un != typeof( l[i].defOnClick ) )
		{
			continue;
		}
		
		l[i].defOnClick = l[i].onclick;
		l[i].onclick = function()
		{
			this.onclick = this.defOnClick;
			if( isFunction( this.onclick ) )
			{
				Notify( false );
				return this.onclick();
			}
		}
	}
}

function $track( url )
{
	try
	{
		if( window.GAT )
		{
			window.GAT._trackPageview( url );
		}
	}
	catch(ex)
	{
	}
}
/* EVENTS END */



/* FADING MANAGER START */
function FadeManager()
{
	this.container = null;
	this.step = 5;
	this.delay = 20;
	this.pause = 4000;
	this.index = 0;
	this.texts = [];
}

FadeManager.prototype =
{
	add : function( txt )
	{
		this.texts.push( txt );
	},

	transform : function()
	{
		this.index++;
		if( this.index >= this.texts.length )
		{
			this.index = 0;
		}
		this.fadeOut();
	},

	fadeOut : function()
	{
		fade( this.container, 100, 0, this.step, this.delay, ( function(){ this.fadeIn(); } ).link( this ) );
	},
	
	fadeIn : function()
	{
		this.container.innerHTML = this.texts[this.index];
		fade( this.container, 0, 100, this.step, this.delay, ( function(){ this.transform.delay( this.pause, this ) } ).link( this ) );
	}
};

function fade( o, as, ae, st, t, cb ) // object, alpha-start, alpha-end, step, time-delay, callback
{
	var na = as > ae ? as - st : as + st;	// new alpha
	if( !isArray( o ) )
	{
		o = [ o ];
	}
	for( var i = 0, len = o.length; i < len; i++ )
	{
		setOpacity( o[i], na );
	}
	if( ( ae < as && na <= ae ) || ( ae > as && na >= ae ) )
	{
		if( null != cb )
		{
			cb();
		}
	}
	else
	{
		fade.delay( t, this, o, na, ae, st, t, cb );
	}
}

function setOpacity( o, val )
{
	if ( 100 == val )
	{
		[ "opacity", "MozOpacity", "KhtmlOpacity", "filter" ].each( function( key )
		{
			if( o.style.removeProperty )
			{
				o.style.removeProperty( key );
			}
			else
			{
				o.style.removeAttribute( key, false );
			}
		});
	}
	else
	{
		o.style.opacity = ( val / 100 );
		o.style.MozOpacity = ( val / 100 );
		o.style.KhtmlOpacity = ( val / 100 );
		o.style.filter = "alpha(opacity=" + val + ")";
	}
	return o;
}
/* FADING MANAGER END */


/* TOOLTIP MANAGER START */

function ToolTipMgr()
{
	this.template = '<div class="tl"><div class="tr"><div class="tm">%t%</div></div></div><div class="ml"><div class="mr"><div class="m">%h%</div></div></div><div class="bl"><div class="br"><div class="bm">%tip%</div></div></div>';
	this.list = {};
	this.open = null;
	this.timer = null;
}

ToolTipMgr.prototype =
{
	Cfg : function( title, html, parent, tip, size, fade )
	{
		return {
			title:	 title,
			html:	 html,
			parent:	 parent,
			tip:	 tip,
			size:	 size,
			fade:	 fade
		};
	},
	
	Add : function( name, cfg )
	{
		this.list[ name ] =
		{
			title:	 cfg.title,
			html:	 cfg.html,
			parent:  cfg.parent,
			tip:	 { show : cfg.tip ? cfg.tip.show : false, xpos : cfg.tip ? ( cfg.tip.xpos ? cfg.tip.xpos : null ) : null },
			size:	 cfg.size,
			fade:	 cfg.fade,
			obj:	 null
		};
	},
	
	Show : function( name, cfg )
	{
		this.timer = ( function( name, cfg )
		{
			if( !this.list.hasKey( name ) )
			{
				if( !cfg )
				{
					return;
				}
				this.Add( name, cfg );
			}
			
			this.Draw( name );
		} ).delay( 300, this, name, cfg );
	},
	
	Hide : function( name )
	{
		if( this.timer != null )
		{
			window.clearTimeout( this.timer );
		}
		
		this.timer = ( function( name )
		{
			if( this.list.hasKey( name ) )
			{
				var tt = this.list[ name ];
				if( tt.fade )
				{
					fade( tt.obj, 100, 0, 4, 20, $hide.link( this, tt.obj ) );
				}
				else
				{
					$hide( tt.obj );
				}
			}
		} ).delay( 300, this, name );
	},
	
	Draw : function( name )
	{
		if( !this.list.hasKey( name ) )
		{
			return;
		}
		
		var tt = this.list[ name ];
		
		if( null != tt.obj )
		{
			if( !isVisible( tt.obj ) )
			{
				if( this.fade )
				{
					setOpacity( tt.obj, 0 );
				}
				
				$show( tt.obj );
				
				if( tt.fade )
				{
					fade( tt.obj, 0, 100, 4, 20, null );
				}
			}
			return;
		}
		
		var n = $class( create( "div" ), "bln" );

		n.innerHTML = this.template.replace( /%t%/, tt.title ).replace( /%h%/, tt.html ).replace( /%tip%/, tt.tip.show ? '<div class="tip"' + ( null != tt.tip.xpos ? ' style="left:' + tt.tip.xpos + 'px;"' : '' )  + '></div>' : '' );

		if( tt.size )
		{
			var s = GetKeys( tt.size );
			for( var k in s )
			{
				n.style[s[k]] = tt.size[s[k]] + "px";
			}
		}
		
		if( tt.tip.show )
		{
			n.style.paddingBottom = "12px";
		}
		
		tt.obj = n;
		
		if( tt.fade )
		{
			setOpacity( n, 0 );
		}
		
		el( tt.parent ).appendChild( n );
		
		if( tt.fade )
		{
			fade( n, 0, 100, 4, 20, null );
		}
		
		return n;
	}
};

var $TT = new ToolTipMgr();

/* TOOLTIP MANAGER END */



/* NEEDS TO BE REWRITTEN START */

/* TABSTRIP START */
function TabStripMgr()
{
    this.tabsList = [
		0,
		0,
		0,
		0
	];
    
    this.regTab = function( ix )
    {
		this.tabsList[ix] = 1;
	};
	
    this.nextTab = function( ix )
    {
		for( var i = ix + 1, len = this.tabsList.length; i < len; ++i )
		{
			if( 1 == this.tabsList[i] )
			{
				return i;
			}
		}
		return -1;
	};

	this.prevTab = function( ix )
	{
		for( var i = ix - 1; i >= 0; --i )
		{
			if( 1 == this.tabsList[i] )
			{
				return i;
			}
		}
		return -1;
	};

	this.init = function()
	{
		var tabObj;
		for( var i = 0; i < 4; ++i )
		{
			tabObj = el( "mytab" + i + "x1" );
			if( null != tabObj )
			{
				this.tabsList[i] = 1;
			}
		}
	};
}
function showMyTab( tabid )
{
	if (ClickOnTab==false && tabid!=4)
	{ 
	    var str = document.cookie;
	    ClickOnTab = true;
	    if (str.indexOf("tabClick")<0)
	    {
	      document.cookie="tabClick=true;Path=/members/";
	    }
	}
	if( tabid == myActiveTab )
	{
		return;
	}
	
	var c = elByTag( "MyTabContainer", "div" );
	
	for( var i = 0, len = c.length; i < len; i++ )
	{
		var id = c[i].id;
		if( $un != typeof( id ) && "MyTab" == id.substring( 0, 5 ) )
		{
			c[i].style.display = parseInt( id.substring( 5, id.length ) ) == tabid ? "" : "none";
		}
	}
	
	if( myActiveTab > -1 )
	{
		if( myActiveTab > 0 && -1 != TabStrip.prevTab( myActiveTab) ) //set the right gif of the previous tab
		{
			$class( "mytab" + TabStrip.prevTab( myActiveTab ) + "x3", "headtab2-r" );
		}
		$class( "mytab" + myActiveTab + "x1", "headtab2-l" );
		$class( "mytab" + myActiveTab + "x2", "headtab2" );
		$class( "mytab" + myActiveTab + "x3", "headtab2-r" );
		$hide( "tabText" + ( myActiveTab + 1 ) );
	}
	
	if( tabid > 0 && -1 != TabStrip.prevTab( tabid ) )
	{
		$class( "mytab" + TabStrip.prevTab( tabid ) + "x3", "headtab2" ); //set the right gif of the previous tab
	}
	$class( "mytab" + tabid + "x1", "headtab-l" );
	$class( "mytab" + tabid + "x2", "headtab" );
	$class( "mytab" + tabid + "x3", "headtab-r" );
	$show( "tabText" + ( tabid + 1 ) );
	myActiveTab = tabid;
}
/* TABSTRIP END */

/* NEEDS TO BE REWRITTEN END */

function sealMe( sID ) //Verisign Seal
{
	var div = el(sID);
	
	if( null != div )
	{
		var ifr = create( "iframe" ),
		q = "?l=" + $T( "l", "en" );
		ifr.id = sID + "_seal2";
		ifr.width = 100;
		ifr.height = 72;
		ifr.scrolling = "no";
		ifr.frameBorder = "0";
		ifr.style.border = "none";
		ifr.src = "https://secure.jajah.com/payment/verisign.html" + q;
		
		div.innerHTML = "";
		div.appendChild( ifr );
	}
}



/* MODAL START */
function Modal()
{
	this.timer = null;
	this.modals = [];
	this.OnWinResize = this.onresize.link( this );
	this.bg = "modalbg";
	this.useiframe = !!window.attachEvent;
	this.iframe = this.bg + "iframe";
	this.opacity = 65;
	this.$cached = {};
	this.cacheprefix = "mod__";
	this.OnShow = null;
}

Modal.prototype =
{
	DefaultLayout : function( b, w )
	{
		///<summary>Create default Layout, just the inner Body needs to be set</summary>
		///<param name="b" type="String">the inner HTML</param>
		///<param name="w" type="Number" integer="true" optional="true">width of the modal dialog</param>
		///<returns type="domElement">the default-styled modal dialog element</returns>
		
		var m = $class( create( "DIV" ), "defmodal" ),
		close = $html( $class( create( "DIV" ), "close" ), '<a href="#" onclick="$M.Close();return false;">Close</a>' ),
		body = $s( $html( create( "DIV" ), b ), "padding", "10px" );
		
		if( $un != typeof w )
		{
			$s( m, "width", w + "px" );
		}
		
		m.appendChild( close );
		m.appendChild( body );
		
		return m;
	},
	
	Create : function( body, fadein, replacelast, params )
	{
		this.CreateBg();
		
		var b = create( "DIV" );
		$class( b, "modal" );

		if( "string" == typeof body )
		{
			if( $un != typeof params && isObject( params ) )
			{
				var k = GetKeys( params );
				for( var i = 0, l = k.length; i < l; i++ )
				{
					var reg = new RegExp( "{" + k[i] + "}", "gi" );
					body = body.replace( reg, params[k[i]] );
				}
				body = body.replace( /{[^}]*}/g, "" );
			}
			b.innerHTML = body;
		}
		else
		{
			b.appendChild( body );
		}
		
		window.scrollTo( 0, 0 );
		togSWF( false );
		
		if( this.HasOpenModal() )
		{
			if( replacelast )
			{
				this.RemoveLast();
			}
			else	
			{
				$hide( this.modals[ this.modals.length - 1 ] );
			}
		}
		else
		{
			AttachEvent( window, "resize", this.OnWinResize );
		}
		
		if( $un == typeof fadein || fadein )
		{
			$d.body.appendChild( setOpacity( b, 0 ) );
			fade( b, 0, 100, 15, 8, null );
		}
		else
		{
			$d.body.appendChild( b );
		}
		
		this.modals.push( b );
		
		return this;
	},
	
	CreateBg : function()
	{
		if( null != el( this.bg ) )
		{
			if( !this.HasOpenModal() )
			{
				this.onresize();
			}
		}
		else
		{
			var o = create( "DIV" ),
			s = getPageSize();
			
			o.id = this.bg;
			o.style.width = s.pw + "px";
			o.style.height = s.ph + "px";
			
			var o2 = o.cloneNode( false );
			
			if( this.useiframe )
			{
				var i = create( "IFRAME" );
				i.src = "/blank.html";
				//i.border = i.frameBorder = "0";
				
				o2.id = this.iframe;
				o2.appendChild( i );
				$d.body.appendChild( setOpacity( o2, 0 ) );
			}
			
			$d.body.appendChild( setOpacity( o, this.opacity ) );
		}
	},
	
	HasOpenModal : function()
	{
		return this.modals.length > 0;
	},
	
	RemoveLast : function()
	{
		var box = this.modals.pop();
		$swf( box ).each( function( o ){ o.parentNode.removeChild( o ); } );
		box.parentNode.removeChild( box );
	},
	
	Close : function()
	{
		this.RemoveLast();
		if( this.HasOpenModal() )
		{
			$show( this.modals[ this.modals.length - 1 ] );
		}
		else
		{
			DetachEvent( window, "resize", this.OnWinResize );
			$hide( this.bg );
			$hide( this.iframe );
			togSWF( true );
		}
	},
	
	onresize : function()
	{
		if( null != this.timer )
		{
			window.clearTimeout( this.timer );
			this.timer = null;
		}
		
		var a = [ el( this.iframe ), el( this.bg ) ];
		if( null != a[1] )
		{
			this.timer = (function()
			{
				this.each( $hide );
				(function()
				{
					var s = getPageSize();
					for( var i = 0; i < 2; i++ )
					{
						if( null != this[i] )
						{
							this[i].style.width = s.pw + "px";
							this[i].style.height = s.ph + "px";
						}
					}
					this.each( $show );
				}).delay( 1, this );
			}).delay( 50, a );
		}
	},
	
	Load : function( n, s, params, replacelast )
	{
		///<summary>Loads a modal from the server</summary>
		///<param name="n" type="String">the modal identifier</param>
		///<param name="s" type="Boolean">if true it will be shown, otherwise just preloaded</param>

		$X.Get( $X.Url.Modal, "GetModal", { id : n, l : $T( "l", "en" ) }, this.GetResult.link( this, n, s, params, replacelast ), false ).Send();
	},
	
	GetResult : function( n, s, params, replacelast, re, ok )
	{
		if( ok && re.length > 0 )
		{
			this.$cached[ this.cacheprefix + n ] = re;
			
			if( s )
			{
				this.Show( n, params, replacelast );
			}
		}
	},
	
	Show : function( n, params, replacelast )
	{
		///<summary>Loads a modal from the server and shows it</summary>
		///<param name="n" type="String">the modal identifier</param>

		if( null == ( this.$cached[ this.cacheprefix + n ] || null ) )
		{
			return this.Load( n, true, params, replacelast );
		}
		
		this.Create( this.$cached[ this.cacheprefix + n ], null, replacelast, params );
		
		if( null != this.OnShow )
		{
			try
			{
				this.OnShow();
			}
			catch(ex)
			{
				$Log(ex);
			}
			this.OnShow = null;
		}
	}
};

var $M = new Modal();

function LoadCSS( src )
{
	var script = create( "LINK" );
	script.href = src;
	script.rel = "stylesheet";
	script.type = "text/css";
	elByTag( $d, "head" )[0].appendChild( script );
}


function getPageSize(){
	
	var xScroll,
	yScroll,
	windowWidth,
	windowHeight;
	
	if (window.innerHeight && window.scrollMaxY)
	{	
		xScroll = window.innerWidth + window.scrollMaxX;
		yScroll = window.innerHeight + window.scrollMaxY;
	}
	else if( $d.body.scrollHeight > $d.body.offsetHeight) // all but Explorer Mac
	{
		xScroll = $d.body.scrollWidth;
		yScroll = $d.body.scrollHeight;
	}
	else // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
	{
		xScroll = $d.body.offsetWidth;
		yScroll = $d.body.offsetHeight;
	}
	
	if( self.innerHeight )	// all except Explorer
	{
		windowWidth = $d.documentElement.clientWidth ? document.documentElement.clientWidth : self.innerWidth;
		windowHeight = self.innerHeight;
	}
	else if( $d.documentElement && $d.documentElement.clientHeight ) // Explorer 6 Strict Mode
	{
		windowWidth = $d.documentElement.clientWidth;
		windowHeight = $d.documentElement.clientHeight;
	}
	else if( $d.body ) // other Explorers
	{
		windowWidth = $d.body.clientWidth;
		windowHeight = $d.body.clientHeight;
	}
	
	return {
		pw : ( xScroll < windowWidth ? xScroll : windowWidth ),
		ph : ( yScroll < windowHeight ? windowHeight : yScroll ),
		ww : windowWidth,
		wh : windowHeight
	};
}

/* MODAL END */



/* sove IE background-image flicker bug */
try
{
	document.execCommand( "BackgroundImageCache", false, true );
}
catch(e)
{
}


/* ON PAGE INIT */

function BaseInit()
{
	// Update Language-Dropdown links with current querystring
	var q = window.location.search.replace(/(\?l=[^&]*&?)|(&l=[^&]*)/, "");
	if( /[?&]/.test(q[0]) )
	{
		q = q.substr(1);
	}
	
	if( "" != q )
	{
		elByTag( "langlist", "A" ).each
		(
			function( a )
			{
				a.href = a.search + "&" + q;
			}
		);
	}
	
	// Update TopNavigation to enable pressed button state
	elByTag( "mainnav", "A" ).each( function( a )
	{
		AttachEvent( a, "mousedown", $press.link( a, a ) );
	} );
	
	/*
	// Remove "index.aspx" from the form action (just cosmetics)
	elByTag( $d, "FORM" ).each
	(
		function( f )
		{
			var a = f.action;
			try
			{
				if( a.startsWith( "index.aspx" ) )
				{
					f.action = "./" + a.substr( 10 );
				}
				else
				{
					f.action = a.replace( /^([^?]+)(index.aspx(?=(\?)|([^?]*$))(.*)?)/i, "$1$5" );
				}
			}
			catch( ex )
			{
				f.action = a;
			}
		}
	);*/
}

function $press( a )
{
	( function(){ this.blur() } ).delay( 1, a );
	if( !$disabled( a ) )
	{
		a.className = "pressed";
		[ "mouseup", "mouseout" ].each( function( e )
			{
				AttachEvent( this, e, $unpress.link( this ) );
			}, a
		);
	}
}

function $unpress()
{
	$class( this, "" );
	/* needs to be fixed, doesn't work anyways --> Event-Observer-Pattern !!!
	[ "mouseup", "mouseout" ].each( function( e )
		{
			DetachEvent( this, e, $unpress );
		}, this
	);
	*/
}

function $disable( o )
{
	o = el( o );
	if( o.tagName == "A" )
	{
		o = o.parentNode;
	}
	setOpacity( o, 33 );
	$class( elByTag( o, "A" )[ 0 ], "btndisabled" );
}

function $disabled( a )
{
	return /btndisabled/i.test( a.className );
}

function $enable( o )
{
	elByTag( o, "a" ).each( function( a )
		{
			setOpacity( a.parentNode, 100 );
			$class( a, "" );
		}
	);
}

function getElementsByClassName(className, tag, elm) {
    var testClass = new RegExp("(^|\\\\s)" + className + "(\\\\s|$)");
    var tag = tag || "*";
    var elm = elm || document;
    var elements = (tag == "*" && elm.all) ? elm.all : elm.getElementsByTagName(tag);
    var returnElements = [];
    var current;
    var length = elements.length;
    for (var i = 0; i < length; i++) {
        current = elements[i];
        if (testClass.test(current.className)) {
            returnElements.push(current);
        }
    }
    return returnElements;
}

function SetGrayText(id, s, col) {
    var inpt = el(id);
    if ($un == typeof col) col = "#838383";
    inpt.data = s;
    //inpt.isPass = (inpt.type == "password");
    AttachEvent(inpt, "focus", function() { focus.call(inpt); });
    AttachEvent(inpt, "blur", function() { blur.call(inpt); });
    blur.call(inpt);

    function focus() {
        if (this.value == this.data) {
            //if (this.isPass) inpt.type = "password";
            this.value = "";
        }
        $s(this, "color", "");
    }
    function blur() {
        if (this.value.length == 0 || this.value == this.data) {
            $s(this, "color", col);
            //if (this.isPass) inpt.type = "text";
            this.value = this.data;
        }
    }
}

function TZMgr( f, c, l)
{
	this.brOff = -new Date().getTimezoneOffset();
	this.usrOff = null;
	this.cont = c;
	this.list = l;
	this.first = !f;
}

TZMgr.prototype =
{
	start : function()
	{
		if(this.list != null && this.list.selectedIndex > -1 && this.list.options[this.list.selectedIndex].defaultSelected)
		{
			this.usrOff = this.list.value;
		}
		else
		{
			this.usrOff = this.brOff;
			if( null != this.list )
		    {
		    	this.list.value = this.usrOff;
		    }
		}
		window.setInterval( this.timer.link( this ), 1000 );
	},
	
	timer : function()
	{
		if(this.cont != null)
		{
			var parsed = new Date( new Date().getTime() + ( this.usrOff - this.brOff ) * 60000 ).toLocaleTimeString();
			this.cont.innerHTML = parsed.indexOf( " GMT" ) > -1 ? parsed.substr( 0, parsed.indexOf( " GMT" ) ) : parsed;
		}
	},
	
	update:function( v )
	{
		this.usrOff = v;
		this.timer();
	}
};

/**
 * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
if(typeof deconcept == "undefined") var deconcept = new Object();
if(typeof deconcept.util == "undefined") deconcept.util = new Object();
if(typeof deconcept.SWFObjectUtil == "undefined") deconcept.SWFObjectUtil = new Object();
deconcept.SWFObject = function(swf, id, w, h, ver, c, quality, xiRedirectUrl, redirectUrl, detectKey) {
	if (!document.getElementById) { return; }
	this.DETECT_KEY = detectKey ? detectKey : 'detectflash';
	this.skipDetect = deconcept.util.getRequestParameter(this.DETECT_KEY);
	this.params = new Object();
	this.variables = new Object();
	this.attributes = new Array();
	if(swf) { this.setAttribute('swf', swf); }
	if(id) { this.setAttribute('id', id); }
	if(w) { this.setAttribute('width', w); }
	if(h) { this.setAttribute('height', h); }
	if(ver) { this.setAttribute('version', new deconcept.PlayerVersion(ver.toString().split("."))); }
	this.installedVer = deconcept.SWFObjectUtil.getPlayerVersion();
	if (!window.opera && document.all && this.installedVer.major > 7) {
		// only add the onunload cleanup if the Flash Player version supports External Interface and we are in IE
		deconcept.SWFObject.doPrepUnload = true;
	}
	if(c) { this.addParam('bgcolor', c); }
	var q = quality ? quality : 'high';
	this.addParam('quality', q);
	this.setAttribute('useExpressInstall', false);
	this.setAttribute('doExpressInstall', false);
	var xir = (xiRedirectUrl) ? xiRedirectUrl : window.location;
	this.setAttribute('xiRedirectUrl', xir);
	this.setAttribute('redirectUrl', '');
	if(redirectUrl) { this.setAttribute('redirectUrl', redirectUrl); }
}
deconcept.SWFObject.prototype = {
	useExpressInstall: function(path) {
		this.xiSWFPath = !path ? "expressinstall.swf" : path;
		this.setAttribute('useExpressInstall', true);
	},
	setAttribute: function(name, value){
		this.attributes[name] = value;
	},
	getAttribute: function(name){
		return this.attributes[name];
	},
	addParam: function(name, value){
		this.params[name] = value;
	},
	getParams: function(){
		return this.params;
	},
	addVariable: function(name, value){
		this.variables[name] = value;
	},
	getVariable: function(name){
		return this.variables[name];
	},
	getVariables: function(){
		return this.variables;
	},
	getVariablePairs: function(){
		var variablePairs = new Array();
		var key;
		var variables = this.getVariables();
		
		for(key in variables){
			if( variables.hasOwnProperty( key ) )
			{
				variablePairs[variablePairs.length] = key +"="+ variables[key];
			}
		}
		
		return variablePairs;
	},
	getSWFHTML: function() {
		var swfNode = "";
		if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) { // netscape plugin architecture
			if (this.getAttribute("doExpressInstall")) {
				this.addVariable("MMplayerType", "PlugIn");
				this.setAttribute('swf', this.xiSWFPath);
			}
			swfNode = '<embed type="application/x-shockwave-flash" src="'+ this.getAttribute('swf') +'" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'" style="'+ this.getAttribute('style') +'"';
			swfNode += ' id="'+ this.getAttribute('id') +'" name="'+ this.getAttribute('id') +'" ';
			var params = this.getParams();
			 for(var key in params){
				if( params.hasOwnProperty( key ) )
				{
					swfNode += [key] +'="'+ params[key] +'" '; 
				}
			}
			var pairs = this.getVariablePairs().join("&");
			 if (pairs.length > 0){ swfNode += 'flashvars="'+ pairs +'"'; }
			swfNode += '/>';
		} else { // PC IE
			if (this.getAttribute("doExpressInstall")) {
				this.addVariable("MMplayerType", "ActiveX");
				this.setAttribute('swf', this.xiSWFPath);
			}
			swfNode = '<object id="'+ this.getAttribute('id') +'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'" style="'+ this.getAttribute('style') +'">';
			swfNode += '<param name="movie" value="'+ this.getAttribute('swf') +'" />';
			var params = this.getParams();
			for(var key in params) {
				if( params.hasOwnProperty( key ) )
				{
					swfNode += '<param name="'+ key +'" value="'+ params[key] +'" />';
				}
			}
			var pairs = this.getVariablePairs().join("&");
			if(pairs.length > 0) {swfNode += '<param name="flashvars" value="'+ pairs +'" />';}
			swfNode += "</object>";
		}
		return swfNode;
	},
	write: function(elementId){
		if(this.getAttribute('useExpressInstall')) {
			// check to see if we need to do an express install
			var expressInstallReqVer = new deconcept.PlayerVersion([6,0,65]);
			if (this.installedVer.versionIsValid(expressInstallReqVer) && !this.installedVer.versionIsValid(this.getAttribute('version'))) {
				this.setAttribute('doExpressInstall', true);
				this.addVariable("MMredirectURL", escape(this.getAttribute('xiRedirectUrl')));
				document.title = document.title.slice(0, 47) + " - Flash Player Installation";
				this.addVariable("MMdoctitle", document.title);
			}
		}
		if(this.skipDetect || this.getAttribute('doExpressInstall') || this.installedVer.versionIsValid(this.getAttribute('version'))){
			var n = (typeof elementId == 'string') ? document.getElementById(elementId) : elementId;
			n.innerHTML = this.getSWFHTML();
			return true;
		}else{
			if(this.getAttribute('redirectUrl') != "") {
				document.location.replace(this.getAttribute('redirectUrl'));
			}
		}
		return false;
	}
}

/* ---- detection functions ---- */
deconcept.SWFObjectUtil.getPlayerVersion = function(){
	var PlayerVersion = new deconcept.PlayerVersion([0,0,0]);
	if(navigator.plugins && navigator.mimeTypes.length){
		var x = navigator.plugins["Shockwave Flash"];
		if(x && x.description) {
			PlayerVersion = new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split("."));
		}
	}else if (navigator.userAgent && navigator.userAgent.indexOf("Windows CE") >= 0){ // if Windows CE
		var axo = 1;
		var counter = 3;
		while(axo) {
			try {
				counter++;
				axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+ counter);
//				document.write("player v: "+ counter);
				PlayerVersion = new deconcept.PlayerVersion([counter,0,0]);
			} catch (e) {
				axo = null;
			}
		}
	} else { // Win IE (non mobile)
		// do minor version lookup in IE, but avoid fp6 crashing issues
		// see http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/
		try{
			var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		}catch(e){
			try {
				var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
				PlayerVersion = new deconcept.PlayerVersion([6,0,21]);
				axo.AllowScriptAccess = "always"; // error if player version < 6.0.47 (thanks to Michael Williams @ Adobe for this code)
			} catch(e) {
				if (PlayerVersion.major == 6) {
					return PlayerVersion;
				}
			}
			try {
				axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			} catch(e) {}
		}
		if (axo != null) {
			PlayerVersion = new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));
		}
	}
	return PlayerVersion;
}
deconcept.PlayerVersion = function(arrVersion){
	this.major = arrVersion[0] != null ? parseInt(arrVersion[0]) : 0;
	this.minor = arrVersion[1] != null ? parseInt(arrVersion[1]) : 0;
	this.rev = arrVersion[2] != null ? parseInt(arrVersion[2]) : 0;
}
deconcept.PlayerVersion.prototype.versionIsValid = function(fv){
	if(this.major < fv.major) return false;
	if(this.major > fv.major) return true;
	if(this.minor < fv.minor) return false;
	if(this.minor > fv.minor) return true;
	if(this.rev < fv.rev) return false;
	return true;
}
/* ---- get value of query string param ---- */
deconcept.util = {
	getRequestParameter: function(param) {
		var q = document.location.search || document.location.hash;
		if (param == null) { return q; }
		if(q) {
			var pairs = q.substring(1).split("&");
			for (var i=0; i < pairs.length; i++) {
				if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
					return pairs[i].substring((pairs[i].indexOf("=")+1));
				}
			}
		}
		return "";
	}
}
/* fix for video streaming bug */
deconcept.SWFObjectUtil.cleanupSWFs = function() {
	var objects = document.getElementsByTagName("OBJECT");
	for (var i = objects.length - 1; i >= 0; i--) {
		objects[i].style.display = 'none';
		for (var x in objects[i]) {
			if (typeof objects[i][x] == 'function') {
				objects[i][x] = function(){};
			}
		}
	}
}
// fixes bug in some fp9 versions see http://blog.deconcept.com/2006/07/28/swfobject-143-released/
if (deconcept.SWFObject.doPrepUnload) {
	if (!deconcept.unloadSet) {
		deconcept.SWFObjectUtil.prepUnload = function() {
			__flash_unloadHandler = function(){};
			__flash_savedUnloadHandler = function(){};
			window.attachEvent("onunload", deconcept.SWFObjectUtil.cleanupSWFs);
		}
		window.attachEvent("onbeforeunload", deconcept.SWFObjectUtil.prepUnload);
		deconcept.unloadSet = true;
	}
}
/* add document.getElementById if needed (mobile IE < 5) */
if (!document.getElementById && document.all) { document.getElementById = function(id) { return document.all[id]; }}

/* add some aliases for ease of use/backwards compatibility */
var getQueryParamValue = deconcept.util.getRequestParameter;
var FlashObject = deconcept.SWFObject; // for legacy support
var SWFObject = deconcept.SWFObject;


