// Document Last edited 19-Oct-09 by Shailendra
// MealStation Home Services JavaScript Document

// News Scroller for MealStation Home Services Homepage
// If Javascript is turned off on the client side then nothing is displayed 

// Source http://www.javascriptkit.com/script/script2/highlight2.shtml

// Highlighter Scroller II script- By JavaScript Kit (http://www.javascriptkit.com)
// For this and over 400+ free scripts, visit http://www.javascriptkit.com/
// This notice must stay intact

//CONFIGURE MESSAGES AND VARIABLES
var tickercontents=new Array()
tickercontents[0]='Looking for a brahmin Cook?<br /><br />Your wait may be longer!';
tickercontents[1]='Visit the Pricing page to request a quote';
tickercontents[2]='FAQs are updated frequently based on questions we are asked by our Customers...';
tickercontents[3]='We prefer communicating by email';
tickercontents[4]='Please give as many details as possible in your request. <br />It helps us find a Cook quickly';
tickercontents[5]='We are not able to keep up with requests! <br />Such a huge response was not expected by us!';
tickercontents[6]='Our current focus is South Bangalore <br />BTM, HSR, JP Nagar, Jayanagar, Koramangala, Indiranagar';
tickercontents[7]='MealStation Home Services comes at a premium, but then we intend to maintain reliability!';
tickercontents[8]='Brahmin Cooks are costlier and difficult to find! <br /><br />We have a long waiting list!';
tickercontents[9]='Current prices are not yet rationalized. <br />We should take some time to get to the right prices.';
tickercontents[10]='We serve from Monday to Saturday, early morning till late evening. <br /><strong>On Sundays we relax!</strong>';
tickercontents[11]='This website is still under development. <br />Many things will change frequently!';
tickercontents[12]='Learn helpful tips on hiring and maintaining Domestic Help. <br />Contact us for a mailer subscription';
tickercontents[13]='A lot of our procedures are not yet setup completely. <br />We are busy working on setting them up ASAP!';
tickercontents[14]='We find Cooks online, through their friends or by customer referrals!';

var tickerwidth="150pt";
var tickerheight="50pt";
var fontcss="class='lnkbottomblue'";//"font: bold 10pt arial; color: #000000";
var tickdelay=5000; // delay between messages
var highlightspeed=1; // pixels at a time.
var highlightcolor="#bbbbff";
var backdroptextcolor="#888888";

////Do not edit past this line////////////////

document.write('<style>#highlighterbg a{color:'+backdroptextcolor+'}</style>');
document.write('<div style="position:relative;left:0px;top:0px; width:'+tickerwidth+'; height:'+tickerheight+';'+fontcss+'">');
document.write('<span id="highlighterbg" style="position:absolute;left:0;top:0;color:'+backdroptextcolor+'; width:'+tickerwidth+'; height:'+tickerheight+';padding: 4px"></span><span id="highlighter" style="position:absolute;left:0;top:0;clip:rect(auto auto auto 0px); background-color:'+highlightcolor+'; width:'+tickerwidth+';height:'+tickerheight+';padding: 4px"></span>');
document.write('</div>');

var currentmessage=Math.floor(Math.random()*tickercontents.length);
var clipbottom=1;

function changetickercontent(){
msgheight=clipbottom=crosstick.offsetHeight;
crosstick.style.clip="rect("+msgheight+"px auto auto 0px)";
crosstickbg.innerHTML=tickercontents[currentmessage];
crosstick.innerHTML=tickercontents[currentmessage];
highlightmsg();
}

function highlightmsg(){
//var msgheight=crosstick.offsetHeight
if (clipbottom>0){
clipbottom-=highlightspeed;
crosstick.style.clip="rect("+clipbottom+"px auto auto 0px)";
beginclip=setTimeout("highlightmsg()",20);
}
else{
clipbottom=msgheight;
clearTimeout(beginclip);
if (currentmessage==tickercontents.length-1) currentmessage=0
else currentmessage++;
setTimeout("changetickercontent()",tickdelay);
}
}

function start_ticking(){
crosstickbg=document.getElementById? document.getElementById("highlighterbg") : document.all.highlighterbg;
crosstick=document.getElementById? document.getElementById("highlighter") : document.all.highlighter;
crosstickParent=crosstick.parentNode? crosstick.parentNode : crosstick.parentElement;
if (parseInt(crosstick.offsetHeight)>0)
crosstickParent.style.height=crosstick.offsetHeight+'px'
else
setTimeout("crosstickParent.style.height=crosstick.offsetHeight+'px'",100); //delay for Mozilla's sake
changetickercontent();
}

if (document.all || document.getElementById)
window.onload=start_ticking;