﻿// JScript File

//--------- Javascript for Gridview/datagrid/datalist------------
    function SelectAllCheckboxes(spanChk)
    {		
		// Added as ASPX uses SPAN for checkbox 
		var xState=spanChk.checked;
		var theBox=spanChk;
		
		// Old code for VS 2002 / .NET framework 1.0 code
		//-----------------------------------------------
		// In .NET 1.0 ASP.NET was using SPAN tag with
		// CheckBox control. 
		//
		//var oItem = spanChk.children;
		//var theBox=oItem.item(0)
		//xState=theBox.checked;	
		//-----------------------------------------------
		
		elm=theBox.form.elements;
		for(i=0;i<elm.length;i++)		
		    if(elm[i].type=="checkbox" && elm[i].id!=theBox.id)
		    {
			    //elm[i].click();
			    if(elm[i].checked!=xState)
			        elm[i].click();
			    //elm[i].checked=xState;
		    }
	}

		//-------------------------------------------------------------
		//----Select highlish rows when the checkboxes are selected
		//
		// Note: The colors are hardcoded, however you can use 
		//       RegisterClientScript blocks methods to use Grid's
		//       ItemTemplates and SelectTemplates colors.
		//		 for ex: grdEmployees.ItemStyle.BackColor OR
		//				 grdEmployees.SelectedItemStyle.BackColor
		//-------------------------------------------------------------
		
	function HighlightRow(chkB)
	{		
	    // Old code for VS 2002 / .NET framework 1.0 code
	    //-----------------------------------------------
	    // In .NET 1.0 ASP.NET was using SPAN tag with
	    // CheckBox control. 
	    //var oItem = chkB.children;
	    //xState=oItem.item(0).checked;
	    var xState=chkB.checked;
			
	    if(xState)
		{
		    chkB.parentElement.parentElement.style.backgroundColor='#CFEBFF';  // grdEmployees.SelectedItemStyle.BackColor
		    chkB.parentElement.parentElement.style.color='white'; // grdEmployees.SelectedItemStyle.ForeColor
		}
		else 
		{
		    chkB.parentElement.parentElement.style.backgroundColor='#efefef'; //grdEmployees.ItemStyle.BackColor
		    chkB.parentElement.parentElement.style.color='black'; //grdEmployees.ItemStyle.ForeColor
		}
	}
				
    function ValidateGrid()
    {    	    
        var l = document.forms[0].elements.length;
	    var i;
	    var cc = 0;
	    for(i=0;i<l;i++)
	    {
		    if ( document.forms[0].elements[i].type == "checkbox" )
		    {
			    if ( document.forms[0].elements[i].checked == true )
			    {
				    cc++;
			    } 
		    }
	    }
	    if(cc == 0)
	    {
		    alert('Please select at least one record!');
		    return false;
	    }
	    else
	    {		
	       		
		    if( confirm('Are you sure you want to take this action?') == true)
		    {	
			    return true;
		    }
		    else
		    {
			    return false;
		    }
		     /**/
		    return true;		    
	    }    	    
    }
    
//--------- End-------------------------------------------------- 


// Functions for right Panel Banner

function leadsolutions(){
window.open("http://www.zed-axis.com/eBusinessSolutions/LeadManagementSolutions.aspx","_blank");
//return false;
}

function salessolutions(){
window.open("http://www.zed-axis.com/eBusinessSolutions/SalesManagementSolutions.aspx","_blank");
//return false;
}

function customersolutions(){
window.open("http://www.zed-axis.com/eBusinessSolutions/CustomerServiceSolutions.aspx","_blank");
//return false;
}

function crmsolutions(){
window.open("http://www.zed-axis.com/eBusinessSolutions/CRMSolutions.aspx","_blank");
//return false;
}
