var requiredMajorVersion = 9;
var requiredMinorVersion = 0;
var requiredRevision = 0;

function isValidEmail(strEmail){
	validRegExp = /^([a-z0-9._-](\+[a-z0-9])*)+@[a-z0-9.-]+\.[a-z]{2,6}$/i;
	if (strEmail.search(validRegExp) == -1) {
		return false;
	} else {
		return true; 
	}
}

function isInt(value){
  if((parseFloat(value) == parseInt(value)) && !isNaN(value)){
      return true;
  } else {
      return false;
  }
}

function switch_class(id, newClass) {
	identity = document.getElementById(id);
	identity.className=newClass;
}

function showhide(id) {
	identity = document.getElementById(id);
	if (identity.style.display!="inline") {
		identity.style.display = "inline";
	} else {
		identity.style.display = "none";
	}
}

function submitForm(id) {
	identity = document.getElementById(id);
	identity.submit();
}

function externalLinks() {  
 if (!document.getElementsByTagName) return;  
 var anchors = document.getElementsByTagName("a");  
 for (var i=0; i<anchors.length; i++) {  
   var anchor = anchors[i];  
   if (anchor.getAttribute("href") &&  
       anchor.getAttribute("rel") == "external")  
     anchor.target = "_blank";  
 }  
}  
window.onload = externalLinks;

function activateTab(id,container_id) {
	if ((document.getElementById(id)) && (document.getElementById(container_id))) {
		identity = document.getElementById(id);
		container_identity = document.getElementById(container_id);		
		container_identity.innerHTML = identity.innerHTML;
		if ((document.getElementById('link_'+id)) && ((document.getElementById('leftcap_'+id)))) {
			base = id.substring(0,id.length-1);
			for (i=1;i<=10;i++) {
				if ((document.getElementById('link_'+base+i)) && ((document.getElementById('leftcap_'+base+i)))) {
					linkid=document.getElementById('link_'+base+i);
					linkid.className='';
					leftcapid=document.getElementById('leftcap_'+base+i);
					leftcapid.style.display = 'none';					
				}
			}
			linkid = document.getElementById('link_'+id);
			linkid.className='selected';
			leftcapid = document.getElementById('leftcap_'+id);
			leftcapid.style.display = 'inline';
		}
	}
}

(function($) {
    if ($.browser.mozilla) {
        $.fn.disableTextSelect = function() {
            return this.each(function() {
                $(this).css({
                    'MozUserSelect' : 'none'
                });
            });
        };
        $.fn.enableTextSelect = function() {
            return this.each(function() {
                $(this).css({
                    'MozUserSelect' : ''
                });
            });
        };
    } else if ($.browser.msie) {
        $.fn.disableTextSelect = function() {
            return this.each(function() {
                $(this).bind('selectstart.disableTextSelect', function() {
                    return false;
                });
            });
        };
        $.fn.enableTextSelect = function() {
            return this.each(function() {
                $(this).unbind('selectstart.disableTextSelect');
            });
        };
    } else {
        $.fn.disableTextSelect = function() {
            return this.each(function() {
                $(this).bind('mousedown.disableTextSelect', function() {
                    return false;
                });
            });
        };
        $.fn.enableTextSelect = function() {
            return this.each(function() {
                $(this).unbind('mousedown.disableTextSelect');
            });
        };
    }
})(jQuery);
