var php = [
'You must have (session) cookies enabled in order to view this site',
'Invalid event count',
'Invalid event time',
'Invalid DutchPIPE XML (2), tagname:',
'/',
'Invalid DutchPIPE XML (1), tagname:',
'inventory',
'close',
'http://www.cute-factor.com/',
'dpclient.php'];
function fix_dpimages() { }
var loc = '',
cur_loc = null,
event_count,
event_time,
has_started = false,
scriptid,
getstr = '',
standalone = false,
warned_nocookies = false,
seq = 0,
am_mouse_x,
am_mouse_y,
am_level,
am_levels,
am_checksum = 0,
am_start = 0,
am_no_close = false,
am_target_over = null,
am_target_out = null,
am_y_mod = 0,
action_history,
remote_history = 0,
action_index = null,
action_cur = null,
action_count = 0,
cur_menu_item = null,
has_formfocus = 0,
options_open,
sb_width = 0,
alive_err = 0;
function send_alive2server(firstcall, calltime, getdivs)
{
jQuery.ajax({
data: 'location=' + encodeURIComponent(loc + getstr) + '&scriptid='
+ (firstcall || (new Date().getTime() - calltime > 2300) ? 0
: scriptid)
+ (getdivs && getdivs != '' ? '&getdivs='
+ encodeURIComponent(getdivs) : '')
+ '&username='
+ (standalone ? '&standalone=true' + (firstcall ? '&title='
+ encodeURIComponent(jQuery('title').html()) : '') : '') + '&seq='
+ seq + _arnd(),
success: function(msg) {
alive_err = 0;
if (handle_response(msg)) {
seq++;
setTimeout('send_alive2server(false, ' + (new Date().getTime())
+ ', "")', 2000);
}
},
error: function(requestOb,msg) {
// no error handling for first call yet
if (seq && alive_err < 3) {
seq++;
alive_err++;
send_alive2server(false, (new Date().getTime()), '');
}
}
});
}
function send_action2server(dpaction, cmdline)
{
jQuery.ajax({
data: 'location=' + encodeURIComponent(loc + getstr) + '&scriptid='
+ scriptid + (standalone ? '&standalone=true' : '')
+ '&seq=' + seq + _arnd()
+ '&username='
+ '&dpaction=' + encodeURIComponent(dpaction)
+ (!cmdline ? '&menuaction=1' : '&cmdline=1')
});
}
function _get_actions_init(event, args)
{
if (event.pageX) {
am_mouse_x = event.pageX;
am_mouse_y = event.pageY;
} else {
am_mouse_x = event.clientX + gbody().scrollLeft - 2;
am_mouse_y = event.clientY + gbody().scrollTop - 2;
}
if (am_mouse_x < 0)
am_mouse_x = 0;
if (am_mouse_y < 0)
am_mouse_y = 0;
am_checksum++;
am_start = new Date();
}
function get_actions(id, event)
{
var lvls = '';
var i;
am_level = arguments.length - 2;
am_levels = new Array(am_level);
for (i = 1; i <= am_level; i++) {
lvls += '&l' + i + '=' + arguments[i + 1];
am_levels[i - 1] = arguments[i + 1];
}
_get_actions_init(event);
jQuery.ajax({
data: 'call_object=' + encodeURIComponent(id) + '&method=getActionsMenu'
+ _arnd() + lvls + '&checksum=' + am_checksum
});
}
function get_map_area_actions(map_name, map_area_id, id, event)
{
var lvls = '';
var i;
am_level = arguments.length - 4;
am_levels = new Array(am_level);
for (i = 1; i <= am_level; i++) {
lvls += '&l' + i + '=' + encodeURIComponent(arguments[i + 3]);
am_levels[i - 1] = encodeURIComponent(arguments[i + 3]);
}
_get_actions_init(event);
jQuery.ajax({
data: 'call_object=' + encodeURIComponent(id)
+ '&method=getActionsMenu&map_name=' + encodeURIComponent(map_name)
+ '&map_area_id=' + encodeURIComponent(map_area_id) +_arnd()
+ lvls + '&checksum=' + am_checksum
});
}
function action_over(el)
{
var target;
target = jQuery.trim(jQuery(el).text());
if (target == am_target_over)
return false;
if (am_target_out) {
jQuery(am_target_out).removeClass('am_selected');
if (jQuery('span.am_icon', am_target_out).attr('id'))
jQuery('span.am_icon > img', am_target_out).attr('src',
jQuery('span.am_icon', am_target_out).attr('id'));
am_target_out = cur_menu_item = null;
}
am_target_over = target;
if (cur_menu_item == el)
return false;
cur_menu_item = el;
if (am_level != undefined && am_levels != undefined) {
var lvl = jQuery(el).attr('id');
lvl = parseInt(lvl.substring(11));
if (lvl != am_level) {
var regExp = /<\/?[^>]+>/gi;
if (jQuery(el).text() != am_levels[lvl].replace(regExp,"")) {
jQuery('div[@id=action_menu' + lvl + '].am_deep_selected').
removeClass('am_deep_selected am_selected am_deep_selected_ghosted');
while (jQuery('div#am_div' + (lvl + 1)).length) {
jQuery('div#am_div' + (lvl + 1)).remove();
lvl++;
}
}
}
}
jQuery(el).addClass('am_selected');
am_over = true;
return true;
}
function handle_response(response)
{
if (warned_nocookies || response == null || response == undefined) {
return false;
}
if (typeof(response) == 'string') {
if (response == '1')
return true;
if (response == '2') {
if (seq > 1) {
//window.location.reload(); //00christian00 removed reload
}
else {
warned_nocookies = true;
//00christian00 temp disabled document.body.innerHTML = '
' + php[0] + ';' + seq + '
';
}
}
//alert(response);
return false;
}
if (response.responseXML != null)
response = response.responseXML;
if (response.parseError != null
&& response.parseError.errorCode != null
&& response.parseError.errorCode != 0) {
return false;
}
var response2 = response.documentElement;
if (response2 == undefined) {
return false;
}
for (var i = 0; i < response2.childNodes.length ; i++) {
//if (jQuery(response2.childNodes[i]).text() != '')
handle_dp_element(response2.childNodes[i]);
}
if (window.init_drag)
init_drag();
return true;
}
function handle_dp_element(el)
{
switch(el.tagName) {
case 'event':
var e_count = parseInt(jQuery(el).attr('count'));
var e_time = parseInt(jQuery(el).attr('time'));
if (event_count != null && event_count != -1
&& event_count >= e_count) {
/*
alert(php[1] + ' ' + event_count
+ ' (received ' + e_count + '): ' + jQuery(el).text());
window.location.reload();
*/
return;
} else
event_count = e_count;
if (event_time != null && event_time != -1 && event_time > e_time) {
/*
alert(php[2] + ' ' + event_time
+ ' (received ' + e_count + '): ' + jQuery(el).text());
window.location.reload();
*/
return;
} else
event_time = e_time;
for (var j = 0; j < el.childNodes.length; j++)
handle_dp_event(el.childNodes[j]);
break;
case 'location':
this.location = jQuery(el).text();
return;
default:
/*
if (jQuery(el).text() != '1')
alert(php[3] + el.tagName);
*/
break;
}
}
function handle_dp_event(el)
{
var id = jQuery(el).attr('id');
switch(el.tagName) {
case 'location':
this.location = jQuery(el).text();
return;
case 'div':
var tmp = jQuery(el).text();
var pos = tmp.indexOf('');
if (pos != -1 && pos == 0) {
tmp = tmp.substring(pos + 17);
tmp = tmp.substring(0,tmp.length - 6);
}
var newdiv = jQuery(document.createElement("DIV")).attr('id', id).
html(tmp).css('z-index', 5);
var olddiv = jQuery('#' + id);
if (!olddiv.length) {
jQuery(document.body).append(newdiv);
if (id == 'dpinventory' || id == 'dpmessagearea')
newdiv.css('position', 'relative');
} else {
zindex = olddiv.css('z-index');
olddiv.css('display', 'none').before(newdiv).remove();
if (!isNaN(zindex))
newdiv.css('z-index', zindex);
}
fix_dpimages();
if ('dpinput_wrap' == id && jQuery('#dpinput[input]').length)
gototop(null,true);
break;
case 'message':
var message;
var messagediv;
message = jQuery(el).text();
if (message == 'close_window') {
//this.location = php[4] + 'dpmultiplewindows.txt';
return;
}
messagediv = _gel('messages');
if (!jQuery('.dpmsgtop').length)
jQuery(messagediv).before('
');
jQuery(messagediv).css('display', 'block');
if (messagediv.childNodes.length == 16)
jQuery(messagediv).css({ height: jQuery(messagediv).height() + 'px',
overflow: 'auto' });
while (messagediv.childNodes.length >= 500)
messagediv.removeChild(messagediv.childNodes[0]);
jQuery(messagediv).append('
' + message + '
');
messagediv.scrollTop = messagediv.scrollHeight;
break;
case 'actions':
make_amenu(el);
break;
case 'script':
if (jQuery(el).attr('src')) {
jQuery.getScript(jQuery(el).attr('src'));
break;
}
var tag = document.createElement("script");
tag.setAttribute('type','text/javascript');
if (el.textContent)
tag.textContent = el.textContent;
else if (el.text)
tag.text = el.text;
document.getElementsByTagName('head')[0].appendChild(tag);
break;
case 'stylesheet':
jQuery(document.createElement('link')).attr({ type: 'text/css', rel:
'stylesheet', href: jQuery(el).attr('href'), media: 'screen' }).
appendTo(jQuery('head'));
break;
case 'removeDpElement':
jQuery('#' + id).remove();
update_dpinv();
break;
case 'addDpElement':
if (jQuery('#' + jQuery(el).attr('where')).length) {
jQuery('#' + id).remove();
var added = jQuery(document.createElement("div")).
attr('id', jQuery(el).attr('id')).addClass(jQuery(el).
attr('class')).html(jQuery(el).text()).
appendTo(jQuery('#' + jQuery(el).attr('where')));
if (jQuery(el).attr('css')) {
var style = jQuery(el).attr('css').split(';');
for (var i = 0, len=style.length, css; i < len; ++i) {
css = style[i].split(':');
added.css(jQuery.trim(css[0]), jQuery.trim(css[1]));
}
}
update_dpinv();
}
fix_dpimages();
break;
case 'changeDpElement':
var t = 'div[@id=' + id + ']';
jQuery('dppage_body' == id ? t : t + '[@class^=title_img],' + t
+ '[@class^=dpobject]').html(jQuery(el).text());
fix_dpimages();
break;
case 'moveDpElement':
jQuery('#' + id).removeClass().remove().clone().attr('id', id).
addClass(jQuery(el).attr('class')).appendTo(jQuery('#' + jQuery(el).
attr('where')));
break;
case 'window':
var delay = jQuery(el).attr('delay');
if (!delay)
make_dpwindow(jQuery(el).text(), jQuery(el).attr('autoclose'),
jQuery(el).attr('styleclass'), jQuery(el).attr('name'));
else
setTimeout('make_dpwindow(' + check_val(jQuery(el).text()) + ', '
+ check_val(jQuery(el).attr('autoclose')) + ', '
+ check_val(jQuery(el).attr('styleclass')) + ', '
+ check_val(jQuery(el).attr('name')) + ')', parseInt(delay));
fix_dpimages();
break;
case 'refreshDpWindow':
if (jQuery('div[@name=' + jQuery(el).attr('name') + ']').length)
send_action2server(jQuery(el).attr('action'));
break;
case 'reportmove':
var ob = jQuery('#' + id).get(0);
jQuery(ob).
css({
left: ob.offsetLeft + 'px',
top: ob.offsetTop + 'px'
}).
animate({
left: parseInt(jQuery(el).attr('left')),
top: parseInt(jQuery(el).attr('top'))
});
break;
case 'history':
insert_history(el);
break;
default:
break;
/*
if (jQuery(el).text() != '1')
alert(php[5] + el.tagName);
*/
}
}
function check_val(val)
{
return undefined == val || null == val ? val
: "'" + val.replace(/\'/g,'\\\'') + "'";
}
function update_dpinv()
{
if (jQuery('div[@id=dpobinv]/div[@id=dpobinv_inner1]').length)
send_action2server(php[6]);
}
function wheight()
{
return (jQuery.browser.mozilla || jQuery.browser.opera)
&& dwidth() > self.innerWidth ? self.innerHeight - sbwidth()
: self.innerHeight || jQuery.boxModel
&& document.documentElement.clientHeight || document.body.clientHeight;
}
function dheight()
{
Math.max(document.body.scrollHeight, document.body.offsetHeight);
}
function wwidth()
{
return (jQuery.browser.mozilla || jQuery.browser.opera)
&& dheight() > self.innerHeight ? self.innerWidth - sbwidth()
: self.innerWidth || jQuery.boxModel
&& document.documentElement.clientWidth || document.body.clientWidth;
}
function dwidth()
{
if (!jQuery.browser.mozilla)
return Math.max(document.body.scrollWidth, document.body.offsetWidth);
var l = self.pageXOffset;
self.scrollTo(9999999, self.pageYOffset);
var w = self.pageXOffset;
self.scrollTo(l, self.pageYOffset);
return document.body.offsetWidth + w;
}
function sbwidth()
{
if (sb_width)
return sb_width;
var el = jQuery('
').css({ width: 100, height: 100, overflow: 'auto',
position: 'absolute', top: -999, left: -999 }).appendTo('body');
sb_width = 100 - el.append('
').find('div').css({ width: '100%',
height: 200 }).width();
el.remove();
return sb_width;
};
function scrtop()
{
return jQuery.boxModel && document.documentElement.scrollTop ||
document.body.scrollTop;
}
function make_amenu(el)
{
var level = parseInt(jQuery(el).attr('level'));
if (am_checksum !== parseInt(jQuery(el).attr('checksum'))
|| jQuery('div#action_menu' + level).length)
return;
var div_id = 'div[@id=action_menu' + (level - 1) + ']';
var indx = jQuery(div_id + '.am').index(jQuery(div_id
+ '.am_deep_selected')[0]);
if (level && indx == -1)
return;
var e = jQuery('div#am_div' + (level - 1));
var lft = !level ? (am_mouse_x-11) : parseInt(e.css('left')) + e.width()
- 5;
var tp = !level ? (am_mouse_y-13) : parseInt(e.css('top')) + (16 * indx);
var amenu = jQuery(document.createElement("div")).attr('id', 'am_div'
+ level). addClass('actionwindow').html(jQuery(el).text()).
css({ left: '0px', top: '0px' });
amenu.appendTo(document.body);
if (!(jQuery.browser.msie && 6 == parseInt(jQuery.browser.version)))
jQuery('div.am').css('height', (parseInt(jQuery('div.am').
css('line-height'))) + 'px');
var zindex = parseInt(amenu.css('z-index'));
amenu.css({ zIndex: -1, visiblity: 'hidden', display: 'block'});
var w = amenu.get(0).clientWidth;
var highlight = 'first';
if (tp + (6 + 16 * jQuery('.am', amenu).length) - scrtop() > wheight()) {
tp = tp - (6 + 16 * jQuery('.am', amenu).length) + 22 + am_y_mod;
am_y_mod = 0;
highlight = 'last';
}
var w2 = !level ? '-' : e.get(0).clientWidth;
if (w < 96)
w = 96;
else if (w > 200)
w = 200;
if (lft + w + 15 > wwidth()) {
lft = lft - w - (!level ? -21 : w2 - 5);
}
amenu.css({
display: 'none',
visiblity: 'visible',
zIndex: (isNaN(zindex) ? 7 : zindex),
width: w + 'px',
left: lft + 'px',
top: tp + 'px'
});
var stop = new Date();
var menu_delay = 365 - (stop.getTime() - am_start.getTime());
if (jQuery.browser.msie) {
msie_opacfix(amenu);
if (6 == parseInt(jQuery.browser.version))
jQuery('span.am_submenu').remove();
}
if (!level) {
e = jQuery('div[@class=actionwindow_inner]/div:' + highlight,
amenu);
var e2 = jQuery('div[@class=actionwindow_inner]/div[@class=am]:'
+ highlight, amenu);
if (e2.length && e.get(0) == e2.get(0)) {
jQuery(e).addClass('am_selected');
am_target_out = e;
} else
jQuery(e).addClass('am_deep_selected');
if (jQuery('span.am_icon', e).length
&& jQuery('span.am_icon', e).attr('id'))
jQuery('span.am_icon > img', e).attr('src',
jQuery('span.am_icon', e).attr('id'));
}
if (!level || menu_delay <= 0) {
amenu.css('display', 'block');
} else
setTimeout("jQuery('div#am_div" + level + "').css('display', 'block')",
menu_delay);
}
function open_options(ob,e)
{
if (options_open)
return;
close_amenu();
options_open = true;
_get_actions_init(e);
am_mouse_x = getleft(ob) + 3 + (jQuery.browser.msie ? 1 : 0);
am_mouse_y = gettop(ob) + 26
+ (jQuery.browser.msie || jQuery.browser.safari ? 1 : 0);
if (am_mouse_y + 44 - scrtop() > wheight())
am_y_mod = -35;
jQuery.ajax({ data: 'call_object=' + encodeURIComponent(
jQuery('div[@id=dpinventory] div[@class=dpinventory2]').
attr('id')) + '&method=getInputAreaOptions' + _arnd() + '&checksum='
+ am_checksum });
}
function make_dpwindow(text, autoclose, styleclass, name)
{
close_dpwindow(styleclass == null ? null : styleclass);
var win = document.createElement("DIV");
var zindex = false;
if (jQuery('#dpwindow:last').length)
zindex = parseInt(jQuery('#dpwindow:last').css('z-index')) + 1;
jQuery(win).attr({ id: 'dpwindow', name: (!name ? '' : name) }).
addClass(null == styleclass ? 'dpwindow_default' : styleclass);
if (autoclose == null)
jQuery(win).html(text + '
'
+ ''
+ php[7] + '
');
else {
jQuery(win).html(text);
setTimeout('close_dpwindow(' + (styleclass == null ? ''
: "'" + styleclass + "'") + ')', autoclose);
}
jQuery(jQuery('body')[0].firstChild).before(win);
jQuery(win).css({ top: (parseInt(jQuery(win).css('top'))
+ (window.pageYOffset != null ? window.pageYOffset : gbody().scrollTop))
+ 'px' });
if (zindex != false)
jQuery(win).css('z-index', zindex);
if (jQuery.browser.msie)
msie_opacfix(jQuery(win));
// Command line loses focus in IE. This solves most cases for now, but
// this should not go just to 'dpaction', it could e.g. be a form field.
focus_input();
}
function close_dpwindow(styleclass)
{
jQuery(!styleclass ? '#dpwindow' : 'div.' + styleclass).remove();
focus_input();
}
function msie_opacfix(el)
{
if (el.css('-moz-opacity'))
el.css('filter', 'alpha(opacity='
+ (el.css('-moz-opacity') * 100) + ')');
else if (el.css('opacity') == '1') // IE6
el.css('filter', 'alpha(opacity=95)');
}
function _gel(a)
{
return document.getElementById(a)
}
function _rnd()
{
return Math.round(Math.random() * 999999);
}
function _arnd()
{
return '&ajax=' + _rnd();
}
/*
function init_drag(id, event)
{
return;
}
*/
function stopdrag(x)
{
jQuery.ajax({
data: 'call_object=' + encodeURIComponent(jQuery(x).attr('id'))
+ '&method=reportMove&x=' + x.style.left + '&y=' + x.style.top
+ _arnd()
});
}
function gototop(jump,no_focus_delay)
{
var top = 0;
if (jump)
top = gettop(jQuery('a[@name=' + jump + ']').get()[0], true);
focus_input(no_focus_delay,'self.scrollTo(0, ' + top + '); '
+ 'jQuery("#dpaction").unbind("focus")');
}
function dpdebug(str)
{
jQuery('#dpdebug').html(jQuery('#dpdebug').html() + str + '
');
}
function gettop(ob, scrollfix)
{
for (var top = 0; ob; ob = ob.offsetParent)
top += ob.offsetTop + (scrollfix && jQuery.browser.opera ? ob.scrollTop
: 0);
return top;
}
function getleft(ob)
{
for (var left = 0; ob; ob = ob.offsetParent)
left += ob.offsetLeft + (jQuery.browser.opera ? ob.scrollLeft : 0);
return left;
}
function action_dutchpipe()
{
var dpaction = jQuery('#dpaction').val();
if (dpaction == '')
close_dpwindow();
else {
if (action_history == undefined)
action_history = new Array();
var len = action_history.length;
if (!len || action_history[len - 1] != dpaction) {
if (20 == len)
action_history.shift();
action_history.push(dpaction);
action_count++;
}
}
send_action2server(dpaction, true);
jQuery('#dpaction').val('');
action_index = action_cur = null;
focus_input();
if ('once' == jQuery('#dpinputpersistent').attr('value'))
setTimeout("close_input()", 100);
return false;
}
function insert_history(el)
{
if (action_history == null) {
if (jQuery(el).text())
action_history = jQuery(el).text().split('@SEP@');
} else if (action_history.length >= 20)
return;
else {
var ins_history = jQuery(el).text().split('@SEP@');
var ins_length = ins_history.length - action_count;
if (ins_length <= 0)
return;
while (action_history.length < 20 && ins_length) {
action_history.unshift(ins_history[ins_length - 1]);
ins_length--;
}
}
action_index = action_history.length - 1;
if (action_cur == null)
action_cur = jQuery('#dpaction').val();
jQuery('#dpaction').val(action_history[action_index]);
}
function bindKeyDown(e)
{
var keynum = e.which ? e.which : e.keyCode;
if (38 != keynum && 40 != keynum)
return true;
if (remote_history == 0) {
remote_history = 1;
jQuery.ajax({
data: 'location=' + loc + getstr + '&scriptid=' + scriptid
+ (standalone ? '&standalone=true' : '') + '&seq=' + seq + _arnd()
+ '&gethistory=1'
});
}
if (action_history == null || action_history.length == 0)
return false;
if (action_cur == null)
action_cur = jQuery('#dpaction').val();
if (38 == keynum) {
if (action_index == null || action_index > 0) {
if (action_index == null) {
action_index = action_history.length - 1;
action_cur = jQuery('#dpaction').val();
}
else
action_index--;
jQuery('#dpaction').val(action_history[action_index]);
}
}
else {
if (action_index != null) {
if (action_index == action_history.length - 1) {
jQuery('#dpaction').val(action_cur);
action_index = action_cur = null;
} else
jQuery('#dpaction').val(action_history[++action_index]);
}
}
return false;
}
function gbody()
{
return document.compatMode && document.compatMode != 'BackCompat'
? document.documentElement : document.body;
}
function focus_input(no_delay,gototop)
{
if (!jQuery('input:not(#dpaction)').length)
has_formfocus = 0;
if (!has_formfocus && jQuery('#dpinput[input]').length) {
if (gototop)
jQuery('#dpaction').bind('focus', {src: gototop},
function(event){setTimeout(event.data.src,
jQuery.browser.msie ? 175 : 0 )});
var src = "if (!has_formfocus && jQuery('#dpinput[input]').length) { "
+ "gbody().focus();\ jQuery('#dpaction')[0].focus() }";
if (no_delay) {
if (jQuery.browser.msie)
setTimeout(src, 10);
else
eval(src);
}
else
setTimeout(src, 100);
}
}
function show_input(act)
{
if (jQuery('#dpinput input').length) {
if ('string' == typeof act)
_gel('dpaction').value = act;
return true;
}
if ('object' == typeof act && 9 != (act.which ? act.which : act.keyCode))
return true;
var tmp = jQuery('#dpinput').html();
jQuery('#dpinput').html(jQuery('#dpinput_say').html());
jQuery('#dpinput_say').html(tmp);
jQuery('#dpaction').bind('keydown', bindKeyDown);
focus_input();
jQuery(gbody()).unbind('keydown', show_input);
if ('string' == typeof act)
_gel('dpaction').value = act;
jQuery.ajax({
data: 'call_object='
+ encodeURIComponent(jQuery(
'div[@id=dpinventory] div[@class=dpinventory2]').attr('id'))
+ '&method=openInputArea' + _arnd()
});
return false;
}
function close_input()
{
jQuery.ajax({
data: 'call_object='
+ encodeURIComponent(jQuery(
'div[@id=dpinventory] div[@class=dpinventory2]').attr('id'))
+ '&method=closeInputArea' + _arnd()
});
var tmp = jQuery('#dpinput').html();
jQuery('#dpinput').html(jQuery('#dpinput_say').html());
jQuery('#dpinput_say').html(tmp);
bind_input();
}
function bind_input()
{
if (!jQuery('#dpinput[input]').length)
jQuery(gbody()).bind('keydown', show_input);
jQuery('input:not(#dpaction),a').focus(function() {
if (!jQuery('#dpinput[input]').length)
jQuery(gbody()).unbind('keydown', show_input);
has_formfocus++;
});
var t = "if (!has_formfocus && !jQuery('#dpinput[input]').length) "
+ "jQuery(gbody()).bind('keydown', show_input)";
jQuery('input:not(#dpaction),a').bind('blur', function() {
has_formfocus--;
setTimeout(t, 100);
});
jQuery('form:not(#actionform)').submit(function() {
has_formfocus = 0;
setTimeout("gbody().focus(); " + t, 100);
});
}
function close_amenu()
{
if (jQuery('div.actionwindow').remove().length) {
am_target_over = am_target_out = options_open = null;
focus_input();
}
}
jQuery(function() {
jQuery(gbody()).click(function() {
if (am_no_close) {
am_no_close = false;
return;
}
close_amenu();
});
loc = location.href;
var dphost_url = php[8];
var dpclient_fn = php[9];
standalone = true;
loc=loc.replace("http://cute","http://www.cute");
jQuery.ajaxSetup({
url: php[4] + dpclient_fn,
success: handle_response
});
var ob = new Date();
var curtime = ob.getTime();
scriptid = _rnd();
if (window.dp_load_elements)
dp_load_elements();
var getdivs = '';
if (standalone) {
if (!jQuery('#dpinventory').length || jQuery('#dpinventory').html()
== '')
getdivs += 'dpinventory#';
if (!jQuery('#dpmessagearea').length || jQuery('#dpmessagearea').html()
== '')
getdivs += 'dpmessagearea#';
if (!jQuery('#dpinput_wrap').length
|| jQuery('#dpinput_wrap').html() == '')
getdivs += 'dpinput_wrap#';
if (!jQuery('#dploginout').length || jQuery('#dploginout').html() == '')
getdivs += 'dploginout#';
}
if (getdivs != '')
send_alive2server(true, curtime, getdivs);
else {
if (standalone)
send_alive2server(true, curtime, '');
else {
setTimeout('send_alive2server(true, '+curtime+', "")',
(!has_started ? 10 : 2000));
}
if (jQuery('#dpinput[input]').length)
gototop(jump,true);
has_started = true;
}
fix_dpimages();
if (typeof history.navigationMode != 'undefined')
history.navigationMode = 'compatible';
jQuery('#dpaction').bind('keydown', bindKeyDown);
bind_input();
});