if (typeof isScreenBlocked == 'undefined')
{
var isScreenBlocked = false;
}
function blockScreen()
{
if (!isScreenBlocked)
{
isScreenBlocked = true;
$.blockUI(
{
message: '
 | Bitte warten ... |
',
css: { border: '3px solid #ddd', width: '200px', left: (jQuery(window).width() - 200) /2 + 'px' },
overlayCSS: { backgroundColor: '#000' },
fadeIn:0,
baseZ: 10000
});
}
}
function unblockScreen()
{
$.unblockUI({fadeOut:0});
isScreenBlocked = false;
}
function openContact()
{
blockScreen();
$("#dialogTwo").html("");
$("#dialogTwo").load("/homepage/dialog_contact.php").dialog({
close: function(event, ui)
{
$(this).dialog('destroy');
},
resizable: false,
height: 'auto',
minHeight: 640,
closeOnEscape: false,
width: 500,
modal: true,
bgiframe: true,
title: "Kontakt mit der Trovarit"
});
}
/************************** NEWSLETTER **************************/
function openNewsletter()
{
blockScreen();
$("#dialogTwo").html("");
$("#dialogTwo").load("/homepage/forms/dialog_newsletter.php").dialog({
close: function(event, ui)
{
$(this).dialog('destroy');
},
closeOnEscape: false,
resizable: false,
height: 'auto',
minHeight: 365,
width: 500,
modal: true,
bgiframe: true,
title: "Newsletter bestellen"
});
}
function sendNewsletter()
{
if ($('#newsletterForm').valid())
{
blockScreen();
$.post( "/homepage/ajax/ajax.php",
{
type: "SEND_NEWSLETTER",
inputNewsletterFirstName: $('#inputNewsletterFirstName').val(),
inputNewsletterName: $('#inputNewsletterName').val(),
inputNewsletterCompany: $('#inputNewsletterCompany').val(),
inputNewsletterStreet: $('#inputNewsletterStreet').val(),
inputNewsletterPLZ: $('#inputNewsletterPLZ').val(),
inputNewsletterCity: $('#inputNewsletterCity').val(),
inputNewsletterEMail: $('#inputNewsletterEMail').val()
},
function(data)
{
unblockScreen();
if (data == 0)
{
$("#dialogTwo").dialog("close");
infoDialog("INFORMATION","Ihre Newsletterbestellung wurde an uns gesendet!");
}
else
{
infoDialog("FEHLER",data);
}
}
);
}
else
{
infoDialog("FEHLER","Bitte füllen Sie alle rot markierten Felder korrekt aus!");
}
}
/************************** PDF Order **************************/
function openPDFOrder(pdfName)
{
blockScreen();
pdfName = encodeURI(pdfName);
$("#dialogTwo").html("");
$("#dialogTwo").load("/homepage/forms/dialog_pdf_order.php?doc="+pdfName+"").dialog({
close: function(event, ui)
{
$(this).dialog('destroy');
},
closeOnEscape: false,
resizable: false,
height: 'auto',
minHeight: 315,
width: 500,
dialogClass: "flora",
modal: true,
bgiframe: true,
title: "PDF bestellen",
overlay: {
opacity: 0.6,
background: "#000"
}
});
}
/************************** PRESSEVERTEILER **************************/
function openPresseverteiler()
{
blockScreen();
$("#dialogTwo").html("");
$("#dialogTwo").load("/homepage/forms/dialog_presseverteiler.php").dialog({
close: function(event, ui)
{
$(this).dialog('destroy');
},
closeOnEscape: false,
resizable: false,
height: 'auto',
minHeight: 375,
width: 500,
modal: true,
bgiframe: true,
title: "Aufnahme in den Presseverteiler"
});
}
/************************** SEMINARE **************************/
function openSeminar()
{
blockScreen();
$("#dialogTwo").html("");
$("#dialogTwo").load("/homepage/forms/dialog_seminar.php").dialog({
close: function(event, ui)
{
$(this).dialog('destroy');
},
closeOnEscape: false,
resizable: false,
height: 'auto',
minHeight: 1120,
width: 500,
modal: true,
bgiframe: true,
title: "Seminaranmeldung"
});
}
function sendSeminar()
{
if ($('#seminarForm').valid())
{
blockScreen();
var seminare = "";
$('.trovarit_seminar_container').each(function(i, val)
{
var titel = $(".seminarTitle",this).text();
var daten = "";
$(".inputSeminarTermindaten:checked", this).each(function(j, val)
{
daten = daten+'"'+$(this).val()+'",';
});
if (daten.length > 0)
{
daten = '['+daten.replace( /,*$/, "")+']';
seminare = seminare + '{"titel":"'+titel+'","date":'+daten +'},';
}
});
seminare = '{"seminare":['+seminare.replace( /,*$/, "")+']}';
$.post( "/homepage/ajax/ajax.php",
{
type: "SEND_SEMINAR",
seminarData: seminare,
inputSeminarFirstName: $('#inputSeminarFirstName').val(),
inputSeminarName: $('#inputSeminarName').val(),
inputSeminarCompany: $('#inputSeminarCompany').val(),
inputSeminarStreet: $('#inputSeminarStreet').val(),
inputSeminarPLZ: $('#inputSeminarPLZ').val(),
inputSeminarCity: $('#inputSeminarCity').val(),
inputSeminarTelefon: $('#inputSeminarTelefon').val(),
inputSeminarEMail: $('#inputSeminarEMail').val()
},
function(data)
{
unblockScreen();
if (data == 0)
{
$("#dialogTwo").dialog("close");
infoDialog("INFORMATION","Vielen Dank! Ihre Seminaranmeldung wurde versendet. Sie erhalten in Kürze eine Bestätigung von uns.");
}
else
{
infoDialog("FEHLER",data);
}
}
);
}
else
{
infoDialog("FEHLER","Bitte füllen Sie alle rot markierten Felder korrekt aus!");
}
}
/************************** MESSETERMIN **************************/
function openMessetermin(title,form)
{
if (form == null)
{
form = "";
}
if (title == null)
{
title = "Terminvereinbarung zur CeBIT 2012";
}
blockScreen();
$("#dialogTwo").html("");
$("#dialogTwo").load("/homepage/forms/dialog_messetermin.php?form="+form+"").dialog({
close: function(event, ui)
{
$(this).dialog('destroy');
},
closeOnEscape: false,
resizable: false,
height: 'auto',
minHeight: 1100,
width: 500,
modal: true,
bgiframe: true,
title: title
});
}
function sendMessetermin()
{
if ($('#messeterminForm').valid())
{
blockScreen();
var messetermine = "";
$(".inputMesseterminTermindaten:checked").each(function(j, val)
{
messetermine = messetermine+'"'+$(this).val()+'",';
});
messetermine = '{"messetermine":['+messetermine.replace( /,*$/, "")+']}';
var messeSpecials = "";
$(".inputMesseterminSpecials:checked").each(function(j, val)
{
messeSpecials = messeSpecials+'"'+$(this).val()+'",';
});
messeSpecials = '{"messeSpecials":['+messeSpecials.replace( /,*$/, "")+']}';
var messeThema = "";
$(".inputMesseterminThemes:checked").each(function(j, val)
{
messeThema = messeThema+'"'+$(this).val()+'",';
});
messeThema = '{"messeThema":['+messeThema.replace( /,*$/, "")+']}';
$.post( "/homepage/ajax/ajax.php",
{
type: "SEND_MESSETERMIN",
messetermine: messetermine,
messeSpecials: messeSpecials,
messeThema: messeThema,
inputMesseterminTitle: $('#inputMesseterminTitle').val(),
inputMesseterminFirstName: $('#inputMesseterminFirstName').val(),
inputMesseterminName: $('#inputMesseterminName').val(),
inputMesseterminCompany: $('#inputMesseterminCompany').val(),
inputMesseterminStreet: $('#inputMesseterminStreet').val(),
inputMesseterminPLZ: $('#inputMesseterminPLZ').val(),
inputMesseterminCity: $('#inputMesseterminCity').val(),
inputMesseterminTelefon: $('#inputMesseterminTelefon').val(),
inputMesseterminEMail: $('#inputMesseterminEMail').val(),
inputMesseterminSoftwareThema: $('#inputMesseterminSoftwareThema').val(),
inputMesseterminTime: $('#inputMesseterminTime').val(),
inputMesseterminBranche: $('#inputMesseterminBranche').val(),
inputMesseterminMessage: $('#inputMesseterminMessage').val(),
inputMesseterminCompanySize: $('input[name="inputMesseterminCompanySize"]:checked').val()
},
function(data)
{
unblockScreen();
if (data == 0)
{
$("#dialogTwo").dialog("close");
infoDialog("INFORMATION","Ihre Nachricht wurde an uns gesendet!");
}
else
{
infoDialog("FEHLER",data);
}
}
);
}
else
{
infoDialog("FEHLER","Bitte füllen Sie alle rot markierten Felder korrekt aus!");
}
}
/************************** REGISTRIERUNG **************************/
function openRegistration(registrationType)
{
blockScreen();
$.post( "/homepage/ajax/ajax.php",
{
type: "GET_REGISTER_TITLE_AND_HEIGHT",
registrationType: registrationType
},
function(data)
{
$("#dialogTwo").html("");
$("#dialogTwo").load("/homepage/dialog_register.php?registrationType="+registrationType+"").dialog({
close: function(event, ui)
{
$(this).dialog('destroy');
},
closeOnEscape: false,
resizable: false,
height: 'auto',
minHeight: data.height,
width: 500,
modal: true,
bgiframe: true,
title: data.title
});
},"json");
}
/**************************************************************/
function download(articleID)
{
$.post( "/homepage/ajax/ajax.php",
{
type: "DOWNLOADCENTER_ENABLED"
}, function(data)
{
if (data == 1)
{
getFile(articleID);
}
else
{
openDownloadcenterRegistration();
}
});
}
function getFile(articleID)
{
$.post( "/homepage/ajax/ajax.php",
{
type: "DOWNLOADCENTER_FILE_CHECK",
articleID: articleID
}, function(data)
{
if (data == 1)
{
location.href = "/homepage/get_file.php?id="+articleID+"";
}
else
{
infoDialog("FEHLER","Interner Fehler: Das angeforderte Dokument
kann nicht auf dem Server gefunden werden!
Der Fehler wurde an die Trovarit AG automatisch gemeldet.");
}
});
}
function openDownloadcenterRegistration()
{
blockScreen();
$("#dialogTwo").html("");
$("#dialogTwo").load("/homepage/dialog_downloadcenter_register.php").dialog({
close: function(event, ui)
{
$(this).dialog('destroy');
trv_setPiwik(null,"Downloadcenter Registration - Dialog close");
},
closeOnEscape: false,
resizable: false,
height: 'auto',
minHeight: 940,
width: 500,
modal: true,
bgiframe: true,
title: "Downloadfreischaltung"
});
}
function openLegalInfo(title, showTextWithID, isDatenschutz)
{
$("#dialog").html("");
$("#dialog").load("/homepage/dialog_legal_info.php?showTextWithID="+showTextWithID+"&isDatenschutz="+isDatenschutz+"").dialog({
close: function(event, ui)
{
$(this).dialog('destroy');
trv_setPiwik(null,"Dialog Legal Info ["+title+"] - Dialog close");
},
open: function(event, ui)
{
trv_setPiwik(null,"Dialog Legal Info ["+title+"] - Dialog open");
},
resizable: false,
height: 'auto',
minHeight: 520,
width: 700,
modal: true,
bgiframe: true,
title: title
});
}
function sendLogin()
{
if ($('form#loginForm').valid())
{
blockScreen();
$.post( "/homepage/ajax/ajax.php",
{
type: "LOGIN",
userName: $('input#userName').val(),
userPassword: $('input#userPassword').val()
},
function(data)
{
if (data.code == 0)
{
location.href = "http://www.it-matchmaker.com/n_login.php?md5="+data.message+"&setSid=68s16o9q31sr6p360os59o6qn50p6op6";
}
else
{
unblockScreen();
infoDialog("FEHLER",data.message);
}
},"json");
}
else
{
infoDialog("FEHLER","Bitte füllen Sie alle rot markierten Felder korrekt aus!");
}
}
function sendLogout()
{
blockScreen();
$.post( "/homepage/ajax/ajax.php",
{
type: "LOGOUT"
},
function(data)
{
$('#trovarit_login_box').html(data);
unblockScreen();
});
}
function openForgotPassword()
{
blockScreen();
$("#dialog_password").html("");
$("#dialog_password").load("/homepage/dialog_password.php").dialog({
close: function(event, ui)
{
$(this).dialog('destroy');
},
closeOnEscape: false,
resizable: false,
height: 'auto',
minHeight: 290,
width: 500,
modal: true,
bgiframe: true,
title: "Passwort vergessen?"
});
}
function sendPassword()
{
if ($('#passwordForgotForm').valid())
{
blockScreen();
$.post( "/homepage/ajax/ajax.php",
{
type: "NEW_PASSWORD",
userEmail: $('#inputEMail').val(),
userName: $('#inputUserName').val()
},
function(data)
{
unblockScreen();
if (data.code == 0)
{
$("#dialog_password").dialog("close");
infoDialog("INFORMATION","Das Passwort wurde ihnen per E-Mail zugestellt.");
}
else
{
infoDialog("FEHLER",data.message);
}
}, "json"
);
}
else
{
infoDialog("FEHLER","Bitte füllen Sie alle rot markierten Felder korrekt aus!");
}
}
function sendContact()
{
if ($('#contactForm').valid())
{
blockScreen();
$.post( "/homepage/ajax/ajax.php",
{
type: "SEND_CONTACT",
inputContactTitle: $('#inputContactTitle').val(),
inputContactFirstName: $('#inputContactFirstName').val(),
inputContactName: $('#inputContactName').val(),
inputContactCompany: $('#inputContactCompany').val(),
inputContactStreet: $('#inputContactStreet').val(),
inputContactPLZ: $('#inputContactPLZ').val(),
inputContactCity: $('#inputContactCity').val(),
inputContactEMail: $('#inputContactEMail').val(),
inputContactTelefon: $('#inputContactTelefon').val(),
inputContactSubject: $('#inputContactSubject').val(),
inputContactMessage: $('#inputContactMessage').val()
},
function(data)
{
unblockScreen();
if (data == 0)
{
$("#dialogTwo").dialog("close");
infoDialog("INFORMATION","Ihre Kontaktanfrage wurde an uns gesendet.
Wir setzten uns mit Ihnen schnellstmöglich in Verbindung.");
}
else
{
infoDialog("FEHLER",data);
}
}
);
}
else
{
infoDialog("FEHLER","Bitte füllen Sie alle rot markierten Felder korrekt aus!");
}
}
function sendDCRegistration()
{
if ($('#downloadcenterRegisterForm').valid())
{
blockScreen();
var zielgruppe = $('input[name=inputDCZielgruppe]:checked').val();
if ($('#inputDCZielgruppeSonstiges').val().length > 0)
{
zielgruppe = $('#inputDCZielgruppeSonstiges').val();
}
var zweck = "";
$('input[name=inputDCZweck]:checked').each(function(i)
{
zweck = zweck + $(this).val()+";";
});
if ($('#inputDCZweckSonstiges').val() != "")
{
zweck = zweck + $('#inputDCZweckSonstiges').val()+";";
}
$.post( "/homepage/ajax/ajax.php",
{
type: "REGISTER_DOWNLOADCENTER",
inputDCTitle: $('#inputDCTitle').val(),
inputDCFirstName: $('#inputDCFirstName').val(),
inputDCName: $('#inputDCName').val(),
inputDCCompany: $('#inputDCCompany').val(),
inputDCStreet: $('#inputDCStreet').val(),
inputDCPLZ: $('#inputDCPLZ').val(),
inputDCCity: $('#inputDCCity').val(),
inputDCEMail: $('#inputDCEMail').val(),
inputDCTelefon: $('#inputDCTelefon').val(),
inputDCPosition: $('#inputDCPosition').val(),
inputDCZielgruppe: zielgruppe,
inputDCZweck: zweck
},
function(data)
{
unblockScreen();
if (data.code == 0)
{
infoDialog("INFORMATION","Ihr Freischaltlink wurde erfolgreich an Sie gesendet.");
$("#dialogTwo").dialog("close");
trv_setPiwik(null,"Downloadcenter Registration - Complete");
}
else
{
infoDialog("FEHLER",data.message,null,400);
}
}, "json"
);
}
else
{
infoDialog("FEHLER","Bitte füllen Sie alle rot markierten Felder korrekt aus!");
}
}
function toggleDownloadInfo(id, image_path)
{
$('div#trovarit_download_'+id).slideToggle(500,
function(){
if ($('div#trovarit_download_'+id+':visible').css("width") != null)
{
$('#trovarit_download_icon_'+id).attr({ src: image_path+'/icons/minus.gif'});
}
else
{
$('#trovarit_download_icon_'+id).attr({ src: image_path+'/icons/plus.gif'});
}
});
}
function getSetTags()
{
$.post( "/homepage/ajax/ajax.php",
{
type: "GET_SET_TAG"
},
function(data)
{
$('#trovarit_dc_tagcloud_set').html(data);
getAddableTags();
});
}
function getAddableTags()
{
$.post( "/homepage/ajax/ajax.php",
{
type: "GET_ADDABLE_TAGS"
},
function(data)
{
$('#trovarit_dc_tagcloud_add').html(data);
unblockScreen();
});
}
function getArticleByTag(tag, action)
{
blockScreen();
$.post( "/homepage/ajax/ajax.php",
{
type: "GET_ARTICLE_BY_TAG",
tag: tag,
action:action
},
function(data)
{
$('#trovarit_layout_dc_content').html(data);
$('html,body').animate({scrollTop: 170}, 500);
$('input#downloadFilterInput').val("");
getSetTags();
});
}
function downloadFilter()
{
blockScreen();
setTimeout(callDownloadFilter, 150);
}
function callDownloadFilter()
{
var filterText = $('input#downloadFilterInput').val();
$('.trovarit_search_text').removeHighlight();
if (filterText.length == 0)
{
$(".trovarit_download_container").show();
}
else
{
$(".trovarit_download_container").each(
function (column)
{
var searchText = "";
$(".trovarit_search_text",this).each(function()
{
searchText += $(this).text()+" ";
});
if (searchText.toLowerCase().indexOf(filterText.toLowerCase()) >= 0)
{
$(this).show();
}
else
{
$(this).hide();
}
});
$('.trovarit_search_text').highlight(filterText);
}
count = $(".trovarit_download_container:visible").length;
$('#trovarit_dc_result_count').text(count);
if (count == 0)
{
$('.trovarit_dc_result').addClass('trovarit_dc_result_red');
}
else
{
$('.trovarit_dc_result').removeClass('trovarit_dc_result_red');
}
unblockScreen();
}
function downloadFilterReset()
{
$('input#downloadFilterInput').val("");
downloadFilter();
}
function openLastenheftWindow()
{
mywin = window.open("http://www.it-matchmaker.com/public/n_01-01-04-02.php", "Lastenheft", "width=850,height=450,scrollbars=yes");
mywin.focus();
}