var myWidth = 0, myHeight = 0;
var cssmenuids=["cssmenu1"] //Enter id(s) of CSS Horizontal UL menus, separated by commas
var csssubmenuoffset=-1 //Offset of submenus from main menu. Default is 0 pixels.

function tooltip_popup(title,body)
{ ddrivetip('<h4 class=newstitle>'+title+'</h4>'+body,'#ffffff',300) }

function tooltip_popup_full(title,body,pagename,thedate)
{ ddrivetip('<font size=1>'+thedate+' - '+pagename+'</font><h4 class=newstitle>'+title+'</h4>'+body,'#ffffff',350) }

function tooltip_popup_loc(title,body)
{ ddrivetip('<h4 class=newstitle>'+title+'</h4>'+body,'#ffffff',450) }

function translate_popup(title,body,fromlanguage)
{

ddrivetip('<font size=1><i>English translation <img src=\'http://worldofo.com/news/flags/ENGs.gif\'></i></font><h4 class=newstitle><span id=\'translation_title\'></span></h4><span id=\'translation_body\'></span>','#ffffff',300)

google.language.translate(title, fromlanguage, "en", function(result) {
  if (!result.error) {
    // translation_title = result.translation;
    var container = document.getElementById("translation_title");
    container.innerHTML = result.translation;
  }
});
google.language.translate(body, fromlanguage, "en", function(result) {
  if (!result.error) {
    // translation_body = result.translation;
    var container = document.getElementById("translation_body");
    container.innerHTML = result.translation;
  }
});



}

function viewvideo(videoname)
{
  var showvideodiv=document.getElementById('showvideodiv');
  showvideodiv.style.display = 'block';
  showvideodiv.innerHTML='<a href="javascript:void(0);" onclick="hidevideo()">Hide video window</a><br><object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/'+ videoname +'"><param name="wmode"><embed src="http://www.youtube.com/v/'+ videoname +'&autoplay=1" type="application/x-shockwave-flash" width="425" height="350"></embed></object>';
  // showvideodiv.innerHTML='<a href="javascript:void(0);" onclick="hidevideo()">Hide video window</a><br><object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/'+ videoname +'"><param name="wmode" value="transparent"><embed src="http://www.youtube.com/v/'+ videoname +'" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>';
}

function woclk(id,eurl) {
  if(document.images)
  {
    (new Image()).src="http://go2.worldofo.com/reg.php?id="+id+"&u="+escape(eurl.href);
  }
  return true;
}

function hideveohvideo(div)
{
  var showvideodiv=document.getElementById(div);
  showvideodiv.innerHTML='';
  showvideodiv.style.display = 'none';
}

function hidevideo()
{
  var showvideodiv=document.getElementById('showvideodiv');
  showvideodiv.innerHTML='';
  showvideodiv.style.display = 'none';
}


function viewveohvideo(videoname,id)
{
  var showvideodiv=document.getElementById(videoname);
  showvideodiv.style.display = 'block';
  var veohheight=438;
  var veohwidth=540;
  // if (screen.height<800)
  if (myHeight<500)
  {
    veohheight=myHeight-150;
    veohwidth=parseInt(veohheight*540/438);
  }

  showvideodiv.innerHTML='<center><img src="http://worldofo.com/news/basis/wotv_top540.jpg"><br><embed src="http://www.veoh.com/videodetails.swf?permalinkId='+ videoname+'&id=1&videoAutoPlay=1" width="'+veohwidth+'" height="'+veohheight+'" bgcolor="#000000" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed><br><a href="javascript:void(0);" onclick="hideveohvideo(\''+videoname+'\')">Click to close woO-TV window</a><br></center>';

  if (id)
  {
    var hiturl="/news/hit.php";
    http.open("GET", hiturl + '?id=' + id, true);
    http.onreadystatechange = handleHttpResponsehit;
    http.send(null);
  }

}

function handleHttpResponsehit() {
  if (http.readyState == 4) {
    //alert('Yes!');
  }
}



function showallforums()
{
  var showforumdiv=document.getElementById('allforumsdiv');
  showforumdiv.style.display = 'block';
  var showforumdiv2=document.getElementById('showallforums');
  showforumdiv2.innerHTML = '<a href=\"javascript:void(0);\" onclick=\"hideallforums();\">>> Hide forum entries</a>';
}

function hideallforums()
{
  var showforumdiv=document.getElementById('allforumsdiv');
  showforumdiv.style.display = 'none';
  var showforumdiv2=document.getElementById('showallforums');
  showforumdiv2.innerHTML = '<a href=\"javascript:void(0);\" onclick=\"showallforums();\">>> Display more forum entries</a>';
}

function showallpgs()
{
  var showpgsdiv=document.getElementById('allpgsdiv');
  showpgsdiv.style.display = 'block';
  var showpgsdiv2=document.getElementById('showallpgs');
  showpgsdiv2.innerHTML = '<a href=\"javascript:void(0);\" onclick=\"hideallpgs();\">>> Hide rest of the entries</a>';
}

function showallp2()
{
  var showp2div=document.getElementById('allp2div');
  showp2div.style.display = 'block';
  var showp2div2=document.getElementById('showallp2');
  showp2div2.innerHTML = '<a href=\"javascript:void(0);\" onclick=\"hideallp2();\">>> Hide Page 2 entries</a>';
}

function toggle(id)
{ var thiselement=document.getElementById(id);
 if (thiselement.style.display=="block"){ thiselement.style.display="none";}
 else
 if (thiselement.style.display=="none"){ thiselement.style.display="block";}
}

function hideallp2()
{
  var showp2div=document.getElementById('allp2div');
  showp2div.style.display = 'none';
  var showp2div2=document.getElementById('showallp2');
  showp2div2.innerHTML = '<a href=\"javascript:void(0);\" onclick=\"showallp2();\">>> Display more Page 2 entries</a>';
}

function hideallpgs()
{
  var showpgsdiv=document.getElementById('allpgsdiv');
  showpgsdiv.style.display = 'none';
  var showpgsdiv2=document.getElementById('showallpgs');
  showpgsdiv2.innerHTML = '<a href=\"javascript:void(0);\" onclick=\"showallpgs();\">>> Show the rest of the entries</a>';
}


  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }

// if (me.style.display=="inline"){
//	me.style.display="none";

function createcssmenu2(){
for (var i=0; i<cssmenuids.length; i++){
  var ultags=document.getElementById(cssmenuids[i]).getElementsByTagName("ul")
    for (var t=0; t<ultags.length; t++){
			ultags[t].style.top=ultags[t].parentNode.offsetHeight+csssubmenuoffset+"px"
    	var spanref=document.createElement("span")
			spanref.className="arrowdiv"
			spanref.innerHTML="&nbsp;&nbsp;&nbsp;&nbsp;"
			ultags[t].parentNode.getElementsByTagName("a")[0].appendChild(spanref)
    	ultags[t].parentNode.onmouseover=function(){
    	this.getElementsByTagName("ul")[0].style.visibility="visible"
    	}
    	ultags[t].parentNode.onmouseout=function(){
			this.getElementsByTagName("ul")[0].style.visibility="hidden"
    }
    }
  }
}


  function StartCountDown(myDiv,myTargetDate,myText1,myText2)
  {
    var dthen;
    if (myTargetDate>1270000000)
    { 
      dthen=new Date();
      dthen.setTime(myTargetDate*1000);
    }
    else
    { dthen	= new Date(myTargetDate);}

    var dnow	= new Date();
    ddiff		= new Date(dthen-dnow);
    gsecs		= Math.floor(ddiff.valueOf()/1000);
    CountBack(myDiv,gsecs,myText1,myText2);
  }
  
  function Calcage(secs, num1, num2)
  {
    s = ((Math.floor(secs/num1))%num2).toString();
    if (s.length < 2) 
    {	
      s = "0" + s;
    }
    return (s);
  }
  function Calcageno0(secs, num1, num2)
  {
    s = ((Math.floor(secs/num1))%num2).toString();
    return (s);
  }
  
  function CountBack(myDiv, secs, myText1,myText2)
  {
    var DisplayStr;
    // var DisplayFormat = myText1 + "<font color=#444>%%H%%:%%M%%:%%S%% hours</font>";
    var DisplayFormat = myText1 + "%%D%% days %%H%%:%%M%%:%%S%%";
    // var DisplayFormat = "%%D%% Days %%H%%:%%M%%:%%S%%";
    DisplayStr = DisplayFormat.replace(/%%D%%/g,	Calcageno0(secs,86400,100000));
    DisplayStr = DisplayStr.replace(/%%H%%/g,		Calcage(secs,3600,24));
    // DisplayStr = DisplayFormat.replace(/%%H%%/g,		Calcage(secs,3600,100000));
    DisplayStr = DisplayStr.replace(/%%M%%/g,		Calcage(secs,60,60));
    DisplayStr = DisplayStr.replace(/%%S%%/g,		Calcage(secs,1,60));
    DisplayStr = DisplayStr.replace(/ 0 days/g,' ');
    if(secs > 0)
    {	
      document.getElementById(myDiv).innerHTML = DisplayStr;
      setTimeout("CountBack('" + myDiv + "'," + (secs-1) + ",'"+myText1+"','"+myText2+"');", 990);
    }
    else
    {
      document.getElementById(myDiv).innerHTML = myText2;
    }
  }


tmppic= new Image(14,14);
tmppic.src="http://worldofo.com/news/basis/wotv_top540.jpg";

if (window.addEventListener)
window.addEventListener("load", createcssmenu2, false)
else if (window.attachEvent)
window.attachEvent("onload", createcssmenu2)




