
//params here
var alter_skipinternal=0;
var alter_skipexternal=0;
var alter_maxlinks=999;
var alter_maxvisits=1000; // in same day
var alter_maxvisitstotal=50000; // in this month
var img_url= " <FONT title='Bu link goinger.com reklami icerir'>(go)</font>"

function setCookie(c_name,value,expiredays)
{
  var exdate=new Date();
  exdate.setDate(exdate.getDate()+expiredays);
  document.cookie=c_name+ "=" +escape(value)+((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

function getCookie(c_name)
{
  if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    { 
    c_start=c_start + c_name.length+1; 
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    } 
  }
  return 0;
}

function convertLinks(our_url,skip_internal,skip_external,max_links,max_visits,max_visits_total)
{
    // finding out how many times user visited
    var visits_today="alter_counter_today_"+document.domain;
    var counter_today=parseInt(getCookie(visits_today));
    
    var visits_total="alter_counter_total_"+document.domain;
    var counter_total=parseInt(getCookie(visits_total));

    // user visit many times same domain?
    if(counter_today>=max_visits)return; 
    if(counter_total>=max_visits_total)return;
    
    // update cookie , valid 1 day
    setCookie(visits_today,counter_today+1,1);
    setCookie(visits_total,counter_total+1,30);


    converted=0;
	for (i=0; i<document.links.length; i++) 
	{
	    // skip with rel=disable
	    if(document.links[i].rel=="no_goinger") continue;
	    
	    // enable only some rels if wanted
	    // if(document.links[i].rel!="yes_goinger") continue;
	   
	    // skip if it is a javascript link
	    if(document.links[i].href.indexOf("avascrip")>0) continue;
	   
	    // skip if it is a mailto link
	    if(document.links[i].href.indexOf("@")>0) continue;
	   
	    // skip if it is an empty link
	    if(document.links[i].href.indexOf("#")>0) continue;
	    
	    // skip if it is not a link
	    if(document.links[i].shape!="") continue;
	    if(document.links[i].coords!="") continue;
	    
	    // exceptions
	    
	    // skip internal links
	    // skip_internal if(document.links[i].href.indexOf("www.selcukecza.com")>0) continue;

	    // skip external links
	    // skip_external if(document.links[i].href.indexOf("www.selcukecza.com")<1) continue;
	    
	    // skip internal links (same domain)?
	    // if(skip_internal  &&  (document.links[i].host==document.domain)) continue;

	    // skip external links 
	    // if(skip_external  &&  (document.links[i].host!=document.domain)) continue;
	    
	    // if(document.links[i].href=="http://www.hostbul.net") continue;

	    // may convert
	    
		var baglanti_obegi = document.links[i].innerHTML;

		document.links[i].href=our_url+'/1411/'+escape(document.links[i].href);

		document.links[i].title = 'Bu link goinger.com reklami icerir';

		// add some html in title 
		document.links[i].innerHTML = baglanti_obegi;

		// must stop?
		converted++;
		if(converted>=max_links)break;
    }
}
//usage 
convertLinks("http://goinger.com",alter_skipinternal,alter_skipexternal,alter_maxlinks,alter_maxvisits,alter_maxvisitstotal)


document.write("<img src=http://base.goinger.com/c.asp?i=1411&tf=kja9j3kass3HRH32jk2 width=0 height=0 border=0>")
//Splash Page script- http://www.dynamicdrive.com/
//Created: August 17th, 2007'

var splashpage={
// Splash Page Script Activation (1=enabled, 0=completely disabled!)
splashenabled: 1,

//1) URL to file on your server to display as the splashpage
splashpageurl: "http://goinger.com/1411/adonload/http://www.goinger.com",

//2) Enable frequency control? (1=yes, 0=no)
enablefrequency: 1,

//3) display freqency: "sessiononly" or "x days" (string value). Only applicable if 3) above is enabled
displayfrequency: "2 days",

//4) HTML for the header bar portion of the Splash Page
// Make sure to create a link that calls "javascript:splashpage.closeit()")
// An IE bug means you should not right align any image within the bar, but instead use "position:absolute" and the "right" attribute

defineheader: '<br><div style="padding: 5px; color: white; font: bold 16px Arial; "><table width=80% border=0 align=center bgcolor=white><tr><td width=20% ><a href=http://www.goinger.com target=_blank><font face=arial size=2 color=gray>Goinger.com reklami</font></a></td><td width=60% align=center><font face=arial size=2 color=black>Reklam 8 saniye icerisinde kapanacaktir</font></td><td align=right width=20% ><a href="javascript:splashpage.closeit()" title="Reklamę kapat"><font face=arial size=2 color=black>Reklami kapat</font></a></td></tr></table></div><br>',

//5) cookie setting: ["cookie_name", "cookie_path"]
cookiename: ["splashpagecookie", "path=/"],

//6) Auto hide Splash Page after x seconds (Integer value, 0=no)?
autohidetimer: 10,

////No need to edit beyond here//////////////////////////////////

launch:false,
browserdetectstr: (window.opera&&window.getSelection) || (!window.opera && window.XMLHttpRequest), //current browser detect string to limit the script to be run in (Opera9 and other "modern" browsers)

output:function(){
	document.write('<div id="slashpage" style="position: absolute; z-index: 100; color: white; background: url(http://www.goinger.com/img/transparent3.gif) repeat;">') //Main splashpage container
	document.write(this.defineheader) //header portion of splashpage
	document.write('<center><iframe name="splashpage-iframe" src="about:blank" style="margin:0; padding:0; width:800px; height: 550px" align=center valign=top frameborder=0></iframe></center>') //iframe
	document.write('<br />&nbsp;</div>')
	this.splashpageref=document.getElementById("slashpage")
	this.splashiframeref=window.frames["splashpage-iframe"]
	this.splashiframeref.location.replace(this.splashpageurl) //Load desired URL into splashpage iframe
	this.standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body
	if (!/safari/i.test(navigator.userAgent)) //if not Safari, disable document scrollbars
	this.standardbody.style.overflow="hidden"
	this.splashpageref.style.left=0
	this.splashpageref.style.top=0
	this.splashpageref.style.width="100%"
	this.splashpageref.style.height="100%"
	this.moveuptimer=setInterval("window.scrollTo(0,0)", 50)
},

closeit:function(){
	clearInterval(this.moveuptimer)
	this.splashpageref.style.display="none"
	this.splashiframeref.location.replace("about:blank")
	this.standardbody.style.overflow="auto"
},

init:function(){
	if (this.enablefrequency==1){ //if frequency control turned on
		if (/sessiononly/i.test(this.displayfrequency)){ //if session only control
			if (this.getCookie(this.cookiename[0]+"_s")==null){ //if session cookie is empty
				this.setCookie(this.cookiename[0]+"_s", "loaded")
				this.launch=true
			}
		}
		else if (/day/i.test(this.displayfrequency)){ //if persistence control in days
			if (this.getCookie(this.cookiename[0])==null || parseInt(this.getCookie(this.cookiename[0]))!=parseInt(this.displayfrequency)){ //if persistent cookie is empty or admin has changed number of days to persist from that of the stored value (meaning, reset it)
				this.setCookie(this.cookiename[0], parseInt(this.displayfrequency), parseInt(this.displayfrequency))
				this.launch=true
			} 
		}
	}
	else //else if enablefrequency is off
		this.launch=true
	if (this.launch){
		this.output()
		if (parseInt(this.autohidetimer)>0)
			setTimeout("splashpage.closeit()", parseInt(this.autohidetimer)*1000)
	}
},

getCookie:function(Name){
	var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair
	if (document.cookie.match(re)) //if cookie found
		return document.cookie.match(re)[0].split("=")[1] //return its value
	return null
},

setCookie:function(name, value, days){
	var expireDate = new Date()
	//set "expstring" to either an explicit date (past or future)
	if (typeof days!="undefined"){ //if set persistent cookie
		var expstring=expireDate.setDate(expireDate.getDate()+parseInt(days))
		document.cookie = name+"="+value+"; expires="+expireDate.toGMTString()+"; "+splashpage.cookiename[1] //last portion sets cookie path
	}
else //else if this is a session only cookie setting
	document.cookie = name+"="+value+"; "+splashpage.cookiename[1] //last portion sets cookie path
}

}

if (splashpage.browserdetectstr && splashpage.splashenabled==1)
	splashpage.init()
