// JavaScript Document
var isvoteSeacrhDisplayed =false;
var container,containerSearch;
function openvoteSearch(){
	container = (container) ? container : document.getElementById('notOffered');
	containerSearch = (containerSearch) ? containerSearch : document.getElementById('notOfferedDetails'); 
	if(!isvoteSeacrhDisplayed){
		container.style.display = 'none';
		containerSearch.style.display ='block';
	}else{
	}
	isvoteSeacrhDisplayed = !isvoteSeacrhDisplayed;
	//return false;
}
function rateCourse(id,rating){
	var data;
	data=rating*15;
	alert(data);
	document.getElementById('rating'+id).style.width =data*1+"px";
	document.getElementById('ratingStar'+id).innerHTML ="";
	document.getElementById('rate'+id).style.width ="";
	/*$("#rating"+id).width("30px");
	$("#ratingStar"+id).html("");
	$("#rate"+id).html("");	
	$.post(appUrl+"/app/modules/learn/courseRating.ajx.php",
	  	{	id:  id,
			rating: rating
		} ,	function(data){
			if(data){
				$("#rating"+id).width(data*1);
			}
			$("#ratingStar"+id).html("");
			$("#rate"+id).html("");
		}
	);*/
	return false;	
}
function addToWishList(){
	wishTitleObj =  document.getElementById('wishedTitle');
	var wishTitle=getFieldValue(wishTitleObj);
	if(empty(wishTitle)){
		alert(MSG_INVALID_TITLE);
		return ;
	}
	document.getElementById('mode').value ="ADD";
	document.getElementById('frmWishList').submit();
}
function voteToWishList(wishID){
	document.getElementById('mode').value ="VOTE";
	document.getElementById('wishListId').value = wishID;
	document.getElementById('frmWishList').submit();
}
function listWishListBy(){
	document.getElementById('page').value ="1";
	document.getElementById('mode').value ="SORT";
	document.getElementById('frmWishList').submit();	
}
function searchWishTitle(){
	document.getElementById('page').value ="1";
	document.getElementById('mode').value ="SEARCH";
	document.getElementById('frmWishList').submit();	
	
}
function trackEnterKey(keycd){

	try{
		if(keycd ==13){
		 searchWishTitle();
		}
	}catch(e){
		
	}
	return;
}
function trackEnterKeyAdd(keycd){

	try{
		if(keycd ==13){
		 addToWishList();
		}
	}catch(e){
		
	}
	return;
}
function clearWishSearchTxt( txt ) {
	try{
			if( txt.value == MSG_SEARCH ) {
				txt.value = "";
			} else if( txt.value == "" ){
				txt.value = MSG_SEARCH;
			}
	}catch(e){
		
	}
}
var isDisplayed = false;

function toggleTitlesInProduction(){
	var titleInProductionList =  document.getElementById('titleInProductionList');
	var titleToggleContainer =  document.getElementById('titleToggleContainer'); 
	isDisplayed = titleInProductionList.style.display;
	if( isDisplayed =="" || isDisplayed =="block"){
		titleInProductionList.style.display = 'none';
		titleToggleContainer.style.cssText = "background:transparent url("+IMAGE_PATH+"/layout/vtcMoreBtn.gif) no-repeat scroll center center;";
		
		//titleToggleContainer.setAttribute("class","titlePart2");
		titleToggleContainer.setAttribute("title","Expand");
		titleToggleContainer.setAttribute("alt","Expand");		
	}else{
		titleInProductionList.style.display = 'block';
		titleToggleContainer.style.cssText = "background:transparent url("+IMAGE_PATH+"/layout/vtcLess.gif) no-repeat scroll center center;";
		
		//titleToggleContainer.setAttribute("class","titlePart2Hide");
		titleToggleContainer.setAttribute("title","Collapse");
		titleToggleContainer.setAttribute("alt","Collapse");			
	}
	
	//return false;
}
var isDisplayed2 = false;

function toggleTitlesAbtRelease(){
	var titleAbtTorealseList =  document.getElementById('titleAbtTorealseList');
	var titleAbtToggleContainer =  document.getElementById('titleAbtToggleContainer'); 
	isDisplayed2 = titleAbtTorealseList.style.display;
	if( isDisplayed2 =="" || isDisplayed2 =="block"){
		titleAbtTorealseList.style.display = 'none';
		titleAbtToggleContainer.style.cssText = "background:transparent url("+IMAGE_PATH+"/layout/vtcMoreBtn.gif) no-repeat scroll center center;";
		//titleAbtToggleContainer.setAttribute("class","titlePart2");
		titleAbtToggleContainer.setAttribute("title","Expand");
		titleAbtToggleContainer.setAttribute("alt","Expand");		
		
	}else{
		titleAbtTorealseList.style.display = 'block';
		titleAbtToggleContainer.style.cssText = "background:transparent url("+IMAGE_PATH+"/layout/vtcLess.gif) no-repeat scroll center center;";
		//titleAbtToggleContainer.setAttribute("class","titlePart2Hide");
		titleAbtToggleContainer.setAttribute("title","Collapse");
		titleAbtToggleContainer.setAttribute("alt","Collapse");		
	}
	
	
}

var isDisplayed3 = false;

function toggleWishListTitles(){
	var titleWishList =  document.getElementById('wishListOuterDiv');
	var titleWishListToggleContainer =  document.getElementById('titleWishListToggleContainer');
	isDisplayed3 = titleWishList.style.display;
	if( isDisplayed3 =="" || isDisplayed3 =="block"){
		titleWishList.style.display = 'none';
		titleWishListToggleContainer.style.cssText = "background:transparent url("+IMAGE_PATH+"/layout/vtcMoreBtn.gif) no-repeat scroll center center;";
		//titleWishListToggleContainer.setAttribute("class","titlePart2");
		titleWishListToggleContainer.setAttribute("title","Expand");
		titleWishListToggleContainer.setAttribute("alt","Expand");		
		
	}else{
		titleWishList.style.display = 'block';
		titleWishListToggleContainer.style.cssText = "background:transparent url("+IMAGE_PATH+"/layout/vtcLess.gif) no-repeat scroll center center;";
		//titleWishListToggleContainer.setAttribute("class","titlePart2Hide");
		titleWishListToggleContainer.setAttribute("title","Collapse");
		titleWishListToggleContainer.setAttribute("alt","Collapse");		
	}
	

}

function toggleDiv(divId){
	var divElement = document.getElementById(divId);
	var divListElement = document.getElementById(divId+'List');
	var divContainer = document.getElementById(divId+'Container');
	
	var isShown = divListElement.style.display;
	if(isShown == "" || isShown == "block"){
		divListElement.style.display = 'none';
		divContainer.style.cssText = "background:transparent url("+IMAGE_PATH+"/layout/vtcMoreBtn.gif) no-repeat scroll center center;";
		divContainer.setAttribute("title","Expand");
		divContainer.setAttribute("alt","Expand");	
	}
	else{
		divListElement.style.display = 'block';
		divContainer.style.cssText = "background:transparent url("+IMAGE_PATH+"/layout/vtcLess.gif) no-repeat scroll center center;";
		divContainer.setAttribute("title","Collapse");
		divContainer.setAttribute("alt","Collapse");		
	}
}
	
