<!--

function check_del()
{
if (window.confirm("Do you really want to delete this work?"))
{
return true;
}
else
return false;
}

function open_wind(filename)
{
url="show_work.asp?id="+filename
window.open(url,"newwin","width=700,height=650,left=150,top=50,toolbar=no,directories=no,scrollbars=yes");
window.close;
}

function show_image(image)
{
window.open(image,"newwin3","width=700,height=650,left=200,top=50,toolbar=no,directories=no,scrollbars=yes");

}
function popup_wind(filename)
{
url="view_profile.asp?id="+filename
//alert(url)
window.open(url,"newwin2","width=600,height=550,left=200,top=50,toolbar=no,directories=no,scrollbars=yes");
window.close;
}

function flash_msg()
{
email=document.form2.email.value;
if(email=="")
{
alert("Please fill in your email")
return false;
}
else if(isEmail(document.form2.email)==false) 
{
alert("The email is not valid email");
return false;
}
else
alert("Thanks for joining our mailing list");

}

function isEmail(s2) {
if (((s2.value == "" || s2.value.indexOf('@', 0) == -1) || s2.value.indexOf('.')<1) || s2.value.indexOf('@')<1) {
return false
}
else {
return true
   }
}

function get_medium()
{
index=document.form1.medium.selectedIndex;
//alert(index);
document.location.href="workofart.asp?medium="+document.form1.medium.options[index].value;

}


function get_item()
{
index=document.f1.category.selectedIndex;
cat=document.f1.category.options[index].value
//alert(cat);
document.location.href="gallery.asp?catid=" +cat
}


function spaceStripper(incomingText,str1,str2)
	{
		workString=incomingText;
		while (workString.indexOf(str1)!=-1)
		{
			workString=workString.substring(0,workString.indexOf(str1))+str2+workString.substring(workString.indexOf(str1)+str1.length,workString.length);
		}
		return workString;
	}  


	  
function submit_onclick()
{


//alert(des_length);
name_length=spaceStripper(document.f1.name.value," ","");
email_length=spaceStripper(document.f1.email.value," ","");
securityCode=document.f1.securityCode.value
//validation for email		
		fld_length=spaceStripper(document.f1.email.value," ","");
		//email is not req. field, so if email is blank do not validate
		if (fld_length.length >0 ) 
		{
		
		var genEmail=/[^A-Za-z0-9@._-]/
		var genEmail=/[^A-Za-z0-9@._-]/

		var email,atemasil,atoccurence,splitter,dotoccurance,loop,loop1,dot;
		email = document.f1.email.value ;
		atemail=email.indexOf("@");
		dotoccurance=email.indexOf(".");
		if(genEmail.test(document.f1.email.value))
		{
			alert("Please check your email address");
			document.f1.email.select();
			document.f1.email.focus();
			return false;
		}
		if (atemail==-1 | atemail==0 | dotoccurance==0)
		{
			alert("Please check your email address");
			document.f1.email.select();
			document.f1.email.focus();
			return false;
		}
		else
		{
			atoccurence=email.indexOf("@");
			if(email.indexOf("@",atoccurence+1) != atoccurence &
			    email.indexOf("@",atoccurence+1) !=-1)
			{
				alert("Please check your email address");
				document.f1.email.select();
				document.f1.email.focus();
				return false;
			}
			dotcheck=email.indexOf(".",atoccurence);
			if (dotcheck==-1)
			{
				alert("Please check your email address");
				document.f1.email.select();
				document.f1.email.focus();
				return false;
			}
			splitter=email.substr((atoccurence+1),1);
			if (splitter=='.')
			{
				alert("Please check your email address");
				document.f1.email.select();
				document.f1.email.focus();
				return false;
			}
			dotoccurance=email.lastIndexOf(".");
			if (email.substr(dotoccurance+1,1)=="")
			{
				alert("Please check your email address");
				document.f1.email.select();
				document.f1.email.focus();
				return false;
			}
			loop1=0;
			dot=new Array(email.length);
			for(loop=0;loop < email.length;loop++)
			{
				if(email.substr(loop,1)==".")
				{
					dot[loop1]=loop;
					loop1++;
				}
			}
			for(loop=0;loop<loop1;loop++)
			{
				if((dot[loop+1])-(dot[loop])==1 | email.substr(dot[loop]+1,1)=="@")
				{
					alert("Please check your email address");
					document.f1.email.select();
					document.f1.email.focus();
					return false;
				}
			}
		}
		}
		else
		{
		alert("Please fill in email field."); 
		return false;
		}

if(name_length.length==0) 
{
alert("Please fill in name field.");
return false;
} 
else if(securityCode.length==0) 
{
alert("Please fill in Security Code.");
return false;
} 

}



//-->
