var fortune = new Array()
fortune[0]='Today is the most fortunate day; stars are in your favor.'
fortune[1]='Your leadership quality brings you an incredible opportunity.'
fortune[2]='This is your lucky week. Enjoy it.'
fortune[3]='Never be hesitant to speak your mind.'
fortune[4]='You will have some trouble; smart thinking can only help!'
fortune[5]='You may have to start everything allover again.'
fortune[6]='Sometimes silence is better than thousand words.'
fortune[7]='Do just what your conscious prompts.'
fortune[8]='You will meet an intelligent, good-looking stranger today.'
fortune[9]='You have a talent for reading people.'
fortune[10]='Give advice only when asked.'
fortune[11]='Look at the sunny side of everything. Be Optimistic.'
fortune[12]='Forget the mistakes of the past your future is bright.'
fortune[13]='You are going to do something special this weekend.'
fortune[14]='Creative imagination is your asset. Use it'
fortune[15]='Watch your actions today, you are being watched.'
fortune[16]='An old friendship will revive this week.'
fortune[17]='You look great, and you know it!'
fortune[18]='Self-confidence in you, is what people are looking at.'
fortune[19]='Today is just the right time for you to finish pending work.'
fortune[20]='Luck is not every thing that is needed for success.'
fortune[21]='Your hard work will pay off. Have heart.'
fortune[22]='Your life may be bit hectic right now. Stay put.'
fortune[23]='Pamper yourself with goodies today. You deserve it.'
fortune[24]='Put on your best behavior today.'
fortune[25]='Every thing you say or do today might become an issue.'
fortune[26]='You have a million reasons to be happy today.'
fortune[27]='You have been feeling guilty; apologize now.'
fortune[28]='Many ways to impress your boss, a smile is just one of it.';
fortune[29]='Prepare yourself for a big change in your personal life.';
fortune[30]='Love looks promising.';
fortune[31]='Good times are just round the corner.';
fortune[32]='Your gaurdian angel is watching over you.';
fortune[33]='Have patience, good fortune in on its way.';
fortune[34]='Watch out! you have many envious eyes around you.';
fortune[35]='Listen to your heart. It will guide you.';
fortune[36]='Help a friend today.';
fortune[37]='This is your testing period, it will pass.';
fortune[38]='A new love will enter your life soon.';


var luck1=0
var luck2=0
var luck3=0

function getRandom() {
  var tmp= Math.floor(38*Math.random())
  if(tmp<38)
  {
  return tmp
  }

} 

function getCookie(Name)
{
          var search = Name + "="
          if (document.cookie.length > 0)
          { // if there are any cookies
                    offset = document.cookie.indexOf(search)
                    if (offset != -1)
                    { // if cookie exists
                              offset += search.length
                              // set index of beginning of value
                              end = document.cookie.indexOf(";", offset)
                              // set index of end of cookie value
                              if (end == -1)
                                        end = document.cookie.length
                              return unescape(document.cookie.substring(offset, end))
                    }
          }
}

function set(luck)
	{
	 var expiry=new Date()
	 expiry.setTime(expiry.getTime()+(24*60*60*1000));
	 var cookval1="fortune="+luck +"; path=/; expiry=" + expiry.toGMTString();
	 //alert(cookval1)
	 document.cookie=cookval1;
	}
	
	function kill()
 {
	 var expires=new Date()
	 expires.setTime(expires.getTime()+(-60*(60*1000)));
	 var cookval="fortune='' ; path=/; expires=" + expires.toGMTString();
	 document.cookie=cookval;
	
 }



function soothsayer(where,what)
{
	var fate = '<table width="185" bgcolor="white"><tr><td><font face="Arial" size="2" color="black"><b>'+fortune[what]+'</b></font></td></tr></table>'
	if(document.layers)
	{
		which=eval("document."+where+".document")
		which.open()
		which.write(fate)
		which.close()
	}
	
	if(document.all)
	{
		which = eval("document.all."+where)
		which.innerHTML=fate
	}
	
}


var ns4 = (document.layers)? true:false
	var ie4 = (document.all)? true:false
	var totalwidth=200
	var totalheight=110
	var iSclippingW=false
	var iSclippingH=false
	var top=53
	var tmp=5
	var flag=0
	
		
function clipValues(obj,which) {
        if (ns4) {
                if (which=="t") return obj.clip.top
                if (which=="r") return obj.clip.right
                if (which=="b") return obj.clip.bottom
                if (which=="l") return obj.clip.left
        }
        else if (ie4) {
                var clipv = obj.clip.split("rect(")[1].split(")")[0].split("px")
                if (which=="t") return Number(clipv[0])
                if (which=="r") return Number(clipv[1])
                if (which=="b") return Number(clipv[2])
                if (which=="l") return Number(clipv[3])
        }
}

function clipTo(obj,t,r,b,l,setwidth) {
        if (ns4) {
                obj.clip.top = t
                obj.clip.right = r
                obj.clip.bottom = b
                obj.clip.left = l
        }
       else if (ie4) 
		{
		obj.clip = "rect("+t+"px "+r+"px "+b+"px "+l+"px)"
			if(setwidth)
			{
			obj.width=r; obj.height=b
			}
		}
}

function clipBy(obj,t,r,b,l,setwidth) {
        if (ns4) {
                obj.clip.top = clipValues(obj,'t') + t
                obj.clip.right = clipValues(obj,'r') + r
                obj.clip.bottom = clipValues(obj,'b') + b
                obj.clip.left = clipValues(obj,'l') + l
        }
        else if (ie4) 
		{
		var at=clipValues(block,'t')+t
		var ar=clipValues(block,'r')+r
		var ab=clipValues(block,'b')+b
		var al=clipValues(block,'l')+l

		clipTo(obj,at,ar,ab,al,setwidth)
		/*obj.clip = "rect("+(this.clipValues(obj,'t')+t)+"px "+(this.clipValues(obj,'r')+r)+"px "+Number(this.clipValues(obj,'b')+b)+"px "+Number(this.clipValues(obj,'l')+l)+"px)"
			if(setwidth)
			{
			obj.width=clipValues(obj,'r')+r; 
			obj.height=clipValues(obj,'b')+b
			}*/
		}
}




function scrollforward()
{
		if(clipValues(block,"r")<totalwidth)
		{
			clipBy(block,0,+5,0,0)
			iSclippingW=true
			//status=clipValues(block,"r")+","+totalwidth +","+clipValues(block,"b")+","+totalheight
		}
		else
		{
			iSclippingW=false
		}
		
		if(clipValues(block,"b")<totalheight)
		{
			clipBy(block,0,0,+5,0)
			iSclippingH=true
			//status=clipValues(block,"r")+","+totalwidth +","+clipValues(block,"b")+","+totalheight

		}
		else
		{
			iSclippingH=false
		}
		if(iSclippingW || iSclippingH)
		{
			tm=setTimeout("scrollforward()",100)
		}
	if((clipValues(block,"r")==totalwidth || clipValues(block,"r")>totalwidth) && (clipValues(block,"b")==totalheight || clipValues(block,"b")>totalheight))
	{
	clearTimeout(tm)
	flag1=false
	//setTimeout("clipTo(block,0,0,0,0); scrollforward();",1000)
	//scrollback()
	}
}

function scrollback()
{
		if(clipValues(block,"r")>0 && clipValues(block,"b")>0)
		{
			clipBy(block,0,-5,-5,0)
			flag1=true
			timer=setTimeout("scrollback()",100)
		}
		if((clipValues(block,"r")==0 || clipValues(block,"r")<0) && (clipValues(block,"b")==0 || clipValues(block,"b")<0))
		{
		clearTimeout(timer)
		flag1=false
		//scrollforward()
		}
}


