function validate_form()
{
	if(document.contact_form.name.value=="")
	{
		alert("Please enter your Full Name");
		document.contact_form.name.focus();
		return false;
	}

			
var string1=document.contact_form.email.value;
	if(string1=="")
	{
		alert("Please enter your Email address");
		document.contact_form.email.focus();
		return false;
	}

	if((string1.indexOf("@")==-1)|| (string1.indexOf(".")==-1))
	{
		alert("Please enter a valid Email address");
		document.contact_form.email.focus();
		return false;
	}
return true;

} 



function NewWindow( valgif ) {
	n_win = open(valgif,"ThisWindow","toolbar=no,directories=no,menubar=no,scrollbars=yes,height=530,width=500");
	n_win.document.close();
}



function isaN(str) {
	if(parseInt(str) != str){
	     return false;
  	}
  	return true;
}


/*Form validation code*/
function goodchar(string) {
var good="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";

    for (var i = 0; i < string.length; i++) {
       if (good.indexOf(string.charAt(i)) == -1) {
          return false;
      // alert("Not valid");
       }
       else { 
          return true;
//alert("VAlid");
       }    
} 
}

function validate_required(field,alerttxt)
{
with (field)
{
if (value==null||value=="")
  {alert(alerttxt);return false}
else {return true}
}
}

function validate_email(field,alerttxt)
{
with (field)
{
apos=value.indexOf("@")
dotpos=value.lastIndexOf(".")
if (apos<1||dotpos-apos<2) 
  {alert(alerttxt);return false}
else {return true}
}
}


function validate_phone(field,alerttxt)
{
	s=field.value;
	
	if (isNaN(s)==true||(s.length>=16)) 
	  {alert(alerttxt);return false}
	else {return true}

}



function validateFrm(thisform) {
	//alert("Hi you are inside the function"+thisform.id);
	with (thisform)
{
	var str=thisform.email.value;
	
	 if(name.value==""||name.value=="Name") 
	{ 
		alert("Please enter your Name");
		name.focus();
		return false;
	}
	else if (validate_required(address," Please enter your Address ")==false)
	{
		address.focus();return false
	}
	else if (phone.value==""||phone.value==null) 
	{
		alert("Please enter your Phone No");
		phone.focus();
		return false;
	}	
	else if(validate_phone(phone,"Please enter a valid Phone No")==false)
  	{
  		phone.focus();return false
  	}
  	else if (email.value==""||phone.value==null) 
	{
		alert("Please enter your Email Address");
		email.focus();
		return false;
	}
	else if(validate_email(email,"Please enter a valid Email Address")==false)
  	{
  		email.focus();return false
	}
}

} 

function OpenNewWindow(form)
{
	var jumpToHere;
	jumpToHere = form.paintings[form.paintings.selectedIndex].value;
	form.price.value="Rs. "+jumpToHere;
 }

function filllist()
{

var paintings=new Array("-----Select Your Art-----", "SK-100 : Are you ready to be free?", "SK-103 : Dancing in the storm", "SK-110 : Ganesha", "SK-111 : Ganesha", "SK-113 : Ganeshuman", "SK-114 : Happy Ganesh", "SK-116 : Third Eye", "SK-117 : Imrana", "SK-119 : Kites on a string", "SK-120 : Looking Out", "SK-121 : Three women on the grass", "SK-122 : Maya", "SK-123 : Mother and Child", "SK-124 : Mother and Child", "SK-129 : Rebirth", "SK-130 : Rebirth", "SK-131 : Red in the face", "SK-132 : Ganesha", "SK-133 : Ganesha", "SK-136 : Schizophrenia", "SK-137 : Scream", "SK-142 : Who am I?", "SK-144 : Words", "SK-145 : Pilgrimage", "SK-146 : I've learnt");
var prices=new Array("", "1,50,000", "75,000", "40,000", "35,000", "55,000", "55,000", "1,50,000", "55,000", "1,75,000", "40,000", "75,000", "80,000", "1,75,000", "99,000", "60,000", "60,000", "40,000", "40,000", "35,000", "1,50,000", "20,000", "45,000", "1,50,000", "1,40,000", "1,50,000");
num=paintings.length;
for(var i=0; i<num; i++)
	{

document.write('<option value=' + prices[i] + '>'+ paintings[i] + '</option>');
}
} 