var switchclassCounter = 0;
var previousclass;
function radcheck(elemId)
{
		try
		{
			//document.getElementById("btn_Delete").disabled = false;
			//document.getElementById("btn_Delete").className = "frm-button";
			//document.getElementById("btn_Edit").disabled = false;
			//document.getElementById("btn_Edit").className = "frm-button";
			var elemObj = document.getElementById(elemId);
			var cellObj = elemObj.parentNode;
			var rowObj = cellObj.parentNode;
			var defaultClassName = "Normal";
			if(switchclassCounter != 0)
			{
				//Previously selected Item
				var pElemObj = document.getElementById(previousclass);
				var pCellObj = pElemObj.parentNode;
				var pRowObj = pCellObj.parentNode;
				pRowObj.className = defaultClassName;
			}
			else
			{
				previousSelectionU = elemId;
			}
			rowObj.className = "bold";
			previousclass = elemId;
			switchclassCounter = switchclassCounter +1;
		}
		catch(e)
		{
			alert(e.description);
		}

}


function CheckEditPossible(ddl,editId)
    {
        var selectedVal= ddl.value;
        if(selectedVal <100000)
            editId.disabled= true;        
           else
           editId.disabled = false ; 
    }
    
    function CheckThemeSelected(themeDDL,editBtn)
    {
        if(themeDDL.value < 100000)
        {
            editBtn.disabled = true;
            editBtn.className='button-mouseout' ;
            return false ;
        }
    }

//CODE done by Usability IDC 
//This function is used for changing the row bg in BT_Myaccount_mysavedfiles.html
function Mover(id,imgId)
{
id.className='ruled';
imgId.className='show';
}
function Mout(id,imgId)
{
id.className='ruler';
imgId.className='hide';
}

function Mover1(id)
{
id.className='ruled';
}
function Mout1(id)
{
id.className='ruler';
}/*
function Mover2(id,img1Id,img2Id,img3Id)
{
//alert(img1Id +'-'+ img2Id +'-'+ img3Id);
if(!img3Id)
{
	//alert("a");
id.className='ruled';
img1Id.className='show';
img2Id.className='show';
}
else
{
	//alert("b");
	id.className='ruled';
img1Id.className='show';
img2Id.className='show';
img3Id.className='show';
}
}
function Mout2(id,img1Id,img2Id,img3Id)
{
	if(!img3Id)
{
	//alert("a");
//alert(img1Id +'-'+ img2Id +'-'+ img3Id);
id.className='ruler';
img1Id.className='hide';
img2Id.className='hide';
}
else
{	//alert("b");
	id.className='ruler';
img1Id.className='hide';
img2Id.className='hide';
	img3Id.className='hide';
}

}
*/
function Mover2(id)
{
		id.className='ruled';
}
function Mout2(id)
{
		id.className='ruler';
}
function ReviewHighligt(id,chkboxStatus)
{
	var colObj = id.parentNode;
	var rowObj = colObj.parentNode;
	if(chkboxStatus == 'H')
	rowObj.className='bg-Bus-100100';
	else
	rowObj.className='bg-Bus-001111';
}
function ReviewNoHighligt(id)
{
id.className='bg-Bus-100100';
}


//This Switchrad function is used in printoptions1.html , printoptions.html for disabling the byfile and preview in csspopup of add special pages.
function switchrad()
{

	if(document.getElementById("radio_preview").checked == true)
	{
	document.getElementById("preveiw").disabled="";
	document.getElementById("byfile").disabled="disabled";
	
	}
	if(document.getElementById("radio_byfile").checked == true)
	{
		document.getElementById("byfile").disabled="";
		document.getElementById("preveiw").disabled="disabled";
		
	}
}

//This Switchrad function is used in printoptions1.html , printoptions.html for disabling the byfile and preview in csspopup of add special pages.
function switchrad2(byFileId, byPageId, fileSelectionId, pageRangeId)
{
    if(document.getElementById(byFileId).checked == true)
    {
        document.getElementById(fileSelectionId).disabled = false;
        document.getElementById(pageRangeId).disabled = true;
    }
    
    if(document.getElementById(byPageId).checked == true)
    {
        document.getElementById(fileSelectionId).disabled = true;
        document.getElementById(pageRangeId).disabled = false;
    }
}

//This showhide function is used in printoptions1.html, prinoptions.html for hiding the properties like Binding & Covers and Finishing.
function showhide(id,status) 
{
	if(status == "hide")
	{
		document.getElementById(id).style.display='none';
	}	
	else if(status == "show")
	{
		document.getElementById(id).style.display='';	
	}
}


//This display funtion is used in printoptions1.html, printoption.html for media control.
var displayStatus = true;
function Display(whichLayer,id,id1)
{
	if (document.getElementById)
		{
	// this is the way the standards work
		var style2 = document.getElementById(whichLayer).style;
		var style1 = document.getElementById(id).style;
		var style3 = document.getElementById(id1).style;
		if(displayStatus)
		{
		//alert("false");
			style1.display = 'none';
			style2.display = '';
			style3.display = '';			
			displayStatus = false;
		}
		else
		{
//			alert("true");
			//alert("WL " + whichLayer + "   Layer Id " + id );
			style1.display = '';
			style2.display = 'none';
			style3.display = 'none';
			displayStatus = true;
		}	
	}
}

//This tooltop function is used in BT_Xmpieproduct.html for hiding the batchimport div
function tooltip(id)
{
//alert(document.getElementById(id));
document.getElementById(id).style.display='none';
}

function isNumberKey(evt)
      {
         var charCode = (evt.which) ? evt.which : event.keyCode
         if (charCode > 31 && (charCode < 48 || charCode > 57))
            return false;

         return true;

      }