if(typeof(IranGreen)=="undefined"){IranGreen = {};} IranGreen.Init = function() { this.isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false; this.isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false; this.isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false; this.isSafari = (navigator.userAgent.indexOf("Safari") != -1) ? true : false; if(typeof(this.pos)=='undefined') this.pos = "ur"; if(typeof(this.theme)=='undefined') this.theme = "tm1"; if(typeof(this.page)=='undefined') this.page = "fix"; this.pos = this.pos.toLowerCase(); this.page = this.page.toLowerCase(); this.theme = this.theme.toLowerCase(); if(this.isSafari) this.InitInterval = window.setInterval("IranGreen.CheckInit()",50); else this.InitInterval = window.setInterval(function(){ IranGreen.CheckInit(); },50); }; IranGreen.CheckInit = function() { IranGreen.InitTrig++; if(IranGreen.InitTrig>800) { window.clearInterval(IranGreen.InitInterval); return; } if(typeof(document)=='object' && typeof(document.body)=='object') { window.clearInterval(IranGreen.InitInterval); IranGreen.InitMain(); } }; IranGreen.InitMain = function() { this.base_panel = document.createElement('div'); this.base_panel.setAttribute('id','ig_basepanel'); if(this.page=="var") this.base_panel.style.position = "absolute"; else this.base_panel.style.position = "fixed"; this.base_panel.style.width = "140px"; this.base_panel.style.height = "120px"; if(this.pos=="ul") { this.base_panel.style.left = "0px"; this.base_panel.style.top = "0px"; } else if(this.pos=="ur") { this.base_panel.style.right = "0px"; this.base_panel.style.top = "0px"; } else { this.base_panel.style.right = "0px"; this.base_panel.style.top = "0px"; } this.base_panel.style.backgroundImage = "url('http://www.irangreen.net/"+this.theme+"_"+this.pos+".png')"; this.base_panel.style.backgroundRepeat = "no-repeat"; this.click_panel = document.createElement('a'); this.click_panel.target = "_blank"; this.click_panel.href = "http://www.irangreen.net"; this.click_panel.style.display = 'block'; this.click_panel.style.position = 'absolute'; this.click_panel.style.width = this.base_panel.style.width; this.click_panel.style.height = this.base_panel.style.height; this.click_panel.style.top = "0px"; this.click_panel.style.left = "0px"; this.base_panel.appendChild(this.click_panel); document.body.appendChild(this.base_panel); }; IranGreen.Init();