function registerElements()
{
ajaxEngine.registerAjaxElement('content-right-content-left');
ajaxEngine.registerAjaxElement('content-right-content-right');
ajaxEngine.registerAjaxElement('selection-menu-content');
ajaxEngine.registerAjaxElement('selection-thema-content');
ajaxEngine.registerAjaxElement('selection-thema-title');
ajaxEngine.registerAjaxElement('selection-thema-footer');
ajaxEngine.registerAjaxElement('selection-album-content');
ajaxEngine.registerAjaxElement('selection-album-title');
ajaxEngine.registerAjaxElement('selection-album-footer');
ajaxEngine.registerAjaxElement('selection-shop-content');
ajaxEngine.registerAjaxElement('selection-shop-title');
ajaxEngine.registerAjaxElement('selection-shop-footer');
ajaxEngine.registerAjaxElement('selection-pictures-content');
ajaxEngine.registerAjaxElement('selection-pictures-title');
ajaxEngine.registerAjaxElement('selection-pictures-footer');
ajaxEngine.registerAjaxElement('content-left-menu');
ajaxEngine.registerAjaxElement('content-right-navigation-tabs');
ajaxEngine.registerAjaxElement('content-right-navigation-menu');
ajaxEngine.registerAjaxElement('preview-image-overlay');
ajaxEngine.registerAjaxElement('preview-image-large');
ajaxEngine.registerAjaxElement('content-right-content-left-thumbnail');
ajaxEngine.registerAjaxElement('infoBoxContent');
ajaxEngine.registerAjaxElement('printart-help-window');
ajaxEngine.registerAjaxElement('printart-basket-window');
ajaxEngine.registerAjaxElement('content-right-cell');
ajaxEngine.registerAjaxElement('content-footer');
ajaxEngine.registerAjaxElement('preview-image-box');
ajaxEngine.registerAjaxElement('printart-preview-window');
ajaxEngine.registerAjaxElement('printart-user-login');
ajaxEngine.registerAjaxElement('printart-login-menu');
ajaxEngine.registerAjaxElement('login-message');
ajaxEngine.registerAjaxElement('own-shop-url-status');
ajaxEngine.registerAjaxElement('printart-debug-window');
ajaxEngine.registerAjaxElement('printart-search-results');
ajaxEngine.registerAjaxElement('printart-search-form-result-count');
ajaxEngine.registerAjaxElement('basket-window-message');
ajaxEngine.registerAjaxElement('printart-flex-window');
ajaxEngine.registerAjaxObject('handleAfterLoadAjaxData', new handleAfterLoadAjaxData());
}
function cancelPayProcess()
{
$('printart-basket-window').style.display = 'none';
$('content-right-content-right').style.visibility = 'visible';
if ($('printart-help-box'))
$('printart-help-box').style.visibility = 'visible';
}
function sendPassword(EMail)
{
if (checkMail(EMail)) {
var options = {parameters: 'application[cmd]=handleshowsaferpay', method: 'post'};
ajaxEngine.registerRequest('loadAjaxContent', '/interface/PAPassword.interface.php?useremail=' + EMail + "&out=xml");
registerElements();
pageTracker._trackPageview("/handleshowsaferpay" );
ajaxEngine.sendRequest('loadAjaxContent');
} else {
$('login-message').innerHTML = 'Bitte geben Sie Ihre E-Mailadresse im Feld Benutzername ein';
}
}
function closePrintartInformationContent()
{
$('printart-information-content').style.display = 'none';
$('layout-center').style.position = '';
}
function getPageHeight()
{
var height;
var test1 = document.body.scrollHeight;
var test2 = document.body.offsetHeight;
if (test1 > test2) // all but Explorer Mac
{
height = document.body.scrollHeight;
}
else // Explorer Mac;
//would also work in Explorer 6 Strict, Mozilla and Safari
{
height = document.body.offsetHeight;
}
return height;
}
function getPageWidth()
{
var width;
var test1 = document.body.scrollWidth;
var test2 = document.body.offsetWidth;
if (test1 > test2) // all but Explorer Mac
{
width = document.body.scrollWidth;
}
else // Explorer Mac;
//would also work in Explorer 6 Strict, Mozilla and Safari
{
width = document.body.offsetWidth;
}
return width;
}
function getInnerHeight()
{
var height;
if (self.innerHeight) // all except Explorer
{
height = self.innerHeight;
}
else if (document.documentElement && document.documentElement.clientHeight)
// Explorer 6 Strict Mode
{
height = document.documentElement.clientHeight;
}
else if (document.body) // other Explorers
{
height = document.body.clientHeight;
}
return height;
}
function handleColorClick(AElement, AID)
{
var ie = (document.all) ? 1 : 0;
if (AElement.style.opacity != 1) {
AElement.style.opacity = 1;
AElement.style['filter'] = 'alpha(opacity=100)';
var value = $('printart-search-form-color').value;
if (value != '')
value = value + ',';
value = value + ' ' + AID + ' ';
$('printart-search-form-color').value = value;
} else {
AElement.style.opacity = 0.3;
AElement.style['filter'] = 'alpha(opacity=30)';
var value = $('printart-search-form-color').value;
var r0 = new RegExp(' ' + AID + ' ', 'gi');
value = value.replace(r0, '');
value = value.replace(/,,/gi, ',');
if (value.charAt(0) == ',') {
value = value.substring(1, value.length);
}
if (value.charAt(value.length-1) == ',') {
value = value.substring(0, value.length-1);
}
$('printart-search-form-color').value = value;
}
}
function getInnerWidth()
{
var width;
if (self.innerHeight) // all except Explorer
{
width = self.innerWidth;
}
else if (document.documentElement && document.documentElement.clientHeight)
// Explorer 6 Strict Mode
{
width = document.documentElement.clientWidth;
}
else if (document.body) // other Explorers
{
width = document.body.clientWidth;
}
return width;
}
function handleDeliveryMethodChange(Checked)
{
if (Checked) {
$('purchase-agency-row').style.display = '';
} else {
$('purchase-agency-row').style.display = 'none';
}
}
function loadAjaxContent(options, function_name)
{
showLoading();
ajaxEngine.registerRequest('loadAjaxContent', '/index.php');
registerElements();
pageTracker._trackPageview("/" + function_name );
ajaxEngine.sendRequest('loadAjaxContent', options);
}
function handleBaseTypeChange(Element)
{
if (Element.name == 'order[basetype]') {
var radio = document.getElementsByName('order[format]');
for (i = 0; i < radio.length; i++) {
if (radio[i].value == 'select' && radio[i].checked)
radio[radio.length-2].checked = true;
}
}
}
function handleFlexLoad(ALoad)
{
if (ALoad) {
var options = {parameters: 'application[cmd]=loadflexsite&load=1', method: 'post'};
} else {
var options = {parameters: 'application[cmd]=loadflexsite&load=0', method: 'post'};
}
loadAjaxContent(options, 'loadflexsite');
}
function handleOrderFinish()
{
var options = {parameters: 'application[cmd]=handlefinishorder', method: 'post'};
loadAjaxContent(options, 'handlefinishorder');
}
function getSimilarImageById(APictureID)
{
var options = {parameters: 'application[cmd]=getsimilarimagebyid&picture_id=' + APictureID, method: 'post'};
loadAjaxContent(options, 'getsimilarimagebyid');
}
function handleAlbumPasswordClick()
{
var password = MD5($('album-password').value);
var options = {parameters: 'application[cmd]=handlealbumpasswordclick&album[password]=' + password, method: 'post'};
loadAjaxContent(options, 'handlealbumpasswordclick');
}
function handleAlbumLogout()
{
var options = {parameters: 'application[cmd]=handlealbumlogout', method: 'post'};
loadAjaxContent(options, 'handlealbumlogout');
}
function handleShowSaferpay()
{
var options = {parameters: 'application[cmd]=handleshowsaferpay', method: 'post'};
loadAjaxContent(options, 'handleshowsaferpay');
}
function handleBasketCouponDelete(ACouponID, ABasketID)
{
var options = {parameters: 'application[cmd]=handlebasketcoupondelete&basket_id=' + ABasketID + '&coupon_id=' + ACouponID, method: 'post'};
loadAjaxContent(options, 'handlebasketcoupondelete');
}
function checkUrlExists(Login)
{
var options = {parameters: 'application[cmd]=checkurl&ownshop[url]=' + Login.value, method: 'post'};
loadAjaxContent(options, 'checkurl');
}
function showOwnShop()
{
if ($('content-onload')) {
$('content-onload').style.display = 'none';
}
if ($('content-right-content')) {
$('content-right-content').style.display = 'block';
}
$('printart-basket-window').style.display = 'none';
$('content-right-content-left').style.border = '2px solid black';
$('content-right-content-left').style.marginBottom = '10px';
$('content-right-content-left').style.height = '750px';
$('content-right-content-left-thumbnail').innerHTML = '';
$('preview-image').style.display = 'none';
$('preview-image-overlay').style.display = 'none';
$('preview-image-box').style.display = 'none';
var options = {parameters: 'application[cmd]=showownshop', method: 'post'};
loadAjaxContent(options, 'showownshop');
}
function handleUploadContactSubmitClick(Form)
{
var request = '';
var name = false;
var email = false;
if (Form.elements['upload[name]'].value != '') {
request += '&' + Form.elements['upload[name]'].name + '=';
request += Form.elements['upload[name]'].value;
name = true;
}
if (Form.elements['upload[telephone]'].value) {
request += '&' + Form.elements['upload[telephone]'].name + '=';
request += Form.elements['upload[telephone]'].value;
}
if (Form.elements['upload[notice]'].value) {
request += '&' + Form.elements['upload[notice]'].name + '=';
request += Form.elements['upload[notice]'].value;
}
if (Form.elements['upload[email]'].value) {
if (checkMail(Form.elements['upload[email]'].value)) {
request += '&' + Form.elements['upload[email]'].name + '=';
request += Form.elements['upload[email]'].value;
email = true;
}
}
for (i = 0; i < Form.elements.length; i++) {
if (Form.elements[i].name.search(/files/) != -1) {
request += '&files[' + i + ']=' + Form.elements[i].value;
}
}
for (i = 0; i < Form.elements.length; i++) {
if (Form.elements[i].name.search(/reason/) != -1) {
request += '&reason[' + i + ']=' + Form.elements[i].value;
}
}
if (request != '' && name && email) {
var options = {parameters: 'application[cmd]=handleUploadErrorContact' + request, method: 'post'};
loadAjaxContent(options, 'handleUploadErrorContact');
$('printart-upload-dialog-content').innerHTML = 'Vielen Dank. Wir werden uns bei Ihnen melden.';
} else {
alert('Bitte füllen Sie die Pflichfelder korrekt aus');
}
return false;
}
function handleIFrameClose()
{
$('printart-basket-window').style.display = 'none';
$('content-right-content-right').style.visibility = 'visible';
if ($('printart-help-box'))
$('printart-help-box').style.visibility = 'visible';
}
function handleTipAFriendFormSubmit(Form)
{
var labels = document.getElementsByTagName('label');
var request = '';
var error = '';
for (i = 0; i < Form.elements.length; i++) {
var elem = Form.elements[i];
if (elem.value != '') {
if (elem.id.search(/email/) != -1) {
if (checkMail(elem.value)) {
request += '&' + elem.name + '=' + elem.value;
} else {
error += '\n Bitte E-Mailadresse überpruefen';
}
} else {
request += '&' + elem.name + '=' + elem.value;
}
} else {
for (j = 0; j < labels.length; j++) {
if (labels[j].htmlFor == elem.id)
var text = labels[j].innerHTML;
}
error += '\n"' + text.replace(/: /g, '') + '" kann nicht leer sein';
}
}
if (error != '')
alert(error);
else {
var options = {parameters: 'application[cmd]=handletipafriendsendmail' + request, method: 'post'};
loadAjaxContent(options, 'handletipafriendsendmail');
handleInfoBoxClose();
}
return false;
}
function deleteUploadImage(PictureID) {
var options = {parameters: 'application[cmd]=deleteuploadimage&pictureupload[pictureID]=' + PictureID, method: 'post'};
loadAjaxContent(options, 'deleteuploadimage');
}
function handleTipAFriend(PictureID)
{
var options = {parameters: 'application[cmd]=handletipafriend&tipafriend[pictureID]=' + PictureID, method: 'post'};
loadAjaxContent(options, 'handletipafriend');
}
function handleFileUploadDelete(Command) {
var options = {onSuccess: handleFileUploadResizeSuccess, parameters: 'application[cmd]=' + Command, method: 'post'};
loadAjaxContent(options, Command);
}
function handleFileUploadFinished(Command) {
var options = {onSuccess: handleFileUploadFinishedSuccess, parameters: 'application[cmd]=' + Command, method: 'post'};
loadAjaxContent(options, Command);
}
function handleFileUploadResizeSuccess(Response) {
setTimeout('handlePreviewSliderClick()', 100);
}
function handleFileUploadFinishedSuccess(Response) {
setTimeout('handleFileUploadResize()', 100);
}
function handleFileUploadResize()
{
var Command = 'handleresizeuploadimage';
var uploadOption = {parameters: 'application[cmd]=' + Command, method: 'post'};
loadAjaxContent(uploadOption, Command);
}
function handleFilesUploadedAndResized(Response)
{
var Command = 'handlePreviewSliderClick';
var uploadOption = {onSuccess: handleFileUploadFinishedSuccess, parameters: 'application[cmd]=' + Command, method: 'post'};
loadAjaxContent(uploadOption, Command);
}
function showFileUploadFlash()
{
var Command = 'handleuploadloadflash';
var uploadOption = {parameters: 'application[cmd]=' + Command, method: 'post'};
loadAjaxContent(uploadOption, Command);
}
function changeBackgroundImage(BackgroundID, PictureID, FormatID)
{
var options = {parameters: 'application[cmd]=changeBackground&background[ID]=' + BackgroundID + '&order[format]=' + FormatID + '&shop[pictureID]=' + PictureID, method: 'post'};
loadAjaxContent(options, 'changeBackground');
}
function showHelpWindow(HelpID)
{
if ($('printart-flex-window'))
$('printart-flex-window').style.display = 'none';
if ($('vaultDiv')) {
$('vaultDiv').style.display = 'none';
}
$('content-right-content-right').style.visibility = '';
if ($('printart-help-box'))
$('printart-help-box').style.visibility = '';
$('printart-basket-window').style.display = 'none';
if ($('content-right-cell')) {
if ($('printart-help-window')) {
var help = $('printart-help-window');
var right = $('content-right-cell');
help.style.top = right.offsetTop - 1+ 'px';
help.style.left = right.offsetLeft + 'px';
help.style.width = right.offsetWidth - 10 + 'px';
help.style.height = right.offsetHeight - 1 + 'px';
help.innerHTML = '';
var options = {parameters: 'typo3[id]=' + HelpID + '&application[cmd]=loadtypohelp', method: 'post'};
loadAjaxContent(options, 'loadtypohelp');
help.style.display = '';
}
}
var help = $('printart-help-window');
var left = $('content-left');
var content = $('layout-center');
var topNavi = $('content-right-navigation');
if (help && left && content) {
help.innerHTML = '';
help.style.top = '83px';
var right = $('content-right-content-right');
if (left && content && right) {
help.style.left = content.offsetLeft + left.clientWidth + 3 + 'px';
help.style.width = content.clientWidth - 14 - left.clientWidth + 'px';
if ($('content-right-content-right').clientHeight == 0) {
if ($('content-onload-background')) {
help.style.height = $('content-onload-background').clientHeight - 22 + 'px';
}
} else {
help.style.height = $('content-right-content-right').clientHeight - 22 + 'px';
}
help.style.display = '';
}
var options = {parameters: 'typo3[id]=' + HelpID + '&application[cmd]=loadtypohelp', method: 'post'};
loadAjaxContent(options, 'loadtypohelp');
}
}
function onBodyResizeHomepage()
{
var basket = $('printart-basket-window');
if (basket.display == '') {
var left = $('content-left');
var content = $('layout-center');
var topNavi = $('content-right-navigation');
if (basket && left && content) {
basket.style.top = '83px';
basket.style.left = content.offsetLeft + left.clientWidth + 3 + 'px';
basket.style.width = content.clientWidth - 14 - left.clientWidth + 'px';
basket.style.height = $('content-right-content-right').clientHeight - 22 + 'px';
basket.style.display = '';
}
}
}
function handleHomepageLoad()
{
var options = {parameters: 'application[cmd]=handlehomepageload&', method: 'post'};
loadAjaxContent(options, 'handlehomepageload');
}
function showPartnerArea()
{
var basket = $('printart-basket-window');
var left = $('content-left');
var content = $('layout-center');
var topNavi = $('content-right-navigation');
if (basket && left && content) {
basket.innerHTML = '';
basket.style.top = '83px';
basket.style.left = content.offsetLeft + left.clientWidth + 3 + 'px';
basket.style.width = content.clientWidth - 14 - left.clientWidth + 'px';
basket.style.height = $('content-right-content-right').clientHeight - 22 + 'px';
basket.style.display = '';
}
var options = {parameters: 'application[cmd]=showpartnerarea&', method: 'post'};
loadAjaxContent(options, 'showpartnerarea');
}
function handleLogoutClick()
{
var options = {parameters: 'application[cmd]=handlelogoutclick&', method: 'post'};
loadAjaxContent(options, 'handlelogoutclick');
var basket = $('printart-basket-window');
if (basket) {
if (basket.style.display == '') {
basket.style.innerHTML = '';
basket.style.display = 'none';
}
}
}
function handleLoginClick(LoginForm) {
var info = $('login-message');
info.innerHTML = '';
var request = '';
var userOK = false;
var passwdOK = false;
if (checkMail(LoginForm.elements['login[username]'].value)) {
request = request + 'login[username]=' + LoginForm.elements['login[username]'].value;
userOK = true;
} else {
info.innerHTML = 'Benutzername ist keine E-Mailadresse!';
}
if (LoginForm.elements['login[password]'].value != '') {
request = request + '&login[password]=' + MD5(LoginForm.elements['login[password]'].value);
passwdOK = true;
} else {
info.innerHTML = 'Passwort muss ausgefüllt sein!';
}
if (passwdOK && userOK) {
var options = {parameters: 'application[cmd]=handleloginclick&' + request, method: 'post'};
loadAjaxContent(options, 'handleloginclick');
}
}
function getContentById(id)
{
if ($('vaultDiv')) {
$('vaultDiv').style.display = 'none';
}
if ($('content-right-navigation-tabs-homepage')) {
$('content-right-navigation-tabs-homepage').style.display = 'none';
}
var basket = $('printart-basket-window');
var left = $('content-left');
var content = $('layout-center');
var topNavi = $('content-right-navigation');
if ((basket && left && content) || ($('content-onload-background') && basket)) {
basket.innerHTML = '';
basket.style.top = '83px';
basket.style.left = content.offsetLeft + left.clientWidth + 3 + 'px';
basket.style.width = content.clientWidth - 14 - left.clientWidth + 'px';
if (document.domain != 'www.printart.ch' && document.domain != 'printart.ch') {
var height = $('content-right-content-right').clientHeight - 22;
basket.style.height = height + 'px';
} else {
$('content-right-content-right').style.height = '750px';
if ($('content-right-content-right').clientHeight == 0) {
if ($('content-onload-background')) {
var height = $('content-onload-background').clientHeight - 12;
}
} else {
var height = $('content-right-content-right').clientHeight - 10;
}
basket.style.height = height + 'px';
}
basket.style.display = '';
} else {
if ($('content-right-content-right').clientHeight == 0) {
if ($('content-onload-background')) {
var height = $('content-onload-background').clientHeight - 12 ;
basket.style.height = height +'px';
}
}
}
//Elemente registrieren
registerElements();
//AJAX Abfrage senden
var options = {parameters: 'typo3[id]=' + id + '&application[cmd]=loadtypocontent', method: 'post'};
loadAjaxContent(options, 'loadtypocontent');
}
function continueShoppingTour()
{
if (modeflex) {
var flexw = $('printart-flex-window');
if (flexw) {
handleFlexShow(true);
}
}
if ($('content-right-cell'))
$('content-right-cell').style.height = '';
if (document.domain == 'www.printart.ch' && document.domain == 'printart.ch') {
if ($('content-frame'))
$('content-frame').style.height = '';
if ($('content-onload').style.display == 'none') {
$('content-frame').style.height = $('content-onload').offsetHeight + $('content-right-navigation').offsetHeight + 'px';
}
}
if ($('vaultDiv')) {
$('vaultDiv').style.display = '';
}
$('content-right-content-right').style.visibility = 'visible';
if ($('printart-help-box'))
$('printart-help-box').style.visibility = 'visible';
$('printart-help-window').style.display = 'none';
$('printart-basket-window').style.display = 'none';
handleHomepageLoadFinish();
}
function handleBodyLoad(startID)
{
if ($('printart-flex-window'))
$('printart-flex-window').style.display = 'none';
$('content-right-content-left').style.border = '';
$('content-right-content-left').style.marginBottom = '';
$('content-right-content-left').style.height = '';
$('printart-help-window').style.display = 'none';
$('printart-basket-window').style.display = 'none';
$('content-right-content-right').innerHTML = '';
$('content-right-content-right').style.visibility = 'visible';
if ($('printart-help-box'))
$('printart-help-box').style.visibility = 'visible';
if ($('content-right-cell'))
$('content-right-cell').style.display = '';
if (startID)
getContentById(startID);
else {
handleTabMenuActive('loadsite') ;
//Rechte Seite laden
var options = {parameters: 'application[cmd]=loadsite', method: 'post'};
loadAjaxContent(options, 'loadsite');
}
transparency($('preview-image-large-background'), 70);
}
function showLoading()
{
transparency($('printartLoading'), 70);
if ($('loadingImageBox'))
$('loadingImageBox').style.display = '';
}
function handleFormUpdate(formElement)
{
var elementFormat = $('order-format-select');
var elementFormatSelect = formElement.form.elements['order[format-select]'];
if (elementFormat && elementFormatSelect) {
if (elementFormat.value == 'select' && elementFormatSelect.selectedIndex == 0)
elementFormatSelect.selectedIndex = 1;
if (formElement.value != 'select' && formElement.name != 'order[format-select]' && !elementFormat.checked)
elementFormatSelect.selectedIndex = 0;
}
/*if (element) {
if (formElement.name == 'order[format-select]' && formElement.selectedIndex == 0) {
element.selectedIndex = 1;
} else if (formElement.value == 'select' && element.selectedIndex == 0) {
element.selectedIndex = 1;
}
}*/
handleFormSubmit(formElement, 'loadorderpart', false);
}
function toggleDeliveryAddress() {
if ($('delivery_address').style.display == 'none') {
$('delivery_address').style.display = 'block';
} else if ($('delivery_address').style.display == 'block') {
$('delivery_address').style.display = 'none';
}
}
function handlePurchaseFormSubmit(formElement)
{
var message = '';
var correct = true;
if ($('purchase-inv_sex').value == '') {
$('purchase-inv_sex-label').style.color = '#ff0000';
message = message + '- Bitte [Anrede] ausfüllen\n';
correct = false;
} else {
$('purchase-inv_sex-label').style.color = '';
}
if ($('purchase-inv_firstname').value == '') {
$('purchase-inv_firstname-label').style.color = '#ff0000';
message = message + '- Bitte [Vorname] ausfüllen\n';
correct = false;
} else {
$('purchase-inv_firstname-label').style.color = '';
}
if ($('purchase-inv_name').value == '') {
$('purchase-inv_name-label').style.color = '#ff0000';
message = message + '- Bitte [Nachname] ausfüllen\n';
correct = false;
} else {
$('purchase-inv_name-label').style.color = '';
}
if ($('purchase-inv_street').value == '') {
$('purchase-inv_street-label').style.color = '#ff0000';
message = message + '- Bitte [Strasse] ausfüllen\n';
correct = false;
} else {
$('purchase-inv_street-label').style.color = '';
}
if ($('purchase-inv_zip').value == '') {
$('purchase-inv_zip-label').style.color = '#ff0000';
message = message + '- Bitte [PLZ] ausfüllen\n';
correct = false;
} else {
$('purchase-inv_zip-label').style.color = '';
}
if ($('purchase-inv_city').value == '') {
$('purchase-inv_city-label').style.color = '#ff0000';
message = message + '- Bitte [Stadt] ausfüllen\n';
correct = false;
} else {
$('purchase-inv_city-label').style.color = '';
}
if ($('inv_country_id').value == '') {
$('inv_country_id-label').style.color = '#ff0000';
message = message + '- Bitte [Land] ausfüllen\n';
correct = false;
} else {
$('inv_country_id-label').style.color = '';
}
if ($('purchase-email').value == '') {
$('purchase-email-label').style.color = '#ff0000';
message = message + '- Bitte [E-Mail] ausfüllen\n';
correct = false;
} else {
if (checkMail($('purchase-email').value)) {
$('purchase-email-label').style.color = '';
} else {
$('purchase-email-label').style.color = '#ff0000';
message = message + '- Bitte [E-Mail] ausfüllen\n';
correct = false;
}
}
if ($('purchase-phone').value == '') {
$('purchase-phone-label').style.color = '#ff0000';
message = message + '- Bitte [Telefon] ausfülllen\n';
correct = false;
}
if (!$('purchase-agbaccept').checked) {
$('purchase-agbaccept-label').style.color = '#ff0000';
message = message + '- Bitte [AGB akzeptieren] ausfüllen\n';
correct = false;
} else {
$('purchase-agbaccept-label').style.color = '';
}
if ($('purchase-deliverymethod')) {
if ($('purchase-deliverymethod').checked != true && $('purchase-paymethod_id').value == 6) {
$('purchase-deliverymethod-label').style.color = '#ff0000';
$('purchase-paymethod_id-label').style.color = '#ff0000';
message = message + '- Wenn [Zahlungsart] "Barzahlung bei Abholung in Freienbach" ausgewählt ist, muss [Abholung] ausgewählt sein\n';
correct = false;
} else {
$('purchase-deliverymethod-label').style.color = '';
$('purchase-paymethod_id-label').style.color = '';
}
}
if ($('purchase-delivery_toggle').checked) {
message = message + '\n\nLieferadresse\n\n'
if ($('purchase-del_sex').value == '') {
$('purchase-del_sex-label').style.color = '#ff0000';
message = message + '- Bitte [Anrede] ausfüllen\n';
correct = false;
} else {
$('purchase-del_sex-label').style.color = '';
}
if ($('purchase-del_firstname').value == '') {
$('purchase-del_firstname-label').style.color = '#ff0000';
message = message + '- Bitte [Vorname] ausfüllen\n';
correct = false;
} else {
$('purchase-del_firstname-label').style.color = '';
}
if ($('purchase-del_name').value == '') {
$('purchase-del_name-label').style.color = '#ff0000';
message = message + '- Bitte [Nachname] ausfüllen\n';
correct = false;
} else {
$('purchase-del_name-label').style.color = '';
}
if ($('purchase-del_street').value == '') {
$('purchase-del_street-label').style.color = '#ff0000';
message = message + '- Bitte [Strasse] ausfüllen\n';
correct = false;
} else {
$('purchase-del_street-label').style.color = '';
}
if ($('purchase-del_zip').value == '') {
$('purchase-del_zip-label').style.color = '#ff0000';
message = message + '- Bitte [PLZ] ausfüllen\n';
correct = false;
} else {
$('purchase-del_zip-label').style.color = '';
}
if ($('purchase-del_city').value == '') {
$('purchase-del_city-label').style.color = '#ff0000';
message = message + '- Bitte [Stadt] ausfüllen\n';
correct = false;
} else {
$('purchase-del_city-label').style.color = '';
}
if ($('del_country_id').value == '') {
$('del_country_id-label').style.color = '#ff0000';
message = message + '- Bitte [Land] ausfüllen\n';
correct = false;
} else {
$('del_country_id-label').style.color = '';
}
}
if (correct)
handleFormSubmit(formElement, 'handlePurchaseFinish', true);
else
alert('Bitte die benötigten Felder ausfüllen:\n\n' + message);
}
function handlePaymethodChange(ID) {
if (ID == 3) {
$('postbill-table').style.display = '';
} else {
$('postbill-table').style.display = 'none';
$('purchase-postbill').checked = false;
}
}
function checkMail(str) {
var at="@"
var dot="."
var lat=str.indexOf(at)
var lstr=str.length
var ldot=str.indexOf(dot)
if (str.indexOf(at)==-1){
return false
}
if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
return false
}
if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
return false
}
if (str.indexOf(at,(lat+1))!=-1){
return false
}
if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
return false
}
if (str.indexOf(dot,(lat+2))==-1){
return false
}
if (str.indexOf(" ")!=-1){
return false
}
return true
}
function handleFormSubmit(formElement, Command, Checkbox)
{
var activeForm = formElement.form;
var request = '';
var first = true;
/*if ($(formElement.name)) {
$(formElement.name).checked = true;
} else {
if ($(formElement.name+'-first-option'))
$(formElement.name+'-first-option').selected = true;
}*/
for (i = 0; i < activeForm.elements.length; i++) {
if (!first)
request = request + '&';
if (activeForm.elements[i].type == 'radio') {
if (activeForm.elements[i].checked) {
request = request + activeForm.elements[i].name + '=' + activeForm.elements[i].value;
first = false;
}
} else if (activeForm.elements[i].type == 'checkbox') {
if (Checkbox) {
if (activeForm.elements[i].checked) {
request = request + activeForm.elements[i].name + '=1';
} else {
request = request + activeForm.elements[i].name + '=0';
}
} else {
if (activeForm.elements[i].checked) {
request = request + activeForm.elements[i].name + '[' + activeForm.elements[i].value + ']' + '=1';
} else {
request = request + activeForm.elements[i].name + '[' + activeForm.elements[i].value + ']' + '=0';
}
}
first = false;
} else {
request = request + activeForm.elements[i].name + '=' + activeForm.elements[i].value;
first = false;
}
}
var options = {parameters: 'application[cmd]=' + Command + '&' + request, method: 'post'};
loadAjaxContent(options, Command);
}
function handlePreviewSliderClick(PicFrom, AlbumID, AlbumFrom)
{
var options = {parameters: 'application[cmd]=handlePreviewSliderClick&shop[picFrom]=' + PicFrom + '&shop[album]=' + AlbumID + '&shop[albumFrom]=' + AlbumFrom, method: 'post'};
loadAjaxContent(options, 'handlePreviewSliderClick');
}
function handleShowPreviewPicture(PictureID, BasketID, FormatID)
{
$('content-right-content-right').style.visibility = 'hidden';
if ($('printart-help-box'))
$('printart-help-box').style.visibility = 'hidden';
var format = document.getElementsByName('order[format]');
var request = '';
for (i = 0;i < format.length;i++) {
if (format[i].checked && format[i].value != 'select')
request = '&order[format]=' + format[i].value;
if (format[i].checked && format[i].value == 'select') {
var formatSelect = document.getElementsByName('order[format-select]');
request = '&order[format]=' + formatSelect[0].value;
}
}
if (request == '')
request = '&order[format]=' + FormatID;
request = request + '&browser[width]=' + getInnerWidth();
request = request + '&browser[height]=' + getInnerHeight();
var options = {parameters: 'application[cmd]=handleShowPreviewPicture&shop[pictureID]=' + PictureID + '&basket[ID]=' + BasketID + request, method: 'post'};
loadAjaxContent(options,'handleShowPreviewPicture');
}
function closePreviewPictureWindow()
{
$('content-right-content-right').style.visibility = 'visible';
if ($('printart-help-box'))
$('printart-help-box').style.visibility = 'visible';
$('printart-preview-overlay').style.display = 'none';
$('printart-preview-window').style.display = 'none';
}
function handlePreviewImageClick(Image, PictureID)
{
var format = document.getElementsByName('order[format]');
var request = '';
for (i = 0;i < format.length;i++) {
if (format[i].checked && format[i].value != 'select')
request = '&order[format]=' + format[i].value;
}
var images = document.getElementsByTagAndClassName('img', 'shop-slider-image-active');
for (i = 0; i < images.length; i++) {
images[i].className = 'shop-slider-image-inactive';
}
Image.className = 'shop-slider-image-active';
var options = {parameters: 'application[cmd]=handlePreviewImageClick&shop[pictureID]=' + PictureID + request, method: 'post'};
loadAjaxContent(options,'handlePreviewImageClick');
}
function showLargeImage(PictureAddress)
{
var fenster = window.open(PictureAddress, "PicturePreview", "width=1024,height=768,left=0,top=0");
fenster.focus();
}
function windowClose()
{
if ($('vaultDiv')) {
$('vaultDiv').style.display = '';
}
$('content-right-content-right').style.visibility = 'visible';
if ($('printart-help-box'))
$('printart-help-box').style.visibility = 'visible';
$('printart-basket-window').style.display = 'none';
$('printart-help-window').style.display = 'none';
return false;
}
function showAGB()
{
if ($('printart-flex-window'))
$('printart-flex-window').style.display = 'none';
showBasketWindow();
$('printart-basket-window').style.overflow = '';
var options = {parameters: 'application[cmd]=showAGB', method: 'post'};
loadAjaxContent(options, 'showAGB');
}
function showImpressum()
{
if ($('printart-flex-window'))
$('printart-flex-window').style.display = 'none';
showBasketWindow();
var options = {parameters: 'application[cmd]=showImpressum', method: 'post'};
loadAjaxContent(options, 'showImpressum');
}
function showBasketWindow()
{
if ($('content-right-cell'))
$('content-right-cell').style.height = '800px';
if ($('content-frame'))
$('content-frame').style.height = '800px';
if ($('vaultDiv')) {
$('vaultDiv').style.display = 'none';
}
var basket = $('printart-basket-window');
var left = $('content-right-cell');
var right = $('content-right-content-right');
var content = $('content-frame');
if (basket && left && right) {
right.style.visibility = 'hidden';
if ($('printart-help-box'))
$('printart-help-box').style.visibility = 'hidden';
basket.innerHTML = '';
basket.style.top = left.offsetTop + 'px';
basket.style.left = left.offsetLeft + 'px';
basket.style.width = left.offsetWidth - 14 + right.offsetWidth + 'px';
basket.style.height = left.offsetHeight - 14 + 'px';
basket.style.display = '';
} else if (content && right) {
contentFrame = $('layout-center');
var contentRightNavigation = $('content-right-navigation');
if ($('printart-help-box'))
$('printart-help-box').style.visibility = 'hidden';
right.style.visibility = 'hidden';
basket.innerHTML = '';
if (window.navigator.userAgent.indexOf("MSIE ") > -1 && parseFloat(navigator.appVersion) >= 4)
basket.style.top = content.offsetTop + contentRightNavigation.offsetHeight + 8 + 'px';
else
basket.style.top = content.offsetTop + contentRightNavigation.offsetHeight + 'px';
basket.style.left = contentFrame.offsetLeft + 2 + 'px';
basket.style.width = content.offsetWidth - 12 + 'px';
basket.style.height = content.offsetHeight - contentRightNavigation.offsetHeight - 14 + 'px';
basket.style.display = '';
}
}
function showBasket()
{
showBasketWindow();
}
function handleBasketButtonClick(formElement)
{
if ($('printart-help-window'))
$('printart-help-window').style.display = 'none';
$('printart-basket-window').style.display = 'none';
showBasket();
handleFormSubmit(formElement, 'handleBasketAddProduct', false);
}
function handleCouponTextBlur()
{
var coupon_text = document.getElementsByClassName('basket_picture_cmd');
for (var i = 0; i < coupon_text.length; i++) {
var basket_id = coupon_text[i].name.replace(/basket_picture_cmd_/g, '');
var coupon_value = coupon_text[i].value;
var Request = '&basket_id=' + basket_id + '&coupon_text=' + coupon_value.replace(/\n/g, '
').replace(/\&/g, '\&');
var options = {parameters: 'application[cmd]=addCouponTextToBasket' + Request, method: 'post'};
loadAjaxContent(options, 'addCouponTextToBasket');
}
}
function handleBasketOrderClick(Command, Request)
{
handleCouponTextBlur();
Request = '&' + Request + '=1';
var options = {parameters: 'application[cmd]=' + Command + Request, method: 'post'};
loadAjaxContent(options, Command);
}
function handleBasketShowClick()
{
if ($('printart-flex-window'))
$('printart-flex-window').style.display = 'none';
if ($('printart-help-window'))
$('printart-help-window').style.display = 'none';
$('printart-basket-window').style.display = 'none';
showBasket();
var options = {parameters: 'application[cmd]=handleBasketShow', method: 'post'};
loadAjaxContent(options, 'handleBasketShow');
}
function handleOnMouseOver(HTMLElement)
{
if (HTMLElement.id == 'picture-wall-image')
if ($('picture-information'))
$('picture-information').style.display = 'block';
HTMLElement.style.cursor = 'pointer';
}
function handleOnMouseOut(HTMLElement)
{
if (HTMLElement.id == 'picture-wall-image')
if ($('picture-information'))
$('picture-information').style.display = 'none';
HTMLElement.style.cursor = 'default';
}
function Numsort (a, b) {
return a - b;
}
function handleBasketChanges(Command, BasketID, BasketOptionID, EditIdentifier)
{
var options = {parameters: 'application[cmd]=' + Command + '&basket[id]=' + BasketID + '&basketoption[id]=' + BasketOptionID + '&basket[identifier]=' + EditIdentifier, method: 'post'};
loadAjaxContent(options, Command);
}
function handleBasketChangeValue(BasketID, BasketOptionID, Value, FieldName)
{
var options = {parameters: 'application[cmd]=handleBasketChangeValue&basket[id]=' + BasketID + '&basketoption[id]=' + BasketOptionID + '&basket[fieldname]=' + FieldName + '&basket[value]=' + Value, method: 'post'};
loadAjaxContent(options, 'handleBasketChangeValue');
}
function handleTabMenuActive(Command)
{
if ($('header-menu-tab-photo')) {
if ($('header-menu-tab-photo').src.search(/inactive/) == -1)
$('header-menu-tab-photo').src = $('header-menu-tab-photo').src.replace(/active/g, 'inactive');
}
if ($('header-menu-tab-poster')) {
if ($('header-menu-tab-poster').src.search(/inactive/) == -1)
$('header-menu-tab-poster').src = $('header-menu-tab-poster').src.replace(/active/g, 'inactive');
}
if ($('header-menu-tab-own')) {
if ($('header-menu-tab-own').src.search(/inactive/) == -1)
$('header-menu-tab-own').src = $('header-menu-tab-own').src.replace(/active/g, 'inactive');
}
if ($('header-menu-tab-catalogue')) {
if ($('header-menu-tab-catalogue').src.search(/inactive/) == -1)
$('header-menu-tab-catalogue').src = $('header-menu-tab-catalogue').src.replace(/active/g, 'inactive');
}
if ($('header-menu-tab-search')) {
if ($('header-menu-tab-search').src.search(/inactive/) == -1)
$('header-menu-tab-search').src = $('header-menu-tab-search').src.replace(/active/g, 'inactive');
}
if (Command == 'loaduploadsite') {
if ($('header-menu-tab-own'))
$('header-menu-tab-own').src = $('header-menu-tab-own').src.replace(/inactive/g, 'active');
} else if (Command == 'loadphotosite') {
if ($('header-menu-tab-photo'))
$('header-menu-tab-photo').src = $('header-menu-tab-photo').src.replace(/inactive/g, 'active');
} else if (Command == 'loadcataloguesite') {
if ($('header-menu-tab-catalogue'))
$('header-menu-tab-catalogue').src = $('header-menu-tab-catalogue').src.replace(/inactive/g, 'active');
} else if (Command == 'handleShowSearch') {
if ($('header-menu-tab-search'))
$('header-menu-tab-search').src = $('header-menu-tab-search').src.replace(/inactive/g, 'active');
}
if (Command == 'loadcataloguesite' || Command == 'handleloginshow' || Command == 'handleShowSearch') {
if ($('preview-image')) {
$('preview-image').style.display = 'none';
}
if ($('preview-image-overlay')) {
$('preview-image-overlay').style.display = 'none';
}
if ($('preview-image-box')) {
$('preview-image-box').style.display = 'none';
}
if ($('content-right-content-left-thumbnail')) {
$('content-right-content-left-thumbnail').innerHTML = '';
}
} else {
if ($('preview-image')) {
$('preview-image').style.display = '';
}
if ($('preview-image-overlay')) {
$('preview-image-overlay').style.display = '';
}
if ($('preview-image-box')) {
$('preview-image-box').style.display = '';
}
}
}
function handleMenuClick(Command, Request)
{
modePlus = 0;
var flexw = $('printart-flex-window');
if (flexw) {
flexw.style.display = 'none';
}
if ($('content-right-navigation-tabs-homepage') && Command != 'handleloginshow') {
$('content-right-navigation-tabs-homepage').style.display = '';
}
if ($('content-onload')) {
$('content-onload').style.display = 'none';
}
if ($('content-right-content')) {
$('content-right-content').style.display = 'block';
}
if ($('vaultDiv')) {
$('vaultDiv').style.display = 'none';
}
$('content-right-content-right').style.visibility = 'visible';
if ($('printart-help-box'))
$('printart-help-box').style.visibility = 'visible';
if (Command == 'handleloginshow') {
modePlus = 1;
$('content-right-content-left').style.border = '2px solid black';
$('content-right-content-left').style.marginBottom = '10px';
$('content-right-content-left').style.height = '400px';
$('content-right-content-left').style.width = '586px';
if (document.domain == 'www.printart.ch' || document.domain == 'printart.ch') {
$('content-right-content-left').style.height = '750px';
//$('content-right-content-left').style.backgroundColor = '#C0C0C0';
}
} else if (Command == 'handleShowSearch') {
modePlus = 1;
$('content-right-content-left').style.border = '2px solid black';
$('content-right-content-left').style.marginBottom = '10px';
$('content-right-content-left').style.height = '900px';
$('content-right-content-left').style.width = '';
if (document.domain == 'www.printart.ch' || document.domain == 'printart.ch') {
if ($('content-frame')) {
$('content-frame').style.height = '980px';
$('content-right-content-left').style.height = '970px';
$('content-right-content-right').style.height = '970px';
}
}
} else {
$('content-right-content-left').style.border = '';
$('content-right-content-left').style.marginBottom = '';
$('content-right-content-left').style.width = '';
$('content-right-content-left').style.height = '';
}
handleTabMenuActive(Command);
if (Command == 'loadcataloguesite') {
window.location = 'http://katalog.printart.ch/';
}
$('printart-help-window').style.display = 'none';
$('printart-basket-window').style.display = 'none';
$('content-right-content-right').innerHTML = '';
if ($('content-right-cell'))
$('content-right-cell').style.display = '';
if (Request != '')
Request = '&' + Request;
var options = {parameters: 'application[cmd]=' + Command + Request, method: 'post'};
loadAjaxContent(options, Command);
handleHomepageLoadFinish();
}
/* Category Selection */
function handleSelectionMenuClick(LinkElement, MenuID, CatID)
{
var links = document.getElementsByClassName('selection-menu-link', 'selection-menu');
for (i = 0; i < links.length; i++) {
links[i].style.backgroundColor = '';
links[i].childNodes[0].src = links[i].childNodes[0].src.replace(/_active/g, '_inactive');
}
LinkElement.childNodes[0].src = LinkElement.childNodes[0].src.replace(/_inactive/g, '_active');
var options = {parameters: 'application[cmd]=handleSectionMenuClick&selection[menuID]=' + MenuID + '&selection[shop][catID]=' + CatID, method: 'post'};
loadAjaxContent(options, 'handleSectionMenuClick');
}
function handleThemaEvent(ImageObject, MouseEvent, MenuID, ThemaID, ShopID, AlbumID, Area, Mode, CatID)
{
if (MouseEvent == 'mouseClick') {
if (ImageObject.className != '') {
ImageObject.className = 'selection-' + Area.toLowerCase() + '-content-item-active';
var images = document.getElementsByTagName('div');
for (i = 0; i < images.length; i++) {
if (images[i].className == 'selection-' + Area.toLowerCase() + '-content-item-active')
images[i].className = 'selection-' + Area.toLowerCase() + '-content-item-inactive';
}
ImageObject.className = 'selection-' + Area.toLowerCase() + '-content-item-active';
}
var images = document.getElementsByClassName('printart-catalogue-' + Area.toLowerCase() + '-text-image');
for (i = 0; i < images.length; i++) {
if (images[i].src.search(/inactive/) == -1)
images[i].src = images[i].src.replace(/active/g, 'inactive');
}
ImageObject.firstChild.firstChild.src = ImageObject.firstChild.firstChild.src.replace(/inactive/g, 'active');
var options = {parameters: 'application[cmd]=handle' + Area + 'MouseClick&selection[themaID]=' + ThemaID + '&selection[shopID]=' + ShopID + '&selection[albumID]=' + AlbumID + '&selection[menuID]=' + MenuID + '&selection[shop][mode]=' + Mode + '&selection[shop][catID]=' + CatID, method: 'post'};
loadAjaxContent(options, 'handle' + Area + 'MouseClick');
} else if (MouseEvent == 'mouseOver') {
if (CatID != '')
CatID = '-' + CatID;
if (ImageObject.className != '') {
if (ImageObject.className != 'selection-' + Area.toLowerCase() + '-content-item-active')
ImageObject.className = 'selection-' + Area.toLowerCase() + '-content-item-focus';
}
//$('selection-' + Area.toLowerCase() + CatID + '-title').innerHTML = ImageObject.alt;
} else if (MouseEvent == 'mouseOut') {
if (CatID != '')
CatID = '-' + CatID;
if (ImageObject.className != '') {
if (ImageObject.className != 'selection-' + Area.toLowerCase() + '-content-item-active')
ImageObject.className = 'selection-' + Area.toLowerCase() + '-content-item-inactive';
}
var images = document.getElementsByTagName('div');
//for (i = 0; i < images.length; i++) {
//if (images[i].className == 'selection-' + Area.toLowerCase() + '-content-item-active')
//$('selection-' + Area.toLowerCase() + CatID + '-title').innerHTML = images[i].alt;
//}
}
}
function handleScrollButtonClick(CatID, MenuRootID, ThemaRootID, Area, Mode)
{
var request = '&selection[menuID]=' + MenuRootID;
request += '&selection[themaID]=' + ThemaRootID;
request += '&selection[shop][catID]=' + CatID;
var options = {parameters: 'application[cmd]=handleScrollButtonClick&selection[' + Area + '][mode]=' + Mode + request, method: 'post'};
loadAjaxContent(options, 'handleScrollButtonClick');
}
function handlePictureScroll(ShopID, PictureFrom, Mode)
{
var request = '&selection[shopID]=' + ShopID;
request += '&selection[PictureFrom]=' + PictureFrom;
request += '&selection[mode]=' + Mode;
var options = {parameters: 'application[cmd]=handlePictureScroll' + request, method: 'post'};
loadAjaxContent(options, 'handlePictureScroll');
}
function handleShowPictureTimeout(PictureID, AlbumID)
{
var options = {parameters: 'application[cmd]=handlePreviewImageClick&shop[pictureID]=' + PictureID + '&shop[album]=' + AlbumID, method: 'post'};
loadAjaxContent(options, 'handlePreviewImageClick');
}
function handleCouponApplyClick(Form)
{
if (Form) {
var coupon_code = Form.elements['coupon[code]'].value;
var options = {parameters: 'application[cmd]=handleCouponApplyClick&coupon[code]=' + coupon_code, method: 'post'};
loadAjaxContent(options, 'handleCouponApplyClick');
}
}
function handleShowPictureDirect(PictureID, AlbumID)
{
window.setTimeout('handleShowPictureTimeout(' + PictureID + ', ' + AlbumID + ')', 500);
}
function handleLoadArea(Command)
{
window.setTimeout('handleMenuClick(\'' + Command + '\')', 500);
}
function handleSearchButtonClick(StartIndex)
{
if ($('printart-search-form-loading')) {
$('printart-search-form-loading').style.display = '';
}
if ($('printart-search-form-result-count')) {
$('printart-search-form-result-count').innerHTML = 'Suche läuft...';
}
var postStr = '';
postStr = 'search[start-index]=' + StartIndex;
if ($('printart-search-form-keyword')) {
if ($('printart-search-form-keyword').value != '') {
if (postStr != '')
postStr += '&';
postStr += 'search[keyword]=' + encodeURIComponent($('printart-search-form-keyword').value);
}
}
if ($('printart-search-form-artist')) {
if ($('printart-search-form-artist').value != '') {
if (postStr != '')
postStr += '&';
postStr += 'search[artist]=' + encodeURIComponent($('printart-search-form-artist').value);
}
}
if ($('printart-search-form-modality')) {
if ($('printart-search-form-modality').value != '') {
if (postStr != '')
postStr += '&';
postStr += 'search[modality]=' + encodeURIComponent($('printart-search-form-modality').value);
}
}
if ($('printart-search-form-color')) {
if ($('printart-search-form-color').value != '') {
if (postStr != '')
postStr += '&';
postStr += 'search[color]=' + encodeURIComponent($('printart-search-form-color').value);
}
}
if ($('printart-search-form-format-from')) {
if ($('printart-search-form-format-from').value != '') {
if (postStr != '')
postStr += '&';
postStr += 'search[format-from]=' + $('printart-search-form-format-from').value;
}
}
if ($('printart-search-form-format-to')) {
if ($('printart-search-form-format-to').value != '') {
if (postStr != '')
postStr += '&';
postStr += 'search[format-to]=' + $('printart-search-form-format-to').value;
}
}
if (postStr != '')
postStr = '&' + postStr;
var options = {parameters: 'application[cmd]=handleSearch' + postStr, method: 'post'};
loadAjaxContent(options, 'handleSearch');
}
function onBodyResize()
{
var basket = $('printart-basket-window');
if (basket) {
if (!basket.style.display) {
var left = $('content-right-cell');
var table = $('layout-center-background');
basket.style.top = left.offsetTop + 'px';
basket.style.left = left.offsetLeft + 'px';
basket.style.width = table.offsetWidth - 14 + 'px';
basket.style.height = left.offsetHeight - 14 + 'px';
}
}
var help = $('printart-help-window');
if (help) {
if (!help.style.display) {
var right = $('content-right-cell');
help.style.top = right.offsetTop - 1+ 'px';
help.style.left = right.offsetLeft + 'px';
help.style.width = right.offsetWidth - 10 + 'px';
help.style.height = right.offsetHeight - 1 + 'px';
}
}
}
function handleInfoBoxClose()
{
$('infoBox').style.display = 'none';
$('infoBoxSplash').style.display = 'none';
}
function handleShowBill()
{
var options = {parameters: 'application[cmd]=handleshowbill', method: 'post'};
loadAjaxContent(options, 'handleshowbill');
}
/* Homepage */
function switchActiveImage(ImageElement, Index)
{
if (ImageElement.src.search(/_active/) == -1) {
var images = document.getElementsByClassName('homepage-image-menu', $('homepage-image-box'));
for (i = 0; i < images.length; i++) {
images[i].src = images[i].src.replace(/_active/g, '_inactive');
}
ImageElement.src = ImageElement.src.replace(/_inactive/g, '_active');
//$('content-right-content-right').innerHTML = '
';
}
}
function handleFormCreateOwnShopSubmit(FormName)
{
var elementSubdomain = $('own-shop-url');
var isOK = true;
var reload = false;
var elementForm = document.forms[FormName];
if (elementSubdomain) {
if (elementSubdomain.value != '') {
if (elementSubdomain.value.search(/^[a-z0-9]([a-z0-9-])+$/) != -1) {
elementSubdomain.style.backgroundColor = '#ffffff';
elementSubdomain.style.color = '#000000';
if (elementForm) {
var elementisOK = elementForm.elements['ownshop[urlok]'];
if (!elementisOK) {
var func = 'handleFormCreateOwnShopSubmit(\'' + FormName + '\')';
isOK = false;
window.setTimeout(func, 10);
reload = true;
} else {
if (elementisOK.value != 1) {
isOK = false;
}
}
}
} else {
isOK = false;
elementSubdomain.style.backgroundColor = '#ff0000';
elementSubdomain.style.color = '#ffffff';
$('own-shop-url-status').innerHTML = '