function OpenWindowNew(direction_window,name_window,properties_window)
{
	CurrentWindowOpen = open(direction_window,name_window,properties_window);
}
function ShowPopupWindow( sUrl )
{
	window.open(sUrl, '_blank', 'width=400,height=200,resizable=no', false);
}
function CountryOpen(country)
{
	if(window.opener && !window.opener.closed)
	{
		//window.opener.document.FormCountryRegistration.action = country;
		//window.opener.document.FormCountryRegistration.submit();
		window.opener.open(country, '_self');
		window.close();
	}
}

function changeBGIMage(evt,id)      
{
    ResetOther();
    document.getElementById(id).style.backgroundImage = "url(../images/over_menbg.gif)";
}
function ResetOther()
{
    var lsAllTDIds = document.getElementById('ctl00_ContentPlaceHolder1_hidtdIds').value;
    lsAllTDIds = lsAllTDIds.substring(0,lsAllTDIds.length - 1);
    var laTDIds = lsAllTDIds.split(',');
    for(li = 0;li<laTDIds.length;li++)
    {
        document.getElementById(laTDIds[li]).style.backgroundImage = "url(../images/button02.jpg)";
        //document.getElementById(laTDIds[li]).setAttribute("onmouseover","className='backgroundChange1'");
//      document.getElementById(laTDIds[li]).setAttribute("onmouseout","className='backgroundChange'");
    }
}


//-------------------------------------------------------------------------------------------------------------------------
function isNumberKey(evt)
{
 var charCode = (evt.which) ? evt.which : event.keyCode
 if (charCode > 31 && (charCode < 48 || charCode > 57))
    return false;

 return true;
}
      
      
maxL=30;
var bName = navigator.appName;
function taLimit(taObj,evt) 
{
    if (taObj.value.length==maxL)
    { 
        var charCode = (evt.which) ? evt.which : event.keyCode
        if(charCode != 8)
            return false;
        else
            return true;
    }
    else
    {
        return true;
    }            
}

function taCount(taObj,Cnt) 
{ 
    objCnt=createObject(Cnt);
    objVal=taObj.value;
    if (objVal.length>maxL) objVal=objVal.substring(0,maxL);
    if (objCnt) 
    {
        if(bName == "Netscape"){	
            objCnt.textContent=maxL-objVal.length;}
        else{objCnt.innerText=maxL-objVal.length;}
    }
    return true;
}
function createObject(objId) 
{
    if (document.getElementById) return document.getElementById(objId);
    else if (document.layers) return eval("document." + objId);
    else if (document.all) return eval("document.all." + objId);
    else return eval("document." + objId);
}


//Function that check that contact no is start with 0 or not
function checkTheContactNo(fsPhoneNo)
{
    var stValue = document.getElementById(fsPhoneNo).value;
    var stCharAt = stValue.charAt(0);
    
    if(stCharAt == 0)
    {
        alert('Start character is ' + stCharAt + '.');
    }
    else
    {
        alert('Please start with 0');
    }
}

/*==============================================Quantity Increment decrement function======================================*/
function incrementQuantity()
{
    var liMaxValue = document.getElementById('ctl00_ContentPlaceHolder1_hidItemMaxQuantity');
    var lotxtQuantity = document.getElementById('ctl00_ContentPlaceHolder1_txtQuantity');
         
    if(lotxtQuantity.value == '')
    {
        lotxtQuantity.value = parseInt('1');
    }
    else if(parseInt(lotxtQuantity.value) == parseInt('0'))
    {
        lotxtQuantity.value = parseInt('1');
    }
    else if(parseInt(lotxtQuantity.value) < parseInt(liMaxValue.value))
    {
        lotxtQuantity.value = parseInt(lotxtQuantity.value) + parseInt('1');
    }
    else if((parseInt(lotxtQuantity.value) > parseInt(liMaxValue.value)) && (parseInt(liMaxValue.value) != parseInt('0')))
    {
        lotxtQuantity.value = parseInt(liMaxValue.value);
    }
    else if(parseInt(liMaxValue.value) == parseInt('0'))
    {
        lotxtQuantity.value = parseInt(lotxtQuantity.value) + parseInt('1');
    }
}
function decrementQuantity()
{
    var liMaxValue = document.getElementById('ctl00_ContentPlaceHolder1_hidItemMaxQuantity');
    var lotxtQuantity = document.getElementById('ctl00_ContentPlaceHolder1_txtQuantity');
    
    if(lotxtQuantity.value == '')
    {
        lotxtQuantity.value = parseInt('1');
    }
    else if(parseInt(lotxtQuantity.value) == parseInt('0'))
    {
        lotxtQuantity.value = parseInt('1');
    }
    else if((parseInt(lotxtQuantity.value) <= parseInt(liMaxValue.value)) && (parseInt(lotxtQuantity.value) != parseInt('1')))
    {
        lotxtQuantity.value = parseInt(lotxtQuantity.value) - parseInt('1');
    }
    else if(parseInt(lotxtQuantity.value) > parseInt(liMaxValue.value) && (parseInt(liMaxValue.value) != parseInt('0')))
    {
        lotxtQuantity.value = parseInt(liMaxValue.value);
    }
    else if((parseInt(lotxtQuantity.value) != parseInt('1')) && (parseInt(liMaxValue.value) == parseInt('0')))
    {
        lotxtQuantity.value = parseInt(lotxtQuantity.value) - parseInt('1');
    }
}
/*=========================================================================================================================*/
