/*checkForEmpty ( idLists)
{
	for (i=0;i<idLists.length;i++)
	{
		var x=document.getElementById(idLists[i]);
		
		if ( x.length == 0)
			return 1;	//Empty

	}

	return 0;	//not empty

}
*/

//subProductsValidate( idLists,  eventSource)
function subProductsValidate(eventSource)
{
	var missingField="";
	var x = document.getElementById("TSubEdition");
	if ( x.length == 0)
		missingField+="SubEdition";

	x = document.getElementById("TDescription");
	if ( x.length == 0)
		missingField+=",Description";

	if (missingField.length> 0)
		alert("Following Fields"+missingField + "are missing");
			
	else{
		//alert("debug send!!");	
		submitComponentForm(eventSource,'__GUIKit__.EvClick','');
	}

}
function addNewSubProduct(eventSource)
{
	/*var x = document.getElementById("TDescription");
	var y = document.getElementById("TDescription");

	if ( x.length == 0 || y.length == 0)
		alert("Fields Missing!!");
	else
	*/
		submitComponentForm(eventSource,'__GUIKit__.EvClick','');
	
	
}
	 
function addNewSubProductForSave(eventSource)
{
	var x = document.getElementById("TSubEdition");
	var y = document.getElementById("TDescription");

	if ( x.value == 0 || y.value == 0)
		alert("Fields Missing!!");
	else
	
		submitComponentForm(eventSource,'__GUIKit__.EvClick','');
	
	
}
	 
function productsValidate(eventSource)
{
	var missingField="";
	var x = document.getElementById("TEdition");
	if ( x.length == 0)
		missingField+="Edition";

	x = document.getElementById("TDescription");
	if ( x.length == 0)
		missingField+=",Description";

	if (missingField.length> 0)
		alert("Following Fields"+missingField + "are missing");
			
	else{
		//alert("debug send!!");	
		submitComponentForm(eventSource,'__GUIKit__.EvClick','');
	}

}
function addNewProduct(eventSource)
{
	
	var x = document.getElementById("TEdition");
	var y = document.getElementById("TDescription");
	if ( x.value == 0 || y.value == 0) 
		alert("Field missing!");
	else
	
		submitComponentForm(eventSource,'__GUIKit__.EvClick','');
	
}

function addProduct()
{
	//alert("Debug");
	submitComponentForm(eventSource,'__GUIKit__.EvClick','');
	
}

function goPreviousPage(eventSource)
{
	submitComponentForm(eventSource,'__GUIKit__.EvClick','');

}
function goToPreviousPage()
{
}
	 
function validatePartner(eventSource)
{
	
	var x = document.getElementById("TPartnerName");
	var y = document.getElementById("TDescription");
	if ( x.value == 0 || y.value == 0) 
		alert("Field missing!");
	else		
		submitComponentForm(eventSource,'__GUIKit__.EvClick','');
		
	

}

function addNewPartner (eventSource)
{
	submitComponentForm(eventSource,'__GUIKit__.EvClick','');
}

function validateInterNationAdmin(eventSource)
{
	var x = document.getElementById("TPartnerName");
	var y = document.getElementById("TDescription");
	

	if ( x.value == 0 || y.value == 0 ) 
		alert("Field missing!");
	else			
		submitComponentForm(eventSource,'__GUIKit__.EvClick','');
}
function partnerDetailAdmin(eventSource)
{
	submitComponentForm(eventSource,'__GUIKit__.EvClick','');

}

function ActivateButton()
{
	
	var x = document.getElementById('CountryName').value;
	
	var frm = document.forms[0];

	

	if ( x.length > 0){
		frm.Add.disabled = false;
		
	}

}
function search()
{
	
	var x = document.getElementById("search_string");
	var searchStr=x.value;
	
	if (searchStr.length > 0)	
		document.location="Search?search="+searchStr;
	else
		x.value = "Enter Search String.";
	//document.location="http://www.google.com";
}
