window.onerror = function (desc, page, line, chr) {
/* alert('JavaScript error occurred! \n'
+'\nError description: \t'+desc
+'\nPage address: \t'+page
+'\nLine number: \t'+line
);*/
}
$(function () {
$('a').focus(function () {
this.blur();
});
SI.Files.stylizeAll();
slider.init();
$('input.text-default').each(function () {
$(this).attr('default', $(this).val());
}).focus(function () {
if ($(this).val() == $(this).attr('default'))
$(this).val('');
}).blur(function () {
if ($(this).val() == '')
$(this).val($(this).attr('default'));
});
$('input.text,textarea.text').focus(function () {
$(this).addClass('textfocus');
}).blur(function () {
$(this).removeClass('textfocus');
});
var popopenobj = 0, popopenaobj = null;
$('a.popup').click(function () {
var pid = $(this).attr('rel').split('|')[0], _os = parseInt($(this).attr('rel').split('|')[1]);
var pobj = $('#' + pid);
if (!pobj.length)
return false;
if (typeof popopenobj == 'object' && popopenobj.attr('id') != pid) {
popopenobj.hide(50);
$(popopenaobj).parent().removeClass(popopenobj.attr('id').split('-')[1] + '-open');
popopenobj = null;
}
return false;
});
$('p.images img').click(function () {
var newbg = $(this).attr('src').split('bg/bg')[1].split('-thumb')[0];
$(document.body).css('backgroundImage', 'url(' + _siteRoot + 'images/bg/bg' + newbg + '.jpg)');
$(this).parent().find('img').removeClass('on');
$(this).addClass('on');
return false;
});
$(window).load(function () {
});
$('div.sc-large div.img:has(div.tml)').each(function () {
$('div.tml', this).hide();
$(this).append(' ').find('a').css( {
left : parseInt($(this).offset().left) + 864, top : parseInt($(this).offset().top) + 1
}).click(function () {
$(this).siblings('div.tml').slideToggle();
return false;
}).focus(function () {
this.blur();
});
});
});
var slider = {
num : - 1, cur : 0, cr : [], al : null, at : 4 * 1000, ar : true,
init : function () {
if (!this.data || !this.data.length)
return false;
var d = this.data;
this.num = d.length;
var pos = Math.floor(Math.random() * 1);
for (var i = 0;i < this.num;i++) {
$('#' + d[i].id).css( {
left : 0,
opacity: (i == pos ? 1.0 : 0.0)
});
$('#nrs_content_center_slide-nav').append('');
}
$('img,div#nrs_content_center_slide-controls', $('div#nrs_content_center_slide-holder')).fadeIn();
this.text(d[pos]);
this.on(pos);
this.cur = pos;
window.setTimeout('slider.auto();', this.at);
},
auto : function () {
if (!this.ar)
return false;
var next = this.cur + 1;
if (next >= this.num)
next = 0;
this.slide(next);
},
slide : function (pos) {
if (pos < 0 || pos >= this.num || pos == this.cur)
return;
window.clearTimeout(this.al);
this.al = window.setTimeout('slider.auto();', this.at);
var d = this.data;
for (var i = 0;i < this.num;i++)
$('#' + d[i].id).stop().animate( {
opacity: (i == pos ? 1.0 : 0.0)
}, 1000, 'swing');
this.on(pos);
this.text(d[pos]);
this.cur = pos;
},
on : function (pos) {
$('#nrs_content_center_slide-nav a').removeClass('on');
$('#nrs_content_center_slide-nav a#nrs_content_center_slide-link-' + pos).addClass('on');
},
text : function (di) {
this.cr['a'] = di.client;
this.cr['b'] = di.desc;
this.cr['c'] = di.content;
// this.ticker('#nrs_content_center_slide-client span', di.client, 'a');
this.ticker('#nrs_content_center_slide-desc', di.desc, 'b');
this.ticker('#nrs_content_center_slide-content .viewport .overview', di.content, 'c');
$('#nrs_content_center_slide-content .more a').each(function()
{
this.href = this.href.replace(/id=([0-9]*)/, "id="+di.client);
});
var content = $('#nrs_content_center_slide-content');
if (!content._scroll)
$('#nrs_content_center_slide-content').tinyscrollbar();
else
$('#nrs_content_center_slide-content').tinyscrollbar_update();
content._scroll = true;
},
ticker : function (el, text, unique) {
if (this.cr[unique] != text)
return false;
$(el).html(text);
}
};
// STYLING FILE INPUTS 1.0 | Shaun Inman | 2007-09-07
if (!window.SI) {
var SI = {
};
};
SI.Files = {
htmlClass : 'SI-FILES-STYLIZED', fileClass : 'file', wrapClass : 'cabinet', fini : false, able : false, init : function () {
this.fini = true;
},
stylize : function (elem) {
if (!this.fini) {
this.init();
};
if (!this.able) {
return;
};
elem.parentNode.file = elem;
elem.parentNode.onmousemove = function (e) {
if (typeof e == 'undefined')
e = window.event;
if (typeof e.pageY == 'undefined' && typeof e.clientX == 'number' && document.documentElement) {
e.pageX = e.clientX + document.documentElement.scrollLeft;
e.pageY = e.clientY + document.documentElement.scrollTop;
};
var ox = oy = 0;
var elem = this;
if (elem.offsetParent) {
ox = elem.offsetLeft;
oy = elem.offsetTop;
while (elem = elem.offsetParent) {
ox += elem.offsetLeft;
oy += elem.offsetTop;
};
};
};
},
stylizeAll : function () {
if (!this.fini) {
this.init();
};
if (!this.able) {
return;
};
}
};