// JScript File



 /// <summary>
 /// <Descripton>Read from Cookie</Descripton>
 /// <Author>Harish Bansal</Author>
 /// <CreatedOn>18/08/2008</CreatedOn>
 /// </summary>  
 
function Read(cookieName,currentCookies)
{   
    var cookie_value=null;
    var index,ch;
    var separatorSemiColon='';
            
    try
    {
         // If User passing the CookieName and group of Cookies then go to If Block
         if(cookieName!='' && currentCookies!='')
         { 
            
            // Remove the "=" and " " in the String and store like cookieName;Value;cookieName;Value
            for(index=0;index<=currentCookies.length-1;index++)
            {
                ch=currentCookies.charAt(index);
                if(ch=="=")
                {
                    separatorSemiColon=separatorSemiColon + ";";
                }
                else
                {
                    if(ch==" ")
                    {
                        // Do Nothing
                    }
                    else
                    {
                        separatorSemiColon=separatorSemiColon+ch;
                    }
                }
            }
            
             
            /* Store the cookieName and value in the Array Like  
                arrayCookies[0]=<cookieName>
                arrayCookies[1]=<value> 
                arrayCookies[2]=<cookieName>
                arrayCookies[3]=<value> 
            */
            var arrayCookies=separatorSemiColon.split(";");
            
             
            // Find the cookie Name in the Array and return the value
            for(index=0;index<=arrayCookies.length-1;index++)
            {   
                if(arrayCookies[index]==cookieName)
                {
             
                    cookie_value=arrayCookies[index +1];
                }
            }
           
         }
     }
     catch(exception)
     {
        alert('Error in Read()' + exception.message);
     }   
    
      return cookie_value;
}




 /// <summary>
 /// <Descripton>Show the Informative Message like "this page is Under Construction"</Descripton>
 /// <Author>Harish Bansal</Author>
 /// <CreatedOn>11/06/2008</CreatedOn>
 /// </summary>  
function UnderConstructionAlert()
{   
     alert("This Page is Under-Construction");
     
}




/// <summary>
/// <Descripton>Change the image at the mouse over / out </Descripton>
/// <Author>Harish Bansal</Author>
/// <CreatedOn>26/06/2008</CreatedOn>
/// </summary>     

var mouseoutover="";
function EffectMouseEvent(elementObject,imageName,optional)
{
    try
    {
		//alert(optional);

		 if (typeof optional == "undefined")
		  {    
			optional = "default value";  
		  }
		 
        var currentImgLen,lastIndexBackSlash,currentImgSource,currentImgName;

        currentImgSource=elementObject.src;

        lastIndexBackSlash=eval(currentImgSource.lastIndexOf("/")+1);

        currentImgLen=currentImgSource.length;
        
        currentImgName=currentImgSource.substr(lastIndexBackSlash,currentImgLen-lastIndexBackSlash);
        

        if(currentImgSource.match(imageName))
        {   
            mouseoutover="over";
        }
        else
        {
           mouseoutover="out";
           if(optional=="homepage")
           {
				elementObject.src="http://www.nopaypoker.com/App_Themes/PokerTheme/Images/"+imageName;
		   }
		   else
		   {
				elementObject.src="http://www.nopaypoker.com/App_Themes/PokerTheme/Images/"+imageName;
		   }
        }
    }
    catch(exception)
    {
        alert(exception.message);
    }
}

function EffectMouseOut(elementObject,imageName,optional)
{
	//alert(optional)
	if (typeof optional == "undefined")
	{    
		optional = "default value";  
	}
    if(mouseoutover=="out")
    {
		if(optional=="homepage")
		{
			elementObject.src="http://www.nopaypoker.com/App_Themes/PokerTheme/Images/"+imageName;
		}
		else
		{
			elementObject.src="http://www.nopaypoker.com/App_Themes/PokerTheme/Images/"+imageName;
		}
    }
}



