/*jQuery(document).ready( function () {
	jQuery('a[rel*=facebox]').bind( 'click',function(){
		$("#printErr").animate({
                	top: "-150px"
                }, 500 );
	});
	jQuery('a[rel*=facebox]').facebox()  // for opening facebox onclicking any link which has rel property set "facebox"
	
	$('#showError li').css('list-style-image:url("images/error.png")');*/
	/*$('#showError').corner("round 8px").parent().css('padding', '4px').corner("round 10px")*/
	/*$('#printErr').corner("keep notch cc:#CA0000");*/
//});



// 
function spchar(value){
 var ret=0; 
 var iChars = "!@#$%^&*()+=-[]\\\';,./{}|\":<>?";
        for (var i = 0; i < value.length; i++) {
                if (iChars.indexOf(value.charAt(i)) != -1) {
               	 ret++;  
                  return ret;                    
                }
        }
}
// Removes leading whitespaces
function LTrim( value ) {	
	var re = /\s*((\S+\s*)*)/;
	return value.replace(re, "$1");	
}

// Removes ending whitespaces
function RTrim( value ) {	
	var re = /((\s*\S+)*)\s*/;
	return value.replace(re, "$1");	
}
// Removes leading and ending whitespaces
function trim( value ) {	
	return LTrim(RTrim(value));	
}
function isDigitDecimal(c){
	var test = "" + c;
	if (test == "0" || test == "1" || test == "2" || test == "3" || test == "4"|| test == "5" || test == "6" || test == "7" || test == "8" || test == "9" ){
		return true;
	}
	return false;
}
// check valid email address
function echeck(str) { 
	var at="@" 
	var dot="." 
	var lat=str.indexOf(at) 
	var lstr=str.length 
	var ldot=str.indexOf(dot) 
	if (str.indexOf(at)==-1){ 
		//alert("Invalid E-mail ID") 
		return false 
	} 
	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){ 
		//alert("Invalid E-mail ID") 
		return false 
	} 
	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){ 
		//alert("Invalid E-mail ID") 
		return false 
	} 
	if (str.indexOf(at,(lat+1))!=-1){ 
		//alert("Invalid E-mail ID") 
		return false 
	} 
	if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){ 
		//alert("Invalid E-mail ID") 
		return false 
	} 
	if (str.indexOf(dot,(lat+2))==-1){ 
		//alert("Invalid E-mail ID") 
		return false 
	} 
	if (str.indexOf(" ")!=-1){ 
		//alert("Invalid E-mail ID") 
		return false 
	} 
	return true 
}  

checked = false;
function checkedAll (frmId) {
	if (checked == false){checked = true}else{checked = false}
	
	for (var i = 0; i < document.getElementById(frmId).elements.length; i++) {
	  document.getElementById(frmId).elements[i].checked = checked;
	}
}

function valSearchProducts()
{
var product_name      =  document.getElementById('product_name');

if(product_name.value == '')
	{
		alert("Entrez un mot s'il vous plaît.");
		return false;
	}
	else
	{
		return true;
	}
}
/* Function for User Login */
function valUserLogin(){
	
	var username   =  document.getElementById('txt_username').value; 
	var password   =  document.getElementById('txt_password').value;
	
	if(username == "" || username=='Username')
	{
		alert("Please enter username.");
		return false;
	}
	
	if(password == "" || password=='password')
	{
		alert("Please enter password.");
		return false;
	}
	
	
	else
	{
			document.frmUserSignIn.submit();
	}
}
/* */



function hideshowHelp(which,act)
{
	
	if (which.style.display == "")
		{
		which.style.display = "none"
			if(act == 'help')
			{
					HelpStatus = 1;
			}
			}
			else
			{
					which.style.display = ""
			if(act == 'help')
			{
					HelpStatus = 0;
			}
	}
} 

//Function for check delete record or no
function checkDelete()
{
	var flag = confirm("Are you sure to delete this record?");
	if(flag == true)
	{
		return true;
	}
	else
	{
		return false;
	}
}
