﻿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;
                                                        tb_init();
                                               } 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 getData(filepath,divID)
{                             
                                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)
    {
        //var obj= document.getElementById(divID);        
        x.open("GET", filepath,true);
        x.onreadystatechange = function()
        {
            if (x.readyState == 4)
            {
                if(x.status == 200)
                {
                    document.getElementById(divID).innerHTML = x.responseText;
                }
            }else{
                    document.getElementById(divID).innerHTML = "<div align=center style='height:500px;'><img src=../images/loading.gif><br><br><font color=orange>Loading...Please Wait</font><br><br></div>";
                }
        }
        x.send(null);
    }
}

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: "Business  [+]", url: "http://business.phoewa.com",submenu: { id: "Business", itemdata: [ 
                        { text: "Articles", url: "http://business.phoewa.com/business/articles.aspx" },
                        { text: "News  ", url: "http://business.phoewa.com/business/news.aspx" },
                        { text: "Interview", url: "http://business.phoewa.com/business/interviews.aspx" },
                        { text: "New Products", url: "http://business.phoewa.com/business/newproducts.aspx" },
                        { text: "Currency Converter", url: "http://business.phoewa.com/business/converter.aspx" }
                    ] } }
                ];                

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

                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);
         
}
var time;
function goes_up()
{
    time=setInterval("shoup('up')",10);
}
function goes_down()
{    
    time=setInterval("shoup('down')",10);
}
function stop()
{
   clearInterval(time);
   } 
function shoup(act)
{
    if(act=="up"){
        document.getElementById("mdlist").scrollTop=eval(document.getElementById("mdlist").scrollTop)+1;
    }else{
       if(act=="down"){
        document.getElementById("mdlist").scrollTop=eval(document.getElementById("mdlist").scrollTop)-1;
        }
    }   
}
function showgallery(para1)
{
   var paths,page
   page="gallery.aspx?id="+para1
   //window.open(page,"",'');
   //window.open(page,null,'status=0,menubar=0,toolbar=0,width=800,height=650')
   window.open(page,"",'left=200,status=0,menubar=0,addressbar=1,toolbar=0,width=640,height=750');
   
}
function load_image(par,id){
        var fpath="showimage.aspx?name="+par+"&id="+id
        getData(fpath,"showgallery")
		
    }    
    
var tt
function moveaction(kk)
{
    if(kk=="left")
    {
        //alert(document.all.tbl1.style.width);
        tt=setInterval("gotoright()",10);
    }else{
        tt=setInterval("goleft()",10);
    }
}
function gotoright()
{
    document.getElementById("ttbar").scrollLeft=eval(document.getElementById("ttbar").scrollLeft)+3;
}
function goleft()
{
    document.getElementById("ttbar").scrollLeft=eval(document.getElementById("ttbar").scrollLeft)-3;
    
}
function stopact()
{
    clearInterval(tt);
    //tt=setInterval("decreseint()",200)
}
function decreseint()
{
    //alert("HELLO")
    document.all.ttbar.scrollLeft=eval(document.all.ttbar.scrollLeft)+1;
    document.all.txt1.value=eval(document.all.ttbar.scrollLeft);
}