// Use this function to retrieve a cookie.
function getCookie(name){
var cname = name + "=";
var dc = document.cookie;
    if (dc.length > 0) {
    begin = dc.indexOf(cname);
        if (begin != -1) {
        begin += cname.length;
        end = dc.indexOf(";", begin);
            if (end == -1) end = dc.length;
            return unescape(dc.substring(begin, end));
        }
    }
return null;
}

// Use this function to save a cookie.
function setCookie(name, value, expires) {
document.cookie = name + "=" + escape(value) + "; path=/" +
((expires == null) ? "" : "; expires=" + expires.toGMTString());
}

// Use this function to delete a cookie.
function delCookie(name) {
document.cookie = name + "=; expires=Thu, 01-Jan-70 00:00:01 GMT" +  "; path=/";
}
function exptime() {
    var exp = new Date();                                   // make new date object
    exp.setTime(exp.getTime() + (1000 * 60 * 60 * 3));
    //exp.setTime(exp.getTime() + (1000 * 60 * 60 * 24 * 31));
        return exp;
}
function getpage (atitle, apage, amoreargs) {
    //Title='+atitle+'
    var oppg='http://www.almondhouse.com/src/template.phtml?&cpage='+apage+amoreargs;
    //alert (oppg);
    document.location.href=oppg;
}
function opaboutuspg() {
    getpage ('About','aboutus.phtml','');
}
function opspecialpg() {
    getpage ('Sweetdescription','sweetdescription.phtml','');
}
function opshowdescpg(asmenuid) {
  getpage ('Sweetdescription','sweetdescription.phtml','&SmenuId='+asmenuid);
}
function opseasonalpg() {
            getpage ('Special Mithai','special.phtml','');
}
function opsuggestionpg() {
            getpage ('Suggestions','suggestion.phtml','');
}
function oponebitepg() {
             getpage ('One Bite Sweets','onebite.phtml','');
}
function ophomepg() {
    document.location.href = 'home.phtml';
}
function opsearchpg() {
    document.location.href = 'searchrest.phtml';
}
function opprapg(){
    document.location.href = 'pra.phtml';
}
function opmenupg(amenuid) {
        setCookie ('currentmenu','menu.phtml' ,exptime());
        document.location.href = 'Menu.phtml?MenuId='+amenuid;
}

function opusamenupg(amenuid) {
    var amenuname;
    switch(amenuid) {
            case 1:
                    amenuname = 'Sweets';
                        break;
                case 2:
                amenuname = 'Savouries';
                        break;
                case 3:
                    amenuname = 'Gift Boxes';
                        break;
                case 4:
                    amenuname = 'Dry Fruits';
                        break;
                case 5:
                    amenuname = 'Seasonal Specials';
                        break;
                case 6:
                    amenuname = 'One byte Sweets';
                        break;
        }
    setCookie ('currentmenu',amenuname,exptime());
    getpage('Menu','menu.phtml','&MenuId='+amenuid);
}

function opindiamenupg(indmenuid) {
    var indmenuname;
    switch(indmenuid) {
            case 1:
                    indmenuname = 'Sweets';
                        break;
                case 2:
                indmenuname = 'Savouries';
                        break;
                case 3:
                    indmenuname = 'Gift Boxes';
                        break;
                case 4:
                    indmenuname = 'Dry Fruits';
                        break;

        }
    setCookie ('currentmenu',indmenuname,exptime());
    getpage('India%20Menu','indiamenu.phtml','&MenuId='+indmenuid);
}

function opmakeyourgiftspg(amenuid) {
    setCookie ('currentmenu','makeyourgifts.phtml' ,exptime());
        getpage('Make your Combination ','makeyourgifts.phtml','&MenuId='+amenuid);
}
function opshoppingcartpg() {
    document.location.href = 'vieworder.phtml';
}
function opcontactuspg(){
    getpage('Contact Us','contactus.phtml','');
}
function opmailreceivepg(){
    getpage('Receive%20Mail','mailreceive.phtml','');
}
function opproductspgindia(){
    setCookie ('menutype','INDIA',exptime());
    getpage('Products','indiamenu.phtml','');
}
function opproductspgusa(){
    setCookie ('menutype','USA',exptime());
    getpage('Products','usamenu.phtml','');
}
function opshubhkaryampg(){
    getpage('Shubhkaryam','shubhkaryam.phtml','');
}
function ophelppg(){
        getpage ('Help','help.phtml','');
}
function opfaqpg(){
        getpage ('FAQ','faq.phtml','');
}
function opfriendshippg(){
        getpage ('Friendship','friendship.phtml','');
}
function opreqpasspg(){
   getpage ('Requestpass page','reqpass1.phtml','');
}
function oplostpasspg(){
   getpage ('Lost Password Page','reqpass.phtml','');
}

function opregisterpg(){
   getpage ('Register page','registerpage.phtml','');
}
function opcustomerpg(){
   getpage ('CustomerMailpage','customermail.phtml','');
}
function logout () {
   unloading();
}
function OpenMenuDesc(afilename) {
     mywin = window.open (afilename,'Help',            'toolbar=1,menubar=1,directories=0,width=500,height=350,scrollbars=yes,resizable=yes');
}
function unloading () {
     delCookie('SearchRest');
     delCookie('SearchCity');
     delCookie('SearchState');
     delCookie('SearchType');
     delCookie('SearchRestId');
         delCookie('SearchRestName');
     delCookie('CuisineType');
     delCookie('LuxuryType');
         delCookie('EncKey');
         delCookie('OrderId');
         delCookie('RestId');
         document.location.href = 'logout.phtml';
}
var scustid;
var banqcount;
var couponcnt;
var searchtype;
function convert(){
         scustid=getCookie('CustId');
         banqcount=getCookie('banqcount');
         couponcnt=getCookie('couponcnt');
         searchtype=getCookie('searchtype');
}
    function openhomehelpwin(afile) {
                mywin = window.open (afile,'Help',            'toolbar=0,menubar=0,directories=0,width=500,height=300,scrollbars=yes,resizable=no');
        }
        // To open home links
    function cmnhomelinks () {
        convert();
                 document.write ("<center><TABLE width=620 border=0 bordercolor=885fff cellspacing=0 cellpadding=4>");
                  document.write ("<TR>");
                  document.write ("<TD>");
                  document.write ("<font size=2 face=verdana color=blue><center>");
                  document.write ("<a "+ " href=\"javascript:ophomepg()\""+
                                 " title='Go to Home Page'> <B>Home </A> |");
                  document.write ("<a "+ " href=\"javascript:opsearchcatpg()\""+
                                 " title='Go to Categories'> <B>Categories </A> |");
                  document.write ("<a "+ " href=\"javascript:opsearchpg()\""+
                                 " title='Go to the Search List Page'> <B>Search List </A> |");
                  document.write (
                  " <a href=\"javascript:opcontactpg()\" " +
                  " title='View Contact Information'><B> Contact Us </a> | " );
                  document.write (
                  " <a href=\"javascript:oprestsignuppg()\" " +
                  " title='View the Restaurants Sign up info'><B> Restaurants Sign Up </A> | ");
                  document.write (
                  " <a " +
                  " href=\"javascript:ophelppg()\" " +
                  " title='Go to the Online Help Guide'><B>Help</A> | ");
                  document.write (
                  " <a " +
                  " href=\"javascript:opfaqpg()\" " +
                  " title='Go to the Online Help Guide'><B>FAQ</A> | ");
                  if (scustid > 0) {
                  }
                  else {
                   document.write (
                   " <a " +
                   " href=\"javascript:opregisterpg()\" " +
                   " title='Register'><B> Register </A> ");
                  }
                  document.write ("</TD>");
                  document.write ("</TR>");
                  document.write ("</TABLE>");
                                  document.write ("<center><TABLE width=325 border=0 bordercolor=885fff cellspacing=0 cellpadding=0><tr><td align=center colspan=2><font size=2>©2000 FoodAndHotels.com is a subsidiary of</td></tr><center><tr><td align=right width=65%><img  align=center name=ebiz1 src='ebizlogosmall.gif' border=0 ></td>&nbsp;<td  width=35% align=left valign=center><font size=2>Pvt.Ltd.,</td></tr><tr><td align=center valign=top colspan=2> <font size=2>All rights reserved.</td></tr></table></center>");
    }
    function cmnmenulinks () {
         document.write ("<center><TABLE border=0 bordercolor=885fff cellspacing=0 cellpadding=4  width=620>");
                  document.write ("<TR>");
                  document.write ("<TD>");
                  document.write ("<font size=2 face=verdana color=blue><center>");
                  document.write ("<a "+ " href=\"javascript:ophomepg()\""+
                                 " title='Go to Home'> <B><font size=2 face=verdana color=blue>Home </A> |");
                  document.write ("<a "+ " href=\"javascript:opsearchcatpg()\""+
                                 " title='Go to Categories'> <B>Categories </A> |");
                  document.write ("<a href=\"javascript:opsearchpg()\" " +
                  " title='Go to the Search List you specified'>" +
                  "<B> Search List </a> |");

                                  document.write ("<a href=\"javascript:opinfopg()\" " +
                  " title='View Restaurant Information' >" +
                  "<B> Information </a> |");

                                  if (searchtype!='Hotels'&&searchtype!='hotels') {
                      document.write ("<a href=\"javascript:opmenupg()\" " +
                      " title='View Restaurant Menu'>" +
                      "<B> Menu </a> |");
                                  }
                                  if (banqcount > 0 ){
                      document.write ("<a href=\"javascript:opbmenupg()\" " +
                      " title='View Banquet Menu'>" +
                      "<B> Banquet Menu </a> |");
                                  }
                  document.write ("<a href=\"javascript:opreviewspg()\" " +
                  " title='View Reviews Posted by Members'>" +
                  "<B> Reviews </a> |");
                  if (couponcnt > 0) {
                     document.write ("<a href=\"javascript:opcpnspg()\" " +
                  " title='View Restaurant Coupons'>" +
                     "<B> Coupons </a> |");
                  }
                          if (searchtype!='Hotels'&&searchtype!='hotels') {
                  document.write ("<a href=\"javascript:opshoppingcartpg()\" " +
                  " title='View the Shopping Cart'>" +
                  "<B> Shopping Cart </a>");
                          }
                  document.write ("</TD>");
                  document.write ("</TR>");
                  document.write ("</TABLE>");
                                  document.write ("<center><TABLE width=325 border=0 bordercolor=885fff cellspacing=0 cellpadding=0><tr><td align=center colspan=2><font size=2>©2000 FoodAndHotels.com is a subsidiary of</td></tr><center><tr><td align=right width=65%><img  align=center name=ebiz1 src='ebizlogosmall.gif' border=0></td>&nbsp;<td  width=35% align=left valign=center><font size=2>Pvt.Ltd.,</td></tr><tr><td align=center valign=top colspan=2> <font size=2>All rights reserved.</td></tr></table></center>");
    }
        function copyright() {
            document.write ("<table width=620 cellspacing=0 cellpadding=0><tr><td><font size=1><center>© 2000 </font><font color='red' size=1><b>ALMOND HOUSE</b></font> <font size=1>Himayatnagar, Hyderabad - 500 029, Phone:91-040-3221475, 3226068</font><font size=1 color=gray><b> Copyright and Legal Disclaimer.</font><a href='javascript:opcustomerpg()'><font size=1> Admin</font></a></td></tr><tr><td valign=center><font size=1><center><br>Designed and Developed by <a href='http://www.ebiztechnix.com' target='_new'><img align=center src='../img/ebizlogosmall.gif' border=0></a>Pvt. Ltd.</font></td></tr></table>");
        }
        function pic(img, imgsrc) {
        document[img].src = imgsrc;
        }


