function validate_comment(type_ID, target_ID, login_sml, uri, session_logged) { //remove all the class add the messagebox classes and start fading $("#comment_title").removeClass(); $("#comment_text").removeClass(); $("#comment_form_error").removeClass().show('fast'); $("#comment_form_msgbox").removeClass().addClass('messagebox').text('Validating....').fadeIn(1000); var output = ''; if($('#comment_title').val()=='') { output += 'Il titolo non può essere vuoto!
'; $("#comment_title").removeClass().addClass('input_error'); } else if($('#comment_title').val().length > 70) { output += 'Il titolo può contenere fino a 70 caratteri!
'; $("#comment_title").removeClass().addClass('input_error'); } if($('#comment_text').val()=='') { output += 'I commenti non possono essere vuoti!
'; $("#comment_text").removeClass().addClass('input_error'); } else if($('#comment_text').val().length > 500) { output += 'Il testo dei commenti non può superare i 500 caratteri!
'; $("#comment_text").removeClass().addClass('input_error'); } $("#comment_form_msgbox").fadeTo(200,0.1,function() { //start fading the messagebox //add message and change the class of the box and start fading if(output=='') { $(this).html('Sending.....').addClass('messageboxok').fadeTo(900,1, function() { if(session_logged!='true') { ajax_set_comments_session_and_continue(login_sml, uri, type_ID, target_ID, $('#comment_title').val(), $('#comment_text').val()); } else { $.get("/common/ajax_func.php",{ action:'add_comment', type_ID: type_ID, target_ID: target_ID, title:$('#comment_title').val(), text:$('#comment_text').val() } ,function(data) { link_submit_form('refresh_form','comment','added'); }); } }); } else { $(this).html(output).removeClass().addClass('messageboxerror').fadeTo(900,1); } }); return false; } function validate_review(category, item_ID, login_sml, uri, session_logged) { //remove all the class add the messagebox classes and start fading var review_title = false; if($("#review_title").length > 0) review_title = true; var vote1_title = false; if($("#vote1_title").length > 0) vote1_title = true; var vote2_title = false; if($("#vote2_title").length > 0) vote2_title = true; var vote3_title = false; if($("#vote3_title").length > 0) vote3_title = true; $("#review_title").removeClass(); $("#review_text").removeClass(); $("#vote1_title").removeClass().addClass('arial_12_b'); $("#vote2_title").removeClass().addClass('arial_12_b'); $("#vote3_title").removeClass().addClass('arial_12_b'); $("#review_form_error").removeClass().fadeIn(100); $("#review_form_msgbox").removeClass().addClass('messagebox').text('Validating....').fadeIn(1000); var output = ''; if(review_title) { if($('#review_title').val()=='') { output += 'Il titolo non può essere vuoto!
'; $("#review_title").removeClass().addClass('input_error'); } else if($('#review_title').val().length > 70) { output += 'Il titolo può contenere fino a 70 caratteri!
'; $("#review_title").removeClass().addClass('input_error'); } } if($('#review_text').val()=='') { output += $('#error_description_is_empty_message').val()+'
'; $("#review_text").removeClass().addClass('input_error'); } else if($('#review_text').val().length > 1000) { output += 'La recensione è troppo lunga!
'; $("#review_text").removeClass().addClass('input_error'); } if(vote1_title && vote2_title && vote3_title) { if($('[name=vote1]:checked').val()==undefined) { output += 'La valutazione non è selezionata!
'; $("#vote1_title").removeClass().addClass('arial_12_red_b'); } if($('[name=vote2]:checked').val()==undefined) { output += 'La valutazione non è selezionata!
'; $("#vote2_title").removeClass().addClass('arial_12_red_b'); } if($('[name=vote3]:checked').val()==undefined) { output += 'La valutazione non è selezionata!
'; $("#vote3_title").removeClass().addClass('arial_12_red_b'); } } $("#review_form_msgbox").fadeTo(200,0.1,function() { //start fading the messagebox //add message and change the class of the box and start fading if(output=='') { var review_title_val = ''; if(review_title) review_title_val = $('#review_title').val(); var vote1_title_val = ''; if(vote1_title) vote1_title_val = $('[name=vote1]:checked').val(); var vote2_title_val = ''; if(vote2_title) vote2_title_val = $('[name=vote2]:checked').val(); var vote3_title_val = ''; if(vote3_title) vote3_title_val = $('[name=vote3]:checked').val(); $(this).html('Sending.....').addClass('messageboxok').fadeTo(900,1, function() { if(session_logged!='true') { ajax_set_reviews_session_and_continue(login_sml, uri, category, item_ID, review_title_val, $('#review_text').val(), vote1_title_val, vote2_title_val, vote3_title_val); } else { $.get("/common/ajax_func.php",{ action:'add_review', category: category, item_ID: item_ID, title:review_title_val, text:$('#review_text').val(), vote1:vote1_title_val, vote2:vote2_title_val, vote3:vote3_title_val } ,function(data) { //link_submit_form('refresh_form','review','added'); window.location = document.location.href; }); } }); } else { $(this).html(output).removeClass().addClass('messageboxerror review_messageboxerror').fadeTo(900,1); } }); return false; } //function that adds opinion to review.. function add_opinion_to_review(did_you_like, review_ID, login_sml, uri, session_logged) { if(session_logged!='true') { $.get('/common/ajax_func.php', {action: 'set_sessions_for_reviews_opinion', uri: uri, review_ID:review_ID, positive:did_you_like}, function(data) { window.location = login_sml; }); } else { $.get("/common/ajax_func.php",{ action:'add_review_opinion', review_ID: review_ID, positive:did_you_like } ,function(data) { window.location = document.location.href; }); } } // make asynchronous HTTP request using the XMLHttpRequest object function ajax_vote(action, attr_ID, target_ID, loading_div, add_button_div) { document.getElementById(add_button_div).onclick=null; document.getElementById(add_button_div).style.cursor=null; $.get("/common/ajax_func.php",{ action:action, attr_ID: attr_ID, target_ID: target_ID} ,function(data) { if(data==1) { var last_vote = document.getElementById(loading_div).innerHTML; document.getElementById(loading_div).innerHTML = parseInt(last_vote)+1; } }); } //Get Interest Rates Table for Webmaster-Tools function change_rates_preview(rows,enable_border,border_color,text_color,bg1,bg2,header_bg,header_text,defaultDomainShort) { if(strpos(bg1,'#')!=false) {bg1 = substr(bg1,1);} if(strpos(bg2,'#')!=false) {bg2 = substr(bg2,1);} if(strpos(text_color,'#')!=false) {text_color = substr(text_color,1);} if(strpos(border_color,'#')!=false) {border_color = substr(border_color,1);} if(strpos(header_bg,'#')!=false) {header_bg = substr(header_bg,1);} if(strpos(header_text,'#')!=false) {header_text = substr(header_text,1);} var url = "/common/proxy.php?proxy_url=http://irates." + defaultDomainShort + "/index.php?rows="+rows; var params = "&bg1="+bg1+"&bg2="+bg2+"&text_color="+text_color+"&enable_border="+enable_border+"&border_color="+border_color+"&header_bg="+header_bg+"&header_text="+header_text; url = url + urlencode(params); $.get(url, function(data) { document.getElementById('irFrame').innerHTML=' '+data; }); } //Webinar Registration //function add_user_to_webinar(webinar_ID, user_ID, firstname, lastname, email, country_ID, phone) { function add_user_to_webinar(webinar_ID, user_ID, redirect) { if(document.getElementById('webinar-reg-body')) { var div_height = document.getElementById('webinar-reg-body').offsetHeight; var div_width = document.getElementById('webinar-reg-body').offsetWidth; document.getElementById('webinar-reg-body').innerHTML = '

Loading..
'; } //$.get("/common/ajax_func.php", { action:'add_user_to_webinar', webinar_ID:webinar_ID, user_ID:user_ID, firstname:firstname, lastname:lastname, email:email, country_ID:country_ID, phone:phone }, function(data) { $.get("/common/ajax_func.php", { action:'add_user_to_webinar', webinar_ID:webinar_ID, user_ID:user_ID }, function(data) { if(data==1) { if(document.getElementById('webinar-reg-body')) { var html_content = document.getElementById('webinar-reg-body'); html_content.innerHTML = ''; html_content.innerHTML += ''; html_content.innerHTML += ''; html_content.innerHTML += ''; html_content.innerHTML += ''; html_content.innerHTML += ''; html_content.innerHTML += ''; html_content.innerHTML += '
'; html_content.innerHTML += '
'; html_content.innerHTML += '
'; html_content.innerHTML += 'Grazie per essersi registrato!
'; html_content.innerHTML += '
'; html_content.innerHTML += 'Le abbiamo inviato un’E-mail con le istruzioni su come partecipare al webinar.
'; html_content.innerHTML += 'Per qualsiasi quesito tecnico relativo al webinar, può usare il nostro Forum sui webinar'; html_content.innerHTML += '
'; html_content.innerHTML += '
'; } if(redirect!='') window.location = redirect; } else { if(document.getElementById('webinar-reg-body')) { document.getElementById('webinar-reg-body').innerHTML = '
Error Occured!
'; } if(redirect!='') window.location = redirect; } }); } /*------------------------REGISTRATION FORM VALIDATION---------------------------*/ function ajax_validate_register_form_part_two(data, errors_arr) { if(data!=1) errors_arr = errors_arr + data; //alert(data + 'errors: ' + errors_arr); if(errors_arr!='') { $("#register_form_msgbox").fadeTo(200,0.1,function() //start fading the messagebox { error = errors_arr.split('|'); var output = ''; for(j=0;j'; } else if(nameMessage == 'false' && emailMessage == 'false' && codeMessage == 'false') { document.getElementById("report_error").innerHTML = '
Close
' + outputMessage + '
'; } }); } /*---------- AJAX FUNCTIONS USED IN ECONOMIC-CALENDAR ----------*/ function include_ext_file_in_div(url, target, message, dir, curr, imp, white_line, print_event_details, print_title, print_banner_inside, print_title_table, print_add_to_your_site_top, print_add_to_your_site_bottom, print_report_an_error,print_importance) { if(curr) { if(document.getElementById('filter_div')) document.getElementById('filter_div').style.visibility = 'hidden'; for(i=0;i<13;i++) { if(curr[i] != undefined && curr[i] != 0) { url += '&'+curr[i]+'=hide'; } } if(imp) { for(j=0;j<=3;j++) { if(imp[j] != undefined && imp[j] != 0) { url += '&'+imp[j]+'=hide'; } } } if(white_line) { url += '&white_line='+white_line; } } if(print_event_details) { url += '&print_event_details='+print_event_details; } if(print_title) { url += '&print_title='+print_title; } if(print_banner_inside) { url += '&print_banner_inside='+print_banner_inside; } if(print_title_table) { url += '&print_title_table='+print_title_table; } if(print_add_to_your_site_top) { url += '&print_add_to_your_site_top='+print_add_to_your_site_top; } if(print_add_to_your_site_bottom) { url += '&print_add_to_your_site_bottom='+print_add_to_your_site_bottom; } if(print_report_an_error) { url += '&print_report_an_error='+print_report_an_error; } if(print_importance) { url += '&print_importance='+print_importance; } var targetHeight = new Array(); var targetWidth = new Array(); obj[target] = document.getElementById(target); targetHeight[target] = parseInt(obj[target].offsetHeight)+"px"; obj[target].innerHTML = '
'+message+'
'+message+'
'; $.ajax({ url: url, type: "GET", dataType: ($.browser.msie) ? "text" : "html", success: function(data){ document.getElementById(target).innerHTML = data; } }); } function get_ec_event_data(row_ID,loading_div,dir) { $.get('/ec_event.php', {}, function(data) { var xml; if (typeof data == "string") { xml = new ActiveXObject("Microsoft.XMLDOM"); xml.async = false; xml.loadXML(data); } else { xml = data; } if(dir=='ltr') var textAlign = 'left'; else var textAlign = 'right'; var event_banner = $('event_banner', xml).text(); var event_banner_text = $('event_banner_text', xml).text(); if(event_banner!='nothing' && event_banner_text!='nothing') document.getElementById('banner_'+row_ID).innerHTML = '
'+event_banner+''+event_banner_text+'
'; else document.getElementById('main_banner_td_'+row_ID).style.display = 'none'; }); } function send_ota_form(formId) { var url = '/common/ota/ajax_func.php'; var str_data = ''; var arr_form = document.getElementById('FrontPage_Form1'); for (var i = 0; i < arr_form.length; i++) str_data += arr_form.elements[i].name + '=' + arr_form.elements[i].value + '&'; str_data = str_data.substr(0, str_data.length); $.ajax({ url: url, type: "POST", data: str_data, dataType: ($.browser.msie) ? "text" : "html", success: function(data){ window.open(data, '_blank'); var str_inner = '' + '
' + '
' + 'If the Webinar does not start automatically, please click on the link below:
' + '
' + '
' + '
' + '' + data + '' + '
' + '
' + ''; var str_div_reame_hader_inner = '  Start Webinar'; document.getElementById('div_inner_form').innerHTML = str_inner; document.getElementById('div_reame_hader').innerHTML = str_div_reame_hader_inner; document.getElementById('AjaxLoading').style.display = "none"; } }); } /*---------- AJAX FUNCTIONS USED IN ECONOMIC-CALENDAR ----------*/