/* Default Javascript File - For Non jQuery code */

String.prototype.ltrim = function() {
	return this.replace(/^\s+/,"");
}

String.prototype.rtrim = function() {
	return this.replace(/\s+$/,"");
}

String.prototype.trim = function() {
	return this.ltrim().rtrim();
};

function textboxFocus(my_textbox){
	if(my_textbox.value == my_textbox.title){
		my_textbox.value = "";
	}
}

function textboxBlur(my_textbox){
	if(my_textbox.value == ""){
		my_textbox.value = my_textbox.title;
	}
}

function isEmail(s){ 
    if (s.trim() == "") return false;
    
    var i = 1;
    var sLength = s.length;

	while ((i < sLength) && (s.charAt(i) != "@")){ 
		i++
    }

    if ((i >= sLength) || (s.charAt(i) != "@")) return false;
    else i += 2;

    while ((i < sLength) && (s.charAt(i) != ".")){ 
		i++
    }

    if ((i >= sLength - 1) || (s.charAt(i) != ".")) return false;
    else return true;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}