var bdy = document.getElementsByTagName("body")[0];
var fgNew = document.createElement("div");
fgNew.setAttribute("id", "formgetapp");
bdy.appendChild(fgNew);
var fgButton = document.createElement("a");
fgButton.setAttribute("id", "fgButton");
fgButton.setAttribute("href", "javascript:void(0)");
fgButton.innerHTML="
";
bdy.appendChild(fgButton);
var container = document.getElementById("formgetapp");
function fgButtonClick() {
if (!container.classList.contains("active")) {
container.classList.add("active");
container.style.height = "auto";
/*var height = (container.clientHeight-5) + "px";*/
var height = "374px";
container.style.height = "0px";
setTimeout(function () {
container.style.height = height;
}, 0);
} else {
container.style.height = "0px";
setTimeout(function () {container.classList.remove("active");},500);
}
}
fgNew.innerHTML="";
var appiframe = document.getElementById("formgetframe").contentWindow.document;
appiframe.open();
appiframe.write('');
appiframe.close();
appiframe.getElementById('form-close').addEventListener('click', function (event) {
container.style.height = '0px';
setTimeout(function () {container.classList.remove('active');},500);
});
function accessCookie(e) {
for (var o = e + '=', i = document.cookie.split(';'), n = 0; n < i.length; n++) {
var t = i[n].trim();
if (0 == t.indexOf(o)) return t.substring(o.length, t.length)
}
return ''
}
var formCount = 0;
if (accessCookie('FormGetCookie') == '') {
formCount = 1;
appiframe.getElementById('fg_count').value = formCount;
var e = new Date;
e.setTime(e.getTime() + 864e5), document.cookie = 'FormGetCookie=AutoOpen; expires=' + e.toGMTString();
var x = appiframe.getElementById('form-ring');
setTimeout(function() { x.play(); }, 2800);
setTimeout(function() {
if (!container.classList.contains('active')) {
container.classList.add('active');
container.style.height = 'auto';
/*var height = container.clientHeight + 'px';*/
var height = '374px';
container.style.height = '0px';
setTimeout(function () { container.style.height = height; }, 0);
}
}, 3000);
}
document.getElementById('agformget').addEventListener('click',function(){console.log('Mesaj Gönderildi ...');});
document.getElementById('agformredirect').addEventListener('click',function(){ });
function isMobile(){return/Mobi/.test(navigator.userAgent)}function getOSName(){var os;if(isMobile()){if(/Windows/.test(navigator.userAgent)){os='Windows';if(/Phone 8.0/.test(navigator.userAgent)){os+=' Phone 8.0'}else if(/Phone 10.0/.test(navigator.userAgent)){os+=' Phone 10.0'}}else if(/Android/.test(navigator.userAgent)){function androidVersion(){if(/Android/.test(navigator.appVersion)){var v=(navigator.appVersion).match(/Android (\d+).(\d+)/);return v}}var ver=androidVersion();os=ver[0]}else if(/iPhone;/.test(navigator.userAgent)){function iOSversion(){if(/iP(hone|od|ad)/.test(navigator.appVersion)){var v=(navigator.appVersion).match(/OS (\d+)_(\d+)_?(\d+)?/);return[parseInt(v[1],10),parseInt(v[2],10),parseInt(v[3]||0,10)]}}var ver=iOSversion();os='iOS '+ver[0]+'.'+ver[1]+'.'+ver[2]}else if(/iPad;/.test(navigator.userAgent)){function iOSversion(){if(/iP(hone|od|ad)/.test(navigator.appVersion)){var v=(navigator.appVersion).match(/OS (\d+)_(\d+)_?(\d+)?/);return[parseInt(v[1],10),parseInt(v[2],10),parseInt(v[3]||0,10)]}}var ver=iOSversion();os='iOS '+ver[0]+'.'+ver[1]+'.'+ver[2]}else if(/BBd*/.test(navigator.userAgent)){os='BlackBerry'}}else{if(/Windows/.test(navigator.userAgent)){os='Windows';if(/5.1;/.test(navigator.userAgent)){os+=' XP'}else if(/6.0;/.test(navigator.userAgent)){os+=' Vista'}else if(/6.1;/.test(navigator.userAgent)){os+=' 7'}else if(/6.2/.test(navigator.userAgent)){os+=' 8'}else if(/10.0;/.test(navigator.userAgent)){os+=' 10'}if(/64/.test(navigator.userAgent)){os+=' 64-bit'}else{os+=' 32-bit'}}else if(/Macintosh/.test(navigator.userAgent)){os='Macintosh';if(/OS X/.test(navigator.userAgent)){os+=' OS X'}}}return os}function getBrowserName(){if((window.opr&&window.opr.addons)||window.opera||navigator.userAgent.indexOf(' OPR/')>=0){return'Opera'}if(typeof InstallTrigger!=='undefined'){return'Firefox'}if(/constructor/i.test(window.HTMLElement)||(function(p){return p.toString()==='[object SafariRemoteNotification]'})(!window.safari)){return'Safari'}if(!1||document.documentMode){return'Internet Explorer'}if(!(document.documentMode)&&window.StyleMedia){return'Microsoft Edge'}if(window.chrome){return'Chrome'}}
appiframe.getElementById("fg_os_name").value = getOSName();
appiframe.getElementById("fg_browser_name").value = getBrowserName();
appiframe.getElementById("fg_is_mobile").value = isMobile() ? 'Mobile' : 'Desktop';