function ExpireDate(offset) { var today = new Date(); var result = new Date(today.getTime() + offset*1000); return result; } var MastaCookieExpireDate = ExpireDate(120); var MCEDSpeed = ExpireDate(1200); function Get_Cookie(name) { var start = document.cookie.indexOf(name+"="); var len = start+name.length+1; if ((!start) && (name != document.cookie.substring(0,name.length))) { return null; } if (start == -1) { return null; } var end = document.cookie.indexOf(";",len); if (end == -1) { end = document.cookie.length; } return unescape(document.cookie.substring(len,end)); } function Set_Cookie(name,value,expires,path,domain,secure) { var cookie = name + "=" +escape(value); cookie += ( (expires) ? ";expires=" + expires.toGMTString() : ""); cookie += ( (path) ? ";path=" + path : ""); cookie += ( (domain) ? ";domain=" + domain : ""); cookie += ( (secure) ? ";secure" : ""); document.cookie = cookie; } function Delete_Cookie(name,path,domain) { if(Get_Cookie(name)) { var cookie = name + "="; cookie += ( (path) ? ";path=" + path : ""); cookie += ( (domain) ? ";domain=" + domain : ""); cookie += ";expires=Thu, 01-Jan-70 00:00:01 GMT"; document.cookie = cookie; } } var MastaLastDisplay = Get_Cookie('LastDisplay'); var MastaSpeed=Get_Cookie('Speed'); var sm = 0; var masta = new Object(); function MastaStartCenter() { try { if(this.HTMLNode.style.position == 'absolute') { if(typeof(window.pageXOffset) == 'number') { this.HTMLNode.style.left = (window.innerWidth - this.HTMLNode.offsetWidth )/2 + window.pageXOffset; this.HTMLNode.style.top = (window.innerHeight - this.HTMLNode.offsetHeight)/2 + window.pageYOffset; } else { this.HTMLNode.style.left = (document.body.offsetWidth - this.HTMLNode.offsetWidth )/2 + document.body.scrollLeft; this.HTMLNode.style.top = (document.body.offsetHeight - this.HTMLNode.offsetHeight)/2 + document.body.scrollTop; } if(typeof(this.Interval) == 'undefined') { this.Interval = window.setInterval("masta.ActiveElement.StartCenter()",50); } } } catch(e) {} } function MastaStopCenter() { try { window.clearInterval(this.Interval); this.Interval = 0; delete this.Interval; } catch(e) {} } var MastaMode = 'ALL'; var MastaClasses = Array(); function all_InitElement() { if(typeof this.HTMLNode == 'object' && this.HTMLNode != null) { var myVar = ""; if(sm.Result == SM_BAS_DEBIT){ myVar += '
ADSL/CABLE'; myVar += ' ACCESS CREDIT CARD ACCESS
If you use high '; myVar += 'speed broadband,
click here !
If you prefer to enter the site using your CC'; myVar += ',
click here !
CLICK HERE
ADSL/CABLE ACCESS
CREDIT CARD ACCESS
If you use high speed
broadband (ADSL, Cable),
click here !
If you prefer to enter the
site using your CreditCard,
click here !
If you prefer to enter the site using your CC, click here!
'; } else { myVar += '
If you prefer to enter the site using your CC, click here !
'; myVar += '
'; } this.HTMLNode.innerHTML = myVar; } } function audiotel_OnDisplay() { } function audiotel (element) { this.HTMLNode = element; this.Init = audiotel_InitElement; this.Show = function(){if(typeof this.HTMLNode == 'object' && this.HTMLNode != null){this.HTMLNode.style.visibility='visible';this.HTMLNode.style.display = 'block';}}; this.Hide = function(){if(typeof this.HTMLNode == 'object' && this.HTMLNode != null){this.HTMLNode.style.visibility='hidden' ;this.HTMLNode.style.display = 'none';}}; this.OnDisplay = audiotel_OnDisplay; this.StartCenter = MastaStartCenter; this.StopCenter = MastaStopCenter; this.Init(); } MastaClasses['audiotel'] = {Class:audiotel, Obj:0}; function cb_InitElement() { if(typeof this.HTMLNode == 'object' && this.HTMLNode != null) { var myVar = ""; if(sm.Result == SM_BAS_DEBIT){ myVar += '
If you use high speed broadband, click here!
'; } else { myVar += '
'; myVar += '
If you use high speed broadband click here!<'; myVar += '/strong>
'; } this.HTMLNode.innerHTML = myVar; } } function cb_OnDisplay() { } function cb (element) { this.HTMLNode = element; this.Init = cb_InitElement; this.Show = function(){if(typeof this.HTMLNode == 'object' && this.HTMLNode != null){this.HTMLNode.style.visibility='visible';this.HTMLNode.style.display = 'block';}}; this.Hide = function(){if(typeof this.HTMLNode == 'object' && this.HTMLNode != null){this.HTMLNode.style.visibility='hidden' ;this.HTMLNode.style.display = 'none';}}; this.OnDisplay = cb_OnDisplay; this.StartCenter = MastaStartCenter; this.StopCenter = MastaStopCenter; this.Init(); } MastaClasses['cb'] = {Class:cb, Obj:0}; function waiting_InitElement() { if(typeof this.HTMLNode == 'object' && this.HTMLNode != null) { var myVar = ""; if(sm.Result == SM_BAS_DEBIT){ myVar += '
Please wait....
'; } else { myVar += '
Please wait....
'; } this.HTMLNode.innerHTML = myVar; } } function waiting_OnDisplay() { sm.Waiting = true; } function waiting (element) { this.HTMLNode = element; this.Init = waiting_InitElement; this.Show = function(){if(typeof this.HTMLNode == 'object' && this.HTMLNode != null){this.HTMLNode.style.visibility='visible';this.HTMLNode.style.display = 'block';}}; this.Hide = function(){if(typeof this.HTMLNode == 'object' && this.HTMLNode != null){this.HTMLNode.style.visibility='hidden' ;this.HTMLNode.style.display = 'none';}}; this.OnDisplay = waiting_OnDisplay; this.StartCenter = MastaStartCenter; this.StopCenter = MastaStopCenter; this.Init(); } MastaClasses['waiting'] = {Class:waiting, Obj:0}; var MastaMapKit=Array(); MastaMapKit[MastaMapKit.length] = {OS:'', browser:'', request:'', kit:'all'}; var speedDetectIndex = MastaMapKit.length; MastaMapKit[MastaMapKit.length] = {OS:'', browser:'', request:'speedDetect', kit:'waiting'}; MastaMapKit[MastaMapKit.length] = {OS:'XP SP2', browser:'', request:'dialer', kit:'dialer'}; MastaMapKit[MastaMapKit.length] = {OS:'notWin', browser:'', request:'dialer', kit:'dialerEXE'}; MastaMapKit[MastaMapKit.length] = {OS:'', browser:'notIE', request:'dialer', kit:'dialerEXE'}; function MastaFindElement(eltID) { try { if(typeof eltID != 'string' || eltID == '') { eltID = 'masta'; } var elt = document.getElementById(eltID); if(typeof elt != 'object') { elt = 0; } return elt; } catch(e) { alert(e); return 0; } } function MastaGetElement(eltID) { try { if(typeof eltID != 'string' || eltID == '') { eltID = 'masta'; } var elt = document.getElementById(eltID); if(typeof elt != 'object' || elt == null) { elt = document.createElement('div'); elt.id=eltID; elt.style.visibility = 'hidden'; elt.style.position = 'absolute'; elt.style.display = 'none'; elt.MastaElement == true; elt.style.zIndex = 1024; document.body.appendChild(elt); } return elt; } catch(e) { alert(e); return 0; } } function MastaCancelEvent(evt) { try { if(typeof evt == 'object' && evt != null) { try { evt.preventDefault(); evt.stopPropagation(); } catch(e) {evt.returnValue = false;} } } catch(e) {} } function MastaSetKit(kit) { if(typeof kit != 'string') { var LastDisplay = Get_Cookie('LastDisplay'); var Mode = Get_Cookie('Mode'); if(LastDisplay && Mode == MastaMode) { kit = LastDisplay; } else { kit = ''; } } for(var i = 0; i < this.MapKit.length; i++) { var map = this.MapKit[i]; if(map.request != map.kit && map.request == kit && (map.OS == '' || this.OS == map.OS) && (map.browser == '' || this.Browser == map.browser)) { kit = map.kit; i = 0; } } if(typeof(this.Classes[kit]) == 'object' && typeof(this.Classes[kit].Obj) == 'object') { if(this.MastaElement) { this.Classes[kit].Obj.OnDisplay(); this.MastaElement.innerHTML = this.Classes[kit].Obj.HTMLNode.innerHTML; this.HTMLNode = this.MastaElement; } else { if(typeof this.ActiveElement == 'object' && this.ActiveElement != null) { this.ActiveElement.StopCenter(); this.ActiveElement.Hide(); } this.ActiveElement = this.Classes[kit].Obj; this.HTMLNode = this.ActiveElement.HTMLNode; this.ActiveElement.Show(); this.ActiveElement.OnDisplay(); this.ActiveElement.StartCenter(); } if(kit != 'dialerEXE' && kit != 'waiting') { Set_Cookie('LastDisplay', kit,MastaCookieExpireDate); Set_Cookie('Mode', MastaMode,MastaCookieExpireDate); Set_Cookie('Speed', sm.Result,MCEDSpeed); } } } function MastaInit() { if(window.navigator.userAgent.indexOf("Windows") != -1) { if(window.navigator.userAgent.indexOf("NT 5.1") != -1) { if(window.navigator.userAgent.indexOf("SV1") != -1) { this.OS = 'XP SP2'; } else { this.OS = 'XP'; } } else { this.OS = 'Win'; } } else { this.OS = 'notWin'; } if(window.navigator.userAgent.indexOf("MSIE") != -1) { this.Browser = 'IE'; } else { this.Browser = 'notIE'; } for(key in this.Classes) { this.Classes[key].Obj = new this.Classes[key].Class(this.GetElement('_tmp_elt_'+key+'_')); } this.MastaElement = this.FindElement(); } function MastaClose() { for(key in this.Classes) { var node = this.Classes[key].Obj.HTMLNode; if(typeof node.MastaElement == 'boolean' && node.MastaElement == 'true') { document.body.removeChild(node); this.Classes[key].Obj.HTMLNode = 0; } } } function Masta(classes, mapkit) { this.Browser = ''; this.OS = ''; this.Classes = classes; this.MapKit = mapkit; this.Init = MastaInit; this.Close = MastaClose; this.FindElement = MastaFindElement; this.GetElement = MastaGetElement; this.CancelEvent = MastaCancelEvent; this.Kit = MastaSetKit; this.MastaElement = 0; this.Init(); } function MastaKit(event, kit) { masta.CancelEvent(event); masta.Kit(kit); } function MastaEndKit(event) { try { masta.Close(); document.body.oldunload(event); document.write(""); document.close(); } catch(e) {} } var SM_BAS_DEBIT = "bas debit"; var SM_HAUT_DEBIT = "haut debit"; var SM_UNKNOWN = 0; function SM_Init() { if(typeof document.SpeedMesurer == 'object' && document.SpeedMesurer == null) { return false; } document.SpeedMesurer = this; } function SM_TimeCheck() { if(!this.Image.complete) { this.Result = SM_BAS_DEBIT; } else { this.Result = SM_HAUT_DEBIT; } this.End(); } function SM_Start() { var image = document.createElement("img"); image.TimeOut = window.setTimeout("document.SpeedMesurer.TimeCheck()", 1500); image.Owner = this; this.Image = image; image.src = this.TestURL; } function SM_End() { this.Image.src = this.StopURL; var toef = typeof this.onMesureComplete; if(toef == 'function') { this.onMesureComplete(); } else if(toef == 'string') { window.execScript(this.onMesureComplete); } } function SpeedMesure() { var args = SpeedMesure.arguments; this.onMesureComplete = args[0] || ''; this.TestURL = 'http://superkit.mastacash.com/image.php?f=speed'; this.StopURL = 'http://superkit.mastacash.com/image.php?f=stop'; this.Image = null; this.Start = SM_Start; this.Init = SM_Init; this.TimeCheck = SM_TimeCheck; this.End = SM_End; this.Result = SM_UNKNOWN; this.Init(); this.Start(); } function SpeedMesureS() { var args = SpeedMesureS.arguments; this.Result = args[0] || ''; this.Speed = args[1] || ''; } function Speed() { try { var kitavoir=""; if (!MastaLastDisplay){ if (MastaMode == "DEFAUT" || MastaMode == "DIAL"){ if(this.Result == SM_HAUT_DEBIT) { kitavoir='audiotel'; } else { kitavoir= 'dialer'; } MastaMapKit[speedDetectIndex].kit =kitavoir; } } else { kitavoir=MastaLastDisplay; MastaMapKit[speedDetectIndex].kit = kitavoir; } Delete_Cookie('LastDisplay'); StartloadKit(kitavoir); } catch(e) { } } if(!MastaSpeed) { sm = new SpeedMesure(Speed); } else { if(MastaSpeed){ sm = new SpeedMesureS(MastaSpeed,Speed); sm.Speed(); } else { sm = new SpeedMesure(Speed); } } function StartloadKit(kit){ masta = new Masta(MastaClasses,MastaMapKit); } try { if(typeof document.body.onunload != 'undefined') { var oldUnLoad = document.body.onunload; if(typeof oldUnLoad == 'function') { document.body.oldunload = oldUnLoad; } else if(typeof oldUnLoad == 'string') { document.body.oldunload = function(){window.execScript(oldUnLoad,'Javascript')}; } else { document.body.oldunload = function(){}; } } } catch(e) { }