 function goSetHeight() 
    {
		if (parent == window) 
			return;
		else	
		{
			try
			{
				parent.setIframeHeight('ifrm');
			}
			catch(err)
			{}
		}
	}
	// Retrieves the specified query string parameter.
function getQueryVariable(variable)
{
    var query = window.location.search.substring(1);
    var vars = query.split("&");
    for (var i=0; i<vars.length;i++)
    {
        var pair = vars[i].split("=");
        if (pair[0] == variable)
        {
            return pair[1];
        }
    }
}

// Function that gets called on the onload property of the body to
// set the source code in the hidden field of a form and to append
// the source code to a link. The link should contain the word 'Source='.
function SetSourceCode(fieldToSet, linkToAppendCodeTo)
{			    
    var source = getQueryVariable('source');
    
    // If source cannot be found, check for Source.
    if (!source) {
        source = getQueryVariable('Source');
    }
    
    // If the source cannot be found, default to MS.
    if (!source) {
        source = "MS";
    }
    
    // The Input Hidden source code.
    document.getElementById(fieldToSet).value = source;
    
}

/////////////////////////////////////////////
//Common Validation  Functions
/////////////////////////////////////////////

// validation for drop down lists.
function validateDDL(Id, NotSelectedValue, Msg)
{
	if (document.getElementById(Id).value == NotSelectedValue)
	{
		alert(Msg);
		document.getElementById(Id).focus();
		return false;
	}
	return true;
}
