function hide_details()
{
	if($('num_of_gift_certificate').value > 1)
	{
		$('first').readOnly                            = true;
		$('last').readOnly                             = true;
		$('email').readOnly                            = true;
		$('confirm').readOnly                          = true;
		$('emailRecipientImmediately').style.display   = 'none';
	}
	else
	{
		$('first').readOnly                            = false;
		$('last').readOnly                             = false;
		$('email').readOnly                            = false;
		$('confirm').readOnly                          = false;
		$('emailRecipientImmediately').style.display   = 'block';
	}
}


function showList(str){ 
		new Effect.Appear( str + '_pic' );
		new Effect.Appear( str + '_text' );
		$('minus_' + str ).style.display   = 'inline';
		$('plus_' + str ).style.display    = 'none';		
}

function hideList(str){
		new Effect.Shrink( str + '_pic' );
		new Effect.Shrink( str + '_text' );
		$('minus_' + str ).style.display   = 'none';
		$('plus_' + str ).style.display   = 'inline';		
}

function agreeTermCondition()
{

	if($('term_condition_checkbox').checked == true){
	     $('purchaseGiftButtonDisable' ).style.display   = 'none';
	     $('purchaseGiftButton' ).style.display   = 'inline';
	}
	if($('term_condition_checkbox').checked == false){
	     $('purchaseGiftButtonDisable' ).style.display   = 'inline';
	     $('purchaseGiftButton' ).style.display   = 'none';
	}
}

function hide_info()
{
	if($('num_of_gift_certificate').value > 1)
	{
			new Effect.Fade('first_name');
			new Effect.Fade('last_name');
			new Effect.Fade('email');
			new Effect.Fade('emailRecipientImmediately');
	}
	else
	{
				new Effect.Appear('first_name');
				new Effect.Appear('last_name');
				new Effect.Appear('email');
				new Effect.Appear('emailRecipientImmediately');				
	}
}

function xstooltip_findPosX(obj) 
{
  var curleft = 0;
  if (obj.offsetParent) 
  {
    while (obj.offsetParent) 
        {
            curleft += obj.offsetLeft
            obj = obj.offsetParent;
        }
    }
    else if (obj.x)
        curleft += obj.x;
    return curleft;
}

function xstooltip_findPosY(obj) 
{
    var curtop = 0;
    if (obj.offsetParent) 
    {
        while (obj.offsetParent) 
        {
            curtop += obj.offsetTop
            obj = obj.offsetParent;
        }
    }
    else if (obj.y)
        curtop += obj.y;
    return curtop;
}

function xstooltip_show(tooltipId, parentId, posX, posY,relativePosX)
{
    it = document.getElementById(tooltipId);
    
    if ((it.style.top == '' || it.style.top == 0) 
        && (it.style.left == '' || it.style.left == 0))
    {
        // need to fixate default size (MSIE problem)
        it.style.width = it.offsetWidth + 'px';
        it.style.height = it.offsetHeight + 'px';
        
        img = document.getElementById(parentId); 
    
        // if tooltip is too wide, shift left to be within parent 
        if (posX + it.offsetWidth > img.offsetWidth) posX = img.offsetWidth - it.offsetWidth;
        if (posX < 0 ) posX = 0; 
        
        x = xstooltip_findPosX(img) + posX + relativePosX;
        y = xstooltip_findPosY(img) + posY;
        //alert(x+"-"+y);
        it.style.top = y + 'px';
        it.style.left = x + 'px';
    }
    
    it.style.visibility = 'visible'; 
}

function xstooltip_hide(id)
{
    it = document.getElementById(id); 
    it.style.visibility = 'hidden'; 
} 

function showGroup(rows)
{
	
	
	
	if($('EntrepreneurIsGroup').value == 2){
	   $('entre_group').style.display   = 'none';
	   //$('group_msg').style.display   = 'none';	
	   //$('single_msg').style.display   = 'block';
	   for(i=0;i<rows;i++){
	      $('select_all').style.display = 'none';
	      $('single_'+i).style.display  = 'inline';
	      $('group_'+i).style.display   = 'none';
	   }
	   document.getElementById("group_message").innerHTML = "";
	}
	else{		
	   $('entre_group').style.display   = 'inline';
	   //$('single_msg').style.display   = 'none';	
	   //$('group_msg').style.display   = 'block';	
	   for(var p=0;p<rows;p++){
	      $('select_all').style.display = 'inline';
	      $('single_'+p).style.display  = 'none';
	      $('group_'+p).style.display   = 'inline';
	   }
	   document.getElementById("single_message").innerHTML = "";
	}	
}

function selectAll(num)
{
	if($('select_all_checkbox').checked == true){
		for(var i=0;i<num;i++){
       $('checkbox_'+i).checked = true;
   }
	}
	else{
		for(var i=0;i<num;i++){
       $('checkbox_'+i).checked = false;
   }
	}
	      
   
}