var suggestionText="";
var list;
var firstKey="";
var checkdiv=0;
this.searchfield = function(in_id,ajaxSuggestion){
	var id = in_id;
	if(in_id=='whois_domain')
		var defaultText = "Whois Lookup";
	else if(in_id=='diff_domain')
		var defaultText = "DiffStats - Enter a Domain Name";
	else
		var defaultText = "Enter a Domain Name for Analysis";
	var suggestion = true;
	//var suggestionText="probcomp.com,google.com,yahoo.com,pickmeweb.com";
	var field = document.getElementById(id);	
	var classInactive = "sf_inactive";
	var classActive = "sf_active";
	var classText = "sf_text";
	var classSuggestion = "sf_suggestion";
	this.safari = ((parseInt(navigator.productSub)>=20020000)&&(navigator.vendor.indexOf("Apple Computer")!=-1));
	if(field && !safari){
		//field.value = defaultText;
		field.c = field.className;		
		field.className = field.c + " " + classInactive;
		field.onfocus = function(){
			this.className = this.c + " "  + classActive;
			this.value = (this.value == "" || this.value == defaultText) ?  "" : this.value;
			tooltip.hide();
		};
		field.onblur = function(){
			this.className = (this.value != "" && this.value != defaultText) ? this.c + " " +  classText : this.c + " " +  classInactive;
			this.value = (this.value != "" && this.value != defaultText) ?  this.value : defaultText;
			clearList();
		};
		if (suggestion){
			
			var selectedIndex = 0;
			if(checkdiv==0)	{
			field.setAttribute("autocomplete", "off");
			var div = document.createElement("div");
			list = document.createElement("ul");
			list.style.display = "none";
			list.style.fontSize = "12px";
			div.className = classSuggestion;
			div.id="classSuggId";
			//list.style.width = field.offsetWidth + "px";
			list.style.width = "240px";
			div.appendChild(list);
			field.parentNode.appendChild(div);	
checkdiv=1;
}
			field.onkeypress = function(e){				
				var key = getKeyCode(e);
				if(field.value.length>=2 && firstKey!="")
					firstKey=field.value;
				tooltip.hide();
				if(key == 13){ // enter
					selectList();
					selectedIndex = 0;
					return false;
				};	
			};
				
			field.onkeyup = function(e){
			
				var key = getKeyCode(e);
				var alphanum = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.";
				var keychar = String.fromCharCode(key);
				if(field.value.length>=2 && field.value!=firstKey){
//alert("Hi"+(field.value!=firstKey) + "-"+ field.value+"-"+firstKey);
					firstKey=field.value;
					clearList();
					//removeElement('classSuggId');
					getSuggestionResult("/suggestion.php?text="+firstKey,in_id);
					return;
				}
				if(field.value.length<2){
					clearList();
					return;
				}
		
				switch(key){
				case 13:
					return false;
					break;			
				case 27:  // esc
					//field.value = "";
					selectedIndex = 0;
					clearList();
					break;				
				case 38: // up
					navList("up");
					break;
				case 40: // down
					navList("down");		
					break;
				default:
					startList();			
					break;
				};
			};
			
			if(ajaxSuggestion==true){
				ajaxSuggestion=false;
				startList();
			};

			this.startList = function(){
				var arr = getListItems(field.value);
				if(field.value.length > 0){
					createList(arr);
				} else {
					clearList();
				};	
			};
			
			this.getListItems = function(value){
				var arr = new Array();
				var src = suggestionText;
				var src = src.replace(/, /g, ",");
				var arrSrc = src.split(",");
				var limit=10;
				var count=0;
				for(i=0;i<arrSrc.length;i++){
					if(arrSrc[i].substring(0,value.length).toLowerCase() == value.toLowerCase()){
						arr.push(arrSrc[i]);
						count++;
					};
					if(count==limit)
						break;
				};				
				return arr;
			};
			
			this.createList = function(arr){				
				resetList();			
				if(arr.length > 0) {
					for(i=0;i<arr.length;i++){				
						li = document.createElement("li");
						a = document.createElement("a");
						a.href = "javascript:void(0);";
						a.i = i+1;
						a.innerHTML = arr[i];
						a.style.padding="4px";
						li.i = i+1;
						li.onmouseover = function(){
							navListItem(this.i);
						};
						a.onmousedown = function(){
							selectedIndex = this.i;
							selectList(true);		
							return false;
						};					
						li.appendChild(a);
						list.setAttribute("tabindex", "-1");
						list.appendChild(li);	
					};	
					list.style.display = "block";				
				} else {
					clearList();
				};
			};	
			
			this.resetList = function(){
				var li = list.getElementsByTagName("li");
				var len = li.length;
				for(var i=0;i<len;i++){
					list.removeChild(li[0]);
				};
			};
			
			this.navList = function(dir){			
				selectedIndex += (dir == "down") ? 1 : -1;
				li = list.getElementsByTagName("li");
				if (selectedIndex < 1) selectedIndex =  li.length;
				if (selectedIndex > li.length) selectedIndex =  1;
				navListItem(selectedIndex);
			};
			
			this.navListItem = function(index){	
				selectedIndex = index;
				li = list.getElementsByTagName("li");
				for(var i=0;i<li.length;i++){
					li[i].className = (i==(selectedIndex-1)) ? "selected" : "";
				};
			};
			
			this.selectList = function(mouseclick){
				if(selectedIndex-1<0){
					if(in_id=='whois_domain')
						startWhois(field);
					else if(in_id=='diff_domain')
						startDiff(field);
					else
						startSearch(field);
					return;
				}
				li = list.getElementsByTagName("li");	
				a = li[selectedIndex-1].getElementsByTagName("a")[0];				
				field.value = a.innerHTML;
				clearList();
				if(in_id=='whois_domain')
					startWhois(field);
				else if(in_id=='diff_domain')
					startDiff(field);
				else
					startSearch(field);
			};			
			this.removeElement = function(id) {
				var element = document.getElementById(id);
				element.parentNode.removeChild(element);
			};
		};
	};
	
	this.clearList = function(){
		if(list){
			list.style.display = "none";
			selectedIndex = 0;
		};
	};		
	this.getKeyCode = function(e){
		var code;
		if (!e) var e = window.event;
		if (e.keyCode) code = e.keyCode;
		return code;
	};
	
};

// script initiates on page load. 

this.addEvent = function(obj,type,fn,in_id){
	if(obj.attachEvent){
		obj['e'+type+fn] = function(){fn(in_id,false)};
		obj[type+fn] = function(){obj['e'+type+fn](window.event );}
		obj.attachEvent('on'+type, obj[type+fn]);
	} else {
		obj.addEventListener(type,function(){fn(in_id,false)},false);
	};
};

//addEvent(window,"load",searchfield,'domain');
function theight(){
	var d=document, b=d.body, e=d.documentElement;
	return Math.max(Math.max(b.scrollHeight,e.scrollHeight),Math.max(b.clientHeight,e.clientHeight))
}
function twidth(){
	var d=document, b=d.body, e=d.documentElement;
	return Math.max(Math.max(b.scrollWidth,e.scrollWidth),Math.max(b.clientWidth,e.clientWidth))
}
function move_box() {
	var offset = 50; // set offset (likely equal to your css top)
	var element = document.getElementById('box');
	element.style.top = (parent.document.documentElement.scrollTop + offset) + 'px';
}
function showBox(w, h, url, title){ 
    var width = document.getElementsByTagName('body')[0].clientWidth;
    var layer = document.createElement('div');
    layer.style.zIndex = 200;
    layer.id = 'layer';
    layer.style.position = 'absolute';
    layer.style.top = '0px';
    layer.style.left = '0px';
    layer.style.height = theight() + 'px';
    layer.style.width = twidth() + 'px';
    layer.style.backgroundColor = 'black';
    layer.style.opacity = '.7';
    layer.style.filter += ("progid:DXImageTransform.Microsoft.Alpha(opacity=60)");
	//layer.onclick="closePopup()";
	layer.onclick = function(){
		closePopup();
	};
    document.body.appendChild(layer); 
   
    var div = document.createElement('div');
    div.style.zIndex = 201;
    div.id = 'box';
    div.style.position = (navigator.userAgent.indexOf('MSIE 6') > -1) ? 'absolute' : 'fixed';
    div.style.top = '180px';
    div.style.left = (twidth() / 2) - (w / 2) + 'px'; 
	//div.style.marginLeft = (width / 2) - (w / 2) + 'px'; 
    //div.style.height = h + 20+ 32+ 'px';
    div.style.width = w + 'px';
    //div.style.backgroundColor = '#000';
    //div.style.border = '10px solid #000';//silver';//#B5CFEF #bcd3ef #adcaed	b7cfed	
	div.style.padding='10px';
    document.body.appendChild(div); 
	
	var div1 = document.createElement('div');
    div1.style.zIndex = 202;
    div1.id = 'ibox';	
    //div1.style.height = h +20 + 'px';
    //div1.style.width = w - 24 +'px';
    div1.style.backgroundColor = '#fff';
	//div1.style.padding = '12px';
    div.appendChild(div1); 
   
   var div_head = document.createElement('div');
	div_head.innerHTML='<div style="float:left;text-shadow:1px 1px 1px #aaa;"><span id="popup-title">' + title + '</span><img id="ajax-loader" src="http://www.webrankstats.com/images/ajax.gif"  alt="Loading..."  style="margin-left:10px; vertical-align:middle;"/></div><div style="float:right;padding-right:5px;padding-top:3px"><a href="javascript:void(0)" onclick="closePopup()"><img border="0" src="http://www.webrankstats.com/images/fileclose.png"/></a></div><div style="clear:both;font-size:0px;height:0px"></div>';
	div_head.style.background="#333 url(/images/popup_title.jpg) repeat-x";//#C9DAEF #ddd
	div_head.style.fontFamily="arial,verdana";
	div_head.style.color="#f9f9f9";
	div_head.style.fontSize="18px";
	div_head.style.padding="3px 0px 6px 15px";
	div_head.style.fontWeight="bold";
	//div_head.style.marginBottom="12px";	
	div1.appendChild(div_head); 
	

    var p = document.createElement('div');	
	p.id='popup';
	p.style.width=w+'px';
	//p.style.height=h +'px';
	p.border='0';
	p.scrolling='no';
	p.style.border="0";
	p.style.color='#000';
	p.frameBorder="0";
	p.style.marginWidth='0px';
	p.style.padding='10px 0';
    div1.appendChild(p);
	
	showResult(url,'popup');
	
	if(navigator.userAgent.indexOf('MSIE 6') > -1) {
		window.setInterval(move_box, 100);
	}
}

function move_box() {
	var offset = 50; // set offset (likely equal to your css top)
	var element = document.getElementById('box');
	element.style.top = (parent.document.documentElement.scrollTop + offset) + 'px';
	//alert(parent.document.documentElement.scrollTop);
}
  
function closePopup(){
	if(document.getElementById('popup')!=null){
		document.getElementById('popup').src='';
		document.body.removeChild(document.getElementById('layer'));
		document.body.removeChild(document.getElementById('box'));
	}
	
	//window.location.reload();
}

function showResult(url,container){
	ajaxLoader(1);
	var xmlhttp=GetXmlHttpObject()
	if (xmlhttp==null){
	  alert ("Your browser does not support XML HTTP Request");
	  return;
	}
	xmlhttp.onreadystatechange=function(){
		if (xmlhttp.readyState==4 && xmlhttp.status==200){
			document.getElementById(container).innerHTML=xmlhttp.responseText;
			ajaxLoader(0);
		}
	};
	xmlhttp.open("GET",url,true);	
	xmlhttp.send(null);
}

function getResult(url,id){	
	ajaxLoader(1);
	var xmlhttp=GetXmlHttpObject();
	if (xmlhttp==null){
	  alert ("Your browser does not support XML HTTP Request");
	  return 1;
	}
	xmlhttp.onreadystatechange=function(){
		if (xmlhttp.readyState==4 && xmlhttp.status==200){
			var reply = xmlhttp.responseText;
			ajaxLoader(0);
			if(id=='captcha'){
				if(reply=='1'){
					var captcha_value = $('captcha-text').value;
					$('popup').innerHTML='<div align="center" style="font-size:18px; padding:0 5px;font-weight:700;">Please wait while updating...<br/>Thank You</div>';
					$('popup-title').innerHTML='Updating'
					ajaxLoader(1);
					return getResult('/newrank.php?captcha='+captcha_value+'&id='+$('update_id').value,'update');
					//return 1;
				}
				else{
					alert("Invalid Captcha");
					return 0;
				}
			}
			else if(id=='update'){
				window.location.reload();
			}
			else if(id=='suggestion'){
				suggestionText=reply;
				searchfield('domain',true);
			}
		}
	};
	xmlhttp.open("GET",url,true);	
	xmlhttp.send(null);
}

function getSuggestionResult(url,id){	
	var xmlhttp=GetXmlHttpObject();
	if (xmlhttp==null){
	  alert ("Your browser does not support XML HTTP Request");
	  return 1;
	}
	xmlhttp.onreadystatechange=function(){
		if (xmlhttp.readyState==4 && xmlhttp.status==200){
			var reply = xmlhttp.responseText;
			suggestionText=reply;
			searchfield(id,true);
		}
	};
	xmlhttp.open("GET",url,true);	
	xmlhttp.send(null);
}

function newhois(){
	ajaxLoader(1);
	return getResult('/newhois.php?id='+$('update_id').value,'update');
}

function checkCaptcha(obj){
	if(obj.value.length==6){
		return getResult('/captcha/captcha_check.php?captcha='+obj.value,'captcha');
	}
	else{
		alert('Invalid Captcha');
		return 0;
	}
}

function checkCommentCaptcha(obj){
	if(obj.captcha.value.length==6){
		url = '/captcha/captcha_check.php?captcha='+obj.captcha.value;
		var xmlhttp=GetXmlHttpObject();
		if (xmlhttp==null){
		  alert ("Your browser does not support XML HTTP Request");
		  return 1;
		}
		xmlhttp.onreadystatechange=function(){
			if (xmlhttp.readyState==4 && xmlhttp.status==200){
				var reply = xmlhttp.responseText;				
				if(reply=='1'){
					getResult('/submit_comment.php?name='+ escape(obj.name.value) + '&email=' + escape(obj.email.value) + '&comment=' + escape(obj.comment.value) + '&id=' + obj.id.value + '&domain=' + obj.domain_name.value+'&captcha='+obj.captcha.value,'comment');
					$('comment-msg').style.backgroundColor='green';
					$('comment-msg').innerHTML='Your comments successfully submitted. A verfication mail has been sent, please check your inbox.';
					$('comment-msg').style.display='block';
					obj.reset();
					newCaptcha();
				}
				else{
					alert("Invalid Captcha");
					return 0;
				}
			}
		};
		xmlhttp.open("GET",url,true);	
		xmlhttp.send(null);
	}
	else{
		alert('Invalid Captcha');
		return 0;
	}
}

function submitComment(obj){
	if(obj.name.value!='' && obj.email.value!='' && obj.comment.value!='' && obj.id.value!='' && obj.captcha.value!=''){
		checkCommentCaptcha(obj);
	}
	else{
		$('comment-msg').style.backgroundColor='red';
		$('comment-msg').innerHTML='All fields are necessary.';
		$('comment-msg').style.display='block';
	}
	return false;
}

function $(id){
	return document.getElementById(id);
}

function GetXmlHttpObject(){
	if (window.XMLHttpRequest){
		return new XMLHttpRequest();	// code for IE7+, Firefox, Chrome, Opera, Safari
	}
	if (window.ActiveXObject){
		return new ActiveXObject("Microsoft.XMLHTTP");	// code for IE6, IE5
	}
	return null;
}

function ajaxLoader(opt){
	if(document.getElementById('ajax-loader')){
		if(opt==0)
			document.getElementById('ajax-loader').style.display='none';
		else
			document.getElementById('ajax-loader').style.display='inline';
	}
}

function newCaptcha(){
	document.getElementById('captcha').src=document.getElementById('captcha').src + '&refresh='+Math.random();	
}

var tooltip=function(){
	var id = 'tt';
	var top = 3;
	var left = 3;
	var maxw = 250;
	var speed = 10;
	var timer = 20;
	var endalpha = 85;
	var alpha = 0;
	var tt,c,h;
	var ie = document.all ? true : false;
	return{
		show:function(v,w){
			if(tt == null){
				tt = document.createElement('div');
				tt.setAttribute('id',id);
				c = document.createElement('div');
				c.setAttribute('id',id + 'cont');
				
				tt.appendChild(c);
				
				document.body.appendChild(tt);
				tt.style.opacity = 0;
				tt.style.filter = 'alpha(opacity=0)';
				document.onmousemove = this.pos;				
			}
			tt.style.display = 'block';
			c.innerHTML = v;
			tt.style.width = w ? w + 'px' : 'auto';
			if(!w && ie){
				
				tt.style.width = tt.offsetWidth;
				
			}
			if(tt.offsetWidth > maxw){tt.style.width = maxw + 'px'}
			h = parseInt(tt.offsetHeight) + top;
			clearInterval(tt.timer);
			tt.timer = setInterval(function(){tooltip.fade(1)},timer);
		},
		pos:function(e){
			var u = ie ? event.clientY + document.documentElement.scrollTop : e.pageY;
			var l = ie ? event.clientX + document.documentElement.scrollLeft : e.pageX;
			tt.style.top = (u - h) + 'px';
			tt.style.left = (l + left) + 'px';
		},
		fade:function(d){
			var a = alpha;
			if((a != endalpha && d == 1) || (a != 0 && d == -1)){
				var i = speed;
				if(endalpha - a < speed && d == 1){
					i = endalpha - a;
				}else if(alpha < speed && d == -1){
					i = a;
				}
				alpha = a + (i * d);
				tt.style.opacity = alpha * .01;
				tt.style.filter = 'alpha(opacity=' + alpha + ')';
			}else{
				clearInterval(tt.timer);
				if(d == -1){tt.style.display = 'none'}
			}
		},
		hide:function(){
			if(tt){
				clearInterval(tt.timer);
				tt.timer = setInterval(function(){tooltip.fade(-1)},timer);
			}
		}
	};
}();

function setDefaultValue(){
	ext_slide_show();
	var temp=document.getElementById('domain').value;
	document.getElementById('domain').defaultValue='Enter a Domain Name for Analysis';
	if(temp!='')
		document.getElementById('domain').value=temp;
	else
		document.getElementById('domain').value=document.getElementById('domain').defaultValue;
	if(!document.getElementById('domain-home'))
		return;
	temp=document.getElementById('domain-home').value;
	document.getElementById('domain-home').defaultValue='Enter a Domain Name for Analysis';
	if(temp!='')
		document.getElementById('domain-home').value=temp;
	else
		document.getElementById('domain-home').value=document.getElementById('domain-home').defaultValue;
}
function setWhoisDefaultValue(){
	ext_slide_show();
	var temp=document.getElementById('whois_domain').value;
	document.getElementById('whois_domain').defaultValue='Whois Lookup';
	if(temp!='')
		document.getElementById('whois_domain').value=temp;
	else
		document.getElementById('whois_domain').value=document.getElementById('whois_domain').defaultValue;
}
function setDiffDefaultValue(){
	ext_slide_show();
	var temp=document.getElementById('diff_domain').value;
	document.getElementById('diff_domain').defaultValue='DiffStats - Enter a Domain Name';
	if(temp!='')
		document.getElementById('diff_domain').value=temp;
	else
		document.getElementById('diff_domain').value=document.getElementById('diff_domain').defaultValue;
}

function getHost(url) {
	url=url.toLowerCase();
	var host = url.replace(/^https{0,1}:\/\//,'');
	host = host.replace(/^www\./,'');
	host = host.replace(/^www[a-z,0-9,A-Z]\./,'');
	host = host.replace(/\/.*/,'');
	return host;
}
function focusSearch(obj){
	if(obj.value==obj.defaultValue)
		obj.value='';
	else
		obj.select();
}
function startSearch(obj){
	if(obj.value!='' && obj.value!=obj.defaultValue && obj.value.indexOf(' ')<0 && obj.value.indexOf('.')>0){
		var domain=getHost(obj.value);
		window.location="/webstats/"+domain;
	}
}
function startWhois(obj){
	if(obj.value!='' && obj.value!=obj.defaultValue && obj.value.indexOf(' ')<0 && obj.value.indexOf('.')>0){
		var domain=getHost(obj.value);
		window.location="/whois/"+domain;
	}
}

function startDiff(obj){
	if(obj.value!='' && obj.value!=obj.defaultValue && obj.value.indexOf(' ')<0 && obj.value.indexOf('.')>0){
		var domain=getHost(obj.value);
		window.location="/diffstats/"+domain;
	}
}

function blurSearch(obj){
	if(obj.value=='')
		obj.value=obj.defaultValue;
}
function gotoSocialWeb(bm){
	var url=escape(document.location);
	var title=escape(document.title);
	otherbms=new Array();
	otherbms['ybuzz']='http://buzz.yahoo.com/buzz?targetUrl='+url+'&headline='+title+'';
	otherbms['delicious']='http://del.icio.us/post?url='+url+'&title='+title+'';
	otherbms['digg']='http://digg.com/submit?phase=2&url='+url+'&title='+title+'';
	otherbms['diigo']='http://secure.diigo.com/post?url='+url+'&title='+title+'';
	otherbms['facebook']='http://www.facebook.com/share.php?u='+url+'&t='+title+'';
	otherbms['ff']='http://friendfeed.com/share?url='+url+'&title='+title+'';
	otherbms['gbuzz']='http://www.google.com/reader/link?url='+url+'&title='+title+'';
	otherbms['linkedin']='http://www.linkedin.com/shareArticle?mini=true&url='+url+'&title='+title+'&summary=&source=';
	otherbms['mixx']='http://www.mixx.com/submit?page_url='+url+'';
	otherbms['myspace']='http://www.myspace.com/Modules/PostTo/Pages/?l=3&u='+url+'&t='+title+'';
	otherbms['reddit']='http://reddit.com/submit?url='+url+'&title='+title+'';
	otherbms['stumble']='http://www.stumbleupon.com/submit?url='+url+'&title='+title+'';
	otherbms['technorati']='http://www.technorati.com/faves?add='+url+'';
	otherbms['twitter']='http://twitter.com/home?status=Check this Out:'+url+'|'+title+'';
	otherbms['evernote']='http://www.evernote.com/clip.action?url='+url+'&title='+title+'';
	otherbms['pickme']='http://www.pickmeweb.com/my-bookmarks/?add='+url;
	window.open(otherbms[bm],"_blank");
}

var isCtrl = false;
var isShift = false;
document.onkeyup=function(e){
	if(e.which == 17) isCtrl=false;
	if(e.which == 16) isShift=false;
}
document.onkeydown=function(e){
	if(e.which == 17) isCtrl=true;
	if(e.which == 16) isShift=true;
	if(e.which == 70 && isCtrl == true && isShift == true) {
		document.getElementById('domain').focus();
		document.getElementById('domain').select();
		return false;
	}
}

function WR_setcookie(name, value, expirydays) {
	if(WR_getcookie(name)!='false' && WR_getcookie(name)!='true' || value=='true'){
		expiry = new Date();
		expiry.setDate(expiry.getDate() + expirydays);
		document.cookie = name+"="+escape(value)+"; expires="+expiry.toGMTString()+"; domain=.webrankstats.com; path=/";
	}
}
function WR_getcookie(name) {
	start = document.cookie.indexOf(name+"=");
	end = document.cookie.indexOf(";", start); // First ; after start
	if (end == -1) end = document.cookie.length; // failed indexOf = -1
	return document.cookie.substring(start+name.length+1, end);
}

function tip_box_close(){
	WR_setcookie("tip-box-close","true",7);
	var obj=document.getElementById('tip-box');
	if(obj)
		obj.style.display="none";
}

var BrowserDetect = {
	init: function () {
		this.browser = this.searchString(this.dataBrowser) || "unknown";
	},
	searchString: function (data) {
		for (var i=0;i<data.length;i++)	{
			var dataString = data[i].string;
			var dataProp = data[i].prop;
			this.versionSearchString = data[i].versionSearch || data[i].identity;
			if (dataString) {
				if (dataString.indexOf(data[i].subString) != -1)
					return data[i].identity;
			}
			else if (dataProp)
				return data[i].identity;
		}
	},				
	dataBrowser: [
		{
			string: navigator.userAgent,
			subString: "Chrome",
			identity: "chrome"
		},					
		{
			string: navigator.userAgent,
			subString: "Firefox",
			identity: "firefox"
		}
		
	]
};

function tip_box_show(){
	if(WR_getcookie("tip-box-close")!='true'){
		BrowserDetect.init();
		var browser= BrowserDetect.browser;
		var addon='';
		if(browser=="firefox")
			addon='<li><a target="_blank" href="https://addons.mozilla.org/en-US/firefox/addon/52177/">Install WebRank Toolbar - Firefox Addon(New Version Launched)</a></li>';
		else if(browser=="chrome" && document.getElementById('WRSInstalled')==null)
			addon='<li><a target="_blank" href="https://chrome.google.com/extensions/detail/mkhilblbmkdnapffblmecglknalglfji">Install WebRank SEO - Chrome Extension</a></li>';
		document.write('<div id="tip-box" class="bottom-right tip-box">\n\
	<div class="tip-box-notification"></div>\n\
	<div class="tip-box-notification highlight ui-corner-all default" style="display: block;">\n\
		<div class="tip-box-close" onclick="tip_box_close()">×</div>\n\
		<div class="tip-box-header"></div>\n\
		<div class="tip-box-message">\n\
			<ul>\n\
				<li>Introducing HTTP Header and DNS Record Analysis in WebStats Page.</li>\n\
				<li><a target="_blank" style="color:#eaa523" href="https://market.android.com/details?id=com.probcomp.webrankstats">WebRank SEO Android App</a> Launched </li>\n\
				<li><a target="_blank" style="color:#eaa523" href="http://www.webrankstats.com/diff-stats/">DiffStats</a> - View difference in the statstics of the website.</li>\n\
				<li><a target="_blank" href="http://whois.webrankstats.com/">Get Whois information of the Websites.</a></li>\n\
				');
//<li><a target="_blank" href="http://www.techaloud.com/2010/06/adding-your-website-to-google-bing-yahoo/">Adding your website to Google, Bing and Yahoo!</a></li>
//<li>Boost your website speed using <a target="_blank" href="http://www.webrankstats.com/tools/javascript-compressor/">Javascript</a> and <a target="_blank" href="http://www.webrankstats.com/tools/css-compressor/">CSS</a> compressor tool.</li>\n\
		document.write('	'+addon);
		document.write('	</ul>\n\
		</div>\n\
	</div>\n\
</div>');
	}
}

function noThanks(){
	WR_setcookie("extensionCheck","true",7);
	var obj=document.getElementById('extensionCheck');
	if(obj)
		obj.style.display="none";
}

function ext_slide_show(){
	if(WR_getcookie("extensionCheck")!='true' && (document.getElementById('WRSInstalled')==null) && navigator.userAgent.match(/Chrome\/\d+/)){
		var obj=document.getElementById('extensionCheck');
		if(obj)
			obj.style.display='block';
	}
}

function ext_slide_hide(){
	var obj=document.getElementById('extensionCheck');
	if(obj)
		obj.style.display="none";
}
