
   //function for submitting search form egobox
function submitform()
{
 if(document.searchform.textfield.value=='' || document.searchform.textfield.value=='Jump to your favourite game')document.searchform.textfield.value='NULL';document.searchform.submit();

}

//functin for search form

   function searchcheck()
{
if(document.searchform.textfield.value=='')
{
document.searchform.textfield.style.color='white';
document.searchform.textfield.value='NULL';

return true;
}
else{
return true;

}
}


//function for submitting search form egobox
function submitegoform()
{
 if(document.searchegoform.textfield.value=='' || document.searchegoform.textfield.value=='Jump to your favourite game')document.searchegoform.textfield.value='NULL';document.searchegoform.submit();

}

//functin for search form

   function searchegocheck()
{
if(document.searchegoform.textfield.value=='')
{
document.searchegoform.textfield.style.color='white';
document.searchegoform.textfield.value='NULL';

return true;
}
else{
return true;

}
}


   function printegobox(mailcount,scrapcount,buddycount,favgamecount,userid)
   { 

   var wwwzapakPath = A1GAMES_SERVER_URL; //added by devendra to work in all pages	
   var myzapakPath = MY_SERVER_URL; //added by devendra to work in all pages
   var mailzapakPath = EMAIL_SERVER_URL; //added by devendra to work in all pages
   
   var egoboxcontent = '';

   egoboxcontent += '<div><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="padding: 0px 5px 5px 0px;" valign="bottom" width="10%" align="left" background="'+RESOURCE_SERVER_URL+'/a1games/images/sebg1.gif"><div id="avatar" style="background-color: rgb(255, 255, 255);"><a href="'+myzapakPath+'/a1prprofile.php" target="_top"><img style="margin: 0px 0px 0px -13px;" src="http://images.api.weeworld.com/zapak/'+ userid+'/weemee/scale/0.45.png?xPad=0&amp;yPad=-14&amp;showlogo=false" border="0"></a></div></td><td class="disT" valign="top" width="339" align="left" background="'+RESOURCE_SERVER_URL+'/a1games/images/sebg1.gif"><table width="100%" border="0" cellpadding="0" cellspacing="0"><tbody><tr><td colspan="5" class="loginbox disL" valign="middle" align="left" height="54"><table width="100%" border="0" cellpadding="0" cellspacing="0"><tbody><tr>';


 //  egoboxcontent += '<td class="bltxt01" valign="top" width="73" align="center"><a href="'+mailzapakPath+'/zapakmail.php" target="_top">Mails</a><br><span class="bltxt02"><a href="'+mailzapakPath+'/zapakmail.php" target="_top">'+mailcount+'&nbsp;</a></span></td><td valign="top" width="1" align="left" bgcolor="#adadad"><img src="'+RESOURCE_SERVER_URL+'/a1games/images/spacer.gif" width="1" height="1"></td>';


  egoboxcontent += '<td class="bltxt01" valign="top" width="73" align="center"><a href="'+myzapakPath+'/a1prmessages.php" target="_top">Scraps</a><br><span class="bltxt02"><a href="'+myzapakPath+'/a1prmessages.php" target="_top">'+scrapcount+'&nbsp;</a></span></td><td valign="top" width="1" align="left" bgcolor="#adadad"><img src="'+RESOURCE_SERVER_URL+'/a1games/images/spacer.gif" width="1" height="1"></td>';

 
 egoboxcontent += '<td class="bltxt01" valign="top" width="85" align="center"><a href="'+myzapakPath+'/a1prfavourite.php" target="_top">Favorites </a><br><span class="bltxt02"><a href="'+myzapakPath+'/a1prfavourite.php" target="_top">'+favgamecount+'&nbsp;</a></span></td><td valign="top" width="1" align="left" bgcolor="#adadad"><img src="'+RESOURCE_SERVER_URL+'/a1games/images/spacer.gif" width="1" height="1"></td>';
   
 
  egoboxcontent += '<td class="bltxt01" valign="top" width="77" align="center"><a href="'+myzapakPath+'/a1prbuddy.php" target="_top">Buddies</a><br><span class="bltxt02"><a href="'+myzapakPath+'/a1prbuddy.php" target="_top">'+buddycount+'&nbsp;</a></span></td>'; 
   
 
   egoboxcontent += '</tr></tbody></table></td></tr><tr><td valign="top" width="1%" align="left"><img src="'+RESOURCE_SERVER_URL+'/a1games/images/secorL.gif" width="8" height="30"></td><td valign="top" width="4%" align="left"><img src="'+RESOURCE_SERVER_URL+'/a1games/images/magni.gif" width="30" height="30"></td><td style="padding-left: 18px; padding-right: 18px;" valign="middle" width="82%" align="left" background="'+RESOURCE_SERVER_URL+'/a1games/images/tseBg.gif"><form action="'+wwwzapakPath+'/a1search.php" method="get" name="searchegoform" id="searchegoform" onsubmit="javascript:searchegocheck()" target="_top"><input name="select" value="ALL" type="hidden"><input name="type" value="GAME" type="hidden"><input name="startindex" value="0" type="hidden"><input name="rows" value="21" type="hidden"><input name="textfield" class="input" value="Jump to your favourite game" style="width: 200px; height: 18px;" onclick="document.searchegoform.textfield.value = \'\';" type="text" align="left"></form></td><td valign="middle" width="12%" align="left" background="'+RESOURCE_SERVER_URL+'/a1games/images/tseBg.gif"><a href="javascript:submitegoform();"><img src="'+RESOURCE_SERVER_URL+'/a1games/images/search.gif" width="56" border="0" height="11"></a></td><td valign="top" width="1%" align="left"><img src="'+RESOURCE_SERVER_URL+'/a1games/images/secorR.gif" width="7" height="30"></td></tr></tbody></table></td></tr></tbody></table>';
   egoboxcontent += '</div>';
 

document.getElementById("egobox").innerHTML = egoboxcontent;
	
   
   }



