// Preload Images
img1 = new Image(16, 16);  
img1.src="images/popup/spinner.gif";

img2 = new Image(220, 19);  
img2.src="images/popup/ajax-loader.gif";

// When DOM is ready
$(document).ready(function(){

$(".groovybutton").mouseover(function () {
      $(this).css("color","#B20E0C");
	  $(this).css("background-color","#EEEEEE");
	  $(this).css("border-color","#B20E0C");
    });
	
$(".groovybutton").mouseout(function () {
      $(this).css("color","#555555");
	  $(this).css("background-color","#EEEEEE");
	  $(this).css("border-color","#555555");
    });	



//check for the cookie
	var cook=$.cookie('survey_answerd')
	if(cook==null)
	{
		$('#survey_form').modal();
		$('#question_1').show();
		
		//$('#survey_form').css("z-index","10000000");
		//$('#survey_form').css("position","absolute");
	}
});


// When the form is submitted
function submitValue(responseVal)
{  

// Hide 'Submit' Button

//alert(responseVal);
// -- Start AJAX Call --

$.ajax({  
    type: "POST",	
    url: "popup.asp",  // Send the login info to this page
	dataType: "application/x-www-form-urlencoded",
    data: "response=" +responseVal,
	async: false,
	success: function(msg)
	{ 
	//$.modal.close();
	//if(msg=='fail')
		//alert(msg);
	//else
		//alert(msg);
	}
   
  });
  
  //set the cookie
	if($.cookie('survey_answerd')==null)
		$.cookie('survey_answerd', '1',{expires:60});
  
  $.modal.close();
  
// -- End AJAX Call --

}


function sayHello(){

	$.ajax({
		type:"POST",
		url: "jQueryExample.asp",
		dataType: "application/x-www-form-urlencoded",
		data: "Action=hello&Val=" + $("#txtName").val(),
		async: false,
		success: function(msg){ $("#fldHello").append(msg);}
	})
} 

function showQuestion(hideDiv,showDiv)
{
	$('#'+hideDiv).hide();
	$('#'+showDiv).show("slow");
}

