﻿function ajaxManager()
{  
    var args = ajaxManager.arguments;  
      switch (args[0]) 
       { 
       case "load_page":
                                // arg[0] ="load_page" ; arg[1]= url ; arg[2]= containerID; arg[3]= loading image position(height);
                             
                                var x=null;
                                try
                                  {
                                  // Firefox, Opera 8.0+, Safari
                                 
                                  x=new XMLHttpRequest();
                                  }
                                catch (e)
                                  {
                                  // Internet Explorer
                                  try
                                 {
                                    x=new ActiveXObject("Msxml2.XMLHTTP");
                                    }
                                  catch (e)
                                    { 
                                    x=new ActiveXObject("Microsoft.XMLHTTP");
                                    }
                                  }                          
                                if (x) 
                                { 
                                    x.onreadystatechange = function() 
                                    {        el = document.getElementById(args[2]);
                                              if (x.readyState == 4 && x.status == 200)
                                              {  
                                                        el.innerHTML="" 
                                                        el.innerHTML = x.responseText;                                                       
                                               } else{
                                                       if ((args[3]=="") || (args[3]==null))
                                                        {
                                                         var hi="650px" ;
                                                         } else{
                                                         var hi=args[3]+"px" ;
                                                         }
                                                       if ((args[4]=="") || (args[4]==null)) 
                                                         { 
                                                         var wi="400px";
                                                         } else{ 
                                                         var wi=args[4]+"px" ;
                                                         }
                                                       el.innerHTML="<div style='width:"+wi+";height:"+hi+"' align=center valign=middle><table cellpadding=0 cellspacing=0 border=0 width=100%><tr><td width="+wi+" height="+hi+" align=center valign=middle><img src=images/loading.gif><br>Loading content....<td></tr></div>";
                                               } 
                                     }          
                                 x.open("GET", args[1], true); 
                                 x.send(null); 
                                 }
                                 break;
        case "start_up": 
        
        }  
}

var XMLHttpRequestObject = false;

if (window.XMLHttpRequest) 
{
    XMLHttpRequestObject = new XMLHttpRequest();
}else if (window.ActiveXObject)
{
    XMLHttpRequestObject = new ActiveXObject("Microsoft.XMLHTTP");   
}

function ymenu()
{
  YAHOO.widget.onDOMReady = function(p_sType) {

               var aItems = [                
                    { text: "Phoewa Home", url: "http://www.phoewa.com"},                  
                    { text: "Entertainment [+]",url: "http://entertainment.phoewa.com", submenu: { id: "entertainment", itemdata: [
                         { text: "Arts", url: "http://entertainment.phoewa.com/entertainment/arts.aspx" },
                         { text: "Movies", url: "http://entertainment.phoewa.com/entertainment/movies.aspx" },
                         { text: "Music", url: "http://entertainment.phoewa.com/entertainment/music.aspx" },
                         { text: "Talk Show", url: "http://entertainment.phoewa.com/entertainment/talkshow.aspx" }     
                    ] } },
                    { text: "Fashion  [+]", url: "http://fashion.phoewa.com",submenu: { id: "fashion", itemdata: [ 
                        { text: "Fashion", url: "http://fashion.phoewa.com/fn/ch/?gp=fashion" },
                        { text: "Beauty", url: "http://fashion.phoewa.com/fn/bt/?gp=beauty" },
                        { text: "Models", url: "http://fashion.phoewa.com/fn/md/?gp=models" },
                        { text: "Cover Story", url: "http://fashion.phoewa.com/fn/cs/?gp=cover_story" },  
                        { text: "Interview", url: "http://fashion.phoewa.com/fn/int/?gp=interview" }
                    ] } },
                   {text: "Forum ", url:"http://forum.phoewa.com"},
                   { text: "Horoscope [+]", url: "http://horoscope.phoewa.com",submenu: { id: "horo", itemdata: [ 
                         { text: "Articles", url: "http://horoscope.phoewa.com/horo/articles.aspx" },
                         { text: "Monthly Horoscope", url: "http://horoscope.phoewa.com/horo/monthly_horosocpe.aspx" }                        
                    ] } },
                   { text: "News [+]",url: "http://news.phoewa.com", submenu: { id: "news", itemdata: [
                        { text: "Local News ", url: "http://news.phoewa.com/news/?cat=local" },
                        { text: "International News ", url: "http://news.phoewa.com/news/?cat=International" },
                        { text: "Entertainment News ", url: "http://news.phoewa.com/news/?cat=entertainment" },
                        { text: "Sports News ", url: "http://news.phoewa.com/news/?cat=sports" },
                        { text: "Science & Technology", url: "http://news.phoewa.com/news/?cat=science" },
                        { text: "Business News", url: "http://news.phoewa.com/news/?cat=business" }
                    ] } },
                   { text: "Sports  [+]", url: "http://sports.phoewa.com",submenu: { id: "sports", itemdata: [ 
                        { text: "Football", url: "http://sports.phoewa.com/sports/football.aspx" },
                        { text: "Tennis", url: "http://sports.phoewa.com/sports/tennis.aspx" },
                        { text: "Golf", url: "http://sports.phoewa.com/sports/golf.aspx" },
                        { text: "Articles", url: "http://sports.phoewa.com/sports/articles.aspx" },
                        { text: "Live Scores", url: "http://sports.phoewa.com/sports/livescores.aspx" }
                    ] } },
                   { text: "Travels [+]", url: "http://travels.phoewa.com",submenu: { id: "travels", itemdata: [ 
                         { text: "Articles", url: "http://travels.phoewa.com/travels/article.aspx" },
                         { text: "Travel Tips", url: "http://travels.phoewa.com/travels/traveltip.aspx" },    
                         { text: "Directory", url: "http://travels.phoewa.com/travels/directory.aspx" }, 
                         { text: "Interesting Places", url: "http://travels.phoewa.com/travels/iplace.aspx" },    
                        { text: "Culture", url: "http://travels.phoewa.com/travels/culture.aspx" }                  
                    ] } }
                ];                

                var oMenu = new YAHOO.widget.Menu("PhoewaSubDomains", { x:200,y:15,width:"120px" });

                oMenu.addItems(aItems);

                oMenu.render(document.body);

                oMenu.showEvent.subscribe(function() {

                    this.focus();
                
                });   
                YAHOO.util.Event.addListener("menutoggle", "mouseover", oMenu.show, null, oMenu);
                YAHOO.util.Event.addListener("menutoggle", "click", oMenu.show, null, oMenu); 
                YAHOO.util.Event.addListener("Content", "mouseover", oMenu.hide, null, oMenu);                           
            };

YAHOO.util.Event.onContentReady("menutoggle", YAHOO.widget.onDOMReady);
         
}