
var edushianchor_obj=document.getElementsByTagName('span');
var edushiflags=edushirnd_str(6,true,false,false);
edushiflags+=GetRandomNum(100000,1000000);
for(var i=0;i<edushianchor_obj.length;i++)
{
    edushianchor_classid=escape(edushianchor_obj[i].getAttribute('classid'));
    if(edushianchor_classid=='edushianchor')
    {
        setTimeout('edushianchor_getdata('+i+')',100);
    }
}

function edushianchor_getdata(index)
{
    edushianchor_city=escape(edushianchor_obj[index].getAttribute('city'));
    edushianchor_sitename=escape(edushianchor_obj[index].getAttribute('sitename'));
    edushianchor_address=escape(edushianchor_obj[index].getAttribute('address'));
    edushianchor_imgtype=escape(edushianchor_obj[index].getAttribute('imgtype'));
    edushianchor_type=escape(edushianchor_obj[index].getAttribute('type'));
    edushianchor_scriptobj=document.createElement('script');
    edushianchor_scriptobj.language='javascript';
    edushianchor_scriptobj.src='http://dw.edushi.com/dw.aspx?idIndex='+index+'&imgtype='+edushianchor_imgtype+'&type='+edushianchor_type+'&city='+edushianchor_city+'&sitename='+edushianchor_sitename+'&address='+edushianchor_address;
    document.body.appendChild(edushianchor_scriptobj);
 }

function edushianchor_show(index,inner)
{
    edushianchor_obj[index].innerHTML=inner;
    edushianchor_obj[index].style.display='';
}

function edushianchor_l(edushi_l,edushi_indexID)
{   if(edushi_indexID>=0)
    {   var edushi_siteName=escape(edushianchor_obj[edushi_indexID].getAttribute('sitename'));
        var edushi_address=escape(edushianchor_obj[edushi_indexID].getAttribute('address'));
        var url='http://dw.edushi.com/Default.aspx?edushi_l='+edushi_l+'&sitename='+edushi_siteName+'&address='+edushi_address+'&flags='+edushiflags+'&action=dw';
        setTimeout('edushianchor_exe(\''+url+'\')',1000);
     }
}

function edushianchor_c(keyword,anchor,city)
{   var edushi_Keyword=escape(keyword);
    var url='http://dwl.edushi.com/Default.aspx?&keyword='+edushi_Keyword+'&action=click';
    edushianchor_scriptc=document.createElement('script');
    edushianchor_scriptc.language='javascript';
    edushianchor_scriptc.src=url;
    document.body.appendChild(edushianchor_scriptc);
}

function edushianchor_exe(url)
{   edushianchor_scriptl=document.createElement('script');
    edushianchor_scriptl.language='javascript';
    edushianchor_scriptl.src=url;
    document.body.appendChild(edushianchor_scriptl);
}

//»ٌµأثو»ْ؛¯ت‎
function GetRandomNum(minNum,maxNum)
{return minNum+Math.round((Math.random()*(maxNum-minNum)));}

function edushirnd_str(str_0,str_1,str_2,str_3)
{   var Seed_array=new Array();
    var seedary;
    var i;
    Seed_array[0]=""
    Seed_array[1]="A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z";
    Seed_array[2]="a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z";
    Seed_array[3]="0,1,2,3,4,5,6,7,8,9";
    if(!str_1&&!str_2&&!str_3)
    {str_1=true;str_2=true;str_3=true;}
if(str_1){Seed_array[0]+=Seed_array[1];}
if(str_2){Seed_array[0]+=","+Seed_array[2];}
if(str_3){Seed_array[0]+=","+Seed_array[3];}
Seed_array[0]=Seed_array[0].split(",");seedary=""
for(i=0;i<str_0;i++)
{seedary+=Seed_array[0][Math.round(Math.random()*(Seed_array[0].length-1))]}
return(seedary);}
