﻿//url rewriting postback correction!
// Sys.Application.add_load(function()
//{
//var str= window.location.href.toLowerCase();

//if (str.search(/sppmembers/i)==-1)
//{
//    var form = Sys.WebForms.PageRequestManager.getInstance()._form;
//    form._initialAction = form.action = window.location.href;
//    }
//});
//url rewriting postback correction! 

  var prm = Sys.WebForms.PageRequestManager.getInstance();

  prm.add_initializeRequest(InitializeRequest);
  prm.add_endRequest(EndRequest);
  var postback_cause;

  function InitializeRequest(sender, args) 
  {
   if (args._postBackElement!=null)
   {
  postback_cause=$get(args._postBackElement.id);
    if ((postback_cause.type=="button") || (postback_cause.type=="submit"))
        postback_cause.disabled = true;
    }
  }
 
 
 

  function EndRequest(sender, args) 
  {
  if (postback_cause!=null)
    {
 if ((postback_cause.type=="button") || (postback_cause.type=="submit"))
   postback_cause.disabled = false;
   }
  }
    
   
      
        function CancelAsyncPostBack() {
            if (prm.get_isInAsyncPostBack()) {
              prm.abortPostBack();
            }
        }
        
        
function ReloadPage()
{
window.location.href=window.location.href;
}

function ProcessStatus()
{
if (window.status) window.status='';
}

        
var maxL = 256;

function txtLimit(txtObj)
{
	if (txtObj.value.length == maxL) return false;
	return true;
}

function txtCount(txtObj,Cnt)
{ 
	objCnt = createObject(Cnt);
	objVal = txtObj.value;
	if (objVal.length > maxL) objVal = objVal.substring(0, maxL);
	if (objCnt) objCnt.innerHTML = maxL - objVal.length;
	return true;
}
function createObject(objId)
{
	if (document.getElementById) return document.getElementById(objId);
	else if (document.layers) return eval("document." + objId);
	else if (document.all) return eval("document.all." + objId);
	else return eval("document." + objId);
}
   
        
        
        
        
        
        
         function SelectThis(v) {
                                // firefox
                                if(document.createRange) {
                                        rangeToSelect = document.createRange();
                                        
rangeToSelect.selectNode(v.firstChild);
                                        curSelect = window.getSelection();
                                        curSelect.addRange(rangeToSelect);
                                        //console.log(this.firstChild);
                                        return false;
                                }
                                // ie
                                if(document.body && 
document.body.createTextRange) {
                                        range = document.body.createTextRange();
                                        range.moveToElementText(v);
                                        range.select();
                                        return false;
                                }
                        }

      
      
      
      
      
      
      

   		if(document.getElementById) { // IE 5 and up, NS 6 and up
			var upLevel = true;
			}
		else if(document.layers) { // Netscape 4
			var ns4 = true;
			}
		else if(document.all) { // IE 4
			var ie4 = true;
			}



		if(upLevel) {
			var splash = document.getElementById("splashScreen");
			}
		else if(ns4) {
			var splash = document.splashScreen;
			}
		else if(ie4) {
			var splash = document.all.splashScreen;
			}
		
		


		function showObject(obj) {
			if (ns4) {
				obj.visibility = "show";
				}
			else if (ie4 || upLevel) {
				obj.style.visibility = "visible";
				}
			}
		function hideObject(obj) {
			if (ns4) {
				obj.visibility = "hide";
				}
			if (ie4 || upLevel) {
				obj.style.visibility = "hidden";
				}
			}
