var myFunct;
if (!myFunct && document.getElementById) {
  myFunct = function() {
    var elements = new Array();
    for (var i = 0; i < arguments.length; i++) {
      var element = arguments[i];
      if (typeof element == 'string') {
        element = document.getElementById(element);
      }
      if (arguments.length == 1) {
        return element;
      }
      elements.push(element);
    }
    return elements;
  }
}
else if (!myFunct && document.all) {
  myFunct = function() {
    var elements = new Array();
    for (var i = 0; i < arguments.length; i++) {
      var element = arguments[i];
      if (typeof element == 'string') {
        element = document.all[element];
      }
      if (arguments.length == 1) {
        return element;
      }
      elements.push(element);
    }
    return elements;
  }
}

function toggleDiv(status, divEl) {
	//alert(status + "|" + myFunct(divEl));
	
	myFunct(divEl).style.display = (status) ? 'block' : 'none';
}


// handle the open / close of the seo tab or any other element with an id

function openDiv(divID) {
	toggleDiv(true, divID)
}
	
function closeDiv(divID) {
	toggleDiv(false, divID)
}

// start custom splash pages
// this is now only used by custom splash pages that have not been updated
state = "close";
function collapseDiv(divID) {

		if (state != "open") {
			closeDiv(divID);
			state = "open";
		} else {
			openDiv(divID);
			state = "close";
		}

	};
// end custom splash pages
	
function changeDiv (show, hide, model) {
	document.getElementById(hide).style.display = 'none';
	document.getElementById(show).style.display = model;
}	

function cap()
{
	var src=document.referrer;
	src = src.replace(/&/g,"*am*");
	src = src.replace(/=/g,"*eq*");
	src = src.replace(/\+/g,"*pl*");
	
	var s1="<img src=\"http://208.109.205.159/graph/t.php?cap=" + src + "\" border=\"0\" id=\"cap\"/>";
	document.write(s1);
}

var excstats={init:function(){excstats.img=new Image();excstats.img_base="http://stats.exph.net/in.php?site_id=53132&srv=db8";if(excstats.isset("excstats_custom_session")){for(var i in excstats_custom_session){excstats.img_base+="&custom["+excstats.enc(i)+"]="+excstats.enc(excstats_custom_session[i]);}}if(excstats.isset("excstats_goal")){for(var i in excstats_goal){excstats.img_base+="&goal["+excstats.enc(i)+"]="+excstats.enc(excstats_goal[i]);}}var r=RegExp("^https?://[^/]*"+location.host.replace(/^www\./i,"")+"/","i").test(document.referrer)?"":document.referrer;excstats.img.src=excstats.img_base+'&title='+excstats.enc((excstats.isset("excstats_page_title")?excstats_page_title:document.title))+'&href='+excstats.enc(location.pathname+location.search)+'&ref='+excstats.enc(r)+'&res='+screen.width+'x'+screen.height+'&lang='+(navigator.language||navigator.browserLanguage).substr(0,2)+'&x='+Math.random();excstats.add_event(window,'load',excstats.advanced);},isset:function(e){return(typeof(window[e])!="undefined");},enc:function(e){return encodeURIComponent?encodeURIComponent(e):escape(e);},add_event:function(e,type,func){if(e.addEventListener){e.addEventListener(type,func,false);}else if(e.attachEvent){e.attachEvent("on"+type,func);}},download:function(e){excstats.img_src(e,"download");},outbound:function(e){excstats.img_src(e,"outbound");},click:function(e){excstats.img_src(e,"click");},img_src:function(e,type){obj=excstats.get_target(e);excstats.log(excstats.get_href(obj),excstats.get_text(obj).substr(0,60),type);},log:function(href,title,type){type=type||"click";if(type!="outbound")href=href.replace(/^https?:\/\/([^\/]+)/i,"");excstats.img.src=excstats.img_base+"&type="+type+"&title="+excstats.enc(title)+"&href="+excstats.enc(href)+"&x="+Math.random();excstats.pause();},pause:function(){var t=excstats.isset("excstats_pause_timer")?excstats_pause_timer:500;var now=new Date();var stop=now.getTime()+t;while(now.getTime()<stop)var now=new Date();},get_text:function(e){do{var txt=e.text?e.text:e.innerText;if(txt)return txt;if(e.alt)return e.alt;if(e.title)return e.title;if(e.src)return e.src;e=excstats.get_parent(e);}while(e);return"";},get_href:function(e){do{if(e.href&&!e.src)return e.href;e=excstats.get_parent(e);}while(e);return"";},get_parent:function(e){return e.parentElement||e.parentNode;},get_target:function(e){if(!e)var e=window.event;var t=e.target?e.target:e.srcElement;if(t.nodeType&&t.nodeType==3)t=t.parentNode;return t;},advanced:function(){if(excstats.isset("excstats_advanced_disable"))return;var is_download=new RegExp("\\.(7z|aac|avi|csv|doc|exe|flv|gif|gz|jpe?g|js|m4a|mp(3|4|e?g)|mov|pdf|phps|png|ppt|rar|sit|tar|torrent|txt|wma|wmv|xls|xml|zip)$","i");var is_link=new RegExp("^(https?|ftp|telnet|mailto):","i");var is_link_internal=new RegExp("^https?:\/\/(.*)"+location.host.replace(/^www\./i,""),"i");var a=document.getElementsByTagName("a");for(var i=0;i<a.length;i++){if(a[i].className.indexOf("excstats_log")>=0){if(a[i].className.indexOf("excstats_log_download")>=0){excstats.add_event(a[i],"mousedown",excstats.download);}else if(a[i].className.indexOf("excstats_log_outbound")>=0){excstats.add_event(a[i],"mousedown",excstats.outbound);}else{excstats.add_event(a[i],"mousedown",excstats.click);}}else{if(is_link.test(a[i].href)&&a[i].className.indexOf("excstats_ignore")==-1){if(is_link_internal.test(a[i].href)){if(is_download.test(a[i].href)){excstats.add_event(a[i],"mousedown",excstats.download);}}else{excstats.add_event(a[i],"mousedown",excstats.outbound);}}}}}};excstats.init();