function OpenPopUp(url)
{
	window.open(url, 
		"_blank", 
		"height=515, width=450, left=0, top=0, " +
		"location=no, menubar=no, resizable=no, " +
		"scrollbars=yes, titlebar=no, toolbar=no", false);
}

function OpenLocal(url)
{
	window.open(url, 
		"_blank", 
		"height=620, width=750, left=350, top=100, " +
		"location=no, menubar=no, resizable=yes, " +
		"scrollbars=yes, titlebar=no, toolbar=no", false);
}
function reloadPage(){
	location.reload();
}
function printPage() {
  if (window.print)
    window.print();
}
function getYear()
{
	var year = new Date();
	year = year.getFullYear();
	document.open();
	document.write(year);
	document.close();
}

function ValidateHtmlEditor(oSrc, args){
   args.IsValid = (args.Value.Length > 0);
}

function roll(id, newSrc) {
    var theImage = findImage(document, id, 0);
    if (theImage) {
      if (typeof(keep) == 'undefined')
        theImage.src = newSrc;
      else {
        if (id != keep)
          theImage.src = newSrc;
      }
    }
}

function findImage(doc, name, j) {
    var theImage = false;
    if (doc.images) theImage = doc.images[name];
    if (theImage) return theImage;
    if (doc.layers) {
        for (j = 0; j < doc.layers.length; j++) {
            theImage = findImage(doc.layers[j].document, name, 0);
            if (theImage) return (theImage);
        }
    }
    return (false);
}

function show(object) {
    if (document.getElementById && document.getElementById(object) != null)
         document.getElementById(object).style.visibility='visible';
    else if (document.layers && document.layers[object] != null)
        document.layers[object].visibility = 'visible';
    else if (document.all && document.all[object])
        document.all[object].style.visibility = 'visible';
}

function hide(object) {
    if (document.getElementById && document.getElementById(object) != null)
         document.getElementById(object).style.visibility='hidden';
    else if (document.layers && document.layers[object] != null)
        document.layers[object].visibility = 'hidden';
    else if (document.all && document.all[object])
         document.all[object].style.visibility = 'hidden';
}

function appear() {
  for (i=0; i < arguments.length; i++) {
    if (document.getElementById && document.getElementById(arguments[i]) != null) {
         document.getElementById(arguments[i]).style.visibility='visible';
         document.getElementById(arguments[i]).style.display = 'inline';
    }
    else if (document.layers && document.layers[arguments[i]] != null)
        document.layers[arguments[i]].visibility = 'visible';
    else if (document.all && document.all[arguments[i]])
        document.all[arguments[i]].style.visibility = 'visible';
  }
}

function disappear() {
  for (i=0; i < arguments.length; i++) {
    if (document.getElementById && document.getElementById(arguments[i]) != null) {
         document.getElementById(arguments[i]).style.visibility='hidden';
         document.getElementById(arguments[i]).style.display = 'none';
    }
    else if (document.layers && document.layers[arguments[i]] != null)
        document.layers[arguments[i]].visibility = 'hidden';
    else if (document.all && document.all[arguments[i]])
         document.all[arguments[i]].style.visibility = 'hidden';
  }
}

function isVisible(elementName) {
    if (document.getElementById && document.getElementById(arguments[0]) != null)
      return document.getElementById(arguments[0]).style.visibility;
    else if (document.layers && document.layers[arguments[0]] != null)
      return document.layers[arguments[0]].visibility;
    else if (document.all && document.all[arguments[0]])
      return document.all[arguments[0]].visibility;
}

function toggleVisibility() {
  for (i=0; i < arguments.length; i++) {
    if (document.getElementById && document.getElementById(arguments[i]) != null) {
      document.getElementById(arguments[i]).style.visibility = (document.getElementById(arguments[i]).style.visibility == 'hidden') ? 'visible' : 'hidden';
      document.getElementById(arguments[i]).style.display = (document.getElementById(arguments[i]).style.display == 'none') ? 'inline' : 'none';
    }
    else if (document.layers && document.layers[arguments[i]] != null)
      document.layers[arguments[i]].visibility = (document.layers[arguments[i]].visibility == 'hidden') ? 'visible' : 'hidden';
    else if (document.all && document.all[arguments[i]])
      document.all[arguments[i]].style.visibility = (document.all[arguments[i]].visibility == 'hidden') ? 'visible' : 'hidden';
  }
}

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_setTextOfTextfield(objName,x,newText) { //v3.0
  var obj = MM_findObj(objName); if (obj) obj.value = newText;
}

function MM_resetTextOfTextfield(objName,x,newText) { //v3.0
  var obj = MM_findObj(objName); if (obj && (obj.value == '')) obj.value = newText;
}

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_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];}
}








//--------------------------------------------------------------------scroller functions
function startdown1(co,iheight)
{
if (iens6)
	contentheight=crossobj1.offsetHeight
else if (ns4)
	document.nscontainer1.document.nscontent1.visibility="show"
movedown(co,iheight);
}

function startdown2(co,iheight)
{
if (iens6)
	contentheight=crossobj2.offsetHeight
else if (ns4)
	document.nscontainer2.document.nscontent2.visibility="show"
movedown(co,iheight);
}
function startdown3(co,iheight)
{
if (iens6)
	contentheight=crossobj3.offsetHeight
else if (ns4)
	document.nscontainer3.document.nscontent3.visibility="show"
movedown(co,iheight);
}

function movedown(co,iheight){
	if (iheight == undefined) { iheight = 270 }
	if (window.moveupvar) clearTimeout(moveupvar)
		if (iens6&&parseInt(co.style.top)>=(contentheight*(-1)+iheight))
			co.style.top=parseInt(co.style.top)-speed+"px"
		else if (ns4&&co.top>=(contentheight*(-1)+iheig))
			co.top-=speed
			method = function(e)//fix mac ie bug
		{
			movedown(co,iheight);
		}
		movedownvar = setTimeout("method()",20)//function() {movedown(co);},20)
}






function startup1(co)
{
if (iens6)
contentheight=crossobj1.offsetHeight
else if (ns4)
document.nscontainer1.document.nscontent1.visibility="show"
moveup(co);

}
function startup2(co)
{
if (iens6)
contentheight=crossobj2.offsetHeight
else if (ns4)
document.nscontainer2.document.nscontent2.visibility="show"
moveup(co);
}
function startup3(co)
{
if (iens6)
contentheight=crossobj3.offsetHeight
else if (ns4)
document.nscontainer3.document.nscontent3.visibility="show"
moveup(co);
}

function moveup(co)
{

if (window.movedownvar) clearTimeout(movedownvar)
if (iens6&&parseInt(co.style.top)<=0)
co.style.top=parseInt(co.style.top)+speed+"px"
else if (ns4&&co.top<=0)
co.top+=speed
method = function(e)//fix mac ie bug
{
	moveup(co);
}
moveupvar= setTimeout("method()",20)//(function(){moveup(co);},20)
}





function stopscroll()
{
if (window.moveupvar) clearTimeout(moveupvar)
if (window.movedownvar) clearTimeout(movedownvar)
}


