function initSkin()
{
    initDynamicMenus();
    initRolloverMenus();
    initPortletDeleteButtons();
    // See the comments in float.js about this function...
    //initPortletFloatButtons();
}
/*************************************
* to cancel right-click on window.
* added by jeeva
*
***************************************/
function right(e) {
if (navigator.appName == 'Netscape' && 
(e.which == 3 || e.which == 2))
return false;
else if (navigator.appName == 'Microsoft Internet Explorer' && 
(event.button == 2 || event.button == 3)) {
alert("Sorry, you do not have permission to right click.");
return false;
if(event.button == 8){
return false;
}
}
return true;
}
document.onkeydown = keyCatcher;
          
 function funDown() {
 	
 if(window.event && window.event.keyCode == 112 ||  window.event.keyCode == 116){
 // F1 to F12 key
window.event.keyCode = 0; 	
    return false;
    }
     if(window.event && window.event.keyCode == 17)  {
      // Capture and remap ctrl
       window.event.keyCode = 555; 	
       return false; 
     } 
    
 }
// allow only numbers.
function allowNo(){
/*********************************************
allows ONLY NUMBERS key
author: Jeevanantham Paramasamy
*********************************************/
if(window.event && window.event.keyCode != 13){
 if(window.event && window.event.keyCode < 48 ||  window.event.keyCode > 58){
alert('Enter only Numbers');
window.event.keyCode = 0; 	
return false;
}
}else{
window.event.keyCode = 13; 	
return true;
 }
}
function keyCatcher() {
var e = event.srcElement.tagName;
if (event.keyCode == 8 && e != "INPUT" && e != "TEXTAREA") {
/*********************************************
Blocks BACK SPACE key
author: Jeevanantham Paramasamy
*********************************************/
event.cancelBubble = true;
event.returnValue = false;
}
for(i=112;i<124;i++){
/*******************************************
blocks F1 - F12 keys
author: Jeevanantham Paramasamy
********************************************/
if(i==window.event.keyCode){
window.event.keyCode = 0; 	
return false;
}
}
}
function allowOnlyChar(){
/*************************************************************
ALLOWS LETTERS, deni SPECIAL CHARS and NUMBER  .
author: Jeevanantham Paramasamy
*************************************************************/
var keys =  new Array(126, 33, 64, 35, 36, 37, 94, 38, 42, 40, 41, 95, 43, 63, 60, 62,45,61,47,48,49,50,51,52,53,54,55,56,57,58,59,123,125,92,124,91,93,39,34,44,96);
for(i=0;i<keys.length;i++){
if(keys[i]==window.event.keyCode){
alert('Special characters and numbers not allowed.');
window.event.keyCode = 0; 	
    return false;
}
}
}
/********************************************************************************
for disable netui button and change cursor type.
********************************************************************************/
function disableButton(fromname, btn){
document[getNetuiTagName(fromname,this)][getNetuiTagName(btn,this)].disabled=true;
document.body.style.cursor = 'wait'; 
document[getNetuiTagName(fromname,this)][getNetuiTagName(btn,this)].className='buttondisabled';
}
/********************************************************************************
for disable button and change cursor type.
********************************************************************************/
function disableReset(buttonReset){
document.getElementById(buttonReset).disabled=true;
document.getElementById(buttonReset).className='buttondisabled';
}
/******************************************************************************
    GIVES MESSAGE FOR RESET ACTION.
******************************************************************************/
function resetMessage(msg){
    return confirm(msg);
}
/******************************************************************************
For Trimming the String Values.  
author: Krishna
*******************************************************************************/
function trimAll(sString) 
{
while (sString.substring(0,1) == ' ')
{
sString = sString.substring(1, sString.length);
}
while (sString.substring(sString.length-1, sString.length) == ' ')
{
sString = sString.substring(0,sString.length-1);
}
return sString;
}
/************************************************************************************
For UserId validation
**************************************************************************************/
//Function to check for Special Characters
function isValidId(data)
{
var ch;
  			for(i=0;i<data.length;i++)
{
    ch=data.charAt(i);
if(!((ch>='a' && ch<='z') || (ch>='A' && ch<='Z') || (ch>='0' && ch<='9') || (ch=='.') || (ch=='_')))
return false;
}
return true;
}
/***********************************************************************************
For ClientId & Service Id validation
************************************************************************************/
//Function to check for Special Characters for Client Id
function isValidClientId(data)
{
var ch;
  			for(i=0;i<data.length;i++)
{
    ch=data.charAt(i);
if(!((ch>='a' && ch<='z') || (ch>='A' && ch<='Z') || (ch>='0' && ch<='9') || (ch=='.') || (ch=='-')))
return false;
}
return true;
}
function validateEmail( strValue) {
/************************************************
DESCRIPTION: Validates that a string contains a 
  valid email pattern. 
  
 PARAMETERS:
   strValue - String to be tested for validity
   
RETURNS:
   True if valid, otherwise false.
   
REMARKS: Accounts for email with country appended
  does not validate that email contains valid URL
  type (.com, .gov, etc.) or valid country suffix.
*************************************************/
var objRegExp  = /(^[a-z0-9]([a-z0-9_\.]*)@([a-z])([a-z\.]*)([.][a-z]{3})$)|(^[a-z0-9]([a-z0-9_\.]*)@([a-z_])([a-z\.]*)([.][a-z]{2})$)/i;
 
  //check for valid email
  return objRegExp.test(strValue);
}
function validateInteger( strValue ) {
/************************************************
DESCRIPTION: Validates that a string contains only 
    valid integer number.
    
PARAMETERS:
   strValue - String to be tested for validity
   
RETURNS:
   True if valid, otherwise false.
******************************************************************************/
  var objRegExp  = /(^-?\d\d*$)/;
 
  //check for integer characters
  return objRegExp.test(strValue);
}
function isValidId(data)
{
var ch;
var ch1;
  			for(i=0;i<data.length;i++)
{	
    	ch=data.charAt(i);	
if(i!=data.length)
    	 ch1=data.charAt(i+1);	
if(!((ch>='a' && ch<='z') || (ch>='A' && ch<='Z') || (ch>='0' && ch<='9') || (ch=='.') || (ch=='_')))
return false;
if(i!=data.length)
if(((ch=='.' && ch1=='.') || (ch=='_' && ch1=='_') || (ch=='_' && ch1=='.') || (ch=='.' && ch1=='_')))
return false;
}
return true;
}
function isValidCreditLimit(data)
{
var ch;
var ch1;
  			for(i=0;i<data.length;i++)
{	
    	ch=data.charAt(i);	
if(i!=data.length)
    	 ch1=data.charAt(i+1);	
if(!((ch>='0' && ch<='9') || (ch=='.')))
return false;
if(i!=data.length)
if(((ch=='.' && ch1=='.')))
return false;
}
return true;
}
function validateAddress(data)
{
 
 var ch;
var ch1;
  			for(i=0;i<data.length;i++)
{
    	ch=data.charAt(i);
if(i!=data.length)
    	 ch1=data.charAt(i+1);
if(!((ch>='a' && ch<='z') || (ch>='A' && ch<='Z') || (ch>='0' && ch<='9') ))
{
if(ch==ch1){
return false;
}
}
}
return true;
}
