var dc=document;
var sAm = '<a href="http://www.amazon.com/exec/obidos/ASIN/';

function showTop() {
var random = Math.floor(Math.random() * 1000000000);
var ranNum= Math.round(Math.random()*12);
//if(ranNum == 3) {
//document.write('<iframe marginwidth="0" marginheight="0" width="728" height="90" scrolling="no" frameborder="0" src="http://www.sffworld.com/ads/top_marco.html?'+random+'"></iframe>');
//}
//else {
document.write('<iframe marginwidth="0" marginheight="0" width="728" height="90" scrolling="no" frameborder="0" src="http://www.sffworld.com/top.html?'+random+'"></iframe>');
//}
}

function showLeft() {
t = new Date();
s = t.getSeconds();
m = t.getMinutes();

dc.write('<div align="center">');
dc.write('<br><a href="http://www.sffworld.com/adm/advertise.php"><b>ADVERTISE<br>on sffworld.com</b></a><p>');

//dc.write('<table width=100% border=0 cellspacing=0 cellpadding=2>');
//dc.write('<tr><td class=rh><b>Support sffworld.com</b></td></tr>');
//dc.write('<tr><td>You can support sffworld.com by making a donation through PayPal.<br><div align=center>');
//dc.write('<iframe marginwidth="0" marginheight="0" width="62" height="32" scrolling="no" frameborder="0" src="http://sffworld.com/ads/support.html"></iframe>');
//dc.write('<br><br></div></td></tr>');

dc.write('<table width=100% border=0 cellspacing=0 cellpadding=2>');
dc.write('<tr><td class=rh><b>sffworld.com Staff</b></td></tr>');
dc.write('<tr><td>Meet the people behind sffworld.com <a href="http://www.sffworld.com/about.html">here</a>.<br>');
dc.write('</td></tr>');

dc.write('<tr><td class=rh><b>Submit content</b></td></tr>');
dc.write('<tr><td>');
dc.write('<font color=#ff0000><b>NEW:</b></font> Post your Stories and Poetry in our brand new <a href="http://www.sffworld.com/community"><b>Community Section</b></a><br><br>');
dc.write('Read more about submitting other content <a href="http://www.sffworld.com/submit"><b>here</b>.');
dc.write('<p></td></tr></table>');
}

function showAds() {
dc.write('<table width=95% bgcolor=#ffffff align=center><tr><td>');


//document.write('<iframe marginwidth="0" marginheight="0" width="100%" height="90" scrolling="no" frameborder="0" src="http://www.sffworld.com/ads/gor_text.html"></iframe>');

document.write('<iframe marginwidth="0" align=right marginheight="0" width="300" height="250" scrolling="no" frameborder="0" src="/ads/gor_300_250.html"></iframe>');

dc.write('<br></td></tr></table>');
}

function showRight() {
//dc.write('<br><div align=center><font color=#ff0000><b>INTERESTED IN HELPING OUT?</b></font><br><a href="http://www.sffworld.com/apply.php"><b>Read More</b></a><br>');

//dc.write('<br><div align=center><font color=#ff0000><b>NEW<br>START YOUR OWN BLOG</b></font><br><a href="http://www.sffworld.com/community/register.php"><b>Register here</b></a><br><br>');

var random = Math.floor(Math.random() * 1000000000);
var ranNum= Math.round(Math.random()*2);
//if(ranNum == 1) {
//sUrl = 'http://www.sffworld.com/ads/tower_black.html';
//}
//else {
sUrl = 'http://www.sffworld.com/ads/gortower.html';
//}
document.write('<iframe marginwidth="0" marginheight="0" width="160" height="600" scrolling="no" frameborder="0" src="http://www.sffworld.com/ads/gortower_main.html"></iframe>');

dc.write('</div><br>');

}


function menuCreate() {

//Menu object creation
oCMenu=new makeCM("oCMenu") //Making the menu object. Argument: menuname

//Menu properties   
oCMenu.pxBetween=0
//Using the cm_page object to place the menu ----
oCMenu.fromLeft=0
oCMenu.fromTop=0
oCMenu.rows=1
oCMenu.menuPlacement=0
                                                             
oCMenu.offlineRoot="" 
oCMenu.onlineRoot="/" 
oCMenu.resizeCheck=1 
oCMenu.wait=1000 
oCMenu.fillImg="cm_fill.gif"
oCMenu.zIndex=0

//Background bar properties
oCMenu.useBar=0

//Level properties - ALL properties have to be spesified in level 0
oCMenu.level[0]=new cm_makeLevel() //Add this for each new level
oCMenu.level[0].width="130"
oCMenu.level[0].height=17 
oCMenu.level[0].regClass="clLevel0"
oCMenu.level[0].overClass="clLevel0over"
oCMenu.level[0].borderX=0
oCMenu.level[0].borderY=0
oCMenu.level[0].borderClass="clLevel0border"
oCMenu.level[0].offsetX=0
oCMenu.level[0].offsetY=0
oCMenu.level[0].rows=0
oCMenu.level[0].arrow=0
oCMenu.level[0].arrowWidth=0
oCMenu.level[0].arrowHeight=0
oCMenu.level[0].align="bottom"

/******************************************
Menu item creation:
myCoolMenu.makeMenu(name, parent_name, text, link, target, width, height, regImage, overImage, regClass, overClass , align, rows, nolink, onclick, onmouseover, onmouseout) 
*************************************/
oCMenu.makeMenu('top0','',' &nbsp; literature','http://www.sffworld.com/aindex.html')
  oCMenu.makeMenu('sub00','top0',' &nbsp; main page','http://www.sffworld.com/aindex.html')
  oCMenu.makeMenu('sub01','top0',' &nbsp; authors','http://www.sffworld.com/aname/a.html')
  oCMenu.makeMenu('sub02','top0',' &nbsp; interviews','http://www.sffworld.com/interviewsname.html')
  oCMenu.makeMenu('sub03','top0',' &nbsp; reviews','http://www.sffworld.com/brevname/a.html')
  oCMenu.makeMenu('sub04','top0',' &nbsp; articles','http://www.sffworld.com/authors/articles.html')
  oCMenu.makeMenu('sub05','top0',' &nbsp; official reviews','http://www.sffworld.com/brevoffname.html')
  oCMenu.makeMenu('sub06','top0',' &nbsp; stories','http://www.sffworld.com/community/')
  oCMenu.makeMenu('sub07','top0',' &nbsp; stories - archive','http://www.sffworld.com/authors/fiction.html')
  oCMenu.makeMenu('sub08','top0',' &nbsp; poems','http://www.sffworld.com/community/')
  oCMenu.makeMenu('sub09','top0',' &nbsp; poems - archive','http://www.sffworld.com/authors/poems/')
  oCMenu.makeMenu('sub10','top0',' &nbsp; excerpts','http://www.sffworld.com/authors/excerpts.html')
  oCMenu.makeMenu('sub11','top0',' &nbsp; synopses','http://www.sffworld.com/authors/synopsis.html')
  oCMenu.makeMenu('sub12','top0',' &nbsp; book voting','http://www.sffworld.com/avotes.html')
  oCMenu.makeMenu('sub13','top0',' &nbsp; news','http://www.sffworld.com/nindex.html')
oCMenu.makeMenu('top1','',' &nbsp; stories/poems','http://www.sffworld.com/community/')
oCMenu.makeMenu('top2','',' &nbsp; tv/movies','http://www.sffworld.com/mindex.html')
  oCMenu.makeMenu('sub20','top2',' &nbsp; main page','http://www.sffworld.com/mindex.html')
  oCMenu.makeMenu('sub21','top2',' &nbsp; movies by title','http://www.sffworld.com/movies/a.html')
  oCMenu.makeMenu('sub22','top2',' &nbsp; last 100 reviews','http://www.sffworld.com/mlast.html')
  oCMenu.makeMenu('sub23','top2',' &nbsp; top rated movies','http://www.sffworld.com/mtop.html')
  oCMenu.makeMenu('sub24','top2',' &nbsp; news','http://www.sffworld.com/nindex.html')
oCMenu.makeMenu('top3','',' &nbsp; news','http://www.sffworld.com/nindex.html')
oCMenu.makeMenu('top4','',' &nbsp; forums','http://www.sffworld.com/forums')
  oCMenu.makeMenu('sub40','top4',' &nbsp; Discussion','http://www.sffworld.com/forums')
  oCMenu.makeMenu('sub41','top4',' &nbsp; - fantasy','http://www.sffworld.com/forums/forumdisplay.php?s=&forumid=6')
  oCMenu.makeMenu('sub42','top4',' &nbsp; - science fiction','http://www.sffworld.com/forums/forumdisplay.php?s=&forumid=7')
  oCMenu.makeMenu('sub43','top4',' &nbsp; - horror','http://www.sffworld.com/forums/forumdisplay.php?s=&forumid=16')
  oCMenu.makeMenu('sub44','top4',' &nbsp; - comics','http://www.sffworld.com/forums/forumdisplay.php?s=&forumid=17')
  oCMenu.makeMenu('sub45','top4',' &nbsp; - writing','http://www.sffworld.com/forums/forumdisplay.php?s=&forumid=10')
  oCMenu.makeMenu('sub46','top4',' &nbsp; - tv and film','http://www.sffworld.com/forums/forumdisplay.php?s=&forumid=9')  
  oCMenu.makeMenu('sub47','top4',' &nbsp; - games','http://www.sffworld.com/forums/forumdisplay.php?s=&forumid=12')
  oCMenu.makeMenu('sub48','top4',' &nbsp; - art','http://www.sffworld.com/forums/forumdisplay.php?s=&forumid=11')  
  oCMenu.makeMenu('sub49','top4','','')  
  oCMenu.makeMenu('sub410','top4',' &nbsp; FunZone','http://www.sffworld.org/funzone')  
  oCMenu.makeMenu('sub411','top4',' &nbsp; - playroom','http://www.sffworld.org/funzone/viewforum.php?f=19')  
  oCMenu.makeMenu('top5','',' &nbsp; art gallery','http://www.sffworld.com/gallery')

//Leave this line - it constructs the menu
oCMenu.construct()		


//Extra code to find position:
function findPos(num){
  //alert(num)
  if(bw.ns4){   //Netscape 4
    x = document.layers["layerMenu"+num].pageX
    y = document.layers["layerMenu"+num].pageY
  }else{ //other browsers
    x=0; y=0; var el,temp
    el = bw.ie4?document.all["divMenu"+num]:document.getElementById("divMenu"+num);
    if(el.offsetParent){
      temp = el
      while(temp.offsetParent){ //Looping parent elements to get the offset of them as well
        temp=temp.offsetParent; 
        x+=temp.offsetLeft
        y+=temp.offsetTop;
      }
    }
    x+=el.offsetLeft
    y+=el.offsetTop
  }
  //Returning the x and y as an array
  return [x,y]
}
function placeElements(){
  //Changing the position of ALL top items:
  pos = findPos(0)
  oCMenu.m["top0"].b.moveIt(pos[0],pos[1])
  pos = findPos(1)
  oCMenu.m["top1"].b.moveIt(pos[0],pos[1])
  pos = findPos(2)
  oCMenu.m["top2"].b.moveIt(pos[0],pos[1])
  pos = findPos(3)
  oCMenu.m["top3"].b.moveIt(pos[0],pos[1])
  pos = findPos(4)
  oCMenu.m["top4"].b.moveIt(pos[0],pos[1])
  pos = findPos(5)
  oCMenu.m["top5"].b.moveIt(pos[0],pos[1])
  
  //Setting the fromtop value
  oCMenu.fromTop = pos[1]
}
placeElements()
//Setting it to re place the elements after resize - the resize is not perfect though..
oCMenu.onafterresize="placeElements()"



var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
try {
var pageTracker = _gat._getTracker("UA-8006732-1");
pageTracker._trackPageview();
} catch(err) {}

}

