  <!-- 					
  		window.onresize = doOnResize;		
  		window.onload =	doOnLoad;	
  //-->	
  

        function Ajax_Rqst(divId, gridId) {

            var response;
            var url = "wstest/Webservice2/service1.asmx/getshoutXMLStories?gridId=";
		    url = url + gridId;
             
            new Ajax.Request(
                url, 
                {  
                      method: 'get',
                      asynchronous: true,
                      onException: function(t,e) { 
                        alert(e.message);
                        handleException(e); 
                      },
                      onFailure: function(transport) {     
	                     var response = transport.responseText || "no response text";
	  	                 alert(response); 
	  	              },
                      onSuccess: function(transport) {     
	                     var notice = $('test_content');
		                 response = transport.responseText || "no response text";
		                 //alert(response); 
		                 viewDetails(divId, gridId, response);
		              }
                }
          );
                    
      } // Ajax_Rqst()

       function News_Request(divId, gridId){
            Ajax_Rqst(divId, gridId);
       }
       
        function viewDetails(divId, gridId, newsDetails) {
            var newsdiv = document.getElementById(divId);
            if(!newsdiv) return;   
          
            //var newsDetails =  "test ittest ittest ittest ittest ittest ittest ittest ittest it";//Ajax_Rqst(divId, gridId);
            //alert(newsDetails);
            //var newsDetails = Ajax_Rqst(divId, gridId); //$(divId).innerHTML;
            
            $('grid0_News').innerHTML = newsDetails;
                      
            var d = $(divId);

            // get position information for the grid element
            var newleft = d.viewportOffset().left + bumpNewsWindowPosition();
            var newtop  = d.viewportOffset().top + bumpNewsWindowPosition();

            SetNewState('grid0_News', 100, newtop, newleft);
        }

        function bumpNewsWindowPosition(){
            return 5;
        }
        
        function SetNewState(layer_ref, newheight, newtop, newleft){

         var hsheet, hsupersheet;

         if(document.all){ 
           /*IS IE 4 or 5 (or 6 beta) */
           eval("document.all." +layer_ref+ ".style.height = newheight"); 
           eval("document.all." +layer_ref+ ".style.left = newleft"); 
           eval("document.all." +layer_ref+ ".style.top = newtop");            
           eval("document.all." +layer_ref+ ".className = 'newsDisplay'");
         } 

         if (document.layers) { //IS NETSCAPE 4 or below 
           document.layers[layer_ref].height = newheight; 
           document.layers[layer_ref].left = newleft; 
           document.layers[layer_ref].top = newtop;
           document.layers[layer_ref].className = "newsDisplay";
         }
         
         if (document.getElementById &&!document.all) { 
            hsheet = document.getElementById(layer_ref); 
           
            hsheet.style.height = newheight + "px";
            hsheet.style.left = newleft + "px";
            hsheet.style.top = newtop + "px";
            $(layer_ref).className = "listItemNews newsDisplay";
         }
         else{
            hsheet = document.getElementById(layer_ref); 
           
            hsheet.style.height = newheight + "px";
            hsheet.style.left = newleft + "px";
            hsheet.style.top = newtop + "px";
            $(layer_ref).className = "listItemNews newsDisplay";
         } 
        }
        
               	
	<!-- 

        // standart string replace functionality
        function str_replace(haystack, needle, replacement) {
            var intIndexOfMatch = haystack.indexOf( needle );

            // Loop over the string value replacing out each matching
            // substring.
            while (intIndexOfMatch != -1){

                var temp = new Array();
                temp = haystack.split(needle);
                haystack = temp[0] + replacement + temp[1];
                intIndexOfMatch = haystack.indexOf( needle );
            }
            
            return haystack;
        }                      
        
        function runTest(divId, shoutContent, gridId) {

            var win = new UI.URLWindow({width: 200, minWidth: 100, minHeight: 80, maxWidth: 300, maxHeight: 400});             
            //win.setgridId('1');
            //var g = win.getgridId();
            //alert(g);
            /* get the shout Page Template to display from the local Div */
            var shoutPageTemplate = $('shoutSandBox').innerHTML;

            /* gets ready to inser the story line by splitting between the two <p> tags*/
            var shoutPageTemplateArr = new Array();
            
            // split to add the gridId.
            shoutPageTemplateArr = shoutPageTemplate.split('*');  

            var shoutTemplAddGridId = shoutPageTemplateArr[0] + gridId;
            
            shoutTemplAddGridId = shoutTemplAddGridId + shoutPageTemplateArr[1];
            
            // store it to a global for access.
            shoutPageTemplateArr = shoutTemplAddGridId.split('+');  
                 
            try{
               
            //alert("shoutContent:" + shoutContent);
            
            /* 1. split at <col_story_title>. */
            /* Throws away split_title[0] */
            var split_title = new Array();
            split_title = shoutContent.split("&lt;col_story_title&gt;");
            
            //alert("split_title:" + split_title[1]);
            
            /* 2. split at </col_story_title>. */
            /* You have the title in split_titletemp[0]; */
            var split_titletemp = new Array();
            split_titletemp = split_title[1].split("&lt;/col_story_title&gt;");
            
            //alert("extracted title:" + split_titletemp[0]);
            
            /* 3. split at <col_story_text> on split_title[1]. */
            /*  Throw away split_story[0]; */
            var split_story = new Array();
            split_story = split_titletemp[1].split("&lt;col_story_text&gt;");
            
            /* 4. split at </col_story_> on split_story[1]. */
            /* You have the story in split_storytemp[0];*/
            var split_storytemp = new Array();
            split_storytemp = split_story[1].split("&lt;/col_story_text&gt;");
            
            //alert("extracted story:" + split_storytemp[0]);
            
            } catch (e) {
                alert(e.name); 

            }
            /*
            var istory = arr[1].indexOf('>');
            
            // extracts <string ...>Xcuts Story...
            var extract = arr[1].substring(istory+1);
            
            // get rid of </string> end tag.
            var splits = new Array();
            splits = extract.split('</string>');
            //alert(splits);
            */                        
                      
             // Get element whose id is divId via $() 
            var d = $(divId);
         
            /* parse shout content */
            //var shoutContentSplits = new Array();
            //shoutContentSplits = shoutContent.split('^'); 
            
             
            //var shoutsmallC = '<p>Aussies Hard to beat - Ganguly,Ganguly says the Aussies will be hard to beat,</p> <p>even with their relatively inexperienced bowling lineup.</p>';                     
                                                        
            //var shoutDynamicPage = shoutPageTemplateArr[0] + shoutContentSplits[2] + shoutPageTemplateArr[1];
            var shoutDynamicPage = shoutPageTemplateArr[0] + split_storytemp[0] + shoutPageTemplateArr[1];
            
            shoutDynamicPage = shoutDynamicPage.replace( /&lt;/gi, "<" );                     
            shoutDynamicPage = shoutDynamicPage.replace( /&gt;/gi, ">" );     
           
           // alert(shoutDynamicPage);
            var made = shoutDynamicPage.makeElement();
            
            // update title
            win.header.update(split_titletemp[0]);
          
            win.content.update(made);
                       
            win.focus();
            
            // get position information for the grid element
            var leftPos = d.viewportOffset().left;
            var topPos = d.viewportOffset().top;
           
            win.setPosition(topPos, leftPos);
            //win.maximize();
            win.show();
            win.activate();           
            win.focus();
            win.show();
            win.activate();           
        }  

        UI.Window.addMethods({
          iconify: function() {
            // ... your iconifying code here ...
            this.fire('iconified');
            // chain friendly
            return this;
          },
          setgridId: function(gid) {
            this.gridIdentity = gid;
          },
          getgridId: function() {
            return this.gridIdentity;
          }
          
        });
		
        function gettheShout(divId, gridId) {
        
            var url = "http://www.sportsindia.com/wstest/Webservice2/service1.asmx/getshoutXMLStories?gridId=";
		    url = url + gridId;
		
		    // creates a shout window 
		    var win = new UI.URLWindow({width: 200, minWidth: 100, minHeight: 80, maxWidth: 300, maxHeight: 400 ,shadow: true, show: Element.appear});  
   
           // , shadow: true, show: Element.appear,
           //**
           // get parent grid's position and overlap 
           // the position of shoutWindow
           //**
           
       
           //win.setUrl("http://www.sportsindia.com/wstest/shout.html");
           win.setUrl("http://www.sportsindia.com/wstest/testit/shoutform.htm");
           
          
           // Get element whose id is divId via $() 
            var d = $(divId);
                       
            // get position information for the grid element
            var leftPos = d.viewportOffset().left;
            var topPos = d.viewportOffset().top;
            
            win.focus();
            win.setPosition(topPos, leftPos);

            win.show();
            win.activate();           
		 }
        
      
      
        function Collapsible(divId, gridId) {
        
            var grid        = document.getElementById('grid0');
            var gridexpand  = document.getElementById('grid0').getElementsByTagName("div");
        
        //alert(gridexpand.item(0).style.visibility);
        //var state = gridexpand.item(0).style.display = "block";
        //var gridexpand  = grid.getElementsByTagName('').item(0);   

            // Get element whose id is divId via $() 
            var d = $(divId);

            // get position information for the grid element
            gridexpand.item(0).style.left = d.viewportOffset().left;
            gridexpand.item(0).style.top  = d.viewportOffset().top;
        
            var state = gridexpand.item(0).style.display;  
            if (state == 'block') {  
                 
                 grid.style.visibility = "visible";
                 gridexpand.item(0).style.display = "none";
                 gridexpand.item(0).style.visibility = "hidden";
            } 
            else 
            {  
                 grid.style.visibility = "hidden";
                 gridexpand.item(0).style.display = 'block';  
                 gridexpand.item(0).style.visibility = "visible";
            }  

         
        }  

        
        function Ajax_Request(divId, gridId) {

            var url = "wstest/Webservice2/service1.asmx/getshoutXMLStories?gridId=";
		    url = url + gridId;
        
          
            new Ajax.Request(
                url, 
                {  
                      method: 'get',
                      asynchronous: true,
                      onException: function(t,e) { 
                        alert(e.message);
                        handleException(e); 
                      },
                      onFailure: function(transport) {     
	                     var response = transport.responseText || "no response text";
	  	                 alert(response); 
	  	              },
                      onSuccess: function(transport) {     
	                     var notice = $('test_content');
		                 var response = transport.responseText || "no response text";
		                 //alert(response); 
		                 runTest(divId, response, gridId);
		                 
		              }
                }

          );
          
      } // Ajax_Request()

-->
		   