function unhidediv(element,layername)
{
    var div

    div = document.getElementById(layername)
    div.style.visibility = "visible";
    div.style.left = element.style.left + 100;
    div.style.top = element.style.top;
    div.style.width = 200;
    div.style.height = 200;
    div.style.position = "relative";
    div.focus();
}

function hidediv(layername)
{
    div = document.getElementById(layername);
    div.style.top=1;
    div.style.left=1;
    div.style.height=0;
    div.style.width=0;
    div.style.visibility = "hidden";
}



function PopOut(sURL,sTitle,iHeight,iWidth,ynScroll,ynResize) {
var objWin;
  objWin = window.open(sURL, sTitle, "height="+iHeight+",width="+iWidth+",scrollbars="+ynScroll+",resizable="+ynResize+"");
  if (parseInt(navigator.appVersion) >=4) objWin.window.focus();
}

function open_new_window(element) 
{
new_window = open("","hoverwindow","width=300,height=200,left=10,top=10,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1");
new_window.moveTo(element.style.left + 300, element.style.top+ 100);
// open new document 
new_window.document.open();

// Text of the new document
// Replace your " with ' or \" or your document.write statements will fail
new_window.document.write("<html><title>JavaScript New Window</title>");
new_window.document.write("<body bgcolor=\"#FFFFFF\">");
new_window.document.write("This is a new html document created by JavaScript ");
new_window.document.write("statements contained in the previous document.");
new_window.document.write("<br>");
new_window.document.write("</body></html>");

// close the document
new_window.document.close(); 

}

// This is the function that will close the
// new window when the mouse is moved off the link
function close_window() 
{
new_window.close();
}


function PrintPage() {
if (window.print != null) { 
	window.print(); 
	} 
else { 
	alert('Your browser does not support this shortcut.  Please select Print from the File menu.'); 
	}
};

function buttonclick(button,image){

    button.src=image;

}

function PhotoLoadFailed(imageObj,width,height)
{
	imageObj.src = "images/NoPhoto.gif";
	imageObj.width = width;
	imageObj.height = height;
	imageObj.alt = "No Photo On File";
}

function SketchLoadFailed(imageObj)
{
	imageObj.src = "images/NoSketch.gif";
	imageObj.width = 192;
	imageObj.height = 192;
	imageObj.alt = "No Sketch On File";
}

function NoSketch(obj)
{
    document.write("No Sketch on file!");
}


function setSearchFrame(value)
{
    var sf=top.data_frame.search
    var m_toggleResults;
    var m_activeSearchFrame;
    var searchtype;
    try{
        m_activeSearchFrame = sf.document.getElementById("hvActiveFrame");
        m_activeSearchFrame.value = value;
        
        searchtype = sf.document.getElementById("hvSearchType");
        if (searchtype.value == 1){
            m_toggleResults = sf.document.getElementById("toggleResults1");
        }else{
            m_toggleResults = sf.document.getElementById("toggleResults0");
        }

        if (value == 0){
            m_toggleResults.value = "Results"
        }
        else
        {
            m_toggleResults.value = "Examples"
        }
    }
    catch(err){}
}

var downStrokeField;

function autojump(fieldName,nextFieldName,fakeMaxLength)
{
    try {
        var myForm=document.forms[document.forms.length - 1];
        var myField=myForm.elements[fieldName];
        myField.nextField=myForm.elements[nextFieldName];
        if (myField.maxLength == null)
            myField.maxLength=fakeMaxLength;

        myField.onkeydown=autojump_keyDown;
        myField.onkeyup=autojump_keyUp;
    }
    catch(ex){
    }
}

function autojump_keyDown()
{
this.beforeLength=this.value.length;
downStrokeField=this;
}

function autojump_keyUp()
{
if (
   (this == downStrokeField) && 
   (this.value.length > this.beforeLength) && 
   (this.value.length >= this.maxLength)
   )
   this.nextField.focus();
downStrokeField=null;
}


function onClose() 
{ 
if ((window.event.clientX<0) && (window.event.clientY<0)) 
    myWindow = window.open("CleanUp.aspx", "tinyWindow", 'toolbar,width=5,height=5,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0'); 
;
} 

 function DetectPopUp() 
    {

        var popup = window.open('blank.htm','Testing','width=300,height=300'); 

        if(popup != null) 
        { 
            // this means that the popup block is OFF.  Popups are OK.
            hv = document.getElementById("hvPopups")
            hv.value = "true"
        }

        else 
        {
            // This means that popup blocker is on. Popups not allowed.
            hv = document.getElementById("hvPopups")
            hv.value = "false"
        }

    }


