function share_astro_div_content(div_id,gobbler_page,email_page,friendlist_page,zone_page, width, height, visitor_mode , content_sharing)
{
	if(width == undefined)
		width = 500;

	if(height == undefined)
		height = 550;

	if(document.getElementById(div_id))
		document.getElementById(div_id).style.display = 'block';
	
	if(document.getElementById('fade_id'))
	{
		document.getElementById('fade_id').style.display = 'block';
	}

	if(document.getElementById('frame1'))
	{
		document.getElementById('frame1').style.display = 'block';
	}
	if(content_sharing == 'photo-bucket')
		var layer_heading_str = "To share your photo bucket, choose recipients using an option below:";
	else
		var layer_heading_str = "Choose recipients using an option below:";
	share_str = "<div class=\"large\" style=\"padding:10px;\"><b>"+layer_heading_str+"</b><br><div class=\"medium\" style=\"padding: 8 0 3 0px;\"><div class=\"left\" style=\"width:10px; text-align:left; color:#0066CC;\">-</div><div class=\"left\" style=\"padding-right:30px;\"><a href=\"#\" onClick=\"open_share_popup('"+gobbler_page+"','','"+div_id+"',520,538);document.getElementById('frame1').style.display='none'; return false;\"  class=\"noborder\">Select E-mails from your address book on yahoo, gmail etc.</a></div><br clear=\"all\"></div><div class=\"medium\" style=\"padding: 3 0px;\"><div class=\"left\" style=\"width:10px; text-align:left; color:#0066CC;\">-</div> <div class=\"left\" style=\"\"><a href=\"#\" onClick=\"open_share_popup('"+email_page+"','','"+div_id+"',"+width+", "+height+");document.getElementById('frame1').style.display='none'; return false;\" class=\"noborder\">Enter E-mail addresses manually</a></div><br clear=\"all\"></div><div class=\"medium\" style=\"padding: 3 0px;\">";
	
	if(visitor_mode != 'Y')
	{
		share_str += "<div class=\"left\" style=\"width:10px; text-align:left; color:#0066CC;\">-</div><div class=\"left\" style=\"\"><a href=\"#\" onClick=\"open_share_popup('"+friendlist_page+"','','"+div_id+"',640, 550);document.getElementById('frame1').style.display='none'; return false;\"  class=\"noborder\">Select from your friends list</a></div><br clear=\"all\"></div><div class=\"medium\" style=\"padding: 3 0px;\"><div class=\"left\" style=\"width:10px; text-align:left; color:#0066CC;\">-</div> <div class=\"left\" style=\"\"><a href=\"#\" onClick=\"open_share_popup('"+zone_page+"','','"+div_id+"',"+width+", "+height+");document.getElementById('frame1').style.display='none'; return false;\" class=\"noborder\">Enter Zonenames</a></div></div></div>";
	}
	
	share_str += "<div class=\"right medium\" style=\"padding:2 5 6 0px;\"><a href=\"#\" onclick = \"document.getElementById('"+div_id+"').style.display='none';document.getElementById('fade_id').style.display='none';document.getElementById('frame1').style.display='none'; return false;\" class=\"noborder\">Close [X]</a><br clear=\"all\"></div>"

	
	document.getElementById(div_id).innerHTML = share_str;

	return false;
}

function findPosAstro(obj) {
	if(obj)
	{
		var curleft = curtop = 0;
		if (obj.offsetParent) {
			curleft = obj.offsetLeft
			curtop = obj.offsetTop
			while (obj = obj.offsetParent) {
				curleft += obj.offsetLeft
				curtop += obj.offsetTop
			}
		}
		

		document.getElementById('fade_id').style.height = curtop;
		document.getElementById('frame1').style.height = curtop;
		document.getElementById('fade_id').style.display = 'block';
		document.getElementById('frame1').style.display = 'block';
	}
}

function show_astro_share_block(obj_div,dv_width,dv_height)
{
	var hrefDiv = document.getElementById(obj_div);
	hrefDiv.style.display = "block";

	var bheight = document.body.clientHeight;
	var bwidth = document.body.clientWidth;		

	var scrolly = document.body.scrollTop;
	var scrollx = document.body.scrollLeft;
	
	var layr_ht = hrefDiv.offsetHeight;
	var layr_wd = hrefDiv.offsetWidth;

	var aa = Math.ceil(layr_ht/2);
	var bb = Math.ceil(layr_wd/2);
	
	var c = Math.ceil(bheight/2);
	var d = Math.ceil(bwidth/2);


	var disp_layer_top_st = c + scrolly - aa ;
	var disp_layer_width_st = d + scrollx - bb;
	
	//alert(disp_layer_top_st)
	//alert(disp_layer_width_st)

	//for Mozilla
	hrefDiv.setAttribute("style","display: block;position: absolute ;top: "+disp_layer_top_st+"px;left: "+disp_layer_width_st+"px; width:"+dv_width+"px; height:"+dv_height+"px; border: 6px solid #333333; z-index:1010; background: #ffffff;");

	
	//for IE
	hrefDiv.style.cssText = "display: block;position: absolute ;top: "+disp_layer_top_st+"px;left: "+disp_layer_width_st+"px; width:"+dv_width+"px; height:"+dv_height+"px; border: 6px solid #333333; z-index:1010; background: #ffffff;";

}//EO

function LTrim( value )
{		
	var re = /\s*((\S+\s*)*)/;
	return value.replace(re, "$1");		
}//EOF

// Removes ending whitespaces
function RTrim( value )
{		
	var re = /((\s*\S+)*)\s*/;
	return value.replace(re, "$1");		
}//EOF

// Removes leading and ending whitespaces
function Trim( value )
{		
	return LTrim(RTrim(value));		
}//EOF

function check_form_lucky_car()
{
	var dd = Trim(document.frm_car_color.day.value);
	var mm = Trim(document.frm_car_color.month.value);
	var yy = Trim(document.frm_car_color.year.value);
	var chk = 1;	
	
	if("" == dd
	&& "" == mm
	&& "" == yy)
	{
		alert("Please enter your birth date.");
		return false;
		chk = 0;
	}
	
	if(isDate(mm+"/"+dd+"/"+yy) == false)
	{
		chk = 0;
		return false;
	}
	if(document.frm_car_color.gender[0].checked)
	{
		gender = Trim(document.frm_car_color.gender[0].value);
	}
	else if(document.frm_car_color.gender[1].checked)
	{
		gender = Trim(document.frm_car_color.gender[1].value);
	}
	else
	{
		alert("Please enter your gender.");
		return false;
	}

	if(1 == chk)
	{
		var url = 'http://www.astrolife.com/interactives/popup/car-color.php?gender='+gender+'&day='+dd+'&month='+mm+'&year='+yy+'&source=fropper';
		
		popup_winname = window.open(url, 'popup_winname', 'width=' + 747 + ', height=' + 480 + ', scrollbars= no , left=' + ((screen.availWidth / 2) - (747 / 2)) + ', top=' + ((screen.availHeight / 2) - (480 / 2)) + ''); 
		popup_winname.focus();
	}
	return false;
}//EOF


function check_form_kua_no()
{
	var dd = Trim(document.frm_kua_number.day.value);
	var mm = Trim(document.frm_kua_number.month.value);
	var yy = Trim(document.frm_kua_number.year.value);
	var chk = 1;	
	
	if("" == dd
	&& "" == mm
	&& "" == yy)
	{
		alert("Please enter your birth date.");
		return false;
		chk = 0;
	}
	
	if(isDate(mm+"/"+dd+"/"+yy) == false)
	{
		chk = 0;
		return false;
	}
	
	if(document.frm_kua_number.gender[0].checked)
	{
		gender = Trim(document.frm_kua_number.gender[0].value);
	}
	else if(document.frm_kua_number.gender[1].checked)
	{
		gender = Trim(document.frm_kua_number.gender[1].value);
	}
	else
	{
		alert("Please enter your gender.");
		return false;
	}

	if(1 == chk)
	{
		var dob = yy+""+mm+""+dd;
		var url = 'http://www.astrolife.com/interactives/popup/kua-number.php?gender='+gender+'&dob='+dob+'&source=fropper';
		
		popup_winname = window.open(url, 'popup_winname', 'width=' + 747 + ', height=' + 480 + ', scrollbars= no , left=' + ((screen.availWidth / 2) - (747 / 2)) + ', top=' + ((screen.availHeight / 2) - (480 / 2)) + ''); 
		popup_winname.focus();
	}
	return false;
}//EOF

function check_form_analyse_phone_no()
{	
	var chk = 1;
	var phno = Trim(document.frm_phone_no.phnumber.value);

	if("" == phno) 
	{
		alert("Please enter your number.");
		document.frm_phone_no.phnumber.focus();
		chk = 0;
		return false;
	}
	else if(isNaN(phno))
	{
		alert("Please enter your numbers between 0-9.");
		document.frm_phone_no.phnumber.focus();
		chk = 0;
		return false;
	}		
	if(phno.length < 4)
	{
		alert("Please enter your four digits of your telephone number.");
		document.frm_phone_no.phnumber.focus();
		chk = 0;
		return false;
	}
	if(1 == chk)
	{
		var url = 'http://www.astrolife.com/interactives/popup/analyse-phone-number.php?phno='+phno+'&source=fropper';
		
		popup_winname = window.open(url, 'popup_winname', 'width=' + 747 + ', height=' + 480 + ', scrollbars= no , left=' + ((screen.availWidth / 2) - (747 / 2)) + ', top=' + ((screen.availHeight / 2) - (480 / 2)) + ''); 
		popup_winname.focus();
	}
	return false;
}//EOF

function check_form_harmonize()
{
	var msg = "";
	var dd = Trim(document.frm_harmonize_name.day.value);
	var mm = Trim(document.frm_harmonize_name.month.value);
	var yy = Trim(document.frm_harmonize_name.year.value);
	var chk = 1;
	var reg_ex = /^[a-zA-z ]+$/;
	var focus = '';

	if("first name" == Trim(document.frm_harmonize_name.fname.value) 
	|| "" == Trim(document.frm_harmonize_name.fname.value)) 
	{
		msg += "Please enter your first name. \n";
		focus = "fname";
		document.frm_harmonize_name.fname.focus();
		chk = 0;
	}
	else if(!(Trim(document.frm_harmonize_name.fname.value).match(reg_ex)))
	{
		msg += "Please enter your proper first name [only alphabets]. \n";
		focus = "fname";
		document.frm_harmonize_name.fname.focus();
		chk = 0;
	}

	if("middle & last name" == Trim(document.frm_harmonize_name.mlname.value) 
	|| "" == Trim(document.frm_harmonize_name.mlname.value))
	{
		msg += "Please enter your middle & last name. \n";
		if(focus == '')
		{
			document.frm_harmonize_name.mlname.focus();
		}
		//document.frm_harmonize_name.mlname.focus();
		chk = 0;
	}
	else if(!(Trim(document.frm_harmonize_name.mlname.value).match(reg_ex)))
	{
		msg += "Please enter your proper middle & last name [only alphabets]. \n";
		//document.frm_harmonize_name.mlname.focus();
		if(focus == '')
		{
			document.frm_harmonize_name.mlname.focus();
		}
		chk = 0;
	}

	if("" == dd
	&& "" == mm
	&& "" == yy)
	{
		msg += "Please enter your birth date. \n";
		chk = 0;
	}
	if(msg.length > 0)
	{
		alert(msg);
		return false;
	}
	if(isDate(mm+"/"+dd+"/"+yy) == false)
	{
		chk = 0;
		return false;
	}

	if(1 == chk)
	{
		var f_name = Trim(document.frm_harmonize_name.fname.value);
		var l_name = Trim(document.frm_harmonize_name.mlname.value);
		var url = 'http://www.astrolife.com/interactives/popup/harmonize-your-name.php?fname='+f_name+'&mlname='+l_name+'&day='+dd+'&month='+mm+'&year='+yy+'&source=fropper';
		
		popup_winname = window.open(url, 'popup_winname', 'width=' + 747 + ', height=' + 480 + ', scrollbars= no , left=' + ((screen.availWidth / 2) - (747 / 2)) + ', top=' + ((screen.availHeight / 2) - (480 / 2)) + ''); 
		popup_winname.focus();
	}
	return false;
}//EOF

function check_form_iching_predictions()
{
	
	var uname = Trim(document.frm_iching.uname.value);
	var reg_ex = /^[a-zA-z ]+$/;

	if("" == uname) 
	{
		alert("Please enter your name.");
		document.frm_iching.uname.focus();
		return false;
	}
	else if(!(uname.match(reg_ex)))
	{
		alert("Please enter your proper name [only alphabets].");
		document.frm_iching.uname.focus();
		return false;
	}
	else
	{		
		var url = 'http://www.astrolife.com/interactives/popup/iching-predictions.php?uname='+uname+'&source=fropper';
		
		popup_winname = window.open(url, 'popup_winname', 'width=' + 747 + ', height=' + 480 + ', scrollbars= no , left=' + ((screen.availWidth / 2) - (747 / 2)) + ', top=' + ((screen.availHeight / 2) - (480 / 2)) + ''); 
		popup_winname.focus();
	}
	return false;
}//EOF

function reset_field(field_name,frm_name)
{
	if(frm_name=="frm_harmonize_name"){
		if("fname" == field_name){
			if("first name" == document.frm_harmonize_name.fname.value){
				document.frm_harmonize_name.fname.value = "";
			}else if("" == document.frm_harmonize_name.fname.value){
				document.frm_harmonize_name.fname.value = "first name";
			}
		}
		if("mlname" == field_name){
			if("middle & last name" == document.frm_harmonize_name.mlname.value){
				document.frm_harmonize_name.mlname.value = "";
			}else if("" == document.frm_harmonize_name.mlname.value){
				document.frm_harmonize_name.mlname.value = "middle & last name";
			}
		}

	}else if (frm_name=="frm_try_another"){

		if("fname" == field_name){
			if("first name" == document.frm_try_another.fname.value){
				document.frm_try_another.fname.value = "";
			}else if("" == document.frm_try_another.fname.value){
				document.frm_try_another.fname.value = "first name";
			}
		}
		if("mlname" == field_name){
			if("middle & last name" == document.frm_try_another.mlname.value){
				document.frm_try_another.mlname.value = "";
			}else if("" == document.frm_try_another.mlname.value){
				document.frm_try_another.mlname.value = "middle & last name";
			}
		}
	}
	return true;
}//EOF

function fortune_cookie()
{
	var url = 'http://www.astrolife.com/interactives/popup/fortune-cookie.php?source=fropper';
	popup_winname = window.open(url, 'popup_winname', 'width=' + 747 + ', height=' + 480 + ', scrollbars= no , left=' + ((screen.availWidth / 2) - (747 / 2)) + ', top=' + ((screen.availHeight / 2) - (480 / 2)) + ''); 
	popup_winname.focus();
	return false;
}//EOF

function ask_the_oracle()
{
	var url = 'http://www.astrolife.com/interactives/popup/ask-the-oracle/ask-the-oracle1.php?source=fropper';
	popup_winname = window.open(url, 'popup_winname', 'width=' + 747 + ', height=' + 480 + ', scrollbars= no , left=' + ((screen.availWidth / 2) - (747 / 2)) + ', top=' + ((screen.availHeight / 2) - (480 / 2)) + ''); 
	popup_winname.focus();
	return false;
}//EOF

function check_compatibility()
{
	var url = 'http://www.astrolife.com/interactives/popup/compatibility/sun-sign-compatibility.php?source=fropper';
	popup_winname = window.open(url, 'popup_winname', 'width=' + 747 + ', height=' + 480 + ', scrollbars=no, left=' + ((screen.availWidth / 2) - (747 / 2)) + ', top=' + ((screen.availHeight / 2) - (480 / 2)) + '');
	popup_winname.focus();
	return false;
}//EOF

function display_disabled_msg(case_name)
{
	var alert_msg = '';

	switch(case_name)
	{
		case "analyse_ph_no":
			alert_msg = "Find out how your phone number can affect your future..Coming soon";
			break;
		case "fortune_cookie":
			alert_msg = "Fortune cookie will unveil your future graph..Coming soon";
			break;
		default:
			break;
	}
	alert(alert_msg);
	return false;
}