﻿function popupwindow(url)
{
    var newwindow=window.open(url,'','height=500,width=625,resizable=no,left=2,top=2');
    if (window.focus) {newwindow.focus()}		
}

function setValueOnfocus(elementId)
{
    var sCurrValue = document.getElementById(elementId).value;
        
    if (elementId == "username"){    
        if (sCurrValue == "username"){
                document.getElementById(elementId).value="";
                document.getElementById(elementId).setAttribute("class", "userpassText");
                document.getElementById(elementId).setAttribute("className", "userpassText"); //IE
            }
        }
        
    if (elementId == "password"){    
        if (sCurrValue == "password"){
                document.getElementById(elementId).value="";
                document.getElementById(elementId).setAttribute("class", "userpassText");
                document.getElementById(elementId).setAttribute("className", "userpassText"); //IE
            }
        }
}

function setValueOnBlur(elementId)
{
    var sCurrValue = document.getElementById(elementId).value;
    
    if (elementId == "username"){    
        if (sCurrValue == ""){
                document.getElementById(elementId).value="username";
                document.getElementById(elementId).setAttribute("class", "watermarkUser");
                document.getElementById(elementId).setAttribute("className", "watermarkUser"); //IE
            }
        }
        
    if (elementId == "password"){    
        if (sCurrValue == ""){
                document.getElementById(elementId).value="password";
                document.getElementById(elementId).setAttribute("class", "watermarkPass");
                document.getElementById(elementId).setAttribute("className", "watermarkPass"); //IE
            }
        }
}

