// JavaScript Document
<!--
<!--


userAgent = window.navigator.userAgent;
browserVers = parseInt(userAgent.charAt(userAgent.indexOf("/")+1),10);
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
} <!--
/****************************************************
     Author: Eric King
     Url: http://redrival.com/eak/index.shtml
     This script is free to use as long as this info is left in
     Featured on Dynamic Drive script library (http://www.dynamicdrive.com)
****************************************************/
var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);}
function bookmarksite(title, url){
if (document.all)
window.external.AddFavorite(url, title);
else if (window.sidebar)
window.sidebar.addPanel(title, url, "")
}
function findElement(n,ly) {
	if (browserVers < 4)		return document[n];
	var curDoc = ly ? ly.document : document;
	var elem = curDoc[n];
	if (!elem) {
		for (var i=0;i<curDoc.layers.length;i++) {
			elem = findElement(n,curDoc.layers[i]);
			if (elem) return elem;
		}
	}
	return elem;
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		var img;
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			img = null;
			if (document.layers) {
				img = findElement(changeImages.arguments[i],0);
			}
			else {
				img = document.images[changeImages.arguments[i]];
			}
			if (img) {
				img.src = changeImages.arguments[i+1];
			}
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		btn_email_over = newImage("images/btn_email-over.gif");
		btn_blogs_over = newImage("images/btn_blogs-over.gif");
		btn_forum_over = newImage("images/btn_forum-over.gif");
		preloadFlag = true;
	}
}

// -->

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function getResult() 
{
	var showResults
	var hideResults
	showResults = document.getElementById("poll").innerHTML;
	hideResults = document.getElementById("results").innerHTML;
	document.getElementById("poll").innerHTML = hideResults;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function openWindow(url,name,width,height) {
  var myLeft = (screen.width - width)/2;
  var myTop = (screen.height - height) /2;
  
  var my_window = window.open(url,name,'scrollbars=yes,resizable=no,menu=no,status=no,width='+width+',height='+height+',left='+myLeft+',top='+myTop);
	   my_window.focus();
}


function getResult() 
{
	var showResults;
	var hideResults;
	showResults = document.getElementById("poll").innerHTML;
	hideResults = document.getElementById("results").innerHTML;
	document.getElementById("poll").innerHTML = hideResults;
}

//-->

/***********************************************
* Contractible Headers script- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use. Last updated Mar 23rd, 2004.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var enablepersist="on" //Enable saving state of content structure using session cookies? (on/off)
var collapseprevious="no" //Collapse previously open content when opening present? (yes/no)

if (document.getElementById){
document.write('<style type="text/css">')
document.write('.switchcontent{display:none;}')
document.write('</style>')
}

function getElementbyClass(classname){
ccollect=new Array()
var inc=0
var alltags=document.all? document.all : document.getElementsByTagName("*")
for (i=0; i<alltags.length; i++){
if (alltags[i].className==classname)
ccollect[inc++]=alltags[i]
}
}

function contractcontent(omit){
var inc=0
while (ccollect[inc]){
if (ccollect[inc].id!=omit)
ccollect[inc].style.display="none"
inc++
}
}

function expandcontent(cid){
if (typeof ccollect!="undefined"){
if (collapseprevious=="yes")
contractcontent(cid)
document.getElementById(cid).style.display=(document.getElementById(cid).style.display!="block")? "block" : "none"
}
}

function revivecontent(){
contractcontent("omitnothing")
selectedItem=getselectedItem()
selectedComponents=selectedItem.split("|")
for (i=0; i<selectedComponents.length-1; i++)
document.getElementById(selectedComponents[i]).style.display="block"
}

function get_cookie(Name) { 
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) { 
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function getselectedItem(){
if (get_cookie(window.location.pathname) != ""){
selectedItem=get_cookie(window.location.pathname)
return selectedItem
}
else
return ""
}

function saveswitchstate(){
var inc=0, selectedItem=""
while (ccollect[inc]){
if (ccollect[inc].style.display=="block")
selectedItem+=ccollect[inc].id+"|"
inc++
}

document.cookie=window.location.pathname+"="+selectedItem
}

function do_onload(){
	preloadImages();
	MM_preloadImages('images/btn_home_over.gif','images/btn_news_over.gif','images/btn_music_over.gif','images/btn_lifestyle_over.gif','images/btn_media_over.gif','images/btn_editorial_over.gif','images/btn_nightlife_over.gif','images/btn_major_over.gif','images/btn_issues_over.gif','images/btn_gallery_over.gif','images/btn_downloads_over.gif','images/btn_about_over.gif','images/btn_contact_over.gif','images/btn_results_over.gif','images/btn_submit_over.gif','images/but_register_over.gif','images/home_over.gif');
	uniqueidn=window.location.pathname+"firsttimeload";
	getElementbyClass("switchcontent");
	if (enablepersist=="on" && typeof ccollect!="undefined"){
		document.cookie=(get_cookie(uniqueidn)=="")? uniqueidn+"=1" : uniqueidn+"=0" 
		firsttimeload=(get_cookie(uniqueidn)==1)? 1 : 0 //check if this is 1st page load
		if (!firsttimeload) revivecontent();
	}
}

if (enablepersist=="on" && document.getElementById)
window.onunload=saveswitchstate

function windowPopup2(url,name,width,height) 
{
  var myLeft = (screen.width-width)/2;
  var myTop = (screen.height-height)/2;
  
  var new_window = window.open(url,name,'scrollbars=yes,resizable=no,location=no,toolbar=yes,statusbar=no,left='+myLeft+',top='+myTop+',width='+width+',height='+height);
  new_window.focus();
}


function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function togglepollresults() {
	if (document.getElementById('pollinput').style.display == '' || document.getElementById('pollinput').style.display == 'block') {
		showhidelayers('pollResults','','block','pollinput','','none');
	} else {
		showhidelayers('pollResults','','none','pollinput','','block');
	}
}

function showhidelayers() { //update to MM_showHideLayers
	var i,p,v='',d='',obj,args=showhidelayers.arguments;
	for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
		if (obj.style) {
			obj=obj.style;
			d=(v=='block')?'block':(v=='none')?'none':'';
			v=(v=='show')?'visible':(v=='hide')?'hidden':'';
			
			if (v != '') obj.visibility = v;
			if (d != '') obj.display = d;
		}
	}
}

if (window.attachEvent) {
   window.attachEvent("onload",setListeners);
   function setListeners() {
      inputList = document.getElementsByTagName("INPUT");
	  for (i=0;i<inputList.length;i++) {
	     inputList[i].attachEvent("onpropertychange",restoreStyles); 
		 inputList[i].style.backgroundColor = "#ffffff";
	  }   
	  selectList = document.getElementsByTagName("SELECT");
	  for (i=0;i<selectList.length;i++) {
	    selectList[i].attachEvent("onpropertychange",restoreStyles);
		selectList[i].style.backgroundColor = "#fffff";
	  }
   }
   function restoreStyles() {
       if (event.srcElement.style.backgroundColor != "") {
	      event.srcElement.style.backgroundColor = "#ffffff";
	   }
	}
}

<!-- Original:  Martin Webb (martin@irt.org) -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function right(e) {
if (navigator.appName == 'Netscape' && 
(e.which == 3 || e.which == 2))
return false;
else if (navigator.appName == 'Microsoft Internet Explorer' && 
(event.button == 2 || event.button == 3)) {
alert("Sorry, you do not have permission to right click.");
return false;
}
return true;
}

function size_ad(){
	document.getElementById('ads').style.height=document.documentElement.scrollHeight+'px';
}

// BEGIN: menu code
var menuShown = null;
var menuId = '';
var menuHideTimer;

function menuShow(id) {
	clearTimeout(menuHideTimer);
	_menuHide();
	document.getElementById('mnu' + id).src = 'images/btn_' + id + '_over.gif'; // show the rollover state
	menuId = id;
	var menu = document.getElementById('sub' + id);
	if (menu) { // show the sub-menu (if any)
		menu.style.display = 'block';
		menuShown = menu;
	}
}

function menuHide() {
	menuHideTimer = setTimeout(_menuHide, 50);
}

function _menuHide() {
	if (menuId != '') { // restore the normal state
		document.getElementById('mnu' + menuId).src = 'images/btn_' + menuId + '.gif';
	}
	if (menuShown) { // hide the sub-menu (if any)
		menuShown.style.display = 'none';
	}
}
// END: menu code

document.onmousedown=right;
document.onmouseup=right;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
if (document.layers) window.captureEvents(Event.MOUSEUP);
window.onmousedown=right;
window.onmouseup=right;

/*if(window.addEventListener){
	window.addEventListener('load',size_ad,true);
	window.addEventListener('resize',size_ad,true);
}else{
	window.attachEvent('onload',size_ad);
	window.attachEvent('onresize',size_ad);
}*/
//  End -->

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