function strpos (haystack, needle, offset)
{
var i = (haystack+'').indexOf(needle, (offset ? offset : 0));
return i === -1 ? false : i;
}
function replaceAll( str, from, to ) {
var idx = str.indexOf( from );
while ( idx > -1 ) {
str = str.replace( from, to );
idx = str.indexOf( from, idx+1 );
}
return str;
}
function addElement()
{
var ni = document.getElementById('checkform_div');
var newdiv = document.createElement('div');
var divIdName = 'sdiv';
newdiv.setAttribute('id',divIdName);
newdiv.innerHTML = '';
newdiv.style.position='absolute';
newdiv.style.border='1px dashed black';
newdiv.style.background='#FFFFFF';
newdiv.style.width='auto';
newdiv.style.zIndex=99;
newdiv.style.color='#6495ED';
newdiv.style.fontWeight='bold';
newdiv.style.display='none';
newdiv.style.maxHeight='100px';
newdiv.style.overflow="auto";
ni.appendChild(newdiv);
nodisplay=0;
}
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 "";
}
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 addSugestion(val)
{
val=val.replace(" ","");
val=val.replace("%20","");
var oldcook = getCookie('ymsgrsg');
if(strpos(oldcook,val,0)!==false)return;
var cook = oldcook + '1sep2' + escape(val);
setCookie('ymsgrsg',cook,30);
}
function delSugestion(val)
{
var oldcook = getCookie('ymsgrsg');
val = '1sep2'+escape(val);
var cook = oldcook.replace(val,"");
setCookie('ymsgrsg',cook,30);
}
function searchSugestion(val)
{
var sugestions = getCookie('ymsgrsg').split('1sep2');
var str='';
for( var i in sugestions )
{
if(sugestions[i]!='')
if(strpos(sugestions[i],val,0)!==false)
str = str + "
" + sugestions[i]+'
';
}
if(str==''||nodisplay==1)
document.getElementById('sdiv').style.display='none';
else
{
document.getElementById('sdiv').style.display='block';
document.getElementById('sdiv').innerHTML = str+"close";
}
}
function help()
{
alert("Hello if you can help us, we will always provide good services, If you are realy interested to help us you can help with:\n1. If you are a member of online communities tell them about my project.\n2. If you have a blog, write about my project and send me an email to put your website on Our friends\n3. You can send a mass message to your buddies list with a link to my website.");
}
function show()
{
var sugestions = getCookie('ymsgrsg').split('1sep2');
var str='';
for( var i in sugestions )
{
if(sugestions[i]!='')
str = str + "" + sugestions[i]+ " | x |
";
}
str=str+"
";
if(str==''||nodisplay==1)
document.getElementById('sdiv').style.display='none';
else
{
document.getElementById('sdiv').style.display='block';
document.getElementById('sdiv').innerHTML = str;
}
}
function initMakeup()
{
//alert("Hello, and sorry for this message, but we realy need your help to promote this website\nPlease tell about my website at least 2 friends.\nThis message will expire on: 28.03.2010 (And we are sorry for this message again)");
addElement();
document.getElementById('form1').setAttribute("autocomplete", "off");
document.getElementById('form1').onsubmit = function()
{
if(document.getElementById('aidi').value!='Enter Yahoo ID')addSugestion(document.getElementById('aidi').value);
show();
showmethemoney();
return false;
}
show();
document.getElementById('google_ads').style.zIndex=10;
document.getElementById('aidi').focus();
}
//check2.php
function showmethemoney()
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
{
alert ("Your browser does not support AJAX!");
return;
}
var url="check0.php";
idul=document.getElementById('aidi').value;
url=url+"?id="+idul;
url=url+"&key=9072524868";
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
return false;
}
function GetXmlHttpObject()
{
var xmlHttp=null;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
// Internet Explorer
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}
function stateChanged()
{
if (xmlHttp.readyState==1)
{
document.getElementById("results").innerHTML="This may take a few seconds. Please wait.

";
}
if (xmlHttp.readyState==4)
{
var tmp=xmlHttp.responseText.split("###");
var str=xmlHttp.responseText;
if(tmp[0]=="Your ip was banned. Reason: Too many checks from a single IP.") document.getElementById("results").innerHTML="!["+ tmp[0] +" avatar](http://img.msg.yahoo.com/avatar.php?yids="+ tmp[0] +") | Your ip was banned. Reason: Too many checks from a single IP.
 |
";
else
if(str.indexOf("###") > -1 )
{
//document.getElementById("results").innerHTML=xmlHttp.responseText;
if(tmp[1]=="working") document.getElementById("results").innerHTML="!["+ tmp[0] +" avatar](http://img.msg.yahoo.com/avatar.php?yids="+ tmp[0] +") | We work to upgrade our system. Please try again in a few minutes.
 |
";
else if(tmp[1]=="busy") document.getElementById("results").innerHTML="";
else document.getElementById("results").innerHTML="YOUR BUDDY IS "+ tmp[1] +"
!["+ tmp[0] +" avatar](http://img.msg.yahoo.com/avatar.php?yids="+ tmp[0] +") |
 |
";
}else document.getElementById("results").innerHTML="Server is Busy";
}
}