/*'---------------------------------------------------------------------------------------------------------
'Author  	  	: saiful islam
'---------------------------------------------------------------------------------------------------------
'Created On 	: 25-07-2009 
'---------------------------------------------------------------------------------------------------------
'email 	: saiful_soft@hotmail.com
'---------------------------------------------------------------------------------------------------------*/	

function Empty_flied_Check(){
	jQuery('#message').empty();
	jQuery('input#blog_titel').each(function(){
		var req = jQuery(this).val();
		if(!req){
			jQuery(this).css('border', '1px solid red');
		}
	});
	
	if(jQuery('input#blog_titel').val() ==''){
		return false;
	} else {return true;}
}



 $(function() {
   
         $('.row_style').mouseover(function() {  
           $(this).addClass('selectedRow');  
		   jQuery(this).css('background', '#F9E3CC'); 
         }).mouseout(function() {  
             $(this).removeClass('selectedRow');
			  jQuery(this).css('background', '#ECB7D5'); 
        }) 
      }
	  ); 


function BoxshowEdit(div_id,show_about_me)
		{
			$("#"+div_id).show("");
			$("#"+show_about_me).hide("");
		
		}
	function cancel(edit_div,show_div)
	{
		$("#"+show_div).show("");
		$("#"+edit_div).hide("");
		
	}
	$(document).ready(function(){
		$("#loading").ajaxStart(function(){
		$(this).show();
		});
	});
	
	$(document).ready(function(){
		$("#loading").ajaxStop(function(){
		$(this).hide();
		});
	});
	
/*'---------------------------------------------------------------------------------------------------------
'Author  	  	: saiful islam
'---------------------------------------------------------------------------------------------------------
'Created On 	: 25-07-2009 
'---------------------------------------------------------------------------------------------------------
'email 	: saiful_soft@hotmail.com
'---------------------------------------------------------------------------------------------------------*/

	function ClearListBox(lst)
		{
		var len=document.getElementById(lst).length ;
		
		for (i=0; i<=len; i++)
		
			{
			document.getElementById(lst).remove(0)
			}
		}
	
	
	function append_html(fromSel,theSel,hID,maxSize,msg)
	 {
	   var selIndex;
	   var IDCollection;
	   var TempID;
			FSel=document.getElementById(fromSel);
			TSel=document.getElementById(theSel);
	
			selIndex = FSel.selectedIndex;
			
			if (TSel.length >=parseInt(maxSize))
				{
					alert(msg);
					return false;
				}
					if (selIndex>=0)
			{
				newValue=FSel.options[selIndex].value;
				newText=FSel.options[selIndex].text;
			
				for(i = 0 ; i < TSel.length ; i++)// find duplicate
					{									
						if (newValue==TSel.options[i].value) 
							{
								return false;
							}
					}//end for
							
				var newOpt1 = new Option(newText, newValue);
					
				TSel.options[TSel.length] = newOpt1;
					
				TSel.selectedIndex =TSel.length-1;
				IDCollection=ListBox_IDCollection(theSel);
				document.getElementById(hID).value=IDCollection;
				
			}
				
	}
		
	
	function remove(tSel,hID)
	{
	  theSel=document.getElementById(tSel);
	  var selIndex = theSel.selectedIndex;
	  if (selIndex != -1)
		 { 
			  if(theSel.options[selIndex].selected)
					  {
						theSel.options[selIndex] = null;//alert(selIndex)
					  }
						
				if (theSel.length > 0)
				{
				  theSel.selectedIndex = selIndex == 0 ? 0 : selIndex - 1;
				}	
				document.getElementById(hID).value=ListBox_IDCollection(tSel);
										
	  }//outer if
	 }
	
	function ListBox_IDCollection(theSel)
		{
		var TempID;	
		var TSel;
		TempID="";
		TSel=document.getElementById(theSel);	
			if (TSel.length>0)
			{				
				for(i=0; i<TSel.length; i++)
				{
					if(TempID != "") //add new id to temp id
						{ 
						TempID = TempID  + "," + TSel.options[i].value;
						}	
					else
						{ 
						TempID = TSel.options[i].value;
						}
				}//end for
				
				TempID="," + TempID + ",";
			}//outer if
			
			return TempID;
				}//end function

