var ajax_root_url='http://anbieter-ichbinneu.de/classes/ajax_wrapper.php';
function Fehlerbehandlung (Nachricht, Datei, Zeile)
{
Fehler = 'Error: ' + Nachricht + ' in: ' + Datei + ' at Line:' + Zeile;
new Ajax.Request(ajax_root_url + '?wrapper=jserror&error='+Fehler,
{
method:'post'
});
alert(Fehler);
return true;
}
window.onerror = Fehlerbehandlung;
var swfu;
function MessageBox( $msg, $caption )
{
try
{
var $overlay = null;
var $iframe = null;
var $msgbox = null;
var $Html = '';
var $id = new Date();
$msg || ($msg = ' ');
$caption || ($caption = ' ');
$id = $id.valueOf();
$overlay = document.createElement( 'div' );
$overlay.id = '' + $id + '.1';
$overlay.className = 'msgbox_overlay';
with( $overlay.style )
{
backgroundColor = '#dddddd';
position = 'absolute';
width = '100%';
height = '100%';
top = '0';
left = '0';
filter = 'alpha(opacity=75)';
opacity = '0.75';
}
$iframe = document.createElement( 'iframe' );
$overlay.appendChild( $iframe );
with( $iframe.style )
{
border = 'none';
width = '100%';
height = '100%';
filter = 'chroma(color=#ffffff)';
}
var $msgbox = document.createElement( 'div' );
$msgbox.id = '' + $id + '.2';
with( $msgbox.style )
{
border = 'none';
display = 'inline';
position = 'absolute';
}
$Html = '
';
$Html += '';
$Html += '';
$Html += '| ';
$Html += ' ';
$Html += ' ';
$Html += ' ';
$Html += $caption;
$Html += ' | ';
$Html += '
';
$Html += '';
$Html += '| ';
$Html += $msg;
$Html += ' | ';
$Html += '
';
$Html += '';
$Html += '
';
$msgbox.innerHTML = $Html;
document.body.appendChild( $overlay );
document.body.appendChild( $msgbox );
var w = (window.innerWidth > document.body.clientWidth)?
window.innerWidth : document.body.clientWidth;
w -= $msgbox.offsetWidth;
w *= 0.5;
if( w )
w += document.body.scrollLeft;
$msgbox.style.left = w + 'px';
var h = (window.innerHeight > document.body.clientHeight)?
window.innerHeight : document.body.clientHeight;
h -= $msgbox.offsetHeight;
h *= 0.4;
h += document.body.scrollTop;
$msgbox.style.top = h + 'px';
}
catch( $e )
{
alert( $msg );
}
}
function show_msgbox( box )
{
var bg = box.parentNode? box.parentNode : (box.parentElement? box.parentElement : null);
bg.style.top = '0px';
bg.style.left = '0px';
bg.style.width = document.body.scrollWidth + 'px';
bg.style.height = document.body.scrollHeight + 'px';
var iframe = document.createElement( 'iframe' );
bg.appendChild( iframe );
iframe.style.width = '100%';
iframe.style.height = '100%';
/*@cc_on
iframe.style.filter = 'chroma (color=#ffffff)';
@*/
bg.style.display = 'block';
box.style.display = 'inline';
var w = (window.innerWidth > document.body.clientWidth)?
window.innerWidth : document.body.clientWidth;
w -= box.offsetWidth;
w *= 0.5;
if( w )
w += document.body.scrollLeft;
box.style.left = w + 'px';
var h = (window.innerHeight > document.body.clientHeight)?
window.innerHeight : document.body.clientHeight;
h -= box.offsetHeight;
h *= 0.4;
h += document.body.scrollTop;
box.style.top = h + 'px';
}
function close_msgbox( box )
{
var bg = box.parentNode? box.parentNode : (box.parentElement? box.parentElement : null);
for( var i = 0; i < bg.childNodes.length; ++i )
{
if( bg.childNodes[i].tagName && (bg.childNodes[i].tagName.toLowerCase() == 'iframe') )
{
bg.removeChild( bg.childNodes[i] );
break;
}
}
bg.style.display = 'none';
}
function MoveNode( NodeId, TargetId )
{
var $node = $( NodeId );
var $parent = $node.parentNode? $node.parentNode:($node.parentElement? $node.parentElement:null);
var $target = $( TargetId );
if( $node && $parent && $target )
{
$parent.removeChild( $node );
$target.appendChild( $node );
}
}
function ShowNodes()
{
var $node = null;
for( var $i = 0; $i 1)
{
//neue höhe berechnen
var h1 = Math.round(120 / ar);
if (h1 > 80)
{
//round
var new_width = Math.round(120 - (ar * (h1 - 80)));
var new_height= Math.round(new_width / ar);
}
else
{
var new_width = 120;
var new_height = h1;
}
//alert(new_width + ' ' + new_height);
}
else if (ar==1)
{
var new_width=95;
var new_height=95;
}
else
{
var w1 = Math.round(120 * ar);
if (w1 > 80)
{
var new_width = 80;
}
else
{
var new_width = w1;
}
var new_height = 120;
}
//alert(new_width + ' ' + new_height);
$(id).width = new_width;
$(id).height = new_height;
}
function display_upload_button(session_id)
{
//alert(session_id);
//post_params: {"PHPSESSID" : " + session_id + "},
var settings = {
flash_url : "/classes/swfupload/swfupload22.swf",
upload_url: "anbieter-anmelden.php?stid=0&stidchk=1&PHP=0851ae590d0a71317efa60a50686c2f9", // Relative to the SWF file
file_size_limit : "1 MB",
file_types : "*.jpg;*.gif;*.png",
file_types_description : "All Files",
file_upload_limit : 0,
file_queue_limit : 1,
custom_settings : {
progressTarget : "fsUploadProgress",
cancelButtonId : "btnCancel"
},
debug: false,
// Button settings
button_image_url: "/images/button_blank.gif",
button_width: "110",
button_height: "16",
button_placeholder_id: "spanButtonPlaceHolder",
button_window_mode: "transparent",
// The event handler functions are defined in handlers.js
file_queued_handler : fileQueued,
file_queue_error_handler : fileQueueError,
file_dialog_complete_handler : fileDialogComplete,
upload_start_handler : uploadStart,
upload_progress_handler : uploadProgress,
upload_error_handler : uploadError,
upload_success_handler : uploadSuccess,
upload_complete_handler : uploadComplete,
queue_complete_handler : queueComplete // Queue plugin event
};
swfu = new SWFUpload(settings);
}
function check_login_final(resp)
{
//alert(resp);
if (resp=="0")
{
// alert('Login fehlgeschlagen');
MessageBox( 'Login fehlgeschlagen!', '' );
}
else
{
var dump = resp.split('|');
//location.href=resp;
var loginuser = dump[1];
var loginpass = dump[2];
var challenge = dump[0];
$('loginuser').value=loginuser;
$('loginuser').name='loginuser'+challenge;
$('loginpass').value=loginpass;
$('loginpass').name='loginpass'+challenge;
$('challenge').value= challenge;
$('login2').action = dump[3];
document.forms.login2.submit();
}
}
function check_login()
{
var user = $('username').value;
var pass = $('realpass').value;
draw_ajax('ajax_check_login', '', '', 'check_login_final','login', 'response');
}
function check_ov_chache()
{
}
function draw_vorschau()
{
//alert('draw_vorschau');
var response='response';
draw_ajax('ajax_get_sd_bild', '', '', 'draw_vorschau_final','', response);
}
function del_firmenlogo()
{
$('sd_firmenlogo').src = 'images/nologo.jpg';
$('sd_firmenlogo_dump').value = '';
}
function draw_vorschau_final(resp)
{
//alert(resp);
if (resp!=1)
{
$('sd_firmenlogo').src = 'uploadtemp/' + resp;
$('sd_firmenlogo_dump').value = resp;
}
}
function submit_login_final(resp)
{
if (resp=='1')
{
//erfolgreich gespeichert
/*Effect.BlindUp('register',
{
duration: 4.0,
afterFinish: function()
{
Effect.BlindDown('welcomesay', { duration: 2.0 });
}
});*/
$('register').style.display = 'none';
$('welcomesay').style.display = 'block';
//eingabehilfe anpassen
change_rthelp('welcomesay');
}
else
{
//fehlermeldung anzeigen
$('shop_sd_savecheck_message').innerHTML = resp;
show_msgbox( $('shop_sd_savecheck') );
// $('grey').style.display = 'block';
// $('shop_sd_savecheck').style.display = 'block';
}
}
function close_sd_savecheck_message()
{
close_msgbox( $('shop_sd_savecheck') );
// $('shop_sd_savecheck').style.display = 'none';
// $('grey').style.display = 'none';
}
function submit_login()
{
draw_ajax('ajax_save_new_user', '', '', 'submit_login_final','', 'response');
}
function check_content_length(obj, max_laenge)
{
if (obj.value.length > max_laenge)
{
obj.style.backgroundColor='#FF3B3B';
obj.value = obj.value.substring(0, max_laenge);
$('shop_sd_inputlaenge_max').innerHTML = max_laenge;
show_msgbox( $('shop_sd_inputlaenge') );
// $('grey').style.display = 'block';
// $('shop_sd_inputlaenge').style.display = 'block';
}
else
{
obj.style.backgroundColor='#EEEEEE';
}
}
function close_sd_inputlaenge()
{
close_msgbox( $('shop_sd_inputlaenge') );
// $('shop_sd_inputlaenge').style.display = 'none';
// $('grey').style.display = 'none';
}
function change_rthelp(feld)
{
//alert(feld);
if (feld=='')
{
feld='inkasso';
}
parameter=feld+'&sid=9';
draw_ajax('ajax_get_shop_rthelp', 'shop_prod_sd_help', parameter, '');
}
function draw_ajax(function_name, returner_id, parameter, rfunction_name, post, rfunction_name_parameter)
{
if (!parameter)
{
parameter='';
}
if ((!post) || (post==''))
{
var post_id = 'kontaktformular';
}
else
{
var post_id = post;
}
var dumper = $(post_id);
new Ajax.Request(ajax_root_url + '?wrapper=login&mid=26&func='+function_name+'&p='+parameter,
{
parameters: $(post_id).serialize(true),
method:'post',
onSuccess: function(transport)
{
var response = transport.responseText;
if ((response=='FALSE') || (response==''))
{
}
else
{
//alert(response);
if (returner_id!='')
{
if (($(returner_id).style.display) && ($(returner_id).style.display=='none'))
{
$('grey').style.height = document.body.scrollHeight;
$('grey').style.display='block';
$(returner_id).style.top=50 + document.body.scrollTop;
$(returner_id).style.display = 'block';
}
$(returner_id).innerHTML = response;
}
if (rfunction_name!='')
{
if (rfunction_name_parameter=='response')
{
rfunction_name_parameter = response;
}
eval(rfunction_name + '(rfunction_name_parameter);');
}
}
},
onFailure: function()
{
alert('Something went wrong...');
}
});
}
function einblenden(elementname1,elementname2)
{
document.getElementById(elementname1).style.display='block';
document.getElementById(elementname2).style.display='none';
}
function ausblenden(elementname1,elementname2)
{
document.getElementById(elementname1).style.display='none';
document.getElementById(elementname2).style.display='block';
}