function headerRez(){
w = $('#navigation').innerWidth();
$('.usercontent img').css('maxWidth',w);
}
function resetAjaxButtons(){
$('.ajaxButtonPlaceholder').each(function(){
$clone = $('#clone_'+$(this).attr('name'));
$('#clonehidden_'+$(this).attr('name')).remove();
oldid = $clone.data('id');
$clone.attr('id',oldid );
$(this).replaceWith($clone);
$clone.removeClass('hidden');
makeAjaxButton($('#'+oldid));
});
}
function makeAjaxButton($el){
$el.removeAttr('disabled').click(function(){
newinp = $(this).clone();
newinp.data('id',newinp.attr('id'));
newinp.attr('id','clone_'+$(this).attr('name'));
newinphidden = $('<input type="hidden" name="'+$(this).attr('name')+'" />');
newinphidden.attr('id','clonehidden_'+$(this).attr('name'));
newinp.addClass('hidden');
try{
agent = navigator.userAgent.toLowerCase();
if(agent.indexOf('chrome') > -1 && agent.indexOf('safari') > -1 && agent.indexOf('opera') > -1){$(this).attr('disabled',true);}
}catch(e){}
$(this).addClass('ajaxButtonPlaceholder').css('backgroundImage','url(http://files.homepagemodules.de/b2001010/a_821_7ed1d5a4.gif)')
.css('backgroundRepeat','no-repeat')
.css('backgroundPosition','3px center')
.css('paddingLeft','20px');
$(this).val('warten...');
$(this).parent().append(newinp).append(newinphidden);
$f = $(this).closest('form');
$f.submit();
});
}
function xob_redirect(url,msg){
text = msg ? msg : "Bitte warten - Seite wird geladen";
goto = url ? url : 0;
$('#xChatBase,#xChatGlobalBaseBox,#xChatMenu').hide();
$('.content').find('.spacer20').first().html('<center><img src="" alt="loading" title="'+text+'" /><br /><br /><h3>'+text+'</h3></center>');
if(goto){window.location = goto}
}
function validateMail(email) {
var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
if ( reg.test(email) == false )
{ return false; }
else { return true; }
}
function writeError(text) {
listel = $('#errorlist li');
found = false;
if($('#error_wrap').length == 0)
{ $('<span id="error_wrap"></span>').insertAfter('#breadcrumbs'); }
if($('#errorlist').length == 0)
{ $('<ul class="error" id="errorlist">').appendTo('#error_wrap'); }
$.each(listel, function(index) {
if($(this).html() == text) { found=true; }
});
if(!found) { $('<li class="js_check">'+text+'</li>').appendTo('#errorlist'); }
}
function remError(text) {
listel = $('#errorlist li');
found = false;
$.each(listel, function(index) {if($(this).html() == text) { $(this).remove(); found=true;} });
if(found) {
listel = $('#errorlist li');
if($(listel).length == 0){ $('#errorlist').remove(); }
}
}
function calcPos() {
var wwidth = $(window).width();
var wheight = $(window).height();
$('#hpmdialogwrap')
.css('left', (wwidth-$('#hpmdialogwrap').outerWidth()) / 2 + "px" )
.css('top', ((wheight - $('#hpmdialogwrap').outerHeight())/2)-30 + "px")
.show();
}
function hpm_newDialogCentered(link, width) {
$('head').append('<style type="text/css">#hpmdialogwrap {display:none;}</style>');
hpm_newDialog(link, width);
checkDialog(false);
function checkDialog(isReady) {
// checks whether the hpm-dialog is ready, and adjusts the position if true.
if (isReady){
calcPos();
} else {
isReady = ($('#hpmdialogwrap').length>0)
setTimeout(function(){checkDialog(isReady);},50);
}
}
return false;
}
var filecount = 1;
var html5checked = false;
function upstat(percent) {$('#progressperc').html(percent);}
function handleUpload2(progress_link) {
if($('#fileselect1').attr('multiple') == true)
{
$('#uploadbutton').trigger('click');
$('#uploadbutton').hide();
$('#escape_upload').hide();
$('#escape_upload_hard').show();
$('#fileselect_wrap').hide();
$('#uploading').show();
$('#ajaxgreywrapper').removeAttr('onclick');
hpm_upload_start_progress(progress_link, 'progressmeter');
}
}
function handleUpload() {
if(!html5checked) {
$('#fileselect1').attr('multiple', 'multiple');
if($('#fileselect1').attr('multiple') == true){$('#multipleupload').show();}
else{
$('#futherfile').show();
$('#dcontentfileupload').removeAttr('onmouseover');
$('#fileselect1').removeAttr('multiple');
}
}
html5checked = true;
}
function addfile() {
$('<br/><input type="file" name="pic_file[]" class="file" />').appendTo('#furtherfilelist');
return false;
}
function checkPostHeight(id){
height = $('#msg'+id+"_cont").find('.mtext').height();
if(height > 200){$('#msg'+id+"_cont").find('.messageinformation_toggler').trigger('click');}
}
xCols = xPages = [];
function xAddCollumn(dir,width){
if(xCols.indexOf(dir)<0){
var w = width ? "width="+width : "";
var c = $('<td id="'+dir+'" '+w+' style="vertical-align:top" class="'+dir+'"><div id="'+dir+'_content"></div></td>');
switch(dir){
case "left" : c.insertBefore($('.main')); break;
case "right" : c.insertAfter($('.main')); break;
default: break;}
}else{try{console.log('Column already added');}catch(e){}}
}
function xLoadBox(source,target,header){
if(source && xPages.indexOf(source)<0){
head = header ? header : source;
$box = $('<div class="box"><div class="boxheader"><strong>'+head+'</strong></div><div class="boxcontent" id="'+source+'"></div>');
url = "/page-"+source+".html";
$box.appendTo($("#"+target+"_content"));
$box.find(".boxcontent").load(url);
xPages.push(source);
}else{try{console.log('Page already loaded');}catch(e){}}
}

