function createWindow(cUrl, cName, cFeatures) { 
var xWin = window.open(cUrl, cName, cFeatures);
}
  function DivSetVisible(state)
  {
   var DivRef = document.getElementById('PopupDiv');
   var IfrRef = document.getElementById('DivShim');
   if(state)
   {
    DivRef.style.display = "block";
    IfrRef.style.width = DivRef.offsetWidth;
    IfrRef.style.height = DivRef.offsetHeight;
    IfrRef.style.top = DivRef.style.top;
    IfrRef.style.left = DivRef.style.left;
    IfrRef.style.zIndex = DivRef.style.zIndex - 1;
    IfrRef.style.display = "block";
   }
   else
   {
    DivRef.style.display = "none";
    IfrRef.style.display = "none";
   }
  }

function FixMenusInIE() {
	if (document.all && document.getElementById) {
		var navRoot, listitems, index, node;

		navRoot = document.getElementById("menucell");

		if (!navRoot) return;

		listitems = navRoot.getElementsByTagName("LI");

		if (!listitems) return;

		for (index in listitems) {
			node = listitems[index];

			node.onmouseover=function() {
				this.className+=" over";
			}
			node.onmouseout=function() {
				this.className=this.className.replace
					(" over", "");
			}
		}
	}
}

function MakePopupLinks() {
	/*
	 * The target attribute of links isn't part of HTML4 Strict. so we
	 * add rel="external" to such links instead and add the target
	 * attribute with javascript.
	 *
	 * Also, this lets us make popup windows easily, by adding rel="popup"
	 */
	if (document.getElementsByTagName) {
		var links = document.getElementsByTagName("A");
		var link, index;

		for (index in links) {
			link = links[index];
			if (!link.rel) continue;

			if (link.rel == "external") {
				link.target = "_blank";
			}

			if (link.rel == "popup") {
				var href = link.href;
				link.onclick = function() {
					window.open(href, "",
					'width=500,height=400,'+
					'resizable=no,scrollbars=yes,');
					return false;
				}
			}
		}
	}
}

function Randomtext() {

var r_text = new Array ();

r_text[0] = "/images/text1.jpg";
r_text[1] = "/images/text2.jpg";
r_text[2] = "/images/text3.jpg";
r_text[3] = "/images/text4.jpg";
r_text[4] = "/images/text5.jpg";
r_text[5] = "/images/text6.jpg";
r_text[6] = "/images/text7.jpg";
r_text[7] = "/images/text8.jpg";
r_text[8] = "/images/text9.jpg";
r_text[8] = "/images/text10.jpg";

var i = Math.round(8*Math.random());

document.write(('<img src="'+r_text[i]+'">'));

}



window.onload = function() {
	FixMenusInIE();
	MakePopupLinks();
}

function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=500,height=400');");
}

function openWin(url, w, h)
{
var winprop = "width=" + w + ",height=" + h;
openwin = window.open(url,'',winprop);
}

function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, windowname,'width=500,height=350,'+
					'resizable=yes,scrollbars=yes,');
return false;
}

function to_old_win(url)
{
	opener.location.href = url;
}

function newWindow(url)
{
    window.open(url);
  return false;  
}