
            function validateEmailv2(email)
            {            
                if(email.length <= 0)
	            {
	                return true;
	            }
                var splitted = email.match("^(.+)@(.+)$");
                if(splitted == null) return false;
                if(splitted[1] != null )
                {
                    var regexp_user=/^\"?[\w-_\.]*\"?$/;
                    if(splitted[1].match(regexp_user) == null) return false;
                }
                if(splitted[2] != null)
                {
                    var regexp_domain=/^[\w-\.]*\.[A-Za-z]{2,4}$/;
                    if(splitted[2].match(regexp_domain) == null) 
                    {
	                    var regexp_ip =/^\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\]$/;
	                    if(splitted[2].match(regexp_ip) == null) return false;
                    }
                    return true;
                }
                return false;
            }
            function AddEmailID()
            {  
                if(trim(document.getElementById("txtemailid").value)=="")
                {
                    document.getElementById("txtemailid").focus();
                    alert("Enter emailid to subscribe to news letter");                    
                    return false;
                }
                else if(!validateEmailv2(trim(document.getElementById("txtemailid").value))) 
                { 
                    var strError = "Enter a valid email address "; 
                    document.getElementById("txtemailid").focus();
                    alert(strError); 
                    return false; 
                }
                
                var stremail= trim(document.getElementById("txtemailid").value);  
                var response = AjaxUtilsMethods.AddUserEmailID(stremail);            
                var ds = response.value;                
                if(ds>0)
                {            
                      document.getElementById("txtemailid").value="";            
                      alert("Successfully Subscribed");
                }
                else
                {   
                    document.getElementById("txtemailid").value="";
                    alert("Email Id Already Exists");
                }
            }        
            function BindLinks()
            {
                if(document.getElementById('sculpture') != null)
                {
                     document.getElementById('asculpture').href = "/subcategories/frmSubCategory"+ document.getElementById('sculpture').value +".shtml"
                }
                if(document.getElementById('prints') != null)
                {
                     document.getElementById('aprints').href = "/subcategories/frmSubCategory"+ document.getElementById('prints').value +".shtml"
                }
                if(document.getElementById('painting') != null)
                {
                     document.getElementById('apainting').href = "/subcategories/frmSubCategory"+ document.getElementById('painting').value +".shtml" 
                }
                if(document.getElementById('drawing') != null)
                {
                     document.getElementById('adrawing').href = "/subcategories/frmSubCategory"+ document.getElementById('drawing').value +".shtml" 
                }
                if(document.getElementById('photography') != null)
                {
                     document.getElementById('aphotography').href = "/subcategories/frmSubCategory"+ document.getElementById('photography').value +".shtml" 
                }
                if(document.getElementById('digital') != null)
                {
                     document.getElementById('adigital').href = "/subcategories/frmSubCategory"+ document.getElementById('digital').value +".shtml" 
                }
                if(document.getElementById('ArtCollectibles') != null)
                {                    
                     document.getElementById('aArtCollectibles').href = "/subcategories/frmSubCategory"+ document.getElementById('ArtCollectibles').value +".shtml" 
                }
            }
            window.onLoad=BindLinks();
            
