function mailpage()
{
	//alert(location.href);
	
	//var thearticle=location.href;
	//alert(thearticle);
	
	mail_str = "mailto:?subject= " + document.title;
	//alert(mail_str);
	mail_str += "&body= I recommend this Article: " + document.title;
 
	mail_str += ". You should check it out at " + location.href;
	location.href = mail_str;

}

function mailpageURL(URL)
{
	//alert(URL);
	//alert(location.href);
	var thesite="http://dev.winexpert.com/";
	//var thearticle=location.href;
	//alert(thearticle);
	
	mail_str = "mailto:?subject= " + document.title;
	//alert(mail_str);
	  mail_str += "&body= I recommend this Article: " + document.title;
	 
	  mail_str += ". You should check it out at: " +thesite+URL;
	  location.href = mail_str;

}

$(document).ready(function() {
	var IE6 = false /*@cc_on || @_jscript_version < 5.7 @*/;

	$("#raq-pop-form").hover(
		function() {
			$("#requestPopForm").height("auto");
			$("#requestPopForm").slideDown('fast');
		},
		function() {
			//$("#requestPopForm").height(0);
			$("#requestPopForm").slideUp('fast', function() {
				$("#requestPopForm").height(0);
			});
		}
	);
});

function openLargeView(theid){
	loadPopup(theid);
}

function loadPopup(theid){
	//loads popup only if it is disabled
	$(".backgroundPopup").css('height',$(document).height());
	$(".backgroundPopup").css('display','block');
	$(".backgroundPopup").fadeIn("fast");
	
	if (theid == 1) 
		var link = '~SITE/Layout/dsp_subscribe.cfm';
	else if (theid == 2)
		var link = '~SITE/Layout/dsp_mobile.cfm';
	else
		var link = '~SITE/Layout/dsp_guide.cfm';
	
	$.ajax({
		type: "POST",
		url: link,
		success: function(msg){
			$("#popupArea").html(msg);
			//request data for centering
			var windowWidth = $(window).width();
			var windowHeight = $(window).height();

			var popupHeight = $("#popup").height();
			var popupWidth = $("#popup").width();
			
			//centering
			$("#popup").css({
				"position": "absolute",
				"top": (windowHeight/2-popupHeight/2) + $(window).scrollTop() +'px',
				"left": windowWidth/2-popupWidth/2+'px'
			});
			$("#popup").fadeIn("fast");
		}
	});
}

function disablePopup(theid){
	//disables popup only if it is enabled

	$(".backgroundPopup").css('display','none');
	$(".backgroundPopup").fadeOut("fast");
	$("#popup").fadeOut("fast");
}

function hoverX() {
	document.getElementById('closeX').src = '~ASSETS/IMG/layout/x.jpg';
}

function normalX() {
	document.getElementById('closeX').src = '~ASSETS/IMG/layout/x_hover.jpg';
}
