document.write('<scr' + 'ipt src="http://www.worldhum.com/js/jquery.cookie.js"><\/script>');

   
$(function(){
	var randSurvey = Math.floor(Math.random()*2);
		var worldHumSurveyDisplay = $.cookie('worldHumSurveyDisplay'); // get cookie
		var frameHeight = $(window).height();
		var frameWidth = $(window).width();
		if ((worldHumSurveyDisplay != "ignore") && (worldHumSurveyDisplay!="notNow") && (randSurvey ===1)){
		$("<div class='surveyOverlay' id='surveySkin'>")
			.css({
				//'position': 'absolute',
				'top': '0px',
				'left': '0px',
				backgroundColor: 'black',
				'opacity': '0.75',
				'width': '100%',
				'height': $('body').height(),
				zIndex: 50000
			})
			.appendTo("body");
			
		$("<div class='surveyOverlay' id='surveyDisplay'><a href='#' class='closeSurvey' style='display: block; float: right; padding-right:10px'>x Close</a><div id='surveyIntro' style='clear: both; text-align: center;'><h2 style='text-align:center; clear:both;'>Thank you for visiting World Hum.  We are currently surveying users to get to know our visitors and better understand how you use our site.  Would you like to participate in our survey?</h2><div style='margin:10px 0px 0px 200px ; width: 350px; float: left; display:inline;'><a href='#' class='surveyContinue' style='margin-right:10px;'>Continue</a> <a href='#' id='noThanks' class='closeSurvey' style='margin-right:10px'>No thanks</a><a href='#' id='surveyIgnore' style='width:120px'>Permanently  Ignore</a></div></div></div>")
			.css({
				backgroundColor: 'white',
				'position' : 'absolute',
				'top': frameHeight/2-75,
				'left': frameWidth/2-350,
				margin: 0,
				width: 700,
				height: 150,
				padding: 0,
				zIndex: 60000,
				fontSize: '12px',
				overflow: 'hidden'
			})
			.appendTo("body");
		$('.closeSurvey').click(function () {
			$('.surveyOverlay').hide('slow');
			return false;
		
		});
		$('iframe .sExit').click(function () {
			$('.surveyOverlay').hide('slow');
			return false;
		
		});
		$('.surveyContinue').click(function () {
			$('#surveyIntro').hide();
			var surveyHeight = frameHeight-100;
			$('#surveyDisplay').animate({height: surveyHeight, 'top' :50}, {duration: 1500});
			$("<iframe src='https://www.surveymonkey.com/s.aspx?sm=VJ8ZJxUWYDavtNYbTMA5lw_3d_3d' scrolling='auto' frameborder='none'></iframe>").css({width: '700px', height:surveyHeight, margin:'0px'}).appendTo("#surveyDisplay");
			$('.closeSurvey').append(' / Exit Survey').wrap('<div id="sc"></div>');
			return false;
		
		});
		$('#noThanks').click(function(){$.cookie('worldHumSurveyDisplay', 'notNow'); return false;});
		$('#surveyIgnore').click(function(){
			$.cookie('worldHumSurveyDisplay', 'ignore', { expires: 999 });
			$('.surveyOverlay').hide('slow');
			return false;
			});
		$('<link rel="stylesheet" type="text/css" href="http://www.worldhum.com/css/wh-survey.css" />').appendTo("head");
		}; //end cookie check!
		
	});