//global functions here
function getDomain()
{   
    var domain = '';
    var domainSplit = document.URL 
    
    domainSplit = domainSplit.split("/");
    
    if(domainSplit[2].indexOf('localhost') > -1 || domainSplit[2].indexOf('.0') > -1){
          domain = domainSplit[0] + '/'+ domainSplit[1] +'/' + domainSplit[2] + '/' + domainSplit[3] + '/' + domainSplit[4];
    }
    else
    {
        domain = domainSplit[0] + '/'+ domainSplit[1] +'/' + domainSplit[2];
    }
    return domain;
}

Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(function (sender, args){
	
	$("label[for]").each(function(i){
		//alert( $(this).siblings("input").length +") "+ $(this).attr("for") +" - "+ $(this).siblings("input").attr("id")  );
		//$(this).attr("for", $(this).siblings("input").attr("id")).css("cursor","pointer");
	});
 
//    var collection = [];
//    collection = $('body').descendants();
//    
//    var temp = [];
//    collection.each(function(item){
//        if(item.id != null && item.id.length > 0)
//            temp.push(item.id);
//    });
//    
//    var ids = [];
//    for(var a = 0;a < temp.length;a++)
//    {
//         ids.push({id:getCleanID(temp[a]),name:temp[a]});
//    }
//    
//    temp.length = 0;
//    
//    $id = function(id){
//        var len = ids.length;
//        for(var a = 0;a < len;a++)
//        {
//            if(id.toLowerCase() == ids[a].id.toLowerCase())
//                return ids[a].name;
//        }
//        return null;
//    }
//    
//    var Default = Class.create({
//        initialize: function(sender){
//            this.me = this;
//            this.sender = sender;
//            this.init();
//        },   
//        init:function()
//        {
//            var me = this.me;
//            //AjaxWebService.getGoogleTrkNo(this.setGoogleTrkNo);
//        }
//    }); 
//    
//    var obj_default = new Default(sender);
//        
//    function getCleanID(arg)
//    {
//        var res = []; 
//        try
//        {
//            res = arg.split('_');
//            return res[res.length-1];
//        }
//        catch(e){}
//        return arg;
//    }
//    
//    //    $($id("FirstName")).observe('click', function(event){   
//    //        alert("hello again");
//    //    }); 
//		$(document).ready(function(){
//			$("#open-close").click(function(){
//				$("#slider").slideToggle("slow",function(){
//					var strAlt = ($("#open-close img").attr("alt")=="Close")?"Open":"Close";
//					var strSrc = ($("#open-close img").attr("alt")=="Close")?"open":"close";
//					$("#open-close img").replaceWith('<img class="close" src="img/bn-' + strSrc + '.gif" alt="' + strAlt + '" width="67" height="25" border="0" title="" />');
//				});
//				return false;
//			});
//		});

});
