﻿// JScript File

function showhidePanel(objDiv)
{
    
	var divsearch  = document.getElementById(objDiv).style;
	if(divsearch.display == "none")
	    if (document.all)
		    divsearch.display = "block";
		 else
		    divsearch.display = "table-row";
	else
		divsearch.display = "none";
		
	return false;
}

function displayColumns(objDiv, fromList, txtfrom, toList, txtTo)
{
	var divcolumn  = document.getElementById(objDiv).style;
	if(divcolumn.display == "none")
		divcolumn.display = "block";					
	else
		divcolumn.display = "none";					
		
    // Assign default values.
    AssignObjValue(fromList, txtfrom, toList, txtTo)
	return false;
}

function AssignObjValue(fList, tfrom, tList, tTo)
{
    objleft = document.getElementById(fList);
	objlefttext = document.getElementById(tfrom);
	objright = document.getElementById(tList);
	objrighttext = document.getElementById(tTo);
}

function generateListArray()
{
    //if(objright.length>0)
    //{
    all_array();
    return true;
    //}
}

function validateImage(obj)
{
    if(obj.value != "" && obj.value.length > 4)
    {
        var ext = obj.value.substring(obj.value.length - 3, obj.value.length);
        if(ext == 'jpg' || ext == 'jpg' || ext == 'gif' || ext == 'GIF' || ext == 'png' || ext == 'PNG')
        {
            return true;
        }
    }
    obj.value = "";
    obj.focus();
    alert("Please select only .JPG, .GIF or .PNG image file.");
    return false;
}