// function for checking string
function checkString(str_temp, str_fld)
{
	temp=new String(str_temp);
	if(str_temp=="")
	{
		window.alert("Please enter the " + str_fld);
		return false;
	}
	
	if(temp.charAt(0)==" ")
	{
		window.alert("The " + str_fld + " cannot start with a space");
		return false;
	}
	
	str=new String("'\"");
	
	var flag=1;
	
	for (c=0; c<temp.length; c++)
	{
		if(str.indexOf(temp.charAt(c))>=0)
		{
			flag=0;
			break;
		}
	}
	
	if (flag==0)
	{
		window.alert("The " + str_fld + " cannot contain single/double quotes");
		return false;
	}
	return true;
}

// function for checking number
function checkNumber(str_temp, str_fld)
{
	temp=new String(str_temp);
	if(str_temp=="")
	{
		window.alert("Please enter the " + str_fld);
		return false;
	}
	
	if(temp.charAt(0)==" ")
	{
		window.alert("The " + str_fld + " cannot start with a space");
		return false;
	}
	
	if (isNaN(str_temp))
	{
		window.alert("The " + str_fld + " can contain only numbers");
		return false;
	}
	return true;
}

// returns the filename(Thumbnail/Blowup name)
function funName(str_temp)
{
	temp=new String(str_temp);
	
	li=temp.lastIndexOf("\\");
	if(li!=-1)
	{
		li++;
		temp=temp.substr(li);
	}
	if(temp.indexOf(".")==-1)
	{
		return("");
	}
	return(temp);
}