Object.prototype.clone = function() {
  var newObj = (this instanceof Array) ? [] : {};
  for (i in this) {
    if (i == 'clone') continue;
    if (this[i] && typeof this[i] == "object") {
      newObj[i] = this[i].clone();
    } else newObj[i] = this[i]
  } return newObj;
};

String.prototype.rtrim = function() {
	return this.replace(/\s+$/,"");
}

function DisplayMenuToolBarOver(Item)
{
	Item.style.backgroundColor='#ffffff';
	Item.style.color='#000000'
}

function DisplayMenu(element, img)
{
	if (element)
	{
		element.src = img;
	}
}
function OpenMyFile(id)
{
    iccd.Log('front.js', 'OpenMyFile', id);
    window.open('getfile.aspx?id=' + id);
}
function DisplayMenuToolBarOut(Item)
{
	Item.style.backgroundColor='#006c85';
	Item.style.color='#ffffff'
}
function OpenPrintPage(id)
{
    var heightpantalla = AltoPantalla();
    var widthpantalla = AnchoPantalla();
    window.open('printarticle.aspx?id=' + id ,'','width=602,height=380,top='+((heightpantalla/2)-66)+',left='+((widthpantalla/2)-301)+', status=no,toolbar=no,menubar=no,location=no,directories=no,resizable=no,scrollbars=no');
}

function DisplayListItemOver(id)
{
    var image = x('ImageFrame_' + id);
    var title = x('Title_' + id);
    if (image && title)
    {
        image.style.backgroundColor = '#78bbcb';
        title.style.color = '#094452';
    }
}

function DisplayListItemOut(id)
{
    var image = x('ImageFrame_' + id);
    var title = x('Title_' + id);
    if (image && title)
    {
        image.style.backgroundColor = '#ffffff';
        title.style.color = '#006c85';
    }
}

function DisplayButtonBoxHome(button, urlimage)
{
    button.style.backgroundImage = 'url("images/layout/' + urlimage + '")' ;
}

function SiteLoad()
{
    if (arrEllipsisFallados && arrEllipsisFallados.length > 0)
    {
        var arr = arrEllipsisFallados.clone();
        for (var i = 0;i<arrEllipsisFallados.length;i++)
        {
            Ellipsis(arr[i].id,
                arr[i].height, 
                arr[i].add, 
                arr[i].complete, 
                arr[i].maxlength, 
                arr[i].startconcat, 
                arr[i].endconcat);
        }
        arrEllipsisFallados = [];
    }
    var buncher = document.getElementById("galleryContainer");
    if(buncher)
    {
        initSlideShow();
    }
}


var arrEllipsisFallados = [];

function Ellipsis(id, height, add, complete, maxlength, startconcat, endconcat)
{   
    if (!maxlength || maxlength == 0)
    {
        alert('El parametro MaxLength no puede valer cero en la funcion Ellipsis().');
    }
    else
    {
        var contenedor = document.getElementById(id);
        if (contenedor)
        {
            if (contenedor.offsetHeight == 0)
            {
                var element = {
                    "id" : id,
                    "height" : height,
                    "add" : add,
                    "complete" : complete,
                    "maxlength" : maxlength,
                    "startconcat" : startconcat,
                    "endconcat" : endconcat
                }
                arrEllipsisFallados.push(element);
            }
            else
            {
                /*if (complete)
                {
                    contenedor.innerHTML += ' ';
                    if (contenedor.offsetHeight < height)
                    {
                        while (contenedor.offsetHeight < height)
                        {
                            contenedor.innerHTML += '&nbsp;<br/>';
                        }
                    }
                }*/
                
                var showPoints = false;
                if (contenedor.offsetHeight > height)
                {
                    if (maxlength < GetInnerText(contenedor).length)
                    {
                        SetInnerText(contenedor, GetInnerText(contenedor).substr(0, maxlength));
                    }
                
                    for (var j=maxlength;j>0;j--)
                    {
                        if (contenedor.offsetHeight > height)
                        {
                            SetInnerText(contenedor,GetInnerText(contenedor).substr(0, j));    
                        }
                        else
                        {
                            break;
                        }
                    }
                    showPoints = true;
                }
                
                if (add != '' && add != null)
                {
                    var elementaux = document.createElement("div");
                    elementaux.innerHTML = add;
                    var addtext = GetInnerText(elementaux);
                    SetInnerText(contenedor, GetInnerText(contenedor) + addtext);
                    
                    for (var m=maxlength;m>0;m--)
                    {
                        if (contenedor.offsetHeight > height)
                        {
                            SetInnerText(contenedor, GetInnerText(contenedor).substr(0,GetInnerText(contenedor).length - (addtext.length + 1)));
                            SetInnerText(contenedor, GetInnerText(contenedor) + addtext);
                            if (!showPoints)
                            {
                                showPoints = true;
                            }
                        }
                        else
                        {
                            break;
                        }
                    }
                    SetInnerText(contenedor, GetInnerText(contenedor).substr(0,GetInnerText(contenedor).length - addtext.length));
                }
                
                if (showPoints)
                {
                    SetInnerText(contenedor, GetInnerText(contenedor).substr(0, GetInnerText(contenedor).length-3));
                    SetInnerText(contenedor, GetInnerText(contenedor) + '...');   
                }
                
                if (add != '' && add != null)
                {
                    contenedor.innerHTML = contenedor.innerHTML + ' ' +  add;
                }
                
                contenedor.innerHTML = startconcat + contenedor.innerHTML + endconcat;
            }
        }    
    }
}

function SetInnerText(object, value)
{
    value = value.rtrim();
    if(document.all)
    {
        object.innerText = value;
    } 
    else
    {
        object.textContent = value;
    }
}

function GetInnerText(object)
{
    if(document.all)
    {
        return object.innerText;
    } 
    else
    {
        return object.textContent;
    }
}

function DisplayBuncherTrackFacultyOver(element)
{
    var Images = getElementsByClassName('ImagenMini', element);
    if (Images && Images.length == 1)
    {
        Images[0].style.backgroundColor = '#086d84';
    }
}

function DisplayBuncherTrackFacultyOut(element)
{
    var Images = getElementsByClassName('ImagenMini', element);
    if (Images && Images.length == 1)
    {
        Images[0].style.backgroundColor = '#F9F9F9';
    }
}

function DisplaySubMenuOver(MenuItem, IdSubMenu)
{
    var SubMenu = $(IdSubMenu);
    if (MenuItem && SubMenu)
    {
        var x = 0;
        var y = 0;
    	var auxMenuItem = MenuItem;
        while(auxMenuItem.offsetParent && String(auxMenuItem).indexOf('HTMLBodyElement') == -1)
        {
	        x += auxMenuItem.offsetLeft;
            y += auxMenuItem.offsetTop;
            auxMenuItem = auxMenuItem.offsetParent;
        }
    	
//        var SubMenus = getElementsByClassName('SubMenu');
//        if (SubMenus)
//        {
//	        for (var i = 0; i<SubMenus.length; i++)
//	        {
//		        SubMenus[i].style.display = 'none';
//	        }
//        }
    	
        SubMenu.style.top = y + 'px';
        SubMenu.style.left = (x + MenuItem.offsetWidth) + 'px';
        SubMenu.style.display = 'block';
    }
}

function DisplaySubMenuOut(IdSubMenu, e)
{
    $(IdSubMenu).style.display = 'none';
}

function PageLoad()
{
    setInterval('DisplaySubMenu()', 5000);
}

function DisplaySubMenu()
{
    
}
function GetPageWidth()
{
	 var viewportwidth;
	 if (typeof window.innerWidth != 'undefined')
	 {
		  viewportwidth = window.innerWidth;
	 }
	 else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0)
	 {
		  viewportwidth = document.documentElement.clientWidth;
	 }
	 else
	 {
		  viewportwidth = document.getElementsByTagName('body')[0].clientWidth;
	 }
	 return viewportwidth;
}
function GetPageHeight()
{
	var pageheight = document.getElementsByTagName('body')[0].clientHeight;
	var windowheight = GetWindowHeight();
	if (pageheight < windowheight)
	{
		return windowheight;
	}
	else
	{
		return pageheight;
	}
}
function GetWindowHeight()
{
	 var viewportheight;
	 if (typeof window.innerHeight != 'undefined')
	 {
		  viewportheight = window.innerHeight;
	 }
	 else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientHeight != 'undefined' && document.documentElement.clientHeight != 0)
	 {
		  viewportheight = document.documentElement.clientHeight;
	 }
	 else
	 {
		  viewportheight = document.getElementsByTagName('body')[0].clientHeight;
	 }
	 return viewportheight;
}
function f_scrollTop() {
	return f_filterResults (
		window.pageYOffset ? window.pageYOffset : 0,
		document.documentElement ? document.documentElement.scrollTop : 0,
		document.body ? document.body.scrollTop : 0
	);
}
function f_filterResults(n_win, n_docel, n_body) {
	var n_result = n_win ? n_win : 0;
	if (n_docel && (!n_result || (n_result > n_docel)))
		n_result = n_docel;
	return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
}
function CloseModalDiv(idmodaldiv)
{
	var modaldiv = document.getElementById(idmodaldiv);
	if (modaldiv)
	{
		modaldiv.style.display = 'none';
		setCookie("ICCD_Faculty","0",1);
	}
}

function OpenModalDiv(idmodaldiv)
{
	var modaldivbg = document.getElementById(idmodaldiv + 'Bg');
	var modaldiv = document.getElementById(idmodaldiv);
	var valcookie = Get_Cookie("ICCD_Faculty");
	
	if (modaldiv && modaldivbg && valcookie != 0 && valcookie != null)
	{
		document.getElementsByTagName("html")[0].style.overflow = "hidden";
		modaldivbg.style.height = "1300px";
		modaldivbg.style.width = "1300px";
		modaldivbg.style.display = 'block';
		modaldiv.style.display = 'block';
		modaldiv.style.left = ((GetPageWidth() / 2) - (modaldiv.offsetWidth / 2)) + 'px';
		modaldiv.style.top = (((GetWindowHeight() / 2) - ((modaldiv.offsetHeight) / 2)) + f_scrollTop()) + 'px';
		resize();
	}
}

function Get_Cookie( check_name ) 
{
	// first we'll split this cookie up into name/value pairs
	// note: document.cookie only returns name=value, not the other components
	var a_all_cookies = document.cookie.split( ';' );
	var a_temp_cookie = '';
	var cookie_name = '';
	var cookie_value = '';
	var b_cookie_found = false; // set boolean t/f default f

	for ( i = 0; i < a_all_cookies.length; i++ )
	{
		// now we'll split apart each name=value pair
		a_temp_cookie = a_all_cookies[i].split( '=' );


		// and trim left/right whitespace while we're at it
		cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');

		// if the extracted name matches passed check_name
		if ( cookie_name == check_name )
		{
			b_cookie_found = true;
			// we need to handle case where cookie has no value but exists (no = sign, that is):
			if ( a_temp_cookie.length > 1 )
			{
				cookie_value = unescape( a_temp_cookie[1].replace(/^\s+|\s+$/g, '') );
			}
			// note that in cases where cookie is initialized but no value, null is returned
			return cookie_value;
			break;
		}
		a_temp_cookie = null;
		cookie_name = '';
	}
	if ( !b_cookie_found )
	{
		return null;
	}
}


function __doPostBack(eventTarget, eventArgument) 
{
    var theform = document.aspnetForm;
    
    theform.submit();
    
}
function setCookie( name, value, days) 
{
    var cookieDate = new Date();
    cookieDate.setTime( cookieDate.getTime() + ( 1000 * 60 * 60 * days ) );
    document.cookie = name + "=" + escape( value ) + "; expires=" + cookieDate.toGMTString();
}



function resize()
{
    var div = document.getElementById("Cruz");
    var wt = document.documentElement.clientWidth;
    var wf = 990;
    var w2 = 170;
    var wd = 720;
    var explorador = navigator.appName;
    
    if(explorador = "Microsoft Internet Explorer")
    {
        wd = 727;
    }
    if(explorador = "Netscape")
    {
        wd = 717;
    }
    
    if(wt > wf)
    {
        div.style.left = (((wt-wf)/2) + w2 + wd) + "px";
    }
    else
    {
        div.style.left = w2+wd;
    }
    
}
      
      
function DisplayButtonsGallery(btn, imageurl)
{
    btn.src = 'images/layout/boxhome/' + imageurl;
}

function DisplayButtonPlayPauseGallery(btn, over)
{
    if (btn.src.indexOf('gallery_play') != -1)
    {
        btn.src = 'images/layout/boxhome/' + (over ? 'gallery_play_over.png' : 'gallery_play.png');
    }
    else if (btn.src.indexOf('gallery_pause') != -1)
    {
        btn.src = 'images/layout/boxhome/' + (over ? 'gallery_pause_over.png' : 'gallery_pause.png');
    }
}


function ViewEvent(permiso,idEvento, IdHiddenIdEvent)
{
    var HiddenIdEvent = $(IdHiddenIdEvent);    
    if (HiddenIdEvent)
    {
        HiddenIdEvent.value = idEvento;
    }
    if(permiso)
    {
    
        var url = document.URL;
        var from;
        switch(url.substring(url.lastIndexOf('/')+1,url.lastIndexOf('.aspx') + 5 ))
        {
            case 'events.aspx':
                from = 'event';
            break;
            case 'bunchertrack.aspx':
                from = 'buncher';
            break;
            default:
                from = 'home';
            break;
        };
    
        Fwindow.location.href = "event-detail.aspx?id=" + idEvento + '&from=' + from;
        
    }
    else
    {
        document.getElementById("ctl00_ContentPH_LogInWindow").style.display = "block";
    }
}


var indexactualimage = 1;
function ResetPositionImages()
{
	var aimage = document.getElementById('ContImages_' + indexactualimage);
	var priimage = document.getElementById('ContImages_1');
	var btnprevious = document.getElementById('btnprevious');
	var btnnext = document.getElementById('btnnext');
	if (aimage && priimage && btnprevious && btnnext)
	{
		aimage.style.display = 'none';
		priimage.style.display = 'inline';
		indexactualimage = 1;
		btnnext.style.display = 'inline';
		btnprevious.style.display = 'none';
	}
}


function SearchContents(e, textbox)
{
    var keycode = (document.all) ? e.keyCode : e.which;
    if (keycode == 13) 
    {
        window.location = 'searchlist.aspx?t=' + textbox.value;
        e.cancelBubble=true;
		e.returnValue=false;
		e.cancel=true;
        return false;
    }
}

function GoToEvent(idevent)
{
    EventoLoginManager.IsLoggedAjax(idevent, GoToEvent_callback);
}

function GoToEvent_callback(IsLogged)
{
    if (IsLogged.error == null)
    {
        if (IsLogged.value.length == 2)
        {
            if (IsLogged.value[1] == 'true')
            {
            
                var url = document.URL;
                var from;
                switch(url.substring(url.lastIndexOf('/')+1,url.lastIndexOf('.aspx') + 5 ))
                {
                    case 'events.aspx':
                        from = 'event';
                    break;
                    case 'bunchertrack.aspx':
                        from = 'buncher';
                    break;
                    default:
                        from = 'home';
                    break;
                };
            
                window.location = 'event-detail.aspx?id=' + IsLogged.value[0] + '&from=' + from;
            }
            else
            {
                OpenLoginForm(IsLogged.value[0]);
            }
        }
    }
}

function OpenLoginForm(idevento)
{
    OpenPageInModalDiv('frmlogin.aspx?id=' + idevento);
}

function LoginRequiredFieldsValidations(Controles)
{
    var isValid = true;
    $('LoginMessages').innerHTML = '';
    if (Controles.length > 0)
    {
        for (var i=0;i<Controles.length;i++)
        {
            $('Error_'+i).innerHTML = '';        
            if (Controles[i].Control.value == '')
            {
                Controles[i].ControlContainer.className = 'TextBox Red';
                $('Error_'+i).innerHTML += Controles[i].Message + ' ';
                isValid = false;
            }
            else
            {
                Controles[i].ControlContainer.className = 'TextBox';
            }
        }
    }
    return isValid;
}

function DoLogin(IdEvento, IdTxtUserName, IdTxtPassword, IdchkRememberMe, usernameMessage, passwordMessage)
{
    var TxtUser = 
    {
        "Name" : 'TXTUSER',
        "Control" : $(IdTxtUserName),
        "Message" : usernameMessage,
        "ControlContainer" : $('ContainerTxtUserName')
    }
    
    var TxtPassword = 
    {
        "Name" : "TXTPASS",
        "Control" : $(IdTxtPassword),
        "Message" : passwordMessage,
        "ControlContainer" : $('ContainerTxtPassword')
    }
    
    var Controles = [];
    Controles.push(TxtUser);
    Controles.push(TxtPassword);
    
    var isValid = LoginRequiredFieldsValidations(Controles);
    if (isValid)
    {
        $('ImgLoadingLogin').style.display = 'block';
        EventoLoginManager.LoginAjax(IdEvento, TxtUser.Control.value, TxtPassword.Control.value, DoLogin_callback);
    }
    ModalDivResize();
}

function DoLogin_callback(LoginProcess)
{
    if (LoginProcess.error == null)
    {
        var idevent = LoginProcess.value[0];
        $('LoginMessages').innerHTML = '';
        if (LoginProcess.value.length > 1)
        {
            for (var i=1;i<LoginProcess.value.length;i++)
            {
                $('LoginMessages').innerHTML += LoginProcess.value[i] + ' ';    
            }
        }
        else
        {
            CloseModalDiv();
            
            var url = document.URL;
            var from;
            switch(url.substring(url.lastIndexOf('/')+1,url.lastIndexOf('.aspx') + 5 ))
            {
                case 'events.aspx':
                    from = 'event';
                break;
                case 'bunchertrack.aspx':
                    from = 'buncher';
                break;
                default:
                    from = 'home';
                break;
            };
            window.location = 'event-detail.aspx?id=' + idevent + '&from=' + from;
            
        }    
    }
    else
    {
        $('LoginMessages').innerHTML = 'An error has occurred while trying to perform the operation';
    }
    $('ImgLoadingLogin').style.display = 'none';
    
}

function SendContacUs(nombre,mail,comments)
{
    var txtNombre = $(nombre);
    var txtMail = $(mail);
    var txtComments = $(comments);
    
    if(txtComments && txtMail && txtNombre)
    {
        ContactUsManager.SendContact(txtNombre.value,txtMail.value, txtComments.value, nombre, mail, comments, SendContact_callback);
    }
}
function SendContact_callback(strErrores)
{
    if(strErrores.error == null)
    {
        $('divErrores').innerHTML = '';
        var tieneErrores = 0;
        
        for (var i = 0;i<strErrores.value.length-1;i++)
        {
            $(strErrores.value[i][1]).className = strErrores.value[i][2];
            
            if(strErrores.value[i][0] != null)
            {
                tieneErrores = 1
            }
        }
        
        if(tieneErrores == 0)
        {
            $('divErrores').innerHTML = TranslationsICCD.MSGSENTSUCCESSFULLY;
            $('divErrores').style.color = "#00c3f0";
            
            // Limpio controles
                
                $(strErrores.value[2][0]).value = '';
                $(strErrores.value[2][1]).value = '';
                $(strErrores.value[2][2]).value = '';
            //
        }
        else
        {
            var divErrores = $('divErrores');

            for (var i = 0;i<strErrores.value.length-1;i++)
            {
                if(strErrores.value[i][0] != null)
                {
                    $('divErrores').style.color = "#bc0562";
                    divErrores.innerHTML += strErrores.value[i][0];
                    $(strErrores.value[i][1]).className = strErrores.value[i][2] + " red";
                    
                }
            }    
        }    
    }
    ModalDivResize();
}
function ModalDivResize()
{
    var rta;
    
    var ChildPlaceModalDivs = $('PlaceModalDivs').childNodes;
    var id;
    for (var i = 0;i<ChildPlaceModalDivs.length;i++)
    {
        if(ChildPlaceModalDivs[i].id)
        {
            
            if(ChildPlaceModalDivs[i].id.indexOf("ModalDiv_") != -1)
            {
                id = ChildPlaceModalDivs[i].id;
            }
        }
    }
    
    var ModalDivContainer = $(id);
    var ModalDiv = getElementsByClassName('ModalDiv', ModalDivContainer)[0];
    var ModalDivBorder = getElementsByClassName('ModalDivBorder', ModalDivContainer)[0];
    var BtnClose = getElementsByClassName('btnCloseModalDiv', ModalDivContainer)[0];
    
    ResizeModalDiv(ModalDiv, ModalDivBorder, BtnClose);

}
function SendSuscribe(idprefix,idname,idlastname,idmail,idcountry,idcity,idprofession,idareas, idModalDiv)
{
    var ddlPrefix = $(idprefix);
    var txtName = $(idname);
    var txtLastName = $(idlastname);
    var txtMail = $(idmail);
    var txtCountry = $(idcountry);
    var txtCity = $(idcity);
    var txtProfession = $(idprofession);
    var txtAreas = $(idareas);
    
    if( ddlPrefix && txtName && txtLastName && txtMail && txtCountry && txtCity && txtProfession && txtAreas)
    {
        SuscribeManager.SendSuscribe(ddlPrefix.value,txtName.value,txtLastName.value,txtMail.value,txtCountry.value, txtCity.value,txtProfession.value,txtAreas.value,idprefix,idname,idlastname,idmail,idcountry,idcity,idprofession,idareas, SendSuscribe_callback);
    }
}
function SendSuscribe_callback(strResul)
{
    if(strResul.error == null)
    {
        $('divErrores').innerHTML = '';
        
        var tieneErrores = 0;
        
        for (var i = 0;i<strResul.value.length-1;i++)
        {
            $(strResul.value[i][1]).className = strResul.value[i][2];
            
            if(strResul.value[i][0] != null)
            {
                tieneErrores = 1
            }
        }
        
        if(tieneErrores == 0)
        {
            $('divErrores').innerHTML = TranslationsICCD.REQUESTWASSENT;
            $('divErrores').style.color = "#00c3f0";
            
            
            /*
            // Limpio controles
                $(strResul.value[0][0]).value = 0; // este es el combo
                $(strResul.value[1][0]).value = '';
                $(strResul.value[2][0]).value = '';
                $(strResul.value[3][0]).value = '';
                $(strResul.value[4][0]).value = '';
                $(strResul.value[5][0]).value = '';
                $(strResul.value[6][0]).value = '';
                $(strResul.value[7][0]).value = '';
                
            //*/
        }
        else
        {
            var divErrores = $('divErrores');

            for (var i = 0;i<strResul.value.length-1;i++)
            {
                if(strResul.value[i][0] != null)
                {
                    $('divErrores').style.color = "#bc0562";
                    divErrores.innerHTML += strResul.value[i][0];
                    $(strResul.value[i][1]).className = strResul.value[i][2] + " red";
                    
                }
            }    
        }    
    }
    ModalDivResize();
}

function CurrentSection()
{
}
function SelectThis(idSelected)
{
    unSelect();
    
    $(idSelected).className = "selected";
}

function unSelect()
{
    var Menu = $('divMenuSuperior').childNodes;
    var url = document.URL;
    var isHome = (url.substring(url.lastIndexOf('/')+1,url.lastIndexOf('.aspx') + 5 ) == "default.aspx") ? 1 : 0;
    var positionHome;
    for (var i = 0;i<Menu.length;i++)
    {
        if(Menu[i].id)
        {
            if(Menu[i].id.indexOf("lnk") != -1)
            {
                Menu[i].className = '';
            }
        }
    }   
}
function SelectHome()
{
    var Menu = $('divMenuSuperior').childNodes;
    var url = document.URL;
    var isHome = (url.substring(url.lastIndexOf('/')+1,url.lastIndexOf('.aspx') + 5 ) == "default.aspx") ? 1 : 0;
    
    for (var i = 0;i<Menu.length;i++)
    {
        if(Menu[i].id)
        {
            if( Menu[i].id.indexOf("lnkMenu") != -1 && isHome==1)
            {
                Menu[i].className = 'selected';
            }
        }
    }
}
function SetBtnSearch(idTextBox,idbtn, pathImageOkEnabled, pathImageOkDisabled, defaultTextTxtSearch)
{
    var textbox = $(idTextBox);
    var button = $(idbtn);
    if(textbox.value.length < 3 && textbox.value != defaultTextTxtSearch)
    {
        button.src = pathImageOkDisabled;
        button.style.cursor = "default";
    }
    else
    {
        button.src = pathImageOkEnabled;
        button.style.cursor = "pointer";
    }
}
function Buscar(text, defaultTextTxtSearch)
{
    var textbox = $(text);

    if(textbox.value.length >= 3 && textbox.value != defaultTextTxtSearch)
    {
        window.location = "searchlist.aspx?t="+textbox.value;
    }
}

function SetFocus(IdControl)
{
    var control = $(IdControl);   
    if (control)
    {
        control.focus();
    }
}
