var menu = "";

function w_header() {
   var s = '' +
    '<h1 id="logo">World Government<BR><span> of World Citizens</span></h1>' +
	'<h2 id="slogan">\"The will of the people shall be the basis of the authority of government...\"</h2>' +
	'<img id="welc" src="hp_graphics/welcome.gif"/>' +
	'<h2 id="slogan_end">Article 21(3), Universal Declaration of Human Rights.</h2>';
	document.write(s);
}

function w_menu() {
   var s = '' +
   	'<ul>' +
		'<li id="current"><a href="index.html?s=1">Home</a></li>' +
		'<li><a href="programs.html?s=2">Programs</a></li>' +
		'<li><a href="commissions.html?s=3">Commissions</a></li>' +
		'<li><a href="contact.html?s=4">Communications</a></li>' +
		'<li><a href="sitemap.html?s=5">Site Map</a></li>' +
	'</ul>';
	document.getElementById('menu').innerHTML = s;
}

function w_sidebar() {
   var s = '';
   var sec = document.location.search; 
   var m = sec.charAt(sec.length-1);
   if (m == "") m = document.getElementById('section').attributes[0].value;
   
   switch (m){
	case "2":
	 s += '<ul id="navigation"><li id="title"><h4>Mundialization</h4></li>' +
		  '<li><a href="munddef.html?s=2">Definition</a></li>' +
		  '<li><a href="mundhow2.html?s=2">How to Mundialize</a></li>' +
		  '<li><a href="mundminn.html?s=2">Minnesota Declaration</a></li>' +
		  '<li><a href="mundcity.html?s=2">Mundialization List</a></li>' +
		  '<li><a href="mundsamp.html?s=2">Sample Declaration</a></li></ul>';
		  
	 s += '<ul id="navigation"><li id="title"><h4>World Syntegrity</h4></li>' +
		  '<li><a href="syn.html?s=2">Overview</a></li>' +
		  '<li><a href="synhis.html?s=2">Background</a></li>' +
		  '<li><a href="synreg.html?s=2">Registration</a></li>' +
		  '<li><a href="topics.html?s=2">Statements of Importance</a></li>' +
		  '<li><a href="syncity.html?s=2">Locations to date</a></li></ul>';
		  
	 s += '<ul id="navigation"><li id="title"><h4>World Referendum</h4></li>' +
		  '<li><a href="wref.html?s=2">Ballot</a></li></ul>';
		  
	 s += '<ul id="navigation"><li id="title"><h4>World Parliament</h4></li>' +
		  '<li><a href="comingsoon.html?s=2">Overview</a></li></ul>';
		  
	 s += '<ul id="navigation"><li id="title"><h4>Views From My Space!</h4></li>' +
		  '<li><a href="http://blog.worldservice.org/2010/05/world-thought-corollary-to-world-action.html">The Garry Davis Blog</a></li>' +
		  '<li><a href="roundup.html?s=4">Global Roundup</a></li>' +
		  '<li><a href="update.html?s=4">Updates Archive</a></li></ul>';
	break;
	case "4":
	 s += '<ul id="navigation"><li id="title"><h4>Views From My Space!</h4></li>' +
		  '<li><a href="http://blog.worldservice.org/2010/05/world-thought-corollary-to-world-action.html">The Garry Davis Blog</a></li>' +
		  '<li><a href="roundup.html?s=4">Global Roundup</a></li>' +
		  '<li><a href="update.html?s=4">Updates Archive</a></li></ul>';
		  
	 s += '<ul id="navigation"><li id="title"><h4>Endorsement</h4></li>' +
		  '<li><a href="endorse.html?s=4">Letters of Support</a></li>' +
		  '<li><a href="letters.html?s=4">Letters to the WSA</a></li>' +
		  '<li><a href="cat.html?s=4">Catalog</a></li>' +
		  '<li><a href="appeal.html?s=4">Appeal</a></li></ul>';
		  
	 s += '<ul id="navigation"><li id="title"><h4>Contact</h4></li>' +
		  '<li><a href="contacts.html?s=4">Contact the WSA</a></li>' +
		  '<li><a href="emailform.html?s=4">Email to a Friend</a></li>' +
		  '<li><a href="feedback.html?s=4">Feedback</a></li></ul>';
		  
	 s += '<ul id="navigation"><li id="title"><h4>World Citizen News</h4></li>' +
	 	  '<li><a href="wcn.html?s=4">WCN Magazine</a></li>' +
		  '<li><a href="carts.html?s=4">WCN Cartoons</a></li></ul>';
		  
	break;
	case "1":
	default : 
	 s += '<ul id="navigation"><li id="title"><h4>Documents</h4></li>' +
		  '<li><a href="docindex.html?s=1">Official Documents</a></li>' +
		  '<li><a href="visas.html?s=1">Visas</a></li>' +
		  '<li><a href="official.html?s=1">Official Letters</a></li></ul>';
	
	 s += '<ul id="navigation"><li id="title"><h4>Reference</h4></li>' +
		  '<li><a href="def.html?s=1">Definitions</a></li>' +	 
		  '<li><a href="ref.html?s=1">Main References</a></li>' +
		  '<li><a href="wsal.html?s=1">Legal Department</a></li>' +
		  '<li><a href="wcwfaq.html?s=1">Frequently Asked Questions</a></li></ul>';
		 
	 s += '<ul id="navigation"><li id="title"><h4>World Citizenship</h4></li>' +
		  '<li><a href="reg.html?s=1">How To Register</a></li>' +
		  '<li><a href="docpass.html?s=1">Passport</a></li>' +
		  '<li><a href="forms.html?s=1">Application Forms</a></li></ul>';
		  
	 s += '<ul id="navigation"><li id="title"><h4>Catalog</h4></li>' +
		  '<li><a href="cat.html?s=4">Books, Videos, etc.</a></li></ul>';
		
	 s += '<ul id="navigation"><li id="title"><h4>Views From My Space!</h4></li>' +
		  '<li><a href="http://blog.worldservice.org/2010/05/world-thought-corollary-to-world-action.html">The Garry Davis Blog</a></li>' +
		  '<li><a href="roundup.html?s=4">Global Roundup</a></li>' +
		  '<li><a href="update.html?s=4">Updates Archive</a></li></ul>';
   } 
   document.write(s);
}

function w_bread() {
  var s = '' +
    '<ul><li class="first">Home' +
	 '<ul><li> Products' +
	   '<ul><li> Computers</li></ul>' +
	 '</li></ul>' +
	'</li></ul>';
  s = '';
  document.write(s);
}

function w_search() {
   var s = '' +
    '<form method="post" class="search" action="#">' +
		'<p><input name="search_query" class="textbox" type="text" />' +
  		'<input name="search" class="button" value="Search" type="submit" /></p>' +
	'</form>';
	s = '';
	document.write(s);
}

function w_comments() {
   var s = '' +
    '<p class="post-footer align-right">' +
			'<a href="index.html" class="readmore">Read more</a>' +
			'<a href="index.html" class="comments">Comments (15)</a>' +
			'<span class="date">Aug 30, 2007</span>' +
	'</p>';
	document.write(s);
}

function w_group() {
   var s = '' +
	'<h1>World Citizen Group</h1>' + 
	'<p id="imgcenter">A dialogue on human rights and world citizenship, law and government.' +
	'<a href="http://groups.yahoo.com/group/WorldCitizen/join"><img src="graphics/yg_join.gif" border="0"><br> Subscribe to the WorldCitizen Group</a></p>';
	document.write(s);
}


function w_footer1(l) {
   var s = '<div id="footer"><div id="footer-content">';
   if(l==""||l==null) s+='<div id="footer-right"><a href="contacts.html?s=4">Contact</a> | <a href="feedback.html?s=4">Email</a> | <a href="links.html">Links</a></div><div id="footer-left">';
   else s+='<div>';
   s+='&copy; Copyright (c) 2010 &nbsp;<strong>World Service Authority. </strong> All rights reserved.&nbsp;</div></div></div>';
   document.write(s);
}
function w_footer3(l) {
   var s = '<div id="footer"><div id="footer-content2"><hr />';
   if(l==""||l==null) s+='<div id="footer-right"><a href="contacts.html?s=4">Contact</a> | <a href="feedback.html?s=4">Email</a> | <a href="links.html">Links</a></div><div id="footer-left">';
   else s+='<div>';
   s+='&copy; Copyright (c) 2010 &nbsp;<strong>World Service Authority. </strong> All rights reserved.&nbsp;</div></div></div>';
   document.write(s);
}
function w_footer2() {
   var s = '' +
    '<div id="cpr" style="font-size: 1.0em; text-align: center; margin-top: 0px; margin-bottom: 2px;">' +
	'<P id="foot"><img src="graphics/wcw.gif" width="34" height="34" title="human-embracing-the-globe"/></p>' +
	'The World Service Authority, and the human-embracing-the-globe logo are service marks or ' +
	'registered service marks of the World Service Authority throughout the world.</div>';
   document.write(s);
//   alert(document.getElementById('main').childNodes[4].innerHTML);
}

function openWin(url,nm,l,menu) {
 var s="";
 var o=",status=yes,resizable=yes,scrollbars=yes,titlebar=yes";
 if (menu == "menu") o+=",menubar=yes";
 if (l == "" || l == null) s+="width=400,height=500"+o; else s="width=650,height=850"+o;
 if (window.opener) {
  if(window.opener.closed) {
   var w=window.open(url,nm,s);
   w.focus();
  } else {
     opener.location.href=url;
     opener.focus();
    }
 } else {
    var w=window.open(url,nm,s);
    w.focus();
   }
}

function valCookie(name){
 var nm=getCookie(name);
 var v=nm.substring(nm.indexOf("="),nm.length);
 return v;
}

function getCookie(name){
 var cook = document.cookie;
 var index = cook.indexOf(name + "=");
 if (index == -1) return null;
 index = cook.indexOf("=", index) + 1;
 var endstr = cook.indexOf(";", index);
 if (endstr == -1) endstr = cook.length;
 return unescape(cook.substring(index,endstr));
}

function deleteCookie(name){if (getCookie(name)){document.cookie=name+"="+"; expires=Thu, 01-Jan-70 00:00:01 GMT";}}

function setC(set_c,val){
 setCookie(set_c,val,null,"/");
//  alert("Setting " + set_c + " to " + t);
}

function setCookie(name, value, exp, path, domain, secure) {
 if (exp){
  var expdate = new Date ();
  expdate.setTime(expdate.getTime() + (exp * 60 * 60 * 1000));
  var ed="; expires=" + expdate.toUTCString();
 } else {var ed="";}
 document.cookie = name + "=" + escape(value) + ed +
  ((path) ? "; path=" + path : "") +
  ((domain) ? "; domain=" + domain : "") +
  ((secure) ? "; secure" : "");
}

function setPage(form) {
   window.location = "emailform.html?" + escape(self.location);
}
