document.write("<script type=text/javascript language=javascript src=http://ads.adhood.com/winwords/include/words.js?r="+Math.random()+"><\/script>");
document.write("<script type=text/javascript language=javascript src=http://ads.adhood.com/winwords/include/blockedurls.js><\/script>");
document.write('<div id="adhood_winwordsobj"></div>');
/* Main variables */
var winwordsmainfilelocations = "http://ads.adhood.com/winwords/include"			// Dosyaların nerede tutulduğu
var timeOutVal = 2000;				// Reklamın kaç saniye gösterileceği
var adhood_b_pw = 20 ;				// Reklam penceresinin yatay kenarlık toplamı
var adhood_b_phtop = 35;				// Reklam penceresinin dikey üst kenarlık mesafesi
var adhood_b_phbottom = 30;				// Reklam penceresinin dikey alt kenarlık mesafesi
var adhood_b_padding = 5;			// Reklam penceresinin iç boşluğu
var adhood_b_normStyle = "color: #008080; font-weight: bold;#008080;cursor:pointer;text-decoration: underline; ";		// Normal görünüm sitili
var adhood_b_overStyle = "color: #FF0000; font-weight: bold;#FF0000;cursor:pointer;text-decoration: underline;";		// Üzerine geldiğindeki sitil
var winwordsbboxlimit=6;					// En fazla gösterilecek reklam kelimesi limiti
var winwordsbboxwordlimit = true;    		// true:  Aynı kelime tekrarı engellenir || false: Aynı kelime tekrarı engellenmez
var winwordsbboxparagraphlimit = false; 	// true: Aynı paragrafta reklam tekrarı engellenir  ||  false: Aynı paragrafta reklam tekrarı engellenmez
var winwordslogo = winwordsmainfilelocations +"/images/winwords_logo.png"
var winwordsurl = "http://www.adhood.com";
var winwordbaloon = '<table border="0" cellspacing="0" cellpadding="0"><tr><td valign="bottom" width="2px" style="padding:0px"><div class="winwords_topleft" style="background: url('+winwordsmainfilelocations+'/img/palette.png) no-repeat -50px 0px; width:2px; height:22px;">&nbsp;</div></td><td class="winwords_top" valign="top" style="padding:0px;background-image: url('+winwordsmainfilelocations+'/img/bg_tb.png);background-position: 0px 13px; background-repeat:repeat-x; height:35px;"><span id="winwords_crs1{id}" class="winwords_crs1" style="{dis1}background: url() no-repeat -305px 0px; width:25px; height:14px;float:left;font-size:1px"></span><span id="winwords_crs2{id}" class="winwords_crs2" style="{dis2}background: url() no-repeat -330px 0px; width:30px; height:14px;float:right;font-size:1px"></span><div class="winwords_logo" style="float:left;width:100%; height:20px; background: url('+winwordsmainfilelocations+'/img/winwords_logo.png) no-repeat left center;"><div class="winwords_close" style="float:right;margin-top:5px;width:15px; height:9px; background: url('+winwordsmainfilelocations+'/img/winwords_close.gif) no-repeat left center; cursor:pointer" onclick="{closeme}"></div><a href="http://www.adhood.com" target="_blank" class="winwords_link" style="width:70px; height:20px;"><p style="width:70px;height:15px;cursor:pointer"></p></a></div></td><td valign="bottom" width="6px" style="padding:0px"><div class="winwords_topright" style="background: url('+winwordsmainfilelocations+'/img/palette.png) no-repeat -144px 0px; width:6px; height:22px;">&nbsp;</div></td></tr><tr><td class="winwords_left" style="width:2px;background-image:url('+winwordsmainfilelocations+'/img/bg_lr.png); background-repeat:repeat-y;"></td><td class="winwords_none" valign="top" id="_winwordscontent" style="padding:'+adhood_b_padding+'px;background-color: #ffffff;">{icerik}</td><td class="winwords_right" style="background-position: -94px 0px; width:6px;background-image:url('+winwordsmainfilelocations+'/img/bg_lr.png); background-repeat:repeat-y;"></td></tr><tr><td class="winwords_bottomleft" style="background: url('+winwordsmainfilelocations+'/img/palette.png) no-repeat -150px -14px; width:2px; height:27px;"></td><td class="winwords_bottom" valign="top" align="right" style="background: url('+winwordsmainfilelocations+'/img/bg_tb.png) 0px -64px; background-repeat:repeat-x;height:27px;"><div id="winwords_crs3{id}" class="winwords_crs3" style="{dis3}background: url('+winwordsmainfilelocations+'/img/palette.png) no-repeat -275px -10px; width:29px; height:17px;float:left;"></div><div id="winwords_crs4{id}" class="winwords_crs4" style="{dis4}background: url('+winwordsmainfilelocations+'/img/palette.png) no-repeat -245px -10px; width:30px; height:17px;float:right;"></div></td><td class="winwords_bottomright" style="background: url('+winwordsmainfilelocations+'/img/palette.png) no-repeat -44px -13px; width:2px;  height:27px;"></td></tr></table>';

/**********************/
var adhood_winword_mainobj
var adhood_bbox_pw = adhood_b_pw + adhood_b_padding;
var adhood_bbox_ph = adhood_b_phtop + adhood_b_padding + adhood_b_phbottom;
document.write("<style> ._winwordsNorm      { "+adhood_b_normStyle+" } ._winwordsOver      { "+adhood_b_overStyle+"  }</style>");
/********************Convert*************************/
var winwordsbboxcount=0;
var cTimers = new Array()
var highlighted_keywordids=new Array();
var str_highlighted_idpairs='';

function getElements() {
  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;
}

function winwords_matchAds(e)
{
	var chkobject = document.getElementById("adhood_winwordsobj");
	if(typeof(adhood_winwordsdiv)!='undefined') {
		adhood_winword_mainobj = document.getElementById(adhood_winwordsdiv);
	}	
	else if(chkobject.parentNode.tagName == "DIV" || chkobject.parentNode.tagName == "TD" || chkobject.parentNode.tagName == "SPAN")
	{

		adhood_winword_mainobj = chkobject.parentNode;
	}
	else
	{
		adhood_winword_mainobj = document.body 
	}
	try{
		obj = adhood_winword_mainobj;
		
		if(document.all)
		{
			tmp = obj.innerHTML;
		}
		else
		{
			if(!obj) obj = obj.childNodes[0];
			if(obj.innerHTML=="")obj = obj.childNodes[1];
			tmp=obj.innerHTML;        
		}            
	}
	catch(e)
	{
		return;
	}
	if(!winwords_CheckBadWords(tmp))
	{
		obj.innerHTML = winwords_markText(tmp);
		
	}              
}

function winwords_CheckBadWords(_inputHtml) 
{
    var AdhoodbadwordsFound = false;

    var inputHtml=fixTurkish(_inputHtml);
  
        
        for(var j=0 ;j<Adhoodbadwords.length;j++)
        {

			var pattern_forbadwords = new RegExp(fixTurkish(Adhoodbadwords[j]),'gi');
            if(inputHtml.search(pattern_forbadwords)!=-1)
            {
                AdhoodbadwordsFound = true;
				return AdhoodbadwordsFound;
                break;
				
            }       
        } 
	
	return AdhoodbadwordsFound;
}


function winwords_markText(inputHtml) 
{
    var re;
    var varMatches;
    var outHtml;
    var replaceText;
    var reptextarray = new Array();
    var keykontrol = new Array();       
    
    for (var k=0 ; k < winwords_Ads.length; k++)
    {
        kelime = winwords_Ads[k].word;
		reptextarray[k]="<span class=\"_winwordsNorm\" style=\""+adhood_b_normStyle+"\" onmouseover=\"this.className='_winwordsOver',adhoodShow_winwords('_winwords"+winwords_Ads[k].id+"','"+winwords_Ads[k].bid+"',"+winwords_Ads[k].w+","+winwords_Ads[k].h+",event,"+winwords_Ads[k].wid+")\" onmouseout=\"this.className='_winwordsNorm',adhoodHide_winwords('_winwords"+winwords_Ads[k].id+"')\" ><b>" + kelime +"</b></span>";
  
      
        keykontrol[k]=0;
    }
	   
    re=new RegExp("(\<[^>][^<]*\>)([^<]*)","g");
    outHtml=new String('');
    outHtmlTextPart=new String('');

    //var bboxcount=0;
    var str ='';
    var tagstr='';
          
    var strSearch = '';  
    var strOut1 = '';
    var strOut2 = '';
    
    var adText = '';
    
    var escape_tags=new Array('<A','<B>','<U','<H1','<H2','<H3','<H4','<H5','<H6','<EM','<STRONG','<TT','<IFRAME','<LAYER','<CODE','<OBJECT','<SELECT','<OPTION','<INPUT','<TEXTAREA','<SCRIPT','<NOSCRIPT','<SMALL');
    var escape_tag_found = false; 
    
   inputHtml = '<font></font>' + inputHtml ; 
   
   var reAnchorStart = new RegExp("<a","gi");

   var reAnchorEnd  = new RegExp("</a>","gi"); 
   var anchor_tag_found = false;   
    
   while ((varMatches = re.exec(inputHtml)) != null)
   {   
		outHtml+=varMatches[1]; 	/*html tag part*/
        str= varMatches[2];
        tagstr=varMatches[1]; 
        
         if(varMatches[1].search(reAnchorStart)!=-1)
         {
            anchor_tag_found=true;            
         }          
                
         if(anchor_tag_found)
         {
            if(varMatches[1].search(reAnchorEnd)!=-1)
            {
                anchor_tag_found=false;
            }    
         }        
          
          
          if(document.all)
          {
            if(str.length==0 || str.charCodeAt(0)==13 || str.charCodeAt(0)==10 || str.charCodeAt(1)==13 || str.charCodeAt(1)==10 )
            {            
                continue;
            }
          }
         
         escape_tag_found = false; 
         
         for(i=0;i<escape_tags.length;i++)
         { 
            var pattern_escape_tags = new RegExp(escape_tags[i],'i');
            if(tagstr.search(pattern_escape_tags)!=-1)
            {
                escape_tag_found = true;
                break;
            }
         }         
          
        strSearch = fixTurkish(str);  
        outHtmlTextPart =  str;
       
            for (k=0; k < winwords_Ads.length; k++) 
            {
			   var chg=reptextarray[k];
                
               
                adText = winwords_Ads[k].word;
                                

	                var pattern = new RegExp('\\b'+ adText +'\\b','gi');            
					var testPattern=pattern.exec(strSearch);
	 
					var pattern2 = new RegExp(adText +'\\W','gi');            
					var testPattern2=pattern2.exec(strSearch);					
					
                if((testPattern!=null && testPattern2!=null))
                {
                   
				   if(escape_tag_found || anchor_tag_found)
                    {
                        break;
                    }           
                
	                if ((!itemDetection(highlighted_keywordids,winwords_Ads[k].id) || winwordsbboxwordlimit != true) && (winwordsbboxcount<winwordsbboxlimit))
	                {
						highlighted_keywordids.push(winwords_Ads[k].id);
		                
		                if(str_highlighted_idpairs=='')
		                {
		                    str_highlighted_idpairs = winwords_Ads[k].adid + '|' + winwords_Ads[k].id ;
		                }
		                else
		                {
		                    str_highlighted_idpairs = str_highlighted_idpairs + ',' + winwords_Ads[k].id ;
		                }
		                
		                var matchedText = testPattern[0];
		                matchedText = matchedText.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
		                
		                strOut1 = strSearch.substr(0,testPattern.index);
		                strOut2 = strSearch.substr(testPattern.index);             
	                
		                matchedText = fixTurkishFix(matchedText);
		                
		                strOut1 = fixTurkishFix(strOut1);
		                strOut2 = fixTurkishFix(strOut2);
						
   		                strSearch=decodeURI(fixTurkish(strOut1)) + decodeURI(fixTurkish(strOut2).replace(matchedText , chg.replace(winwords_Ads[k].word,matchedText))); 
   		                
						outHtmlTextPart=decodeURI(strOut1) + decodeURI(strOut2.replace(matchedText , chg.replace(winwords_Ads[k].word,matchedText)));
   		                
		                winwordsbboxcount++;
		               if(winwordsbboxparagraphlimit == true) { break; }
	                }
		        }
            }
        outHtml+=outHtmlTextPart;  
   }  

   return outHtml;
}

function fixTurkish(strText)
{   
    strText=strText.replace(/i/g,"c4b0");
    strText=strText.replace(/İ/g,"C4B0");    
    strText=strText.replace(/ı/g,"c4b1");
    strText=strText.replace(/I/g,"C4B1");
    strText=strText.replace(/ü/g,"c3bc");
    strText=strText.replace(/Ü/g,"C3BC");
    strText=strText.replace(/ğ/g,"c49f");
    strText=strText.replace(/Ğ/g,"C49F");
    strText=strText.replace(/ş/g,"c59f");
    strText=strText.replace(/Ş/g,"C59F");
    strText=strText.replace(/ç/g,"c3a7");
    strText=strText.replace(/Ç/g,"C3A7");
    strText=strText.replace(/ö/g,"c3b6");
    strText=strText.replace(/Ö/g,"C3B6");

    return strText;
}

function fixTurkishFix(strText)
{ 
    strText=strText.replace(/c4b0/g,"i");       //i
    strText=strText.replace(/C4B0/g,"%C4%B0");  //İ
    strText=strText.replace(/c4b1/g,"%C4%B1");  //ı
    strText=strText.replace(/C4B1/g,"I");       //İ
    strText=strText.replace(/c3bc/g,"%C3%BC");  //ü
    strText=strText.replace(/C3BC/g,"%C3%9C");  //Ü
    strText=strText.replace(/c49f/g,"%C4%9F");  //ğ
    strText=strText.replace(/C49F/g,"%C4%9E");  //Ğ
    strText=strText.replace(/c59f/g,"%C5%9F");  //ş
    strText=strText.replace(/C59F/g,"%C5%9E");  //Ş
    strText=strText.replace(/c3a7/g,"%C3%A7");  //ç
    strText=strText.replace(/C3A7/g,"%C3%87");  //Ç
    strText=strText.replace(/c3b6/g,"%C3%B6");  //ö
    strText=strText.replace(/C3B6/g,"%C3%96");  //Ö
    return strText;
}

function winwords_toTurkish(strText)

{ 
    strText=strText.replace(/İ/g,"&#304;");    
    strText=strText.replace(/ı/g,"&#305;");
    strText=strText.replace(/ü/g,"&#252;");
    strText=strText.replace(/Ü/g,"&#220;");
    strText=strText.replace(/ğ/g,"&#287;");
    strText=strText.replace(/Ğ/g,"&#286;");
    strText=strText.replace(/ş/g,"&#351;");
    strText=strText.replace(/Ş/g,"&#350;");
    strText=strText.replace(/ç/g,"&#231;");
    strText=strText.replace(/Ç/g,"&#199;");
    strText=strText.replace(/ö/g,"&#246");
    strText=strText.replace(/Ö/g,"&#214;");
    return strText;
}
function itemDetection(originalArray, itemToDetect)
{
    var j=0;
 	while (j < originalArray.length)
 	 {
 	 		if (originalArray[j] == itemToDetect)
 	 		 {
 	 		    return true;
 	 		 } 
 	 		 j++;
 	}
 	return false;
}


var winwordlibJS = {
    addEvent: function(obj,type,fn)
    {
        if (obj.addEventListener)
        {
            obj.addEventListener(type,fn,false);
            return true;
        }
        else if (obj.attachEvent) 
        {
            obj['e'+type+fn] = fn;
            obj[type+fn] = function() { obj['e'+type+fn](window.event);}
            var r = obj.attachEvent('on'+type, obj[type+fn]);
            return r;
        }
        else
        {
            obj['on'+type] = fn;
            return true;
        }
    }
}

/**********************Creat***************************/
  
	
function adhoodShow_winwords(nesne,bid,width,height,evt,wid)
{
	var m=0;
	
	if(m == 0)
	{ 
		for ( var h in cTimers ) 	
		{ 
		    try
		    {
		    clearTimeout(cTimers[h]);
		    document.getElementById(h).style.display = 'none'; 
		    }
		    catch(err)
			{
			}
		}
		
		 
		if (document.getElementById(nesne) == undefined)
		{
		    var divTag = document.createElement("div");
		    divTag.id = nesne;
		    divTag.style.position = "absolute";
		    adhood_winword_mainobj.appendChild(divTag);	
		    divTag.onmouseover = function () { clearTimeout(cTimers[nesne]);}
		    divTag.onmouseout = function () { adhoodHide_winwords(nesne);}
			createobj = true;
		} else {createobj = false;}

		var node = (evt.target) ? evt.target : ((evt.srcElement)?evt.srcElement : null );
		evt = (evt) ? evt : ((event) ? event : null);
		xpo = evt.clientX;
		ypo = evt.clientY;
		boxmustleft = (width+adhood_bbox_pw);
		boxmusttop = (height+adhood_bbox_ph);

    var scrOfX = 0, scrOfY = 0;
	if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
        //DOM compliant
        scrOfY = document.body.scrollTop;
        scrOfX = document.body.scrollLeft;
    }else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
        //IE6 standards compliant mode
        scrOfY = document.documentElement.scrollTop;
        scrOfX = document.documentElement.scrollLeft;
    } 



		if(xpo < boxmustleft)
		{
			if(ypo < boxmusttop)
			{
				objectTop = ypo + scrOfY+10;
				objectLeft = xpo + scrOfX+10;
				showobj = "{dis1}";
				showobj_exist = '1';
			}
			else
			{
				objectTop = (ypo - boxmusttop) + scrOfY - 10;
				objectLeft = xpo + scrOfX - 10 ;
				showobj = "{dis3}";
				showobj_exist = '3';
			}
		}
		else
		{
			if(ypo < boxmusttop)
			{
				objectTop = ypo + scrOfY + 10;
				objectLeft = (xpo - (boxmustleft)) + scrOfX - 20;
				showobj = "{dis2}";
				showobj_exist = '2';
			}
			else
			{
				objectTop = (ypo - boxmusttop) + scrOfY-10;
				objectLeft = (xpo - (boxmustleft)) + scrOfX-20;
				showobj = "{dis4}";
				showobj_exist = '4';
			}	
		
		}
		
		if(createobj == true) {
			var winwordsdata = winwordbaloon;
			winwordsdata = winwordsdata.replace('{icerik}', "<iframe id='adhood_winwordsframe"+wid+"' width='"+width+"' height='"+height+"' scrolling='no' marginheight='0' marginwidth='0' frameborder='0' src=''></iframe>");
			winwordsdata = winwordsdata.replace('{closeme}', 'document.getElementById(\''+nesne+'\').style.display=\'none\'');
			winwordsdata = winwordsdata.replace('{dis1}', '');
			winwordsdata = winwordsdata.replace('{dis2}', '');
			winwordsdata = winwordsdata.replace('{dis3}', 'display:none;');
			winwordsdata = winwordsdata.replace('{dis4}', 'display:none;');			
			winwordsdata = winwordsdata.replace('{id}', wid);
			document.getElementById(nesne).innerHTML = null;
			document.getElementById(nesne).innerHTML = winwordsdata;
		} 
		else
		{
			
		}
		
		document.getElementById(nesne).style.left = objectLeft + "px";
		document.getElementById(nesne).style.top = objectTop + "px";
		document.getElementById(nesne).style.display='block';
		if(createobj == true) {
			document.getElementById("adhood_winwordsframe"+wid).contentWindow.document.write("<script type=text/javascript language=javascript src=http://www.adhood.com/adserver/ad.php?zid="+zid+"&bid="+bid+"&wid="+wid+"><\/script>");
			if (navigator.appName.indexOf('Microsoft') != -1) { } else {
				document.getElementById("adhood_winwordsframe"+wid).contentWindow.document.close();
			}
		}
	}
}	

function adhoodHide_winwords(nesne)
{
	try
	{
		cTimers[nesne] = setTimeout(adhoodHideDiv, timeOutVal);
	}
	catch(err)
	  {
	  }
	
}
function adhoodHideDiv()
{
		for ( var h in cTimers ) 	
		{ 
		    try
		    {
				clearTimeout(cTimers[h]);
				document.getElementById(h).style.display = 'none';
		    }
		    catch(err)
			{
			}
		}

}

/*****************Run************************/ 
winwordlibJS.addEvent(window,'load', winwords_matchAds);