var btn_class = "rgtbtm";var siteurl = "https://app.responseiq.com/";var allow_widgets_url = '[{"type":"1","pattern":"scotlanddebt.co.uk"}]';var disallow_widgets_url = '[]';var widget = "C910SY71104A41";var pagetitle = "";var htmlpage = "

John Baird

Scotland Debt Solutions

Struggling with personal debts? Facing pressure from creditors or sheriff officers? It’s time to take control of your finances and plan towards a debt-free future. Enter your number below and a specialist debt adviser can provide a free consultation in complete confidence.

We're by ResponseiQ

";var widget_schedule_html = "";var widget_thanks_html = "";var agentslist = "";var departmentslist = "";var widget_schedule_callback_html = "";var widget_gdpr_consent_html = "";var widget_gdpr_consent_confirm_html = "";var widget_gdpr_consent_confirm_thanks_html = "";var phonecode = "+1";var location_ip = "US";var city = "Ashburn";var region = "Virginia";var timezone = "America/New_York";var country_name = "United States";var country = "US";var location_ip = "US";var phone_icon = "
Phone iconCross icon
";var agents_agents_true = "0";var day_agent = "";var time_agent = "";var delay_icon_second = 3000;var enable_sounds = 0;var onlineagents = "0";var show_opt_count = "0";var welcometext_animate_1 = "0";var welcometextschedule_animate_2 = "0";var btn_border_color = "#8fa1ff";var btn_color = "#3f51b5";var ipaddress = "97dc45a1565931e550470118e8be0400";var tooltip_close = "0";var tooltip_close_click = "0";var time_check = "1";var time_on_website = "18000";var show_tooltip = "1";var attempts_to_exit = "0";var delay_before_minimising_popup = "60000";var saveattempts_to_exit = "0";var tooltip_animation = "0";var samesession = "0";var browsersession = "15379204484765";var is_type = "0";var company_id = "214";var selector = "Agent";var hide_after_closing_popup = "0";var currenttimezone = "Current London Time: 01:07 am";var template_id = "0";var template_capture_number = "";var call_schedule_button_enable = "0";var sub_widget_company_id = "241";var schedule_call_timezone_enable = "1";var lead_revisit_alert = "0";var api_type = "0";var widget_id = "208";var visitor_id = "0";var widget_country_code_edit = "0";var gdpr_enable = "0";var select_visitor_time = "America/New_York";var deviceRiq = "Desktop";var showCountryTextbox = 1;var noFlag = 1;var hide_widgets_background = "1";var tooltip_reload_page = "0";var googleAnalyticsEvent = [];var googleAnalyticsTrackID = "";var v = "1.11.1"; /*call me now button clicked*/ var callnowclick = 0; var schedulecallclick = 0; /*referrer website*/ var referrer = document.referrer; /*current page title*/ var title=document.title; /*all latest jquery file versions*/ var version = ['3.1','3.0','2.2','2.1','2.0','1.12','1.11','1.10','1.9','1.8']; /*version found*/ var versionfound = 0; /* if (window.jQuery === undefined){ versionfound = 0; }else{ jQuery.each(version, function(index,value){ if(versionfound==0){ if(value == parseFloat(window.jQuery.fn.jquery)){ versionfound = 1; } } }); } */ /*if ((window.jQuery === undefined) || (versionfound == 0)) {*/ if(call_schedule_button_enable==1){ var callmebuttontext = ''; var schedulecallbuttontext = ''; }else{ var buttontext = ''; } var gdpr_enable_check = 1; if(gdpr_enable==1){ gdpr_enable_check = 0; } var europa_country = ["IN","AT", "BE", "BG", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GB", "GR", "HR", "HU", "IE", "IT", "LT", "LU", "LV", "MT", "NL", "PL", "PT", "RO", "SE", "SI", "SK"]; var googleanalatics = ''; var timezoneobj = { 'America/Puerto_Rico':'Atlantic','America/New_York':'Eastern','America/Chicago':'Central','America/Denver': 'Mountain','America/Phoenix': 'MST','America/Los_Angeles':'Pacific','America/Anchorage':'Alaska','Aacific/Honolulu':'Hawaii','America/Adak':'Hawaii','America/Anchorage':'Alaska','America/Anguilla':'Eastern','America/Antigua':'Eastern','America/Araguaina': 'Araguaina','America/Argentina/Buenos_Aires': 'Argentina - Buenos Aires','America/Argentina/Catamarca': 'Argentina - Catamarca','America/Argentina/ComodRivadavia': 'Argentina - ComodRivadavia','America/Argentina/Cordoba':'Argentina - Cordoba','America/Argentina/Jujuy': 'Argentina - Jujuy','America/Argentina/La_Rioja': 'Argentina - La Rioja','America/Argentina/Mendoza':'Argentina - Mendoza','America/Argentina/Rio_Gallegos': 'Argentina - Rio Gallegos','America/Argentina/Salta': 'Argentina - Salta','America/Argentina/San_Juan': 'Argentina - San Juan','America/Argentina/San_Luis': 'Argentina - San Luis','America/Argentina/Tucuman': 'Argentina - Tucuman','America/Argentina/Ushuaia':'Argentina - Ushuaia','America/Aruba': 'Atlantic','America/Asuncion': 'Asuncion','America/Atikokan': 'Eastern','America/Atka': 'Hawaii','America/Bahia': 'Bahia','America/Barbados': 'Eastern','America/Belem': 'Belem','America/Belize': 'Central','America/Blanc-Sablon': 'Atlantic','America/Boa_Vista': 'Boa Vista','America/Bogota': 'Bogota','America/Boise': 'Mountain','America/Buenos_Aires': 'Buenos Aires','America/Cambridge_Bay': 'Mountain','America/Campo_Grande': 'Campo Grande','America/Cancun': 'Eastern','America/Caracas': 'Atlantic','America/Catamarca': 'Catamarca','America/Cayenne': 'Cayenne','America/Cayman': 'Cayman','America/Chicago': 'Central','America/Chihuahua': 'Mountain','America/Coral_Harbour': 'Eastern','America/Cordoba': 'Cordoba','America/Costa_Rica': 'Costa Rica','America/Cuiaba': 'Cuiaba','America/Curacao': 'Atlantic','America/Danmarkshavn': 'Danmarkshavn','America/Dawson': 'Pacific','America/Dawson_Creek': 'Mountain','America/Denver': 'Mountain','America/Detroit': 'Eastern','America/Dominica': 'Eastern','America/Edmonton': 'Mountain','America/Eirunepe': 'Eirunepe','America/El_Salvador': 'El Salvador','America/Ensenada': 'Pacific','America/Fortaleza': 'Fortaleza','America/Fort_Wayne':'Eastern','America/Glace_Bay': 'Atlantic','America/Godthab': 'Godthab','America/Goose_Bay': 'Atlantic','America/Grand_Turk': 'Atlantic','America/Grenada':'Eastern','America/Guadeloupe': 'Guadeloupe','America/Guatemala': 'Central','America/Guayaquil': 'Guayaquil','America/Guyana': 'Guyana','America/Halifax': 'Atlantic','America/Havana': 'Eastern','America/Hermosillo': 'Mountain','America/Indiana/Indianapolis': 'Eastern','America/Indiana/Knox': 'Central','America/Indiana/Marengo': 'Eastern','America/Indiana/Petersburg': 'Central','America/Indiana/Tell_City': 'Central','America/Indiana/Vevay': 'Eastern','America/Indiana/Vincennes': 'Eastern','America/Indiana/Winamac': 'Indiana - Winamac','America/Indianapolis': 'Eastern','America/Inuvik': 'Mountain','America/Iqaluit': 'Eastern','America/Jamaica': 'Jamaica','America/Jujuy': 'Jujuy','America/Juneau': 'Juneau','America/Kentucky/Louisville': 'Kentucky - Louisville','America/Kentucky/Monticello': 'Kentucky - Monticello','America/Knox_IN': 'Knox IN','America/La_Paz': 'La Paz','America/Lima': 'Lima','America/Los_Angeles': 'Pacific','America/Louisville': 'Eastern','America/Maceio': 'Maceio','America/Managua': 'Managua','America/Manaus': 'Manaus','America/Marigot': 'Marigot','America/Martinique': 'Martinique','America/Matamoros': 'Matamoros','America/Mazatlan': 'Mazatlan','America/Mendoza': 'Mendoza','America/Menominee': 'Menominee','America/Merida': 'Merida','America/Mexico_City': 'Central','America/Miquelon': 'Miquelon','America/Moncton': 'Atlantic','America/Monterrey': 'Central ','America/Montevideo': 'Montevideo','America/Montreal': 'Montreal','America/Montserrat': 'Montserrat','America/Nassau': 'Eastern','America/New_York': 'Eastern','America/Nipigon': 'Eastern','America/Nome': 'Alaska','America/Noronha': 'Noronha','America/North_Dakota/Center': 'North Dakota - Center','America/North_Dakota/New_Salem': 'North Dakota - New Salem','America/Ojinaga': 'Ojinaga','America/Panama': 'Panama','America/Pangnirtung': 'Pangnirtung','America/Paramaribo': 'Paramaribo','America/Phoenix': 'Mountain','America/Port-au-Prince': 'Port-au-Prince','America/Porto_Acre': 'Porto Acre','America/Port_of_Spain': 'Port of Spain','America/Porto_Velho': 'Porto Velho','America/Puerto_Rico': 'Puerto Rico','America/Rainy_River': 'Rainy River','America/Rankin_Inlet': 'Rankin Inlet','America/Recife': 'Recife','America/Regina': 'Regina','America/Resolute': 'Resolute','America/Rio_Branco': 'Rio Branco','America/Rosario': 'Rosario','America/Santa_Isabel': 'Santa Isabel','America/Santarem': 'Santarem','America/Santiago': 'Santiago','America/Santo_Domingo': 'Santo Domingo','America/Sao_Paulo': 'Sao Paulo','America/Scoresbysund': 'Scoresbysund','America/Shiprock': 'Shiprock','America/St_Barthelemy': 'St Barthelemy','America/St_Johns': 'St Johns','America/St_Kitts': 'St Kitts','America/St_Lucia': 'St Lucia','America/St_Thomas': 'St Thomas','America/St_Vincent': 'St Vincent','America/Swift_Current': 'Swift Current','America/Tegucigalpa': 'Tegucigalpa','America/Thule': 'Thule','America/Thunder_Bay': 'Eastern','America/Tijuana': 'Pacific','America/Toronto': 'Toronto','America/Tortola': 'Tortola','America/Vancouver': 'Vancouver','America/Virgin': 'Mountain','America/Whitehorse': 'Pacific','America/Winnipeg': 'Central','America/Yakutat': 'Alaska','America/Yellowknife': 'Yellowknife','Europe/Amsterdam': 'Amsterdam','Europe/Andorra': 'Andorra','Europe/Athens': 'Athens','Europe/Belfast': 'Belfast','Europe/Belgrade': 'Belgrade','Europe/Berlin': 'Berlin','Europe/Bratislava': 'Bratislava','Europe/Brussels': 'Brussels','Europe/Bucharest': 'Bucharest','Europe/Budapest': 'Budapest','Europe/Chisinau': 'Chisinau','Europe/Copenhagen': 'Copenhagen','Europe/Dublin': 'Dublin','Europe/Gibraltar': 'Gibraltar','Europe/Guernsey': 'Guernsey','Europe/Helsinki': 'Helsinki','Europe/Isle_of_Man': 'Isle of Man','Europe/Istanbul': 'Istanbul','Europe/Jersey': 'Jersey','Europe/Kaliningrad': 'Kaliningrad','Europe/Kiev': 'Kiev','Europe/Lisbon': 'Lisbon','Europe/Ljubljana': 'Ljubljana','Europe/London': 'London','Europe/Luxembourg': 'Luxembourg','Europe/Madrid': 'Madrid','Europe/Malta': 'Malta','Europe/Mariehamn': 'Mariehamn','Europe/Minsk': 'Minsk','Europe/Monaco': 'Monaco','Europe/Moscow': 'Moscow','Europe/Nicosia': 'Nicosia','Europe/Oslo': 'Oslo','Europe/Paris': 'Paris','Europe/Podgorica': 'Podgorica','Europe/Prague': 'Prague','Europe/Riga': 'Riga','Europe/Rome': 'Rome','Europe/Samara': 'Samara','Europe/San_Marino': 'San Marino','Europe/Sarajevo': 'Sarajevo','Europe/Simferopol': 'Simferopol','Europe/Skopje': 'Skopje','Europe/Sofia': 'Sofia','Europe/Stockholm': 'Stockholm','Europe/Tallinn': 'Tallinn','Europe/Tirane': 'Tirane','Europe/Tiraspol': 'Tiraspol','Europe/Uzhgorod': 'Uzhgorod','Europe/Vaduz': 'Vaduz','Europe/Vatican': 'Vatican','Europe/Vienna': 'Vienna','Europe/Vilnius': 'Vilnius','Europe/Volgograd': 'Volgograd','Europe/Warsaw': 'Warsaw','Europe/Zagreb': 'Zagreb','Europe/Zaporozhye': 'Zaporozhye','Europe/Zurich': 'Zurich','Asia/Aden': 'Aden','Asia/Almaty': 'Almaty','Asia/Amman': 'Amman','Asia/Anadyr': 'Anadyr','Asia/Aqtau': 'Aqtau','Asia/Aqtobe': 'Aqtobe','Asia/Ashgabat': 'Ashgabat','Asia/Ashkhabad': 'Ashkhabad','Asia/Baghdad': 'Baghdad','Asia/Bahrain': 'Bahrain','Asia/Baku': 'Baku','Asia/Bangkok': 'Bangkok','Asia/Beirut': 'Beirut','Asia/Bishkek': 'Bishkek','Asia/Brunei': 'Brunei','Asia/Calcutta': 'Calcutta','Asia/Choibalsan': 'Choibalsan','Asia/Chongqing': 'Chongqing','Asia/Chungking': 'Chungking','Asia/Colombo': 'Colombo','Asia/Dacca': 'Dacca','Asia/Damascus': 'Damascus','Asia/Dhaka': 'Dhaka','Asia/Dili': 'Dili','Asia/Dubai': 'Dubai','Asia/Dushanbe': 'Dushanbe','Asia/Gaza': 'Gaza','Asia/Harbin': 'Harbin','Asia/Ho_Chi_Minh': 'Ho Chi Minh','Asia/Hong_Kong': 'Hong Kong','Asia/Hovd': 'Hovd','Asia/Irkutsk': 'Irkutsk','Asia/Istanbul': 'Istanbul','Asia/Jakarta': 'Jakarta','Asia/Jayapura': 'Jayapura','Asia/Jerusalem': 'Jerusalem','Asia/Kabul': 'Kabul','Asia/Kamchatka': 'Kamchatka','Asia/Karachi': 'Karachi','Asia/Kashgar': 'Kashgar','Asia/Kathmandu': 'Kathmandu','Asia/Katmandu': 'Katmandu','Asia/Kolkata': 'Kolkata','Asia/Krasnoyarsk': 'Krasnoyarsk','Asia/Kuala_Lumpur': 'Kuala Lumpur','Asia/Kuching': 'Kuching','Asia/Kuwait': 'Kuwait','Asia/Macao': 'Macao','Asia/Macau': 'Macau','Asia/Magadan': 'Magadan','Asia/Makassar': 'Makassar','Asia/Manila': 'Manila','Asia/Muscat': 'Muscat','Asia/Nicosia': 'Nicosia','Asia/Novokuznetsk': 'Novokuznetsk','Asia/Novosibirsk': 'Novosibirsk','Asia/Omsk': 'Omsk','Asia/Oral': 'Oral','Asia/Phnom_Penh': 'Phnom Penh','Asia/Pontianak': 'Pontianak','Asia/Pyongyang': 'Pyongyang','Asia/Qatar': 'Qatar','Asia/Qyzylorda': 'Qyzylorda','Asia/Rangoon': 'Rangoon','Asia/Riyadh': 'Riyadh','Asia/Saigon': 'Saigon','Asia/Sakhalin': 'Sakhalin','Asia/Samarkand': 'Samarkand','Asia/Seoul': 'Seoul','Asia/Shanghai': 'Shanghai','Asia/Singapore': 'Singapore','Asia/Taipei': 'Taipei','Asia/Tashkent': 'Tashkent','Asia/Tbilisi': 'Tbilisi','Asia/Tehran': 'Tehran','Asia/Tel_Aviv': 'Tel Aviv','Asia/Thimbu': 'Thimbu','Asia/Thimphu': 'Thimphu','Asia/Tokyo': 'Tokyo','Asia/Ujung_Pandang': 'Ujung Pandang','Asia/Ulaanbaatar': 'Ulaanbaatar','Asia/Ulan_Bator': 'Ulan Bator','Asia/Urumqi': 'Urumqi','Asia/Vientiane': 'Vientiane','Asia/Vladivostok': 'Vladivostok','Asia/Yakutsk': 'Yakutsk','Asia/Yekaterinburg':'Yekaterinburg','Asia/Yerevan': 'Yerevan','Africa/Abidjan': 'Abidjan','Africa/Accra': 'Accra','Africa/Addis_Ababa': 'Addis Ababa','Africa/Algiers': 'Algiers','Africa/Asmara': 'Asmara','Africa/Asmera': 'Asmera','Africa/Bamako': 'Bamako','Africa/Bangui': 'Bangui','Africa/Banjul': 'Banjul','Africa/Bissau': 'Bissau','Africa/Blantyre': 'Blantyre','Africa/Brazzaville': 'Brazzaville','Africa/Bujumbura': 'Bujumbura','Africa/Cairo': 'Cairo','Africa/Casablanca': 'Casablanca','Africa/Ceuta': 'Ceuta','Africa/Conakry': 'Conakry','Africa/Dakar': 'Dakar','Africa/Dar_es_Salaam': 'Dar es Salaam','Africa/Djibouti': 'Djibouti','Africa/Douala': 'Douala','Africa/El_Aaiun': 'El Aaiun','Africa/Freetown': 'Freetown','Africa/Gaborone': 'Gaborone','Africa/Harare': 'Harare','Africa/Johannesburg': 'Johannesburg','Africa/Kampala': 'Kampala','Africa/Khartoum': 'Khartoum','Africa/Kigali': 'Kigali','Africa/Kinshasa': 'Kinshasa','Africa/Lagos': 'Lagos','Africa/Libreville': 'Libreville','Africa/Lome': 'Lome','Africa/Luanda': 'Luanda','Africa/Lubumbashi': 'Lubumbashi','Africa/Lusaka': 'Lusaka','Africa/Malabo': 'Malabo','Africa/Maputo': 'Maputo','Africa/Maseru': 'Maseru','Africa/Mbabane': 'Mbabane','Africa/Mogadishu': 'Mogadishu','Africa/Monrovia': 'Monrovia','Africa/Nairobi': 'Nairobi','Africa/Ndjamena': 'Ndjamena','Africa/Niamey': 'Niamey','Africa/Nouakchott': 'Nouakchott','Africa/Ouagadougou': 'Ouagadougou','Africa/Porto-Novo': 'Porto-Novo','Africa/Sao_Tome': 'Sao Tome','Africa/Timbuktu': 'Timbuktu','Africa/Tripoli': 'Tripoli','Africa/Tunis': 'Tunis','Africa/Windhoek': 'Windhoek','Australia/ACT': 'ACT','Australia/Adelaide': 'Adelaide','Australia/Brisbane': 'Brisbane','Australia/Broken_Hill': 'Broken Hill','Australia/Canberra': 'Canberra','Australia/Currie': 'Currie','Australia/Darwin': 'Darwin','Australia/Eucla': 'Eucla','Australia/Hobart': 'Hobart','Australia/LHI': 'LHI','Australia/Lindeman': 'Lindeman','Australia/Lord_Howe': 'Lord Howe','Australia/Melbourne': 'Melbourne','Australia/North': 'North','Australia/NSW': 'NSW','Australia/Perth': 'Perth','Australia/Queensland': 'Queensland','Australia/South': 'South','Australia/Sydney': 'Sydney','Australia/Tasmania': 'Tasmania','Australia/Victoria': 'Victoria','Australia/West': 'West','Australia/Yancowinna': 'Yancowinna','Indian/Antananarivo': 'Antananarivo','Indian/Chagos': 'Chagos','Indian/Christmas': 'Christmas','Indian/Cocos': 'Cocos','Indian/Comoro': 'Comoro','Indian/Kerguelen': 'Kerguelen','Indian/Mahe': 'Mahe','Indian/Maldives': 'Maldives','Indian/Mauritius': 'Mauritius','Indian/Mayotte': 'Mayotte','Indian/Reunion': 'Reunion','Atlantic/Azores': 'Azores','Atlantic/Bermuda': 'Bermuda','Atlantic/Canary': 'Canary','Atlantic/Cape_Verde': 'Cape Verde','Atlantic/Faeroe': 'Faeroe','Atlantic/Faroe': 'Faroe','Atlantic/Jan_Mayen': 'Jan Mayen','Atlantic/Madeira': 'Madeira','Atlantic/Reykjavik': 'Reykjavik','Atlantic/South_Georgia': 'South Georgia','Atlantic/Stanley':'Stanley','Atlantic/St_Helena': 'St Helena','Pacific/Apia': 'Apia','Pacific/Auckland': 'Auckland','Pacific/Chatham': 'Chatham','Pacific/Easter': 'Easter','Pacific/Efate': 'Efate','Pacific/Enderbury': 'Enderbury','Pacific/Fakaofo': 'Fakaofo','Pacific/Fiji': 'Fiji','Pacific/Funafuti': 'Funafuti','Pacific/Galapagos': 'Galapagos','Pacific/Gambier': 'Gambier','Pacific/Guadalcanal': 'Guadalcanal','Pacific/Guam': 'Guam','Pacific/Honolulu': 'Honolulu','Pacific/Johnston': 'Johnston','Pacific/Kiritimati': 'Kiritimati','Pacific/Kosrae': 'Kosrae','Pacific/Kwajalein': 'Kwajalein','Pacific/Majuro': 'Majuro','Pacific/Marquesas': 'Marquesas','Pacific/Midway': 'Midway','Pacific/Nauru': 'Nauru','Pacific/Niue': 'Niue','Pacific/Norfolk': 'Norfolk','Pacific/Noumea': 'Noumea','Pacific/Pago_Pago': 'Pago Pago','Pacific/Palau': 'Palau','Pacific/Pitcairn': 'Pitcairn','Pacific/Ponape': 'Ponape','Pacific/Port_Moresby': 'Port Moresby','Pacific/Rarotonga': 'Rarotonga','Pacific/Saipan': 'Saipan','Pacific/Samoa': 'Samoa','Pacific/Tahiti': 'Tahiti','Pacific/Tarawa': 'Tarawa','Pacific/Tongatapu': 'Tongatapu','Pacific/Truk': 'Truk','Pacific/Wake': 'Wake','Pacific/Wallis': 'Wallis','Pacific/Yap': 'Yap','Antarctica/Casey': 'Casey','Antarctica/Davis': 'Davis','Antarctica/DumontDUrville': 'DumontDUrville','Antarctica/Macquarie': 'Macquarie','Antarctica/Mawson': 'Mawson','Antarctica/McMurdo': 'McMurdo','Antarctica/Palmer': 'Palmer','Antarctica/Rothera': 'Rothera','Antarctica/South_Pole': 'South Pole','Antarctica/Syowa': 'Syowa','Antarctica/Vostok': 'Vostok','Arctic/Longyearbyen': 'Longyearbyen','UTC': 'UTC','UTC-12': 'UTC-12','UTC-11': 'UTC-11','UTC-10': 'UTC-10','UTC-9': 'UTC-9','UTC-8': 'UTC-8','UTC-7': 'UTC-7','UTC-6': 'UTC-6','UTC-5': 'UTC-5','UTC-4': 'UTC-4','UTC-3': 'UTC-3','UTC-2': 'UTC-2','UTC-1': 'UTC-1','UTC+0': 'UTC+0','UTC+1': 'UTC+1','UTC+2': 'UTC+2','UTC+3': 'UTC+3','UTC+4': 'UTC+4','UTC+5': 'UTC+5','UTC+6': 'UTC+6','UTC+7': 'UTC+7','UTC+8': 'UTC+8','UTC+9': 'UTC+9','UTC+10': 'UTC+10','UTC+11': 'UTC+11','UTC+12': 'UTC+12','UTC+13': 'UTC+13','UTC+14': 'UTC+14','US/Eastern': 'Eastern','US/Central': 'Central','Canada/Saskatchewan': 'Central Standard' }; var schdcallmebuttontext = ''; /*check if jquery in exists on current page*/ var impressionSaved = 0; if (window.jQuery === undefined) { var done = false; /*create script tag for jquery file and than auto append to head tag*/ var script = document.createElement("script"); script.src = "https://ajax.googleapis.com/ajax/libs/jquery/" + v + "/jquery.min.js"; document.getElementsByTagName("head")[0].appendChild(script); /*script is loaded*/ script.onload = script.onreadystatechange = function(e){ /*check script is ready*/ if (!done && (!this.readyState || this.readyState == "loaded" || this.readyState == "complete")) { /*var scripflagphone = document.createElement("script"); scripflagphone.src = siteurl+"widgetsjs/countrySelect.js"; var scriptypeit = document.createElement("script"); scriptypeit.src = siteurl+"widgetsjs/typeit.js"; document.getElementsByTagName("head")[0].appendChild(scriptdialog); document.getElementsByTagName("head")[0].appendChild(scripflagphone); document.getElementsByTagName("head")[0].appendChild(scriptypeit);*/ done = true; jQuery(document).ready(function (){ include_google_analytics(); keywordbasedsettings(); var urlfound = 0; /*disallow all url in json format*/ if(disallow_widgets_url !=''){ /* disallowed keywords and urls.*/ var obj = jQuery.parseJSON(disallow_widgets_url); /*check json array length*/ if(obj.length > 0){ /*obj length loop*/ jQuery.each(obj, function(i,c){ /*check if keyword*/ if(obj[i].type==1){ var locationurl = window.location.href.toLowerCase(); /*checking keyword index in current page url*/ if(locationurl.indexOf(obj[i].pattern) > -1) { urlfound = 1; } /*check if url*/ }else if(obj[i].type==0){ var locationurl = window.location.href.replace(/\/$/, "").toLowerCase(); /*checking current page url is same as disallow url*/ if(locationurl == obj[i].pattern) { urlfound = 1; } } }); } } /*if current page url is not found in disallow urls*/ if(urlfound == 0 || company_id==545){ /*now checking allow url*/ if(allow_widgets_url !=''){ /*allowed keywords and urls.*/ var obj = jQuery.parseJSON(allow_widgets_url); /*checking if allow url variable is not empty*/ if(obj.length > 0){ urlfound = 1; /*obj length loop*/ jQuery.each(obj, function(i,c){ /*check if keyword*/ if(obj[i].type==1){ var locationurl = window.location.href.toLowerCase(); /*checking keyword index in current page url*/ if(locationurl.indexOf(obj[i].pattern) > -1) { urlfound = 0; } }else if(obj[i].type==0){ var locationurl = window.location.href.replace(/\/$/, "").toLowerCase(); /*checking current page url is same as disallow url*/ if(locationurl == obj[i].pattern) { urlfound = 0; } } }); } } /*check if this url/keyword is allowed*/ } if(company_id==1251){ jQuery('a[href^="tel:0203 553 0193"]').each(function(){ urlfound = 1; }); } //commented by simer 12 june 2017 //urlfound = 0; /*if url exists in allow url*/ if(urlfound ==0) { /*get current page url*/ var pathname = window.location.href; if(company_id==1237){ var quoteref = ''; try { quoteref = jQuery('.header .hidden-xs.hidden-sm.col-sm-12 span:last-child a').text(); }catch(error) { } if(quoteref !=''){ pathname = pathname+"?quoteref="+quoteref; } } /*save visitors*/ savevisitors(pathname,0); /*save referrer page url*/ savereferrer(referrer,0); /*responseiq custom variable*/ var responseiq = getParameterByName('responseiq'); /*checking if responseiq custom variable exists in document body*/ if ( typeof responseiq !== "undefined" && responseiq) { /*if responseiq custom variable exists with custom variable value*/ if(responseiq !=''){ /*if custom variable value is same as our custom value*/ if(responseiq.toUpperCase()=='CUSTOM'){ /*set delay icon 3 seconds if value is match*/ delay_icon_second = 3000; } } } /*set time-out to appear icon*/ setTimeout(function(){ /*set deafult zero if widget button appear only*/ var count = 0; /* default 0 means there is no click in phone number input field*/ var phone_number_click = 0; /*play sound*/ var playsound = 0; /*hide widget*/ var hideone = 1; /*create span tag for widget button*/ var span = document.createElement("span"); /*add ID attribute in span widget tag*/ var att = document.createAttribute("id"); /*assign widget attribute value */ att.value = "riq_requestcall"; span.setAttributeNode(att); /*append span tag with html page*/ document.body.appendChild(span); jQuery("#riq_requestcall").append(phone_icon); /*show first template and removed all the btn_class*/ jQuery("#riq_calltemplate_4").show(); jQuery("#riq_calltemplate_1").removeClass("widpupnw "+btn_class); jQuery("#riq_calltemplate_2").removeClass("widpupnw "+btn_class); jQuery("#riq_calltemplate_3").removeClass("widpupnw "+btn_class); jQuery("#riq_calltemplate_4").removeClass("widpupnw "+btn_class); if(jQuery(".cookieNotice").is(":visible") && (company_id == "1378" || company_id==1378) && (deviceRiq=='iPhone' || deviceRiq=='Android')){ jQuery('#riq_dilricn2nw').hide(); jQuery('.cookieNotice_close').click(function(){ jQuery('#riq_dilricn2nw').show(); }) }else{ /*get widget button element*/ var el = document.getElementById("riq_dilricn2nw"); fadeIn(el); /*jQuery('.dilricn2nw').fadeIn(2000);*/ /*fade effect on widget button*/ setTimeout(function(){ jQuery('#riq_dilricn2nw').addClass('hvr-grow_1'); remove(); /*if show tool-tip is enabled*/ if(show_tooltip==1){ setTimeout(function(){ jQuery(".riq_box1").show(); var el = document.getElementById("riq_dlrtxtr"); /*call tool tip fade effect function*/ fadeIntooltip(el); autoclosetooltip(); },2000); } },2000); } /*remove fade effect*/ function remove(){ setTimeout(function(){ if(impressionSaved == 0){ savewidgetimpression(1); } jQuery('#riq_dilricn2nw').removeClass('hvr-grow_1'); },1000); } /*if visitor closed the tool-tip*/ if(tooltip_close_click== 1){ jQuery(".riq_box1").hide(); } /*click on speech bubble to show popup*/ //northshore cross button click jQuery(".riq-cross-aj").click(function(){ jQuery(".dilricn2nw").trigger("click","open"); }); /*if tool-tip is enabled*/ if(show_tooltip==1){ /*when mouse over on tool tip add effect*/ jQuery(".riq_dlrtxtr").mouseover(function() { jQuery("#riq_dilricn2nw").addClass('riq_dlrtxtrhvr'); }); jQuery(".riq_dlrtxtr").mouseout(function() { jQuery("#riq_dilricn2nw").removeClass('riq_dlrtxtrhvr'); }); /*click on speech bubble to show popup*/ jQuery("#riq_click_tooltip").click(function(){ jQuery(".dilricn2nw").trigger("click","open"); }); } /*clicked on widget button*/ jQuery(".dilricn2nw").click(function(event,triggeFor){ if(company_id==823){ if(!jQuery( ".dilricn2nw" ).hasClass("crssic")){ savewidgetopen(); setTimeout(function(){ jQuery(".wgtppotshhd").css("height", '238px'); jQuery(".wgtppotshhd").css("display", 'block'); },300); }else{ jQuery(".wgtppotshhd").css("display", 'none'); } }else{ if(!jQuery( ".dilricn2nw" ).hasClass("crssic")){ savewidgetopen(); } } /*if tool-tip enabled close*/ if(show_tooltip==1){ /*hide tooltip*/ jQuery(".riq_box1").hide(); } jQuery(".wgtppotshhd").toggle( function(){ /*if schedule date time div exist*/ if(jQuery("#riq_calltemplate_2").length > 0 || jQuery("#riq_calltemplate_7").length > 0){ playsound = 0; /*if no agent is available shown schedule call page otherwise call me now page showing*/ if(agents_agents_true==0){ jQuery("#riq_showthanks").empty(); jQuery("#riq_showthanks").html(widget_schedule_callback_html); //flightguru then remove poweredby responseiq if(company_id == 558){ jQuery(".bltby").hide(); } jQuery("#riq_calltemplate_4").show(); }else{ jQuery("#riq_showthanks").empty(); jQuery("#riq_showthanks").html(htmlpage); //flightguru then remove poweredby responseiq if(company_id == 558){ jQuery(".bltby").hide(); } jQuery("#riq_calltemplate_1").show(); } jQuery("#riq_calltemplate_1").removeClass("widpupnw "+btn_class); jQuery("#riq_calltemplate_2").removeClass("widpupnw "+btn_class); jQuery("#riq_calltemplate_3").removeClass("widpupnw "+btn_class); jQuery("#riq_calltemplate_4").removeClass("widpupnw "+btn_class); jQuery("#phone_codes").empty(); /*apend input field*/ jQuery("#phone_codes").prepend(''); /*if no flag is disabled*/ if(noFlag == 0){ /*create drop down with country flag*/ jQuery("#phonenumber").countrySelect({ defaultCountry: location_ip.toLowerCase(), }); /*set country code of visitor*/ jQuery("#phone_codes").prepend(''); /*set phone number code of visitors*/ jQuery("#phone_codes").prepend(''); }else{ if(showCountryTextbox == 1){ /*set country code of visitors*/ jQuery("#phone_codes").prepend(''); /*set phone number code of visitors*/ jQuery("#phone_codes").prepend(''); }else{ /*set country code of visitors*/ jQuery("#phone_codes").prepend(''); /*set phone number code of visitors*/ jQuery("#phone_codes").prepend(''); } } /*set country name of visitor*/ jQuery("#phone_codes").prepend(''); /*set agent id*/ jQuery("#phone_codes").prepend(''); /*set visitor id*/ jQuery("#phone_codes").prepend(''); /*set department id*/ jQuery("#phone_codes").prepend(''); /*set phone number input field blank*/ document.getElementById("phonenumber_code").value = ''; /*jQuery('#phonenumber_code').focus();*/ jQuery(".btncll").hover(function(){ jQuery(this).css("border-width", "border-width: 0 0 2px;"); /*jQuery(this).css("background-color", btn_border_color);*/ },function(){ jQuery(this).css("border-width", "border-width: 0 0 4px;"); /*jQuery(this).css("background-color", btn_color);*/ }); /*noting used*/ if((agents_agents_true==1) || (agents_agents_true==0)){ if(agentslist !=''){ if(jQuery("#r_dep").length > 0){ jQuery("#r_dep").empty(); jQuery("#r_dep").html(agentslist); } }else if(departmentslist !=''){ if(jQuery("#r_dep").length > 0){ jQuery("#r_dep").empty(); jQuery("#r_dep").html(departmentslist); } } } /*when visitor enter phone number in input field*/ jQuery("#phonenumber_code").keyup(function(){ /*if country is austria then we have not used this code*/ if(jQuery("#country_name").val() =='GB' || jQuery("#country_name").val() =='UK'){ phone_number_click = 1; /*remove space*/ var number = jQuery("#phonenumber_code").val().replace(/\s/g,''); /*get first character from phone number*/ var first1char = number.substring(0,1); /*get first 2 character from phone number*/ var first2char = number.substring(0,2); /*if first character is 0 then removed*/ if(first1char == 0){ var newnumber = number.substr(1); jQuery("#phonenumber_code").val(newnumber); /*if first 2 character is 00 then removed*/ }else if(first2char == 00){ var newnumber = number.substr(2); jQuery("#phonenumber_code").val(newnumber); /*remove space from phone number*/ }else{ jQuery("#phonenumber_code").val().replace(/\s/g,''); } } }); /*if clicked in input filed set phone number close to 1 so popup will not close*/ jQuery("#phonenumber_code").click(function(){ phone_number_click = 1; }); hideone = 1; /*change place holder of input field*/ /*if(company_id == 829){ if (jQuery(window).width() < 767 ){ jQuery("#phonenumber_code").attr("placeholder","Saisir votre numéro"); }else{ jQuery("#phonenumber_code").attr("placeholder","Saisir votre numéro"); } }else{ if (jQuery(window).width() < 767 ){ jQuery("#phonenumber_code").attr("placeholder","Enter Your Number"); }else{ jQuery("#phonenumber_code").attr("placeholder","Enter Your Number"); } }*/ } } ); if(widget_country_code_edit==0){ jQuery('#country_code').attr('readonly', true); jQuery("#country_code").click(function(){ jQuery("#phonenumber_code").focus(); }); } /*add toggle class to widget button*/ jQuery(".dilricn2nw").toggleClass("crssic"); /*get button text of template*/ if(call_schedule_button_enable==1){ callmebuttontext = jQuery('#callmebutton').text(); schedulecallbuttontext = jQuery('#schedulecallmebutton').text(); }else{ buttontext = jQuery('.btncll').text(); } /*trigger attempt to exists function to save pop-up is opened*/ savetooltip_attemt_to_exist(); /*save visitor*/ savevisitors(pathname,1); /*save referrer*/ savereferrer(referrer,1); if(hideone == 0){ hideone = 1; /*if company enabled hide widgets background*/ if(hide_widgets_background==1){ jQuery.each([5,4,3,2,1], function(index,value){ setTimeout(function(){ if(value == 1){ var slowopacity = '0'; }else{ var slowopacity = '0.'+value; } jQuery(".riq-vbox-overlay").stop().fadeTo("slow", slowopacity); if(value == 1){ delaypage(); } },300); }); }else if(company_id == 282){ //northshore grey box jQuery(".riq-vbox-overlay").css("display","none"); } // console.log(company_id+'company_id'); }else{ hideone = 0; count = 1; /*hide widgets background disabled*/ if(hide_widgets_background==1){ jQuery("#ovt").css('height',"100%"); jQuery.each([1,2,3,4,5], function(index,value){ setTimeout(function(){ var slowopacity = '0.'+value; jQuery(".riq-vbox-overlay").stop().fadeTo("slow", slowopacity); },300); }); }else if(company_id == 282){ //northshore grey box jQuery(".riq-vbox-overlay").css("display","block"); } // console.log(company_id+'company_id'); } /*if pop-up opened and tooltip hide_after_closing_popup */ if(jQuery( ".dilricn2nw" ).hasClass("crssic")){ /*document.title="(1) "+title;*/ document.title=title; /*hide tool-tip*/ if(hide_after_closing_popup==1){ jQuery(".riq_box1").hide(); /*save tool tip close*/ savetooltip_close_click(); } }else{ document.title=title; /*if hide_after_closing_popup is enable and tool tip is not closed then close tool tip with fade*/ if(hide_after_closing_popup==0 && tooltip_close_click==0){ jQuery('#riq_dilricn2nw').addClass('hvr-grow_1'); remove(); /*if show tool tip is enabled*/ if(show_tooltip==1){ setTimeout(function(){ jQuery(".riq_box1").show(); var el = document.getElementById("riq_dlrtxtr"); /*fade tool tip function*/ fadeIntooltip(el); },2000); } } } if(triggeFor == 'autopopup'){ trigger_google_event(2); }else if(triggeFor == 'open'){ trigger_google_event(1); }else if(triggeFor == 'close' || triggeFor == 'autoclose'){ trigger_google_event(3); }else if(jQuery( ".dilricn2nw" ).hasClass("crssic")){ trigger_google_event(1); }else{ trigger_google_event(3); } }); /*close pop-up if visitor clicked on grey effect shadow any where*/ jQuery("#ovt").click(function(){ if(jQuery( ".dilricn2nw" ).hasClass("crssic")){ jQuery(".dilricn2nw").trigger("click","close"); } }); /*if press enter key in pop-up then pop-up button will clicked*/ jQuery(document).keypress(function(e){ if(e.which == 13) { if(jQuery( ".dilricn2nw" ).hasClass("crssic")){ jQuery(".btncll").trigger("click"); } } }); /* jQuery(".crssicn").click(function(){ jQuery("#ovt").removeClass('riq-vbox-overlay'); }); jQuery(".dilicn").click(function(){ jQuery("#ovt").addClass('riq-vbox-overlay'); }); */ /*empty span tag of phone codes*/ jQuery("#phone_codes").empty(); /*append hidden input field to create drop down*/ jQuery("#phone_codes").prepend(''); /*if no flag is disabled*/ if(noFlag == 0){ /*create country drop down*/ jQuery("#phonenumber").countrySelect({ defaultCountry: location_ip.toLowerCase(), }); /*append visitor country code*/ jQuery("#phone_codes").prepend(''); /*append visitor phone country code*/ jQuery("#phone_codes").prepend(''); }else{ if(showCountryTextbox == 1){ /*append visitor country code*/ jQuery("#phone_codes").prepend(''); /*append visitor phone country code*/ jQuery("#phone_codes").prepend(''); }else{ /*append visitor country code*/ jQuery("#phone_codes").prepend(''); /*append visitor phone country code*/ jQuery("#phone_codes").prepend(''); } } /*append visitor country name*/ jQuery("#phone_codes").prepend(''); /*append visitor agent id*/ jQuery("#phone_codes").prepend(''); /*append visitor id*/ jQuery("#phone_codes").prepend(''); /*set department id*/ jQuery("#phone_codes").prepend(''); /*document.getElementById("phonenumber_code").value = phonecode;*/ document.getElementById("phonenumber_code").value = ''; /*jQuery('#phonenumber_code').focus();*/ /*widget button mouse over effect*/ jQuery(".btncll").hover(function(){ jQuery(this).css("border-width", "border-width: 0 0 2px;"); /*jQuery(this).css("background-color", btn_border_color);*/ },function(){ jQuery(this).css("border-width", "border-width: 0 0 4px;"); /*jQuery(this).css("background-color", btn_color);*/ }); /*set button text from template*/ if(call_schedule_button_enable==1){ callmebuttontext = jQuery('#callmebutton').text(); schedulecallbuttontext = jQuery('#schedulecallmebutton').text(); }else{ buttontext = jQuery('.btncll').text(); } /*code not in used*/ if((agents_agents_true==1) || (agents_agents_true==0)){ if(agentslist !=''){ if(jQuery("#r_dep").length > 0){ jQuery("#r_dep").empty(); jQuery("#r_dep").html(agentslist); } }else if(departmentslist !=''){ if(jQuery("#r_dep").length > 0){ jQuery("#r_dep").empty(); jQuery("#r_dep").html(departmentslist); } } } /*when visitor enter phone number in input field*/ jQuery("#phonenumber_code").keyup(function(){ phone_number_click = 1; /*if country is austria then we have not used this code*/ if(jQuery("#country_name").val() =='GB' || jQuery("#country_name").val() =='UK'){ /*remove space*/ var number = jQuery("#phonenumber_code").val().replace(/\s/g,''); /*get first character from phone number*/ var first1char = number.substring(0,1); /*get first 2 character from phone number*/ var first2char = number.substring(0,2); /*if first character is 0 then removed*/ if(first1char == 0){ var newnumber = number.substr(1); jQuery("#phonenumber_code").val(newnumber); /*if first 2 character is 00 then removed*/ }else if(first2char == 00){ var newnumber = number.substr(2); jQuery("#phonenumber_code").val(newnumber); /*remove space from phone number*/ }else{ jQuery("#phonenumber_code").val().replace(/\s/g,''); } } }); /*if visitor clicked in phone number input field*/ jQuery("#phonenumber_code").click(function(){ phone_number_click = 1; }); /*change input field place holder*/ /*if(company_id == 829){ if (jQuery(window).width() < 767 ){ jQuery("#phonenumber_code").attr("placeholder","Saisir votre numéro"); }else{ jQuery("#phonenumber_code").attr("placeholder","Saisir votre numéro"); } }else{ if (jQuery(window).width() < 767 ){ jQuery("#phonenumber_code").attr("placeholder","Enter Your Number"); }else{ jQuery("#phonenumber_code").attr("placeholder","Enter Your Number"); } }*/ /*if attempts to exists is enabled from widget settings*/ if(saveattempts_to_exit == 0){ if(attempts_to_exit==1){ jQuery(document).on( "mousemove", function(event) { if(event.pageY <=15){ if(count==0){ jQuery(".dilricn2nw").trigger("click","autopopup"); count = 1; savetooltip_attemt_to_exist(); } } }); } } if(company_id==381){ jQuery(".new-modal_responseiq").click(function(e){ /*trigger widget button*/ jQuery(".dilricn2nw").trigger("click","open"); count = 1; }); }else{ jQuery(".new-modal_responseiq").click(function(e){ /*trigger widget button*/ jQuery(".dilricn2nw").trigger("click","open"); count = 1; }); } if(company_id==730){ jQuery("#headerCall a").removeAttr("href"); jQuery("#headerCustomerService a").removeAttr("href"); jQuery("#headerCall").click(function(e){ /*trigger widget button*/ jQuery(".dilricn2nw").trigger("click","open"); count = 1; }); jQuery("#headerCustomerService").click(function(e){ /*trigger widget button*/ jQuery(".dilricn2nw").trigger("click","open"); count = 1; }); } if((company_id==887) && (company_id=='887') && (sub_widget_company_id==888)){ jQuery("#responseiq_buttonid").click(function(e){ /*trigger widget button*/ jQuery(".dilricn2nw").trigger("click","open"); count = 1; }); } /*trigger pop-up if custom variable is set in url*/ var responseiq = getParameterByName('responseiq'); if ( typeof responseiq !== "undefined" && responseiq) { /*if responseiq custom variable exists with custom variable value*/ if(responseiq !=''){ /*if custom variable value is same as our custom value*/ if(responseiq.toUpperCase()=='CUSTOM'){ if(count==0){ /*trigger widget button*/ jQuery(".dilricn2nw").trigger("click","open"); count = 1; } } } } /*if time check is enabled from company widget settings*/ if(time_check==1){ /*if time on website is more than 0 and attempt to exits is not updated*/ if(time_on_website > 0 && saveattempts_to_exit==0){ setTimeout(function(){ /*widget not clicked*/ if(count==0){ /*widget open*/ jQuery(".dilricn2nw").trigger("click","autopopup"); /*update count 1*/ count = 1; setTimeout(function(){ /*if widget open and not clicked anywhere in widget then close popup automatically*/ if(count==1 && phone_number_click==0){ /*if widget opened button class exists*/ if(jQuery( ".dilricn2nw" ).hasClass("crssic")){ /*trigger close button of widget*/ jQuery(".dilricn2nw").trigger("click","autoclose"); } } },delay_before_minimising_popup); } },time_on_website); } } },delay_icon_second); } }); } }; /*create widget css style tag based on company id*/ var head = document.getElementsByTagName("head")[0]; var cssIdwidgets = "myCsswidgets"; var linkwidgets = document.createElement("link"); linkwidgets.id = cssIdwidgets; linkwidgets.rel = "stylesheet"; linkwidgets.type = "text/css"; if((company_id==278) || (company_id=='278')){ linkwidgets.href = siteurl+"assets_new/dist/css/marginstylewidgets.css"; }else if((company_id==277) || (company_id=='277')){ linkwidgets.href = siteurl+"assets_new/dist/css/marginmobilestylewidgets.css"; }else if((company_id==408) || (company_id=='408')){ linkwidgets.href = siteurl+"assets_new/dist/css/noflagamericanbullionstylewidgets.css"; }else if((company_id==531) || (company_id=='531')){ linkwidgets.href = siteurl+"assets_new/dist/css/cruisestylewidgets.css"; }else if((company_id==482) || (company_id=='482')){ linkwidgets.href = siteurl+"assets_new/dist/css/sovereignnoflagstylewidgets.css"; }else if((company_id==831) || (company_id=='831')){ linkwidgets.href = siteurl+"assets_new/dist/css/luxtrippernoflagstylewidgets.css"; }else if((company_id==810) || (company_id=='810')){ linkwidgets.href = siteurl+"assets_new/dist/css/wisperbikesnoflagstylewidgets.css"; }else if((company_id==875) || (company_id=='875')){ linkwidgets.href = siteurl+"assets_new/dist/css/outofofficenoflagstylewidgets.css"; }else if((company_id==931) || (company_id=='931')){ linkwidgets.href = siteurl+"assets_new/dist/css/pissupnoflagstylewidgets.css"; }else if((company_id==988) || (company_id=='988')){ linkwidgets.href = siteurl+"assets_new/dist/css/expatexplorenoflagstylewidgets.css"; }else if((company_id==919) || (company_id=='919')){ linkwidgets.href = siteurl+"assets_new/dist/css/cruiseclubuknoflagstylewidgets.css"; }else if((company_id==943) && (company_id=='943') && (sub_widget_company_id==0)){ linkwidgets.href = siteurl+"assets_new/dist/css/mulberrycottagesnoflagstylewidgets.css"; }else if((company_id==714) || (company_id=='714')){ linkwidgets.href = siteurl+"assets_new/dist/css/oxford-royalenoflagstylewidgets.css"; }else if((company_id==1027) && (company_id=='1027') && (sub_widget_company_id==0)){ linkwidgets.href = siteurl+"assets_new/dist/css/floridatixnoflagstylewidgets.css"; }else if((company_id==1027) && (company_id=='1027') && (sub_widget_company_id==1062)){ linkwidgets.href = siteurl+"assets_new/dist/css/attractiontixnoflagstylewidgets.css"; }else if((company_id==887) && (company_id=='887') && (sub_widget_company_id==888)){ linkwidgets.href = siteurl+"assets_new/dist/css/inspiringtravelcompanynoflagstylewidgets.css"; }else if((company_id==874) || (company_id=='874')){ linkwidgets.href = siteurl+"assets_new/dist/css/thamesvalleylettingsnoflagstylewidgets.css"; }else if((company_id==881) || (company_id=='881')){ linkwidgets.href = siteurl+"assets_new/dist/css/hetravelnoflagstylewidgets.css"; }else if((company_id==1001) || (company_id=='1001')){ linkwidgets.href = siteurl+"assets_new/dist/css/straybootsnoflagstylewidgets.css"; }else if((company_id==1237) || (company_id=='1237')){ linkwidgets.href = siteurl+"assets_new/dist/css/ukinsurancenoflagstylewidgets.css"; }else if((company_id==3) || (company_id=='3')){ linkwidgets.href = siteurl+"assets_new/dist/css/responseiqnoflagstylewidgets.css"; }else if((company_id==1218) && (company_id=='1218') && (sub_widget_company_id==0)){ linkwidgets.href = siteurl+"assets_new/dist/css/trektravelnoflagstylewidgets.css"; }else if((company_id==1271) || (company_id=='1271')){ linkwidgets.href = siteurl+"assets_new/dist/css/wildfrontierstravelnoflagstylewidgets.css"; }else if((company_id==1261) || (company_id=='1261')){ linkwidgets.href = siteurl+"assets_new/dist/css/borrowmydoggynoflagstylewidgets.css"; }else if((company_id==1086) || (company_id=='1086')){ linkwidgets.href = siteurl+"assets_new/dist/css/cooptravelnoflagstylewidgets.css"; }else if((company_id==1334) || (company_id=='1334')){ linkwidgets.href = siteurl+"assets_new/dist/css/turquoiseholidaynoflagstylewidgets.css"; }else if((company_id==1389) || (company_id=='1389')){ linkwidgets.href = siteurl+"assets_new/dist/css/outsidegonoflagstylewidgets.css"; }else if((company_id==1263) || (company_id=='1263')){ linkwidgets.href = siteurl+"assets_new/dist/css/trekamericanoflagstylewidgets.css"; }else if((company_id==531) && (company_id=='531') && (sub_widget_company_id==1342)){ linkwidgets.href = siteurl+"assets_new/dist/css/kreuzfahrtberaternoflagstylewidgets.css"; }else if((company_id==1429) && (company_id=='1429') && (sub_widget_company_id==0)){ linkwidgets.href = siteurl+"assets_new/dist/css/travelcenternoflagstylewidgets.css"; }else if((company_id==1429) && (company_id=='1429') && (sub_widget_company_id==1432)){ linkwidgets.href = siteurl+"assets_new/dist/css/travelcenternoflagstylewidgets.css"; }else if((company_id==1429) && (company_id=='1429') && (sub_widget_company_id==1433)){ linkwidgets.href = siteurl+"assets_new/dist/css/travelcenternoflagstylewidgets.css"; }else if((company_id==1462) && (company_id=='1462') && (sub_widget_company_id==0)){ linkwidgets.href = siteurl+"assets_new/dist/css/electricaldealsdirectnoflagstylewidgets.css"; }else if((company_id==1537) && (company_id=='1537') && (sub_widget_company_id==0)){ linkwidgets.href = siteurl+"assets_new/dist/css/direct365noflagstylewidgets.css"; }else if((company_id==1258) && (company_id=='1258')){ linkwidgets.href = siteurl+"assets_new/dist/css/tropicalskynoflagstylewidgets.css"; }else if((company_id==1603) && (company_id=='1603')){ linkwidgets.href = siteurl+"assets_new/dist/css/autographleasingnoflagstylewidgets.css"; }else if((company_id==1610) && (company_id=='1610')){ linkwidgets.href = siteurl+"assets_new/dist/css/classic-collectionnoflagstylewidgets.css"; }else if((company_id==1630) && (company_id=='1630')){ linkwidgets.href = siteurl+"assets_new/dist/css/nationalvehiclenoflagstylewidgets.css"; }else if((company_id==1541) && (company_id=='1541')){ linkwidgets.href = siteurl+"assets_new/dist/css/webuyanyhousenoflagstylewidgets.css"; }else{ linkwidgets.href = siteurl+"assets_new/dist/css/noflagstylewidgets.css"; } linkwidgets.media = "all"; head.appendChild(linkwidgets); if((company_id==681) || (company_id=='681')){ var linkletlords = document.createElement("link"); linkletlords.id = 'letlordcss'; linkletlords.rel = "stylesheet"; linkletlords.type = "text/css"; linkletlords.href = siteurl+"assets_new/dist/css/letlord.css"; linkletlords.media = "all"; head.appendChild(linkletlords); } var cssIdflagphone = "myCssflagphone"; var linkflagphone = document.createElement("link"); linkflagphone.id = cssIdflagphone; linkflagphone.rel = "stylesheet"; linkflagphone.type = "text/css"; linkflagphone.href = siteurl+"widgetsjs/countrySelect.css"; linkflagphone.media = "all"; head.appendChild(linkflagphone); var cssIdfonts = "myCssfonts"; var linkfonts = document.createElement("link"); linkfonts.id = cssIdfonts; linkfonts.rel = "stylesheet"; linkfonts.type = "text/css"; /*linkfonts.href = "https://fonts.googleapis.com/css?family=Titillium+Web:400,600,700";*/ linkfonts.href = siteurl+"assets_new/dist/css/Titillium-Regular.woff"; linkfonts.media = "all"; head.appendChild(linkfonts); }else{ /*var scripflagphone = document.createElement("script"); scripflagphone.src = siteurl+"widgetsjs/countrySelect.js"; var scriptypeit = document.createElement("script"); scriptypeit.src = siteurl+"widgetsjs/typeit.js";*/ jQuery(document).ready(function (){ include_google_analytics(); keywordbasedsettings(); var urlfound = 0; /*disallow all url in json format*/ if(disallow_widgets_url !=''){ /* disallowed keywords and urls.*/ var obj = jQuery.parseJSON(disallow_widgets_url); /*check json array length*/ if(obj.length > 0){ /*obj length loop*/ jQuery.each(obj, function(i,c){ /*check if keyword*/ if(obj[i].type==1){ var locationurl = window.location.href.toLowerCase(); /*checking keyword index in current page url*/ if(locationurl.indexOf(obj[i].pattern) > -1) { urlfound = 1; } /*check if url*/ }else if(obj[i].type==0){ var locationurl = window.location.href.replace(/\/$/, "").toLowerCase(); /*checking current page url is same as disallow url*/ if(locationurl == obj[i].pattern) { urlfound = 1; } } }); } } /*if current page url is not found in disallow urls*/ if(urlfound == 0 || company_id==545 ){ /*now checking allow url*/ if(allow_widgets_url !=''){ /*allowed keywords and urls.*/ var obj = jQuery.parseJSON(allow_widgets_url); /*checking if allow url variable is not empty*/ if(obj.length > 0){ urlfound = 1; /*obj length loop*/ jQuery.each(obj, function(i,c){ /*check if keyword*/ if(obj[i].type==1){ var locationurl = window.location.href.toLowerCase(); /*checking keyword index in current page url*/ if(locationurl.indexOf(obj[i].pattern) > -1) { urlfound = 0; } }else if(obj[i].type==0){ var locationurl = window.location.href.replace(/\/$/, "").toLowerCase(); /*checking current page url is same as allow url*/ if(locationurl == obj[i].pattern) { urlfound = 0; } } }); } } /*check if this url/keyword is allowed*/ } if(company_id==1251){ jQuery('a[href^="tel:0203 553 0193"]').each(function(){ urlfound = 1; }); } //commented by simer 12 june 2017 //urlfound = 0; /*if url exists in allow url*/ if(urlfound == 0 ) { /*get current page url*/ var pathname = window.location.href; if(company_id==1237){ var quoteref = ''; try { quoteref = jQuery('.header .hidden-xs.hidden-sm.col-sm-12 span:last-child a').text(); }catch(error) { } if(quoteref !=''){ pathname = pathname+"?quoteref="+quoteref; } } /*save visitors*/ savevisitors(pathname,0); /*save referrer page url*/ savereferrer(referrer,0); /*responseiq custom variable*/ var responseiq = getParameterByName('responseiq'); /*checking if responseiq custom variable exists in document body*/ if ( typeof responseiq !== "undefined" && responseiq) { /*if responseiq custom variable exists with custom variable value*/ if(responseiq !=''){ /*if custom variable value is same as our custom value*/ if(responseiq.toUpperCase()=='CUSTOM'){ /*set delay icon 3 seconds if value is match*/ delay_icon_second = 3000; } } } /*set time-out to appear icon*/ setTimeout(function(){ /*set deafult zero if widget button appear only*/ var count = 0; /* default 0 means there is no click in phone number input field*/ var phone_number_click = 0; /*play sound*/ var playsound = 0; /*hide widget*/ var hideone = 1; /*create span tag for widget button*/ var span = document.createElement("span"); span.href = "#null"; /*add ID attribute in span widget tag*/ var att = document.createAttribute("id"); /*assign widget attribute value */ att.value = "riq_requestcall"; span.setAttributeNode(att); /*append span tag with html page*/ document.body.appendChild(span); jQuery("#riq_requestcall").append(phone_icon); /*show first template and removed all the btn_class*/ jQuery("#riq_calltemplate_4").show(); jQuery("#riq_calltemplate_1").removeClass("widpupnw "+btn_class); jQuery("#riq_calltemplate_2").removeClass("widpupnw "+btn_class); jQuery("#riq_calltemplate_3").removeClass("widpupnw "+btn_class); jQuery("#riq_calltemplate_4").removeClass("widpupnw "+btn_class); if(jQuery(".cookieNotice").is(":visible") && (company_id == "1378" || company_id==1378) && (deviceRiq=='iPhone' || deviceRiq=='Android')){ jQuery('#riq_dilricn2nw').hide(); jQuery('.cookieNotice_close').click(function(){ jQuery('#riq_dilricn2nw').show(); }) }else{ /*get widget button element*/ var el = document.getElementById("riq_dilricn2nw"); fadeIn(el); /*jQuery('.dilricn2nw').fadeIn(2000);*/ setTimeout(function(){ jQuery('#riq_dilricn2nw').addClass('hvr-grow_1'); remove(); /*if show tool-tip is enabled*/ if(show_tooltip==1){ setTimeout(function(){ jQuery(".riq_box1").show(); var el = document.getElementById("riq_dlrtxtr"); fadeIntooltip(el); autoclosetooltip(); },2000); } },2000); } /*remove fade effect*/ function remove(){ setTimeout(function(){ if(impressionSaved == 0){ savewidgetimpression(2); } jQuery('#riq_dilricn2nw').removeClass('hvr-grow_1'); },1000); } /*if visitor closed the tool-tip*/ if(tooltip_close_click== 1){ jQuery(".riq_box1").hide(); } //northshore cross button click jQuery(".riq-cross-aj").click(function(){ jQuery(".dilricn2nw").trigger("click","open"); }); /*if tool-tip is enabled*/ if(show_tooltip==1){ /*when mouse over on tool tip add effect*/ jQuery(".riq_dlrtxtr").mouseover(function() { jQuery("#riq_dilricn2nw").addClass('riq_dlrtxtrhvr'); }); jQuery(".riq_dlrtxtr").mouseout(function() { jQuery("#riq_dilricn2nw").removeClass('riq_dlrtxtrhvr'); }); /*click on speech bubble to show popup*/ jQuery("#riq_click_tooltip").click(function(){ jQuery(".dilricn2nw").trigger("click","open"); }); } /*clicked on widget button*/ jQuery(".dilricn2nw").click(function(event,triggeFor){ if(company_id==823){ if(!jQuery( ".dilricn2nw" ).hasClass("crssic")){ savewidgetopen(); setTimeout(function(){ jQuery(".wgtppotshhd").css("height", '238px'); jQuery(".wgtppotshhd").css("display", 'block'); },300); }else{ jQuery(".wgtppotshhd").css("display", 'none'); } }else{ if(!jQuery( ".dilricn2nw" ).hasClass("crssic")){ savewidgetopen(); } } /*if tool-tip enabled close*/ if(show_tooltip==1){ jQuery(".riq_box1").hide(); } jQuery(".wgtppotshhd").toggle( function(){ /*if schedule date time div exist*/ if(jQuery("#riq_calltemplate_2").length > 0 || jQuery("#riq_calltemplate_7").length > 0){ playsound = 0; /*if no agent is available shown schedule call page otherwise call me now page showing*/ if(agents_agents_true==0){ jQuery("#riq_showthanks").empty(); jQuery("#riq_showthanks").html(widget_schedule_callback_html); //flightguru then remove poweredby responseiq if(company_id == 558){ jQuery(".bltby").hide(); } jQuery("#riq_calltemplate_4").show(); }else{ jQuery("#riq_showthanks").empty(); jQuery("#riq_showthanks").html(htmlpage); //flightguru then remove poweredby responseiq if(company_id == 558){ jQuery(".bltby").hide(); } jQuery("#riq_calltemplate_1").show(); } jQuery("#riq_calltemplate_1").removeClass("widpupnw "+btn_class); jQuery("#riq_calltemplate_2").removeClass("widpupnw "+btn_class); jQuery("#riq_calltemplate_3").removeClass("widpupnw "+btn_class); jQuery("#riq_calltemplate_4").removeClass("widpupnw "+btn_class); jQuery("#phone_codes").empty(); /*append input field*/ jQuery("#phone_codes").prepend(''); /*if no flag is disabled*/ if(noFlag == 0){ /*create drop down with country flag*/ jQuery("#phonenumber").countrySelect({ defaultCountry: location_ip.toLowerCase(), }); /*set country code of visitor*/ jQuery("#phone_codes").prepend(''); /*set phone number code of visitors*/ jQuery("#phone_codes").prepend(''); }else{ if(showCountryTextbox == 1){ /*set country code of visitors*/ jQuery("#phone_codes").prepend(''); /*set phone number code of visitors*/ jQuery("#phone_codes").prepend(''); }else{ /*set country code of visitors*/ jQuery("#phone_codes").prepend(''); /*set phone number code of visitors*/ jQuery("#phone_codes").prepend(''); } } /*set country name of visitor*/ jQuery("#phone_codes").prepend(''); /*set agent id*/ jQuery("#phone_codes").prepend(''); /*set visitor id*/ jQuery("#phone_codes").prepend(''); /*set department id*/ jQuery("#phone_codes").prepend(''); /*set phone number input field blank*/ document.getElementById("phonenumber_code").value = ''; /*jQuery('#phonenumber_code').focus();*/ jQuery(".btncll").hover(function(){ jQuery(this).css("border-width", "border-width: 0 0 2px;"); /*jQuery(this).css("background-color", btn_border_color);*/ },function(){ jQuery(this).css("border-width", "border-width: 0 0 4px;"); /*jQuery(this).css("background-color", btn_color);*/ }); /*noting used*/ if((agents_agents_true==1) || (agents_agents_true==0)){ if(agentslist !=''){ if(jQuery("#r_dep").length > 0){ jQuery("#r_dep").empty(); jQuery("#r_dep").html(agentslist); } }else if(departmentslist !=''){ if(jQuery("#r_dep").length > 0){ jQuery("#r_dep").empty(); jQuery("#r_dep").html(departmentslist); } } } /*when visitor enter phone number in input field*/ jQuery("#phonenumber_code").keyup(function(){ phone_number_click = 1; /*if country is austria then we have not used this code*/ if(jQuery("#country_name").val() =='GB' || jQuery("#country_name").val() =='UK'){ /*remove space*/ var number = jQuery("#phonenumber_code").val().replace(/\s/g,''); /*get first character from phone number*/ var first1char = number.substring(0,1); /*get first 2 character from phone number*/ var first2char = number.substring(0,2); /*if first character is 0 then removed*/ if(first1char == 0){ var newnumber = number.substr(1); jQuery("#phonenumber_code").val(newnumber); /*if first 2 character is 00 then removed*/ }else if(first2char == 00){ var newnumber = number.substr(2); jQuery("#phonenumber_code").val(newnumber); /*remove space from phone number*/ }else{ jQuery("#phonenumber_code").val().replace(/\s/g,''); } } }); /*if clicked in input filed set phone number close to 1 so popup will not close*/ jQuery("#phonenumber_code").click(function(){ phone_number_click = 1; }); hideone = 1 /*change place holder of input field*/; /*if(company_id == 829){ if (jQuery(window).width() < 767 ){ jQuery("#phonenumber_code").attr("placeholder","Saisir votre numéro"); }else{ jQuery("#phonenumber_code").attr("placeholder","Saisir votre numéro"); } }else{ if (jQuery(window).width() < 767 ){ jQuery("#phonenumber_code").attr("placeholder","Enter Your Number"); }else{ jQuery("#phonenumber_code").attr("placeholder","Enter Your Number"); } }*/ } } ); if(widget_country_code_edit==0){ jQuery('#country_code').attr('readonly', true); jQuery("#country_code").click(function(){ jQuery("#phonenumber_code").focus(); }); } /*add toggle class to widget button*/ jQuery(".dilricn2nw").toggleClass("crssic"); /*get button text of template*/ if(call_schedule_button_enable==1){ callmebuttontext = jQuery('#callmebutton').text(); schedulecallbuttontext = jQuery('#schedulecallmebutton').text(); }else{ buttontext = jQuery('.btncll').text(); } /*trigger attempt to exists function to save pop-up is opened*/ savetooltip_attemt_to_exist(); /*save visitor*/ savevisitors(pathname,1); /*save referrer*/ savereferrer(referrer,1); if(hideone == 0){ hideone = 1; /*if company enabled hide widgets background*/ if(hide_widgets_background==1){ jQuery.each([5,4,3,2,1], function(index,value){ setTimeout(function(){ if(value == 1){ var slowopacity = '0'; }else{ var slowopacity = '0.'+value; } jQuery(".riq-vbox-overlay").stop().fadeTo("slow", slowopacity); if(value == 1){ delaypage(); } },300); }); }else if(company_id == 282){ //northshore grey box jQuery(".riq-vbox-overlay").css("display","none"); } }else{ hideone = 0; count = 1; if(hide_widgets_background==1){ jQuery("#ovt").css('height',"100%"); jQuery.each([1,2,3,4,5], function(index,value){ setTimeout(function(){ var slowopacity = '0.'+value; jQuery(".riq-vbox-overlay").stop().fadeTo("slow", slowopacity); },300); }); }else if(company_id == 282){ //northshore grey box jQuery(".riq-vbox-overlay").css("display","block"); } } /*if pop-up opened and tooltip hide_after_closing_popup */ if(jQuery( ".dilricn2nw" ).hasClass("crssic")){ /*document.title="(1) "+title;*/ document.title=title; /*hide tool-tip*/ if(hide_after_closing_popup==1){ jQuery(".riq_box1").hide(); /*save tool tip close*/ savetooltip_close_click(); } }else{ document.title=title; /*if hide_after_closing_popup is enable and tool tip is not closed then close tool tip with fade*/ if(hide_after_closing_popup==0 && tooltip_close_click==0){ jQuery('#riq_dilricn2nw').addClass('hvr-grow_1'); remove(); /*if show tool tip is enabled*/ if(show_tooltip==1){ setTimeout(function(){ jQuery(".riq_box1").show(); var el = document.getElementById("riq_dlrtxtr"); fadeIntooltip(el); },2000); } } } if(triggeFor == 'autopopup'){ trigger_google_event(2); }else if(triggeFor == 'open'){ trigger_google_event(1); }else if(triggeFor == 'close' || triggeFor == 'autoclose'){ trigger_google_event(3); }else if(jQuery( ".dilricn2nw" ).hasClass("crssic")){ trigger_google_event(1); }else{ trigger_google_event(3); } }); /*close pop-up if visitor clicked on grey effect shadow any where*/ jQuery("#ovt").click(function(){ if(jQuery( ".dilricn2nw" ).hasClass("crssic")){ jQuery(".dilricn2nw").trigger("click","close"); } }); /*if press enter key in pop-up then pop-up button will clicked*/ jQuery(document).keypress(function(e){ if(e.which == 13) { if(jQuery( ".dilricn2nw" ).hasClass("crssic")){ jQuery(".btncll").trigger("click"); } } }); /* jQuery(".crssicn").click(function(){ jQuery("#ovt").removeClass('riq-vbox-overlay'); }); jQuery(".dilicn").click(function(){ jQuery("#ovt").addClass('riq-vbox-overlay'); }); */ /*empty span tag of phone codes*/ jQuery("#phone_codes").empty(); /*append hidden input field to create drop down*/ jQuery("#phone_codes").prepend(''); /*if no flag is disabled*/ if(noFlag == 0){ /*create country drop down*/ jQuery("#phonenumber").countrySelect({ defaultCountry: location_ip.toLowerCase(), }); /*append visitor country code*/ jQuery("#phone_codes").prepend(''); /*append visitor phone country code*/ jQuery("#phone_codes").prepend(''); }else{ /*if show phone number code is enabled*/ if(showCountryTextbox == 1){ /*append visitor country code*/ jQuery("#phone_codes").prepend(''); /*append visitor phone country code*/ jQuery("#phone_codes").prepend(''); }else{ /*append visitor country code*/ jQuery("#phone_codes").prepend(''); /*append visitor phone country code*/ jQuery("#phone_codes").prepend(''); } } /*append visitor country name*/ jQuery("#phone_codes").prepend(''); /*append visitor agent id*/ jQuery("#phone_codes").prepend(''); /*append visitor id*/ jQuery("#phone_codes").prepend(''); /*append department id*/ jQuery("#phone_codes").prepend(''); document.getElementById("phonenumber_code").value = ''; if((agents_agents_true==1) || (agents_agents_true==0)){ if(agentslist !=''){ if(jQuery("#r_dep").length > 0){ jQuery("#r_dep").empty(); jQuery("#r_dep").html(agentslist); } }else if(departmentslist !=''){ if(jQuery("#r_dep").length > 0){ jQuery("#r_dep").empty(); jQuery("#r_dep").html(departmentslist); } } } /*jQuery('#phonenumber_code').focus();*/ jQuery(".btncll").hover(function(){ jQuery(this).css("border-width", "border-width: 0 0 2px;"); /*jQuery(this).css("background-color", btn_border_color);*/ },function(){ jQuery(this).css("border-width", "border-width: 0 0 4px;"); /*jQuery(this).css("background-color", btn_color);*/ }); /*set button text from template*/ if(call_schedule_button_enable==1){ callmebuttontext = jQuery('#callmebutton').text(); schedulecallbuttontext = jQuery('#schedulecallmebutton').text(); }else{ buttontext = jQuery('.btncll').text(); } /*when visitor enter phone number in input field*/ jQuery("#phonenumber_code").keyup(function(){ phone_number_click = 1; /*if country is austria then we have not used this code*/ if(jQuery("#country_name").val() =='GB' || jQuery("#country_name").val() =='UK'){ /*get first character from phone number*/ var number = jQuery("#phonenumber_code").val().replace(/\s/g,''); /*get first character from phone number*/ var first1char = number.substring(0,1); /*get first 2 character from phone number*/ var first2char = number.substring(0,2); /*if first character is 0 then removed*/ if(first1char == 0){ var newnumber = number.substr(1); jQuery("#phonenumber_code").val(newnumber); /*if first 2 character is 00 then removed*/ }else if(first2char == 00){ var newnumber = number.substr(2); jQuery("#phonenumber_code").val(newnumber); /*remove space from phone number*/ }else{ jQuery("#phonenumber_code").val().replace(/\s/g,''); } } }); /*if visitor clicked in phone number input field*/ jQuery("#phonenumber_code").click(function(){ phone_number_click = 1; }); /*change input filed place holder*/ /*if(company_id == 829){ if (jQuery(window).width() < 767 ){ jQuery("#phonenumber_code").attr("placeholder","Saisir votre numéro"); }else{ jQuery("#phonenumber_code").attr("placeholder","Saisir votre numéro"); } }else{ if (jQuery(window).width() < 767 ){ jQuery("#phonenumber_code").attr("placeholder","Enter Your Number"); }else{ jQuery("#phonenumber_code").attr("placeholder","Enter Your Number"); } }*/ /*if attempts to exists is enabled from widget settings*/ if(saveattempts_to_exit == 0){ if(attempts_to_exit==1){ jQuery(document).on( "mousemove", function(event) { if(event.pageY <=15){ if(count==0){ jQuery(".dilricn2nw").trigger("click","autopopup"); count = 1; savetooltip_attemt_to_exist(); } } }); } } if(company_id==381){ jQuery(".new-modal_responseiq").click(function(e){ /*trigger widget button*/ jQuery(".dilricn2nw").trigger("click","open"); count = 1; }); }else{ jQuery(".new-modal_responseiq").click(function(e){ /*trigger widget button*/ jQuery(".dilricn2nw").trigger("click","open"); count = 1; }); } if(company_id==730){ jQuery("#headerCall a").removeAttr("href"); jQuery("#headerCustomerService a").removeAttr("href"); jQuery("#headerCall").click(function(e){ /*trigger widget button*/ jQuery(".dilricn2nw").trigger("click","open"); count = 1; }); jQuery("#headerCustomerService").click(function(e){ /*trigger widget button*/ jQuery(".dilricn2nw").trigger("click","open"); count = 1; }); } if((company_id==887) && (company_id=='887') && (sub_widget_company_id==888)){ jQuery("#responseiq_buttonid").click(function(e){ /*trigger widget button*/ jQuery(".dilricn2nw").trigger("click","open"); count = 1; }); } /*trigger pop-up if custom variable is set in url*/ var responseiq = getParameterByName('responseiq'); /*checking if responseiq custom variable exists in document body*/ if ( typeof responseiq !== "undefined" && responseiq) { /*if responseiq custom variable exists with custom variable value*/ if(responseiq !=''){ /*if custom variable value is same as our custom value*/ if(responseiq.toUpperCase()=='CUSTOM'){ if(count==0){ /*set trigger widget button*/ count = 1; } } } } /*check if time check is enabled from company widget settings*/ if(time_check==1){ /*if time on website is more than 0 and attempt to exits is not updated*/ if(time_on_website > 0 && saveattempts_to_exit==0){ setTimeout(function(){ /*widget not clicked*/ if(count==0){ /*widget open*/ jQuery(".dilricn2nw").trigger("click","autopopup"); /*update count 1*/ count = 1; setTimeout(function(){ /*if widget open and not clicked anywhere in widget then close popup automatically*/ if(count==1 && phone_number_click==0){ /*if widget opened button class exists*/ if(jQuery( ".dilricn2nw" ).hasClass("crssic")){ /*trigger close button of widget*/ jQuery(".dilricn2nw").trigger("click","autoclose"); } } },delay_before_minimising_popup); } },time_on_website); } } },delay_icon_second); } }); /*widget css file based on company id*/ /*document.getElementsByTagName("head")[0].appendChild(scripflagphone); document.getElementsByTagName("head")[0].appendChild(scriptypeit);*/ var cssIdwidgets = "myCsswidgets"; var head = document.getElementsByTagName("head")[0]; var linkwidgets = document.createElement("link"); linkwidgets.id = cssIdwidgets; linkwidgets.rel = "stylesheet"; linkwidgets.type = "text/css"; if((company_id==278) || (company_id=='278')){ linkwidgets.href = siteurl+"assets_new/dist/css/marginstylewidgets.css"; }else if((company_id==277) || (company_id=='277')){ linkwidgets.href = siteurl+"assets_new/dist/css/marginmobilestylewidgets.css"; }else if((company_id==408) || (company_id=='408')){ linkwidgets.href = siteurl+"assets_new/dist/css/noflagamericanbullionstylewidgets.css"; }else if((company_id==531) && (company_id=='531') && (sub_widget_company_id==0)){ linkwidgets.href = siteurl+"assets_new/dist/css/cruisestylewidgets.css"; }else if((company_id==482) || (company_id=='482')){ linkwidgets.href = siteurl+"assets_new/dist/css/sovereignnoflagstylewidgets.css"; }else if((company_id==831) || (company_id=='831')){ linkwidgets.href = siteurl+"assets_new/dist/css/luxtrippernoflagstylewidgets.css"; }else if((company_id==810) || (company_id=='810')){ linkwidgets.href = siteurl+"assets_new/dist/css/wisperbikesnoflagstylewidgets.css"; }else if((company_id==875) || (company_id=='875')){ linkwidgets.href = siteurl+"assets_new/dist/css/outofofficenoflagstylewidgets.css"; }else if((company_id==931) || (company_id=='931')){ linkwidgets.href = siteurl+"assets_new/dist/css/pissupnoflagstylewidgets.css"; }else if((company_id==988) || (company_id=='988')){ linkwidgets.href = siteurl+"assets_new/dist/css/expatexplorenoflagstylewidgets.css"; }else if((company_id==919) || (company_id=='919')){ linkwidgets.href = siteurl+"assets_new/dist/css/cruiseclubuknoflagstylewidgets.css"; }else if((company_id==943) && (company_id=='943') && (sub_widget_company_id==0)){ linkwidgets.href = siteurl+"assets_new/dist/css/mulberrycottagesnoflagstylewidgets.css"; }else if((company_id==714) || (company_id=='714')){ linkwidgets.href = siteurl+"assets_new/dist/css/oxford-royalenoflagstylewidgets.css"; }else if((company_id==1027) && (company_id=='1027') && (sub_widget_company_id==0)){ linkwidgets.href = siteurl+"assets_new/dist/css/floridatixnoflagstylewidgets.css"; }else if((company_id==1027) && (company_id=='1027') && (sub_widget_company_id==1062)){ linkwidgets.href = siteurl+"assets_new/dist/css/attractiontixnoflagstylewidgets.css"; }else if((company_id==887) && (company_id=='887') && (sub_widget_company_id==888)){ linkwidgets.href = siteurl+"assets_new/dist/css/inspiringtravelcompanynoflagstylewidgets.css"; }else if((company_id==874) || (company_id=='874')){ linkwidgets.href = siteurl+"assets_new/dist/css/thamesvalleylettingsnoflagstylewidgets.css"; }else if((company_id==881) || (company_id=='881')){ linkwidgets.href = siteurl+"assets_new/dist/css/hetravelnoflagstylewidgets.css"; }else if((company_id==1001) || (company_id=='1001')){ linkwidgets.href = siteurl+"assets_new/dist/css/straybootsnoflagstylewidgets.css"; }else if((company_id==1237) || (company_id=='1237')){ linkwidgets.href = siteurl+"assets_new/dist/css/ukinsurancenoflagstylewidgets.css"; }else if((company_id==3) || (company_id=='3')){ linkwidgets.href = siteurl+"assets_new/dist/css/responseiqnoflagstylewidgets.css"; }else if((company_id==1218) && (company_id=='1218') && (sub_widget_company_id==0)){ linkwidgets.href = siteurl+"assets_new/dist/css/trektravelnoflagstylewidgets.css"; }else if((company_id==1271) || (company_id=='1271')){ linkwidgets.href = siteurl+"assets_new/dist/css/wildfrontierstravelnoflagstylewidgets.css"; }else if((company_id==1261) || (company_id=='1261')){ linkwidgets.href = siteurl+"assets_new/dist/css/borrowmydoggynoflagstylewidgets.css"; }else if((company_id==1086) || (company_id=='1086')){ linkwidgets.href = siteurl+"assets_new/dist/css/cooptravelnoflagstylewidgets.css"; }else if((company_id==1334) || (company_id=='1334')){ linkwidgets.href = siteurl+"assets_new/dist/css/turquoiseholidaynoflagstylewidgets.css"; }else if((company_id==1389) || (company_id=='1389')){ linkwidgets.href = siteurl+"assets_new/dist/css/outsidegonoflagstylewidgets.css"; }else if((company_id==1263) || (company_id=='1263')){ linkwidgets.href = siteurl+"assets_new/dist/css/trekamericanoflagstylewidgets.css"; }else if((company_id==531) && (company_id=='531') && (sub_widget_company_id==1342)){ linkwidgets.href = siteurl+"assets_new/dist/css/kreuzfahrtberaternoflagstylewidgets.css"; }else if((company_id==1429) && (company_id=='1429') && (sub_widget_company_id==0)){ linkwidgets.href = siteurl+"assets_new/dist/css/travelcenternoflagstylewidgets.css"; }else if((company_id==1429) && (company_id=='1429') && (sub_widget_company_id==1432)){ linkwidgets.href = siteurl+"assets_new/dist/css/travelcenternoflagstylewidgets.css"; }else if((company_id==1429) && (company_id=='1429') && (sub_widget_company_id==1433)){ linkwidgets.href = siteurl+"assets_new/dist/css/travelcenternoflagstylewidgets.css"; }else if((company_id==1462) && (company_id=='1462') && (sub_widget_company_id==0)){ linkwidgets.href = siteurl+"assets_new/dist/css/electricaldealsdirectnoflagstylewidgets.css"; }else if((company_id==1537) && (company_id=='1537') && (sub_widget_company_id==0)){ linkwidgets.href = siteurl+"assets_new/dist/css/direct365noflagstylewidgets.css"; }else if((company_id==1258) && (company_id=='1258')){ linkwidgets.href = siteurl+"assets_new/dist/css/tropicalskynoflagstylewidgets.css"; }else if((company_id==1603) && (company_id=='1603')){ linkwidgets.href = siteurl+"assets_new/dist/css/autographleasingnoflagstylewidgets.css"; }else if((company_id==1610) && (company_id=='1610')){ linkwidgets.href = siteurl+"assets_new/dist/css/classic-collectionnoflagstylewidgets.css"; }else if((company_id==1630) && (company_id=='1630')){ linkwidgets.href = siteurl+"assets_new/dist/css/nationalvehiclenoflagstylewidgets.css"; }else if((company_id==1541) && (company_id=='1541')){ linkwidgets.href = siteurl+"assets_new/dist/css/webuyanyhousenoflagstylewidgets.css"; }else{ linkwidgets.href = siteurl+"assets_new/dist/css/noflagstylewidgets.css"; } linkwidgets.media = "all"; head.appendChild(linkwidgets); if((company_id==681) || (company_id=='681')){ var linkletlords = document.createElement("link"); linkletlords.id = 'letlordcss'; linkletlords.rel = "stylesheet"; linkletlords.type = "text/css"; linkletlords.href = siteurl+"assets_new/dist/css/letlord.css"; linkletlords.media = "all"; head.appendChild(linkletlords); } /*add country flag dropdown in head tag*/ var cssIdflagphone = "myCssflagphone"; var linkflagphone = document.createElement("link"); linkflagphone.id = cssIdflagphone; linkflagphone.rel = "stylesheet"; linkflagphone.type = "text/css"; linkflagphone.href = siteurl+"widgetsjs/countrySelect.css"; linkflagphone.media = "all"; head.appendChild(linkflagphone); /*add fonts on page with css in head tag*/ var cssIdfonts = "myCssfonts"; var linkfonts = document.createElement("link"); linkfonts.id = cssIdfonts; linkfonts.rel = "stylesheet"; linkfonts.type = "text/css"; /*linkfonts.href = "https://fonts.googleapis.com/css?family=Titillium+Web:400,600,700";*/ linkfonts.href = siteurl+"assets_new/dist/css/Titillium-Regular.woff"; linkfonts.media = "all"; head.appendChild(linkfonts); } /*get parameter name and value*/ function getParameterByName(name){ var url = window.location.href; name = name.replace(/[\[\]]/g, "\\$&"); var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), results = regex.exec(url); if (!results) return null; if (!results[2]) return ''; return decodeURIComponent(results[2].replace(/\+/g, " ")); } /*delay page*/ function delaypage(){ jQuery.each([100,80,60,40,20,0], function(index,value){ setTimeout(function(){ var height = value+"%"; jQuery("#ovt").css('height',height); /*jQuery("#ovt").css('height',"100%");*/ },400); }); } /*assign agent id if customer select agent from dropdown*/ function riq_change_agent(agent_id){ jQuery("#agent_id").val(agent_id); } /*assign department if customer select agent from dropdown*/ function riq_change_departments(department_id){ jQuery("#department_id").val(department_id); } /*if successfully triggered call or scheduled call then showing thanks page message*/ function jsonCallback(json){ if( typeof json != 'undefined' ){ trigger_google_event(6);// call now conversion }else{ trigger_google_event(7); // schedule call now conversion } /*empty current div content with thanks page*/ jQuery("#riq_showthanks").empty(); /*append thanks page hrml*/ jQuery("#riq_showthanks").html(widget_thanks_html); //flightguru then remove poweredby responseiq if(company_id == 558){ jQuery(".bltby").hide(); } /*display block content div class*/ jQuery(".wgtppotshhd").css("display", "block"); jQuery("#riq_calltemplate_2").css("display", "block"); jQuery("#riq_calltemplate_2").removeClass("widpupnw "+btn_class); callnowclick = 0; schedulecallclick = 0; if(gdpr_enable==1){ gdpr_enable_check = 0; } } /* if number is invalid*/ function phoneinvalid(){ if(company_id==1378){ if(call_schedule_button_enable==1){ if(schedulecallclick==1){ /*change input field message*/ jQuery("#schedulepopupbuttontext2").text("ungültige Nummer."); /*change input field message font size*/ jQuery("#schedulecallmebutton").css("font-size", "12px"); setTimeout(function(){ jQuery("#schedulepopupbuttontext2").text(schedulecallbuttontext); jQuery("#schedulecallmebutton").css("font-size", "15px"); },2000); schedulecallclick = 0; }else if(callnowclick==1){ /*change input field message*/ jQuery("#callmebutton2").text("ungültige Nummer."); /*change input field message font size*/ jQuery("#callmebutton").css("font-size", "12px"); setTimeout(function(){ jQuery("#callmebutton2").text(callmebuttontext); jQuery("#callmebutton").css("font-size", "15px"); },2000); callnowclick = 0; } }else{ /*change input field message*/ jQuery(".btncll").text("ungültige Nummer."); /*change input field message font size*/ jQuery(".btncll").css("font-size", "12px"); setTimeout(function(){ jQuery(".btncll").text(buttontext); jQuery(".btncll").css("font-size", "18px"); },2000); callnowclick = 0; schedulecallclick = 0; } }else{ if(call_schedule_button_enable==1){ if(schedulecallclick==1){ /*change input field message*/ jQuery("#schedulepopupbuttontext2").text("Number invalid."); /*change input field message font size*/ jQuery("#schedulecallmebutton").css("font-size", "12px"); setTimeout(function(){ jQuery("#schedulepopupbuttontext2").text(schedulecallbuttontext); jQuery("#schedulecallmebutton").css("font-size", "15px"); },2000); schedulecallclick = 0; }else if(callnowclick==1){ /*change input field message*/ jQuery("#callmebutton2").text("Number invalid."); /*change input field message font size*/ jQuery("#callmebutton").css("font-size", "12px"); setTimeout(function(){ jQuery("#callmebutton2").text(callmebuttontext); jQuery("#callmebutton").css("font-size", "15px"); },2000); callnowclick = 0; } }else{ /*change input field message*/ jQuery(".btncll").text("The number is invalid."); /*change input field message font size*/ jQuery(".btncll").css("font-size", "12px"); setTimeout(function(){ jQuery(".btncll").text(buttontext); jQuery(".btncll").css("font-size", "18px"); },2000); callnowclick = 0; schedulecallclick = 0; } } return false; } /* if no agent avaliable*/ function noagentavaliable(){ if(call_schedule_button_enable==1){ if(callnowclick==1){ /*change input field message*/ jQuery("#callmebutton2").text("Closed, sorry."); /*change input field message font size*/ jQuery("#callmebutton").css("font-size", "12px"); setTimeout(function(){ jQuery("#callmebutton2").text(callmebuttontext); jQuery("#callmebutton").css("font-size", "15px"); },2000); callnowclick = 0; } }else{ /*change input field message*/ jQuery(".btncll").text("Sorry, we're now closed."); /*change input field message font size*/ jQuery(".btncll").css("font-size", "12px"); setTimeout(function(){ jQuery(".btncll").text(buttontext); jQuery(".btncll").css("font-size", "18px"); },2000); callnowclick = 0; schedulecallclick = 0; } return false; } /* if number is duplicate*/ function duplicatenumber(){ if(call_schedule_button_enable==1){ if(schedulecallclick==1){ /*change input field message*/ jQuery("#schedulepopupbuttontext2").text("Duplicate number"); /*change input field message font size*/ jQuery("#schedulecallmebutton").css("font-size", "12px"); setTimeout(function(){ jQuery("#schedulepopupbuttontext2").text(schedulecallbuttontext); jQuery("#schedulecallmebutton").css("font-size", "15px"); },1000); schedulecallclick = 0; }else if(callnowclick==1){ /*change input field message*/ jQuery("#callmebutton2").text("Duplicate number"); /*change input field message font size*/ jQuery("#callmebutton").css("font-size", "12px"); setTimeout(function(){ jQuery("#callmebutton2").text(callmebuttontext); jQuery("#callmebutton").css("font-size", "15px"); },1000); callnowclick = 0; } }else{ /*change input field message*/ jQuery(".btncll").text("Duplicate number, please wait for your call."); /*change input field message font size*/ jQuery(".btncll").css("font-size", "12px"); setTimeout(function(){ jQuery(".btncll").text(buttontext); jQuery(".btncll").css("font-size", "18px"); },1000); callnowclick = 0; schedulecallclick = 0; } return false; } /*check if customer number is in blacklist*/ function blacklistnumber(){ if(call_schedule_button_enable==1){ if(schedulecallclick==1){ /*change input field message*/ jQuery("#schedulepopupbuttontext2").text("Not able to make call"); /*change input field message font size*/ jQuery("#schedulecallmebutton").css("font-size", "12px"); setTimeout(function(){ jQuery("#schedulepopupbuttontext2").text(schedulecallbuttontext); jQuery("#schedulecallmebutton").css("font-size", "15px"); },1000); schedulecallclick = 0; }else if(callnowclick==1){ /*change input field message*/ jQuery("#callmebutton2").text("Not able to make call"); /*change input field message font size*/ jQuery("#callmebutton").css("font-size", "12px"); setTimeout(function(){ jQuery("#callmebutton2").text(callmebuttontext); jQuery("#callmebutton").css("font-size", "15px"); },1000); callnowclick = 0; } }else{ /*change input field message*/ jQuery(".btncll").text("We are not able to make call to this number.."); /*change input field message font size*/ jQuery(".btncll").css("font-size", "12px"); setTimeout(function(){ jQuery(".btncll").text(buttontext); jQuery(".btncll").css("font-size", "18px"); },1000); callnowclick = 0; schedulecallclick = 0; } return false; } /* if time is duplicate*/ function timeexists(){ /*change input field message*/ jQuery(".btncll").text("Please choose another time or date."); /*change input field message font size*/ jQuery(".btncll").css("font-size", "12px"); setTimeout(function(){ jQuery(".btncll").text(schdcallmebuttontext); jQuery(".btncll").css("font-size", "18px"); },1000); callnowclick = 0; schedulecallclick = 0; return false; } /*select schedule date time page*/ function schedule(phone){ /*check phone number*/ var phonenumber = document.getElementById("phonenumber_code").value; /*check country name*/ var country_name = document.getElementById("country_name").value; /*check country code*/ var country_code = document.getElementById("country_code").value.replace(/\s+/g, ""); /*check phone number country code*/ var phone_country_code = document.getElementById("phone_country_code").value.replace(/\s+/g, ""); /*check agent id if type selected from widget customization page*/ var agent_id = document.getElementById("agent_id").value; /*check department id*/ var department_id = document.getElementById("department_id").value; /*check visitors record id*/ var visitor_id = document.getElementById("visitor_id").value; /*update schedule date time template in current div*/ jQuery("#riq_showthanks").empty(); jQuery("#riq_showthanks").html(widget_schedule_html); //flightguru then remove poweredby responseiq if(company_id == 558){ jQuery(".bltby").hide(); } if(schedule_call_timezone_enable == 1){ try { if (timezoneobj[Intl.DateTimeFormat().resolvedOptions().timeZone] !== undefined) { if((company_id==1378) && (sub_widget_company_id==0)){ var date = new Date(); var hours = date.getHours() < 10 ? "0" + date.getHours() : date.getHours(); var minutes = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes(); var seconds = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds(); currenttimezone = "Aktuelle Zeit "+timezoneobj[Intl.DateTimeFormat().resolvedOptions().timeZone]+" Zeitzone: "+hours + ":" + minutes + ":" + seconds+" Uhr"; }else if(sub_widget_company_id==1342){ currenttimezone = "Aktuelle Zeitzone "+timezoneobj[Intl.DateTimeFormat().resolvedOptions().timeZone]+": "+new Date().toLocaleTimeString()+""; }else{ currenttimezone = "Current Local "+timezoneobj[Intl.DateTimeFormat().resolvedOptions().timeZone]+" Time: "+new Date().toLocaleTimeString()+""; } } }catch(error) { } } /*if current time zone is not empty than replace title*/ if(currenttimezone !=''){ jQuery("#schd_currenttimezone").html(""); jQuery("#schd_currenttimezone").html(currenttimezone); } /*empty date drop-down*/ jQuery("#select_day_agent").empty(); /*apply date drop-down*/ jQuery("#select_day_agent").html(day_agent); /*empty time drop-down*/ jQuery("#select_time_agent").empty(); /*apply time drop-down*/ jQuery("#select_time_agent").html(time_agent); /*append all variables in new schedule call page*/ jQuery("#riq_showthanks").append(""); jQuery("#riq_showthanks").append(""); jQuery("#riq_showthanks").append(""); jQuery("#riq_showthanks").append(""); jQuery("#riq_showthanks").append(""); jQuery("#riq_showthanks").append(""); jQuery("#riq_showthanks").append(""); /*remove display none of widget*/ jQuery(".wgtppotshhd").css("display", "block"); /*remove display none of template*/ jQuery("#riq_calltemplate_3").css("display", "block"); /*call select time function*/ selecttimes(); if(template_id ==15 || template_id ==22 || template_id ==23){ getcontents(); } /*change button shadow on mouse hover*/ jQuery(".btncll").hover(function(){ jQuery(this).css("background-color", btn_border_color); },function(){ jQuery(this).css("background-color", btn_color); }); schdcallmebuttontext = jQuery(".btncll").text(); if(gdpr_enable==1){ gdpr_enable_check = 0; } } function getcontents(){ var pathname = window.location.href; if(company_id==1237){ var quoteref = ''; try { quoteref = jQuery('.header .hidden-xs.hidden-sm.col-sm-12 span:last-child a').text(); }catch(error) { } if(quoteref !=''){ pathname = pathname+"?quoteref="+quoteref; } } jQuery.ajax({ dataType: "jsonp", jsonp: "callback", jsonpCallback: "jsonpCallback", contentType: "application/json", url: siteurl+"keywordwidgets/getcontents?calltype=1&visiturl="+encodeURIComponent(pathname), }); } /*when customer clicked on request callback button*/ function requestcallback(call){ if(call === undefined) { call = 0; } if(gdpr_enable==1){ if(gdpr_enable_check==0){ if(europa_country.indexOf(location_ip) > -1) { gdpr_enable_check = 0; }else{ gdpr_enable_check = 1; } } } if(gdpr_enable_check==1){ //destinology if(template_id ==1){ var capture_number = jQuery(".dwsSiteNumber").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==2){ //cruise site var capture_number = jQuery("#affiliate_phone").first().text(); //alert(capture_number); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); //alert(template_capture_number); } }else if(template_id ==3){ //cruisenation site var capture_number = jQuery(".telephone.nav-link").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==4){ //totstoo site var capture_number = jQuery(".rTapNumber213178").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==5){ //cruise club uk var capture_number = jQuery(".rTapNumber145852").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==6){ //expatexplore var capture_number = jQuery("#cont_number").text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==7){ //anglopacific var capture_number = jQuery(".call-tracking").text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==8){ //travel nation var capture_number = jQuery(".InfinityNumber").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } if(template_capture_number==''){ var capture_number = jQuery(".rTapNumber303274").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } } }else if(template_id ==9){ //mauritiusholidaysdirect mobile var capture_number = jQuery(".rulertel").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==10){ //Premier Global var capture_number = jQuery(".rTapNumber204017").text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==11){ //eecsolarenergy var capture_number = jQuery(".rulertel.phone-header").text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==12){ //titantravel var capture_number = jQuery(".InfinityNumber").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==13){ //cooptravel var capture_number = jQuery(".rTapNumber204169").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==14){ //best at travel var capture_number = jQuery(".InfinityNumber").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==15){ //tropicalsky if(template_capture_number==''){ var capture_number = jQuery(".number strong").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } } }else if(template_id ==16){ //barrheadtravel var capture_number = jQuery(".rTapNumber271758").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==17){ //cruisedirect.co.uk var capture_number = jQuery(".rTapNumber271765").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==18){ //cruisedirect.uk var capture_number = jQuery(".rTapNumber271766").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==19){ //the-cruise-specialists.co.uk var capture_number = jQuery(".rTapNumber271777").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==20){ //canadatravelspecialists.com var capture_number = jQuery(".rTapNumber271770").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==21){ //GoSkydive var capture_number = jQuery(".rTapNumber5459").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==22){ //www.americansky.co.uk if(template_capture_number==''){ var capture_number = jQuery(".rTapNumber164894").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } } }else if(template_id ==23){ //www.canadiansky.co.uk if(template_capture_number==''){ var capture_number = jQuery(".rTapNumber144878").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } } }else if(template_id ==24){ //www.newzealandsky.co.uk var capture_number = jQuery(".rTapNumber144880").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==25){ //www.australiansky.co.uk var capture_number = jQuery(".rTapNumber144879").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==26){ //www.africaskysafari.com var capture_number = jQuery(".rTapNumber238442").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==27){ //www.tropicalsky.com var capture_number = jQuery(".number strong").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==28){ //www.tropicalsky.ie var capture_number = jQuery(".city + strong").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==29){ //www.americansky.ie var capture_number = jQuery(".city + strong").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==30){ //www.canadiansky.ie var capture_number = jQuery(".city + strong").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==31){ //www.australiansky.ie var capture_number = jQuery(".city + strong").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==32){ //www.newzealandsky.ie var capture_number = jQuery(".city + strong").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==33){ //www.trailfinders.com var capture_number = jQuery(".telTxt a").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==34){ //www.southernresorts.com var capture_number = jQuery(".phone a").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } if(template_capture_number==''){ var capture_number = jQuery(".phone").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } } }else if(template_id ==35){ //www.kreuzfahrtberater.de var capture_number = jQuery(".phone").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==36){ //www.steppestravel.com var capture_number = jQuery(".InfinityNumber9471").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==37){ //www.broadwaytravel.com var capture_number = jQuery(".c-header__phone-link-number").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==38){ //www.condo-world.com var capture_number = jQuery(".connectNum").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==39){ //www.honeymoondreams.co.uk var capture_number = jQuery(".mediahawkNumber2649").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==40){ //www.travelcenter.uk var capture_number = jQuery("#firstnumber").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==41){ //www.tourcenter.uk var capture_number = jQuery(".Tourcenter-Phone-Number").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==42){ //www.worldairfares.uk var capture_number = jQuery('.navbar-contact .transition-effect.hidden-sm.hidden-xs').last().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==43){ //www.mabuhaytravel.uk var capture_number = jQuery("#firstnumber a").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==44){ //https://www.discover-the-world.co.uk var capture_number = jQuery(".rTapNumber275509").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==45){ //www.trekamerica.co.uk var capture_number = jQuery('.trek-phone-container .contact-phone.phone-gb.visible .phone-number').first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); }else{ var capture_number = jQuery('.InfinityNumber').first().text(); template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==46){ //www.grandamericanadventures.com var capture_number = jQuery('.trek-phone-container .contact-phone.phone-gb.visible .phone-number').first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); }else{ var capture_number = jQuery('.landing-page-text-field-content .InfinityNumber').first().text(); template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==47){ //www.elegantresorts.co.uk var capture_number = jQuery('#pageHeader_divSingleNumberDropDown .call_right_telNumber h3').first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==48){ //kenwoodtravel.co.uk var capture_number = jQuery("#contact_phone a").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==49){ //travel.saga.co.uk var capture_number = jQuery(".InfinityNumber").first().text() if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==50){ //direct365.co.uk var capture_number = jQuery('.box p span').last().text(); if(capture_number != ''){ template_capture_number = capture_number.replace(/\s/g, ''); }else{ var template_capture_number = ''; var capture_number = jQuery('.usps + p > span').first().text(); if (capture_number != ''){ template_capture_number = capture_number.replace('on', '').replace(/\s/g, ''); } if (template_capture_number == ''){ var capture_number = jQuery('.separated ~ p span').first().text(); if (capture_number != ''){ template_capture_number = capture_number.replace('on', '').replace(/\s/g, ''); } } if (template_capture_number == ''){ var capture_number = jQuery('#docs-internal-guid-38ff0fa5-be86-c368-b1b3-ecff10b539c5').first().text(); if (capture_number != '') { template_capture_number = capture_number.replace('on', '').replace(/\s/g, ''); } } if (template_capture_number == ''){ var capture_number = jQuery('#docs-internal-guid-849a4106-be6e-587c-348a-917876a73ff5 strong').first().text(); if (capture_number != '') { template_capture_number = capture_number.replace('on', '').replace(/\s/g, ''); }else{ var capture_number = jQuery('.InfinityNumber').first().text(); template_capture_number = capture_number.replace(/\s/g, ''); } } } } /*check phone number*/ var phonenumber = document.getElementById("phonenumber_code").value; /*check country code*/ var country_code = document.getElementById("country_code").value.replace(/\s+/g, ""); /*check phone number country code*/ var phone_country_code = document.getElementById("phone_country_code").value.replace(/\s+/g, ""); /*check country name*/ var country_name = document.getElementById("country_name").value; /*check agent id if type selected from widget customization page*/ var agent_id = document.getElementById("agent_id").value; /*check department id*/ var department_id = document.getElementById("department_id").value; /*select scheduled date*/ var select_day_agent = document.getElementById("select_day_agent").value; /*select scheduled time*/ var select_time_agent = document.getElementById("select_time_agent").value; /*if country code is empty*/ if(country_code==''){ country_code = phone_country_code; } // fix UK 0 problem if(country_code == '+440' || country_code == '+440 '){ country_code = '+44'; } /*apply phone number country code with phone number*/ var phonenumber = country_code+""+phonenumber; /*remove space from phone number*/ phonenumber = phonenumber.replace(/\s+/g, ""); /*current page url*/ var pathname = window.location.href; if(company_id==1237){ var quoteref = ''; try { quoteref = jQuery('.header .hidden-xs.hidden-sm.col-sm-12 span:last-child a').text(); }catch(error) { } if(quoteref !=''){ pathname = pathname+"?quoteref="+quoteref; } } /*referrer page url*/ var referrer = document.referrer; /*set host page*/ var host = ''; /*if referrer url is not empty*/ if(referrer !=''){ host = referrer.match(/:\/\/(.[^/]+)/)[1]; } if(callnowclick == 0){ /*call button is successfully clicked once */ callnowclick = 1; /*if phone number is not empty*/ if(phonenumber !=""){ if(gdpr_enable==1){ if(call==1){ save_do_not_call_click(5); } } /*send request on server*/ if(api_type ==1){ jQuery.ajax({ dataType: "jsonp", jsonp: "callback", jsonpCallback: "jsonpCallback", contentType: "application/json", url: siteurl+"pcallwidgets/requestcallback?phonenumber="+encodeURIComponent(phonenumber)+"&select_day_agent="+encodeURIComponent(select_day_agent)+"&select_time_agent="+encodeURIComponent(select_time_agent)+"&widget="+encodeURIComponent(widget)+"&country_code="+encodeURIComponent(country_code)+"&country_name="+encodeURIComponent(country_name)+"&url="+encodeURIComponent(pathname)+"&referrerurl="+encodeURIComponent(referrer)+"&host="+encodeURIComponent(host)+"&agent_id="+encodeURIComponent(agent_id)+"&template_capture_number="+encodeURIComponent(template_capture_number)+"&visitor_id="+encodeURIComponent(visitor_id)+"&department_id="+encodeURIComponent(department_id), }); }else{ jQuery.ajax({ dataType: "jsonp", jsonp: "callback", jsonpCallback: "jsonpCallback", contentType: "application/json", url: siteurl+"callwidgets/requestcallback?phonenumber="+encodeURIComponent(phonenumber)+"&select_day_agent="+encodeURIComponent(select_day_agent)+"&select_time_agent="+encodeURIComponent(select_time_agent)+"&widget="+encodeURIComponent(widget)+"&country_code="+encodeURIComponent(country_code)+"&country_name="+encodeURIComponent(country_name)+"&url="+encodeURIComponent(pathname)+"&referrerurl="+encodeURIComponent(referrer)+"&host="+encodeURIComponent(host)+"&agent_id="+encodeURIComponent(agent_id)+"&template_capture_number="+encodeURIComponent(template_capture_number)+"&visitor_id="+encodeURIComponent(visitor_id)+"&department_id="+encodeURIComponent(department_id), }); } } } }else{ /*check phone number*/ var phonenumber = document.getElementById("phonenumber_code").value; /*check country name*/ var country_name = document.getElementById("country_name").value; /*check country code*/ var country_code = document.getElementById("country_code").value.replace(/\s+/g, ""); /*check phone number country code*/ var phone_country_code = document.getElementById("phone_country_code").value.replace(/\s+/g, ""); /*check agent id if type selected from widget customization page*/ var agent_id = document.getElementById("agent_id").value; /*check department record id*/ var department_id = document.getElementById("department_id").value; /*check visitors record id*/ var visitor_id = document.getElementById("visitor_id").value; /*select scheduled date*/ var select_day_agent = document.getElementById("select_day_agent").value; /*select scheduled time*/ var select_time_agent = document.getElementById("select_time_agent").value; /*update schedule date time template in current div*/ jQuery("#riq_showthanks").empty(); jQuery("#riq_showthanks").html(widget_gdpr_consent_html); /*append all variables in new schedule call page*/ jQuery("#riq_showthanks").append(""); jQuery("#riq_showthanks").append(""); jQuery("#riq_showthanks").append(""); jQuery("#riq_showthanks").append(""); jQuery("#riq_showthanks").append(""); jQuery("#riq_showthanks").append(""); jQuery("#riq_showthanks").append(""); jQuery("#riq_showthanks").append(""); jQuery("#riq_showthanks").append(""); /*remove display none of widget*/ jQuery(".wgtppotshhd").css("display", "block"); /*remove display none of template*/ jQuery("#riq_calltemplate_6").css("display", "block"); gdpr_enable_check = 1; callnowclick = 0; jQuery("#gdpr_welcometext_agree_text_pop").attr("onclick","schedule_requestcallback()"); save_do_not_call_click(1); } } function schedule_requestcallback(){ if((company_id==1378) && (sub_widget_company_id==0)){ if(jQuery("#gdpr_welcometext_agree_second_text_pop").length > 0){ jQuery("#gdpr_welcometext_agree_second_text_pop").text("Einen Moment bitte"); }else{ jQuery("#gdpr_welcometext_agree_text_pop").text("Einen Moment bitte"); } }else if(sub_widget_company_id==1342){ if(jQuery("#gdpr_welcometext_agree_second_text_pop").length > 0){ jQuery("#gdpr_welcometext_agree_second_text_pop").text("Einen Moment..."); }else{ jQuery("#gdpr_welcometext_agree_text_pop").text("Einen Moment..."); } }else{ if(jQuery("#gdpr_welcometext_agree_second_text_pop").length > 0){ jQuery("#gdpr_welcometext_agree_second_text_pop").text("One Moment..."); }else{ jQuery("#gdpr_welcometext_agree_text_pop").text("One Moment..."); } } if(jQuery("#gdpr_welcometext_agree_second_text_pop").length > 0){ jQuery("#gdpr_welcometext_agree_second_text_pop").css("font-size", "12px"); }else{ jQuery("#gdpr_welcometext_agree_text_pop").css("font-size", "12px"); } gdpr_enable_check = 1; requestcallback(1); } function calldynamicnumber(json){ template_capture_number = json.template_capture_number; callnowclick = 0; callnow(1); } function scheduledynamicnumber(json){ template_capture_number = json.template_capture_number; } /*if widget is live and call me now but showing then this function ill work*/ function callnow(call){ if(call === undefined) { call = 0; trigger_google_event(5); } if(template_id ==1){ var capture_number = jQuery(".dwsSiteNumber").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==2){ //cruise site var capture_number = jQuery("#affiliate_phone").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==3){ //cruisenation site var capture_number = jQuery(".telephone.nav-link").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==4){ //totstoo site var capture_number = jQuery(".rTapNumber213178").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==5){ //cruise club uk var capture_number = jQuery(".rTapNumber145852").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==6){ //expatexplore var capture_number = jQuery("#cont_number").text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==7){ //anglopacific var capture_number = jQuery(".call-tracking").text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==8){ //travelnation var capture_number = jQuery(".InfinityNumber").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } if(template_capture_number==''){ var capture_number = jQuery(".rTapNumber303274").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } } }else if(template_id ==9){ //mauritiusholidaysdirect mobile var capture_number = jQuery(".rulertel").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==10){ //Premier Global var capture_number = jQuery(".rTapNumber204017").text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==11){ //eecsolarenergy var capture_number = jQuery(".rulertel.phone-header").text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==12){ //titantravel var capture_number = jQuery(".InfinityNumber").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==13){ //cooptravel var capture_number = jQuery(".rTapNumber204169").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==14){ //best at travel var capture_number = jQuery(".InfinityNumber").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==15){ //tropicalsky if(template_capture_number==''){ var capture_number = jQuery(".number strong").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } } }else if(template_id ==16){ //barrheadtravel var capture_number = jQuery(".rTapNumber271758").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==17){ //cruisedirect.co.uk var capture_number = jQuery(".rTapNumber271765").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==18){ //cruisedirect.uk var capture_number = jQuery(".rTapNumber271766").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==19){ //the-cruise-specialists.co.uk var capture_number = jQuery(".rTapNumber271777").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==20){ //canadatravelspecialists.com var capture_number = jQuery(".rTapNumber271770").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==21){ //GoSkydive var capture_number = jQuery(".rTapNumber5459").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==22){ //www.americansky.co.uk if(template_capture_number==''){ var capture_number = jQuery(".rTapNumber164894").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } } }else if(template_id ==23){ //www.canadiansky.co.uk if(template_capture_number==''){ var capture_number = jQuery(".rTapNumber144878").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } } }else if(template_id ==24){ //www.newzealandsky.co.uk var capture_number = jQuery(".rTapNumber144880").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==25){ //www.australiansky.co.uk var capture_number = jQuery(".rTapNumber144879").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==26){ //www.africaskysafari.com var capture_number = jQuery(".rTapNumber238442").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==27){ //www.tropicalsky.com var capture_number = jQuery(".number strong").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==28){ //www.tropicalsky.ie var capture_number = jQuery(".city + strong").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==29){ //www.americansky.ie var capture_number = jQuery(".city + strong").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==30){ //www.canadiansky.ie var capture_number = jQuery(".city + strong").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==31){ //www.australiansky.ie var capture_number = jQuery(".city + strong").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==32){ //www.newzealandsky.ie var capture_number = jQuery(".city + strong").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==33){ //www.trailfinders.com var capture_number = jQuery(".telTxt a").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==34){ //www.southernresorts.com var capture_number = jQuery(".phone a").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } if(template_capture_number==''){ var capture_number = jQuery(".phone").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } } }else if(template_id ==35){ //www.kreuzfahrtberater.de var capture_number = jQuery(".phone").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==36){ //www.steppestravel.com var capture_number = jQuery(".InfinityNumber9471").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==37){ //www.broadwaytravel.com var capture_number = jQuery(".c-header__phone-link-number").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==38){ //www.condo-world.com var capture_number = jQuery(".connectNum").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==39){ //www.honeymoondreams.co.uk var capture_number = jQuery(".mediahawkNumber2649").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==40){ //www.travelcenter.uk var capture_number = jQuery("#firstnumber").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==41){ //www.tourcenter.uk var capture_number = jQuery(".Tourcenter-Phone-Number").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==42){ //www.worldairfares.uk var capture_number = jQuery('.navbar-contact .transition-effect.hidden-sm.hidden-xs').last().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==43){ //www.mabuhaytravel.uk var capture_number = jQuery("#firstnumber a").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==44){ //https://www.discover-the-world.co.uk var capture_number = jQuery(".rTapNumber275509").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==45){ //www.trekamerica.co.uk var capture_number = jQuery('.trek-phone-container .contact-phone.phone-gb.visible .phone-number').first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); }else{ var capture_number = jQuery('.InfinityNumber').first().text(); template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==46){ //www.grandamericanadventures.com var capture_number = jQuery('.trek-phone-container .contact-phone.phone-gb.visible .phone-number').first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); }else{ var capture_number = jQuery('.landing-page-text-field-content .InfinityNumber').first().text(); template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==47){ //www.elegantresorts.co.uk var capture_number = jQuery('#pageHeader_divSingleNumberDropDown .call_right_telNumber h3').first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==48){ //kenwoodtravel.co.uk var capture_number = jQuery("#contact_phone a").first().text(); if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==49){ //travel.saga.co.uk var capture_number = jQuery(".InfinityNumber").first().text() if(capture_number !=''){ template_capture_number = capture_number.replace(/\s/g,''); } }else if(template_id ==50){ //direct365.co.uk var capture_number = jQuery('.box p span').last().text(); if(capture_number != ''){ template_capture_number = capture_number.replace(/\s/g, ''); }else{ var template_capture_number = ''; var capture_number = jQuery('.usps + p > span').first().text(); if (capture_number != ''){ template_capture_number = capture_number.replace('on', '').replace(/\s/g, ''); } if (template_capture_number == ''){ var capture_number = jQuery('.separated ~ p span').first().text(); if (capture_number != ''){ template_capture_number = capture_number.replace('on', '').replace(/\s/g, ''); } } if (template_capture_number == ''){ var capture_number = jQuery('#docs-internal-guid-38ff0fa5-be86-c368-b1b3-ecff10b539c5').first().text(); if (capture_number != '') { template_capture_number = capture_number.replace('on', '').replace(/\s/g, ''); } } if (template_capture_number == ''){ var capture_number = jQuery('#docs-internal-guid-849a4106-be6e-587c-348a-917876a73ff5 strong').first().text(); if (capture_number != '') { template_capture_number = capture_number.replace('on', '').replace(/\s/g, ''); }else{ var capture_number = jQuery('.InfinityNumber').first().text(); template_capture_number = capture_number.replace(/\s/g, ''); } } } } /*check phone number*/ var phonenumber = document.getElementById("phonenumber_code").value; /*check country name*/ var country_name = document.getElementById("country_name").value; /*check agent id if type selected from widget customization page*/ var agent_id = document.getElementById("agent_id").value; /*check department*/ var department_id = document.getElementById("department_id").value; /*check country code*/ var country_code = document.getElementById("country_code").value.replace(/\s+/g, ""); /*check phone number country code*/ var phone_country_code = document.getElementById("phone_country_code").value.replace(/\s+/g, ""); /*remove space from phone number*/ phonenumber = phonenumber.replace(/\s+/g, ""); /*current page url*/ var pathname = window.location.href; if(company_id==1237){ var quoteref = ''; try { quoteref = jQuery('.header .hidden-xs.hidden-sm.col-sm-12 span:last-child a').text(); }catch(error) { } if(quoteref !=''){ pathname = pathname+"?quoteref="+quoteref; } } /*referrer page url*/ var referrer = document.referrer; /*set host page*/ var host = ''; /*if referrer url is not empty*/ if(referrer !=''){ host = referrer.match(/:\/\/(.[^/]+)/)[1]; } /*if phone number is blank*/ if(phonenumber ==""){ if(company_id==1378){ if(call_schedule_button_enable==1){ jQuery("#callmebutton2").text("Nummer eingeben."); jQuery("#callmebutton").css("font-size", "12px"); setTimeout(function(){ jQuery("#callmebutton2").text(callmebuttontext); jQuery("#callmebutton").css("font-size", "15px"); },1000); }else{ jQuery(".btncll").text("Nummer eingeben."); jQuery(".btncll").css("font-size", "12px"); setTimeout(function(){ jQuery(".btncll").text(buttontext); jQuery(".btncll").css("font-size", "18px"); },1000); } }else{ if(call_schedule_button_enable==1){ jQuery("#callmebutton2").text("Enter number."); jQuery("#callmebutton").css("font-size", "12px"); setTimeout(function(){ jQuery("#callmebutton2").text(callmebuttontext); jQuery("#callmebutton").css("font-size", "15px"); },1000); }else{ jQuery(".btncll").text("Enter number."); jQuery(".btncll").css("font-size", "12px"); setTimeout(function(){ jQuery(".btncll").text(buttontext); jQuery(".btncll").css("font-size", "18px"); },1000); } } return false; /*if type is selected and agent id is 0*/ }else if((departmentslist != '') && (department_id==0)){ if(call_schedule_button_enable==1){ jQuery("#callmebutton2").text("Select Department."); jQuery("#callmebutton").css("font-size", "12px"); setTimeout(function(){ jQuery("#callmebutton2").text(callmebuttontext); jQuery("#callmebutton").css("font-size", "15px"); },1000); }else{ jQuery(".btncll").text("Select Department."); jQuery(".btncll").css("font-size", "12px"); setTimeout(function(){ jQuery(".btncll").text(buttontext); jQuery(".btncll").css("font-size", "18px"); },1000); } return false; }else if((is_type == 1) && (agent_id==0)){ if(call_schedule_button_enable==1){ jQuery("#callmebutton2").text("Select "+selector+"."); jQuery("#callmebutton").css("font-size", "12px"); setTimeout(function(){ jQuery("#callmebutton2").text(callmebuttontext); jQuery("#callmebutton").css("font-size", "15px"); },1000); }else{ jQuery(".btncll").text("Select "+selector+"."); jQuery(".btncll").css("font-size", "12px"); setTimeout(function(){ jQuery(".btncll").text(buttontext); jQuery(".btncll").css("font-size", "18px"); },1000); } return false; }else{ if(call_schedule_button_enable==1){ if((company_id==1378) && (sub_widget_company_id==0)){ jQuery("#callmebutton2").text("Einen Moment bitte"); }else if(sub_widget_company_id==1342){ jQuery("#callmebutton2").text("Einen Moment..."); }else{ jQuery("#callmebutton2").text("One Moment..."); } jQuery("#callmebutton").css("font-size", "12px"); }else{ /*changing button text*/ if((company_id==1378) && (sub_widget_company_id==0)){ jQuery(".btncll").text("Einen Moment bitte"); }else if(sub_widget_company_id==1342){ jQuery(".btncll").text("Einen Moment..."); }else{ jQuery(".btncll").text("One Moment..."); } /*add font-size of button text*/ jQuery(".btncll").css("font-size", "12px"); } /*if country code is empty*/ if(country_code==''){ country_code = phone_country_code; } // fix UK 0 problem if(country_code == '+440' || country_code == '+440 '){ country_code = '+44'; } /*apply phone number country code with phone number*/ var phonenumber = country_code+""+phonenumber; if(callnowclick == 0){ /*call button is successfully clicked once */ callnowclick = 1; if((template_id ==15 || template_id ==22 || template_id ==23) && (call == 0)){ jQuery.ajax({ dataType: "jsonp", jsonp: "callback", jsonpCallback: "jsonpCallback", contentType: "application/json", url: siteurl+"keywordwidgets/getcontents?calltype=0&visiturl="+encodeURIComponent(pathname), }); }else{ if(gdpr_enable==1){ if(gdpr_enable_check==0){ if(europa_country.indexOf(location_ip) > -1) { gdpr_enable_check = 0; }else{ gdpr_enable_check = 1; } } } if(gdpr_enable_check==1){ if(gdpr_enable==1){ if(call==2){ save_do_not_call_click(4); } } /*send request on server*/ if(api_type ==1){ jQuery.ajax({ dataType: "jsonp", jsonp: "callback", jsonpCallback: "jsonpCallback", contentType: "application/json", url: siteurl+"pcallwidgets/callnow?phonenumber="+encodeURIComponent(phonenumber)+"&country_code="+encodeURIComponent(country_code)+"&country_name="+encodeURIComponent(country_name)+"&widget="+encodeURIComponent(widget)+"&url="+encodeURIComponent(pathname)+"&referrerurl="+encodeURIComponent(referrer)+"&host="+encodeURIComponent(host)+"&agent_id="+encodeURIComponent(agent_id)+"&template_capture_number="+encodeURIComponent(template_capture_number)+"&visitor_id="+encodeURIComponent(visitor_id)+"&department_id="+encodeURIComponent(department_id), }); }else{ jQuery.ajax({ dataType: "jsonp", jsonp: "callback", jsonpCallback: "jsonpCallback", contentType: "application/json", url: siteurl+"callwidgets/callnow?phonenumber="+encodeURIComponent(phonenumber)+"&country_code="+encodeURIComponent(country_code)+"&country_name="+encodeURIComponent(country_name)+"&widget="+encodeURIComponent(widget)+"&url="+encodeURIComponent(pathname)+"&referrerurl="+encodeURIComponent(referrer)+"&host="+encodeURIComponent(host)+"&agent_id="+encodeURIComponent(agent_id)+"&template_capture_number="+encodeURIComponent(template_capture_number)+"&visitor_id="+encodeURIComponent(visitor_id)+"&department_id="+encodeURIComponent(department_id), }); } }else{ if(api_type ==1){ jQuery.ajax({ dataType: "jsonp", jsonp: "callback", jsonpCallback: "jsonpCallback", contentType: "application/json", url: siteurl+"pcallwidgets/gdpr_phone_check?phonenumber="+encodeURIComponent(phonenumber)+"&country_code="+encodeURIComponent(country_code)+"&country_name="+encodeURIComponent(country_name)+"&widget="+encodeURIComponent(widget)+"&visitor_id="+encodeURIComponent(visitor_id), }); }else{ jQuery.ajax({ dataType: "jsonp", jsonp: "callback", jsonpCallback: "jsonpCallback", contentType: "application/json", url: siteurl+"callwidgets/gdpr_phone_check?phonenumber="+encodeURIComponent(phonenumber)+"&country_code="+encodeURIComponent(country_code)+"&country_name="+encodeURIComponent(country_name)+"&widget="+encodeURIComponent(widget)+"&visitor_id="+encodeURIComponent(visitor_id), }); } } } } } } /*if no agent is available than schedule call widget is open */ function schedulecall(){ trigger_google_event(4); /*check phone number*/ var phonenumber = document.getElementById("phonenumber_code").value; /*check country name*/ var country_name = document.getElementById("country_name").value; /*check agent id if type selected from widget customization page*/ var agent_id = document.getElementById("agent_id").value; /*check department id*/ var department_id = document.getElementById("department_id").value; /*check country code*/ var country_code = document.getElementById("country_code").value.replace(/\s+/g, ""); /*check phone number country code*/ var phone_country_code = document.getElementById("phone_country_code").value.replace(/\s+/g, ""); /*remove space from phone number*/ var phonenumber = phonenumber.replace(/\s+/g, ""); /*if phone number is blank*/ if(phonenumber ==""){ if(company_id==1378){ if(call_schedule_button_enable==1){ jQuery("#schedulepopupbuttontext2").text("Nummer eingeben."); jQuery("#schedulecallmebutton").css("font-size", "12px"); setTimeout(function(){ jQuery("#schedulepopupbuttontext2").text(schedulecallbuttontext); jQuery("#schedulecallmebutton").css("font-size", "15px"); },1000); }else{ jQuery(".btncll").text("Nummer eingeben."); jQuery(".btncll").css("font-size", "12px"); setTimeout(function(){ jQuery(".btncll").text(buttontext); jQuery(".btncll").css("font-size", "18px"); },1000); } }else{ if(call_schedule_button_enable==1){ jQuery("#schedulepopupbuttontext2").text("Enter number."); jQuery("#schedulecallmebutton").css("font-size", "12px"); setTimeout(function(){ jQuery("#schedulepopupbuttontext2").text(schedulecallbuttontext); jQuery("#schedulecallmebutton").css("font-size", "15px"); },1000); }else{ jQuery(".btncll").text("Please enter phone."); jQuery(".btncll").css("font-size", "12px"); setTimeout(function(){ jQuery(".btncll").text(buttontext); jQuery(".btncll").css("font-size", "18px"); },1000); } } return false; /*if type is selected and agent id is 0*/ }else if((departmentslist !='') && (department_id==0)){ if(call_schedule_button_enable==1){ jQuery("#schedulepopupbuttontext2").text("Select Department."); jQuery("#schedulecallmebutton").css("font-size", "12px"); setTimeout(function(){ jQuery("#schedulepopupbuttontext2").text(schedulecallbuttontext); jQuery("#schedulecallmebutton").css("font-size", "15px"); },1000); }else{ jQuery(".btncll").text("Please select department."); jQuery(".btncll").css("font-size", "12px"); setTimeout(function(){ jQuery(".btncll").text(buttontext); jQuery(".btncll").css("font-size", "18px"); },1000); } return false; }else if((is_type == 1) && (agent_id==0)){ if(call_schedule_button_enable==1){ jQuery("#schedulepopupbuttontext2").text("Select "+selector+"."); jQuery("#schedulecallmebutton").css("font-size", "12px"); setTimeout(function(){ jQuery("#schedulepopupbuttontext2").text(schedulecallbuttontext); jQuery("#schedulecallmebutton").css("font-size", "15px"); },1000); }else{ jQuery(".btncll").text("Please select "+selector+"."); jQuery(".btncll").css("font-size", "12px"); setTimeout(function(){ jQuery(".btncll").text(buttontext); jQuery(".btncll").css("font-size", "18px"); },1000); } return false; }else{ if(call_schedule_button_enable==1){ if((company_id==1378) && (sub_widget_company_id==0)){ jQuery("#schedulepopupbuttontext2").text("Einen Moment bitte"); }else if(sub_widget_company_id==1342){ jQuery("#schedulepopupbuttontext2").text("Einen Moment..."); }else{ jQuery("#schedulepopupbuttontext2").text("One Moment..."); } jQuery("#schedulecallmebutton").css("font-size", "12px"); setTimeout(function(){ jQuery("#schedulepopupbuttontext2").text(schedulecallbuttontext); jQuery("#schedulecallmebutton").css("font-size", "18px"); },1000); }else{ /*changing button text*/ if((company_id==1378) && (sub_widget_company_id==0)){ jQuery(".btncll").text("Einen Moment bitte"); }else if(sub_widget_company_id==1342){ jQuery(".btncll").text("Einen Moment..."); }else{ jQuery(".btncll").text("One Moment..."); } /*add font-size of button text*/ jQuery(".btncll").css("font-size", "12px"); setTimeout(function(){ jQuery(".btncll").text(buttontext); jQuery(".btncll").css("font-size", "18px"); },1000); } /*if country code is empty*/ if(country_code==''){ /*use phone country code*/ country_code = phone_country_code; } // fix UK 0 problem if(country_code == '+440'){ country_code = '+44'; } /*apply phone number country code with phone number*/ var phonenumber = country_code+""+phonenumber; if(schedulecallclick == 0){ /*call button is successfully clicked once */ schedulecallclick = 1; /*send request on server*/ if(api_type ==1){ jQuery.ajax({ dataType: "jsonp", jsonp: "callback", jsonpCallback: "jsonpCallback", contentType: "application/json", url: siteurl+"pcallwidgets/schedulecall?phonenumber="+encodeURIComponent(phonenumber)+"&country_code="+encodeURIComponent(country_code)+"&country_name="+encodeURIComponent(country_name)+"&widget="+encodeURIComponent(widget)+"&visitor_id="+encodeURIComponent(visitor_id), }); }else{ jQuery.ajax({ dataType: "jsonp", jsonp: "callback", jsonpCallback: "jsonpCallback", contentType: "application/json", url: siteurl+"callwidgets/schedulecall?phonenumber="+encodeURIComponent(phonenumber)+"&country_code="+encodeURIComponent(country_code)+"&country_name="+encodeURIComponent(country_name)+"&widget="+encodeURIComponent(widget)+"&visitor_id="+encodeURIComponent(visitor_id), }); } } } } /*if time is available the shown time here*/ function selecttime(json){ /*empty current time from drop-down with new available time*/ jQuery("#select_time_agent").empty(); /*set new time in drop-down*/ jQuery("#select_time_agent").html(json.options); } /*select scheduled dates time available*/ function selecttimes(){ /*get current date */ var date = document.getElementById("select_day_agent").value; /*get lead phone number*/ var phonenumber = document.getElementById("phonenumber_code").value; /*its default 0 if type is selected from widget customization than agent id is greater than 0*/ var agent_id = document.getElementById("agent_id").value; //visitor time enabled if(select_visitor_time==''){ if(schedule_call_timezone_enable == 1){ try { select_visitor_time = Intl.DateTimeFormat().resolvedOptions().timeZone; }catch(error) { } } } /*if phone number is not empty*/ if(phonenumber !=""){ if(api_type ==1){ if(select_visitor_time !=''){ /*send request to server to get agent availability time*/ jQuery.ajax({ dataType: "jsonp", jsonp: "callback", jsonpCallback: "jsonpCallback", contentType: "application/json", url: siteurl+"pcallwidgets/scheduletimes?start_date="+encodeURIComponent(date)+"&widget="+encodeURIComponent(widget)+"&agent_id="+encodeURIComponent(agent_id)+"&select_visitor_time="+encodeURIComponent(select_visitor_time), }); }else{ /*send request to server to get agent availability time*/ jQuery.ajax({ dataType: "jsonp", jsonp: "callback", jsonpCallback: "jsonpCallback", contentType: "application/json", url: siteurl+"pcallwidgets/scheduletimes?start_date="+encodeURIComponent(date)+"&widget="+encodeURIComponent(widget)+"&agent_id="+encodeURIComponent(agent_id), }); } }else{ if(select_visitor_time !=''){ /*send request to server to get agent availability time*/ jQuery.ajax({ dataType: "jsonp", jsonp: "callback", jsonpCallback: "jsonpCallback", contentType: "application/json", url: siteurl+"callwidgets/scheduletimes?start_date="+encodeURIComponent(date)+"&widget="+encodeURIComponent(widget)+"&agent_id="+encodeURIComponent(agent_id)+"&select_visitor_time="+encodeURIComponent(select_visitor_time), }); }else{ /*send request to server to get agent availability time*/ jQuery.ajax({ dataType: "jsonp", jsonp: "callback", jsonpCallback: "jsonpCallback", contentType: "application/json", url: siteurl+"callwidgets/scheduletimes?start_date="+encodeURIComponent(date)+"&widget="+encodeURIComponent(widget)+"&agent_id="+encodeURIComponent(agent_id), }); } } } } /*previous function*/ function dialogclose(){ jQuery.dialog._hide("popup_container_alert", "overflow_alert"); jQuery.each([0,1,2,3,4,5,6,7,8,9], function(index,value){ var slow = '0.'+value+''; jQuery(".dailricon").stop().fadeTo("slow", slow); }); } /*close tooltip permanently*/ function closetooltip(){ /*hide tool tip*/ jQuery(".dlrtxtr").hide(); /*send request to server to update tool-tip closed*/ savetooltip_close_click(); } /*save visitor */ function savevisitors(pathname,clicks){ if(visitor_id > 0){ jQuery("#visitor_id").val(visitor_id); }else{ /*check referrer page url*/ var referrer = document.referrer; /*get host name from referrer url*/ var host = ''; /*if referrer url found*/ if(referrer !=''){ /*get host name from referrer url*/ host = referrer.match(/:\/\/(.[^/]+)/)[1]; } if(googleanalatics==''){ try { var tracker = ga.getAll()[0]; googleanalatics = tracker.get('clientId'); }catch(error) { } } if(googleanalatics==''){ try { ga(function(tracker) { googleanalatics = tracker.get('clientId'); }); }catch(error) { } } /*check if current page url not empty*/ if(pathname !=''){ /*send request to server*/ if(api_type ==1){ jQuery.ajax({ dataType: "jsonp", jsonp: "callback", contentType: "application/json", url: siteurl+"pcallwidgets/savevisiters?widget="+encodeURIComponent(widget)+"&url="+encodeURIComponent(pathname)+"&clicks="+encodeURIComponent(clicks)+"&browsersession="+browsersession+"&host="+host+"&referrerurl="+referrer+"&location_ip="+location_ip+"&city="+city+"®ion="+region+"&country="+country+"&timezone="+timezone+"&country_name="+country_name+"&googleanalatics="+googleanalatics, }); }else{ jQuery.ajax({ dataType: "jsonp", jsonp: "callback", contentType: "application/json", url: siteurl+"callwidgets/savevisiters?widget="+encodeURIComponent(widget)+"&url="+encodeURIComponent(pathname)+"&clicks="+encodeURIComponent(clicks)+"&browsersession="+browsersession+"&host="+host+"&referrerurl="+referrer+"&location_ip="+location_ip+"&city="+city+"®ion="+region+"&country="+country+"&timezone="+timezone+"&country_name="+country_name+"&googleanalatics="+googleanalatics, }); } } } } /*call function after visitor created*/ function visitorsdetails(json){ /*save visitor is in widget page form*/ jQuery("#visitor_id").val(json.visitors_id); /*assign value to exist visitor variable*/ visitor_id = json.visitors_id; } function savetooltip_close_click(){ /*if show tool-tip is disable than speachbox will disable */ if(show_tooltip==1){ jQuery(".riq_box1").hide(); show_tooltip = 0; } /*if visitor already exists*/ if(visitor_id > 0){ /*send request to server to save tool-tip close click*/ if(api_type ==1){ jQuery.ajax({ dataType: "jsonp", jsonp: "callback", contentType: "application/json", url: siteurl+"pcallwidgets/savetooltip_close_click?widget="+encodeURIComponent(widget)+"&browsersession="+browsersession+"&visitor_id="+visitor_id, }); }else{ jQuery.ajax({ dataType: "jsonp", jsonp: "callback", contentType: "application/json", url: siteurl+"callwidgets/savetooltip_close_click?widget="+encodeURIComponent(widget)+"&browsersession="+browsersession+"&visitor_id="+visitor_id, }); } } } /*save tool tip click and attempt to exist*/ function savetooltip_attemt_to_exist(){ /*if visitor already exists*/ if(visitor_id > 0){ /*send request to server to save tool-tip click and attempt to exist*/ if(api_type ==1){ jQuery.ajax({ dataType: "jsonp", jsonp: "callback", contentType: "application/json", url: siteurl+"pcallwidgets/savetooltip_attemt_to_exist?widget="+encodeURIComponent(widget)+"&browsersession="+browsersession+"&visitor_id="+visitor_id }); }else{ jQuery.ajax({ dataType: "jsonp", jsonp: "callback", contentType: "application/json", url: siteurl+"callwidgets/savetooltip_attemt_to_exist?widget="+encodeURIComponent(widget)+"&browsersession="+browsersession+"&visitor_id="+visitor_id }); } } } /*save referrer click and url*/ function savereferrer(pathname,clicks){ /*referrer url is found*/ if(pathname !=''){ /*get host name of current referral*/ var host = pathname.match(/:\/\/(.[^/]+)/)[1]; /*send request to server to save referrer url with clicks*/ if(api_type ==1){ jQuery.ajax({ dataType: "jsonp", jsonp: "callback", contentType: "application/json", url: siteurl+"pcallwidgets/savereferrer?widget="+encodeURIComponent(widget)+"&url="+encodeURIComponent(pathname)+"&clicks="+encodeURIComponent(clicks)+"&host="+host+"&browsersession="+browsersession, }); }else{ jQuery.ajax({ dataType: "jsonp", jsonp: "callback", contentType: "application/json", url: siteurl+"callwidgets/savereferrer?widget="+encodeURIComponent(widget)+"&url="+encodeURIComponent(pathname)+"&clicks="+encodeURIComponent(clicks)+"&host="+host+"&browsersession="+browsersession, }); } } } /*save widget impression*/ function savewidgetimpression(test){ impressionSaved = 1; if(api_type ==1){ /*send request to server to save widget impression*/ jQuery.ajax({ dataType: "jsonp", jsonp: "callback", contentType: "application/json", url: siteurl+"pcallwidgets/savewidgetimpression?widget="+encodeURIComponent(widget), }); }else{ /*send request to server to save widget impression*/ jQuery.ajax({ dataType: "jsonp", jsonp: "callback", contentType: "application/json", url: siteurl+"callwidgets/savewidgetimpression?widget="+encodeURIComponent(widget), }); } } /*save widget open*/ function savewidgetopen(){ /*send request to server to save widget open*/ if(api_type ==1){ jQuery.ajax({ dataType: "jsonp", jsonp: "callback", contentType: "application/json", url: siteurl+"pcallwidgets/savewidgetopen?widget="+encodeURIComponent(widget), }); }else{ jQuery.ajax({ dataType: "jsonp", jsonp: "callback", contentType: "application/json", url: siteurl+"callwidgets/savewidgetopen?widget="+encodeURIComponent(widget), }); } } /*fade widget button opacity */ function fadeIn(el){ //flightguru then remove poweredby responseiq if(company_id == 558 || company_id == 559 || company_id == 562 || company_id == 565 || company_id == 566 || company_id == 568 || company_id == 569){ jQuery(".bltby").hide(); } /*checking el variable is defined of not*/ if(typeof(el) != "undefined" && el !== null) { el.style.opacity = 0; var tick = function(){ el.style.opacity = +el.style.opacity + 0.01; if (+el.style.opacity < 1) { (window.requestAnimationFrame && requestAnimationFrame(tick)) || setTimeout(tick, 16) } }; tick(); } } /*fade tool-tip opacity */ function fadeIntooltip(el){ /*checking widget button is clicked and class changed*/ if(jQuery( ".dilricn2nw" ).hasClass("crssic")==true){ jQuery("#riq_dlrtxtr").hide(); }else{ /*checking el variable is defined of not*/ if(typeof(el) != "undefined" && el !== null) { el.style.opacity = 0; var tick = function(){ el.style.opacity = +el.style.opacity + 0.01; if (+el.style.opacity < 0.8) { (window.requestAnimationFrame && requestAnimationFrame(tick)) || setTimeout(tick, 16) } }; tick(); } } } /*fade tool-tip opacity */ function fadeOuttooltip(el){ /*checking widget button is clicked and class changed*/ if(jQuery( ".dilricn2nw" ).hasClass("crssic")==true){ jQuery("#riq_dlrtxtr").hide(); }else{ /*checking el variable is defined of not*/ if(typeof(el) != "undefined" && el !== null) { el.style.opacity = 0.8; var tick = function(){ el.style.opacity = +el.style.opacity - 0.01; if (+el.style.opacity > 0) { (window.requestAnimationFrame && requestAnimationFrame(tick)) || setTimeout(tick, 16) } }; tick(); } } } function autoclosetooltip(){ if(hide_after_closing_popup==1 && (tooltip_reload_page > 0 || tooltip_reload_page > '0')){ setTimeout(function(){ var el = document.getElementById("riq_dlrtxtr"); /*call tool tip fade effect function*/ fadeOuttooltip(el); // jQuery(".riq_box1").hide(); },tooltip_reload_page); } } function keywordbasedresult(json){ show_tooltip = json.show_tooltip; if(json.phone_icon !=''){ phone_icon = json.phone_icon; } if(json.htmlpage !=''){ htmlpage = json.htmlpage; } if(json.widget_schedule_html !=''){ widget_schedule_html = json.widget_schedule_html; } if(json.widget_thanks_html !=''){ widget_thanks_html = json.widget_thanks_html; } if(json.widget_schedule_callback_html !=''){ widget_schedule_callback_html = json.widget_schedule_callback_html; } if(json.time_on_website > 0){ time_on_website = json.time_on_website; } if(json.delay_before_minimising_popup > 0){ delay_before_minimising_popup = json.delay_before_minimising_popup; } } function keywordbasedsettings(){ /*send request to server to keyword based widget settings*/ jQuery.ajax({ dataType: "jsonp", jsonp: "callback", contentType: "application/json", url: siteurl+"keywordwidgets/keywordbasedsettings?widget="+encodeURIComponent(widget)+"&onlineagents="+encodeURIComponent(onlineagents)+"&url="+encodeURIComponent(window.location.href), }); setTimeout(function(){ revisit_user(); },2000); } function revisit_user(){ if(lead_revisit_alert ==1){ /*send request to server to revisit user*/ jQuery.ajax({ dataType: "jsonp", jsonp: "callback", contentType: "application/json", url: siteurl+"keywordwidgets/revisit_user?widget="+encodeURIComponent(widget)+"&ipaddress="+encodeURIComponent(ipaddress)+"¤tvisiturl="+encodeURIComponent(window.location.href), }); } } /*select gdpr confirmation page page*/ function gdprcallme(phone){ /*check phone number*/ var phonenumber = document.getElementById("phonenumber_code").value; /*check country name*/ var country_name = document.getElementById("country_name").value; /*check country code*/ var country_code = document.getElementById("country_code").value.replace(/\s+/g, ""); /*check phone number country code*/ var phone_country_code = document.getElementById("phone_country_code").value.replace(/\s+/g, ""); /*check agent id if type selected from widget customization page*/ var agent_id = document.getElementById("agent_id").value; /*check visitors record id*/ var visitor_id = document.getElementById("visitor_id").value; /*check department record id*/ var department_id = document.getElementById("department_id").value; /*update schedule date time template in current div*/ jQuery("#riq_showthanks").empty(); jQuery("#riq_showthanks").html(widget_gdpr_consent_html); /*append all variables in new schedule call page*/ jQuery("#riq_showthanks").append(""); jQuery("#riq_showthanks").append(""); jQuery("#riq_showthanks").append(""); jQuery("#riq_showthanks").append(""); jQuery("#riq_showthanks").append(""); jQuery("#riq_showthanks").append(""); jQuery("#riq_showthanks").append(""); /*remove display none of widget*/ jQuery(".wgtppotshhd").css("display", "block"); /*remove display none of template*/ jQuery("#riq_calltemplate_6").css("display", "block"); callnowclick = 0; save_do_not_call_click(1); } /* if number is duplicate*/ function gdprduplicatenumber(){ /*change input field message*/ jQuery("#callmebutton2").text("Duplicate number"); /*change input field message font size*/ jQuery("#callmebutton").css("font-size", "12px"); setTimeout(function(){ jQuery("#callmebutton2").text(callmebuttontext); jQuery("#callmebutton").css("font-size", "15px"); },1000); callnowclick = 0; return false; } /*check if customer number is in blacklist*/ function gdprblacklistnumber(){ /*change input field message*/ jQuery("#callmebutton2").text("Not able to make call"); /*change input field message font size*/ jQuery("#callmebutton").css("font-size", "12px"); setTimeout(function(){ jQuery("#callmebutton2").text(callmebuttontext); jQuery("#callmebutton").css("font-size", "15px"); },1000); callnowclick = 0; return false; } /* if number is invalid*/ function gdprphoneinvalid(){ /*change input field message*/ /*change input field message*/ if(company_id==1378){ jQuery("#callmebutton2").text("ungültige Nummer."); }else{ jQuery("#callmebutton2").text("Number invalid."); } /*change input field message font size*/ jQuery("#callmebutton").css("font-size", "12px"); setTimeout(function(){ jQuery("#callmebutton2").text(callmebuttontext); jQuery("#callmebutton").css("font-size", "15px"); },1000); callnowclick = 0; return false; } function callme(){ if((company_id==1378) && (sub_widget_company_id==0)){ if(jQuery("#gdpr_welcometext_agree_second_text_pop").length > 0){ jQuery("#gdpr_welcometext_agree_second_text_pop").text("Einen Moment bitte"); }else{ jQuery("#gdpr_welcometext_agree_text_pop").text("Einen Moment bitte"); } }else if(sub_widget_company_id==1342){ if(jQuery("#gdpr_welcometext_agree_second_text_pop").length > 0){ jQuery("#gdpr_welcometext_agree_second_text_pop").text("Einen Moment..."); }else{ jQuery("#gdpr_welcometext_agree_text_pop").text("Einen Moment..."); } }else{ if(jQuery("#gdpr_welcometext_agree_second_text_pop").length > 0){ jQuery("#gdpr_welcometext_agree_second_text_pop").text("One Moment..."); }else{ jQuery("#gdpr_welcometext_agree_text_pop").text("One Moment..."); } } if(jQuery("#gdpr_welcometext_agree_second_text_pop").length > 0){ jQuery("#gdpr_welcometext_agree_second_text_pop").css("font-size", "12px"); }else{ jQuery("#gdpr_welcometext_agree_text_pop").css("font-size", "12px"); } gdpr_enable_check = 1; callnow(2); } /*select gdpr do not call me page*/ function nonotcallme(){ /*check phone number*/ var phonenumber = document.getElementById("phonenumber_code").value; /*check country name*/ var country_name = document.getElementById("country_name").value; /*check country code*/ var country_code = document.getElementById("country_code").value.replace(/\s+/g, ""); /*check phone number country code*/ var phone_country_code = document.getElementById("phone_country_code").value.replace(/\s+/g, ""); /*check agent id if type selected from widget customization page*/ var agent_id = document.getElementById("agent_id").value; /*check visitors record id*/ var visitor_id = document.getElementById("visitor_id").value; /*check department record id*/ var department_id = document.getElementById("department_id").value; //select call schedule time var select_day_agent = ''; var select_time_agent = ''; try { select_day_agent = document.getElementById("select_day_agent").value; select_time_agent = document.getElementById("select_time_agent").value; }catch(error) { } /*update schedule date time template in current div*/ jQuery("#riq_showthanks").empty(); jQuery("#riq_showthanks").html(widget_gdpr_consent_confirm_html); /*append all variables in new schedule call page*/ jQuery("#riq_showthanks").append(""); jQuery("#riq_showthanks").append(""); jQuery("#riq_showthanks").append(""); jQuery("#riq_showthanks").append(""); jQuery("#riq_showthanks").append(""); jQuery("#riq_showthanks").append(""); jQuery("#riq_showthanks").append(""); if(select_day_agent !='' && select_time_agent !=''){ jQuery("#riq_showthanks").append(""); jQuery("#riq_showthanks").append(""); jQuery("#gdpr_welcometext_agree_second_text_pop").attr("onclick","schedule_requestcallback()"); } /*remove display none of widget*/ jQuery(".wgtppotshhd").css("display", "block"); /*remove display none of template*/ jQuery("#riq_calltemplate_7").css("display", "block"); callnowclick = 0; if(gdpr_enable==1){ gdpr_enable_check = 0; } save_do_not_call_click(2); } /*if successfully triggered call or scheduled call then showing thanks page message*/ function thankscall(){ /*empty current div content with thanks page*/ jQuery(".dilricn2nw").trigger("click","close"); callnowclick = 0; schedulecallclick = 0; if(gdpr_enable==1){ gdpr_enable_check = 0; } save_do_not_call_click(3); } function save_do_not_call_click(type){ if(type === undefined) { type = 0; } jQuery.ajax({ dataType: "jsonp", jsonp: "callback", contentType: "application/json", url: siteurl+"keywordwidgets/save_do_not_call_click?widget="+encodeURIComponent(widget)+"&type="+encodeURIComponent(type), }); } function include_google_analytics(){ if(googleAnalyticsTrackID!=''){ try { ga('create', { trackingId: googleAnalyticsTrackID, cookieDomain: 'auto', name: 'ResponseIqTracker', }); }catch(error) { console.log('google_analytics_js_included'); (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); ga('create', { trackingId: googleAnalyticsTrackID, cookieDomain: 'auto', name: 'ResponseIqTracker', }); } } } function trigger_google_event(id) { if(id === undefined) { id = 0; } if(googleAnalyticsTrackID!=''){ console.log(id); if(id in googleAnalyticsEvent===true){ //variable in widgetsrc var eventObjectToSend = Object.assign({}, googleAnalyticsEvent[id]); eventObjectToSend['hitType'] = 'event'; eventObjectToSend['eventCategory'] = 'ResponseiQ' eventObjectToSend['eventLabel'] += ' ResponseiQ'; eventObjectToSend['eventAction']+= '.ResponseiQ'; eventObjectToSend['eventValue']=0; ga('ResponseIqTracker.send', eventObjectToSend); } } }