$(document).ready(function() {
    // --start jquery code
   
 	$(".activity").corner("6px");
	
	//alert($("div.activity").attr("class"));
		
		$("a.btn_activity").click(function(){
			
			//make only available activities clickable
			if ($(this).parents("div").attr("class") == "activity Avail_NotComp") {		
			//alert("here!");
				$(this).parents(".activity").css("background-color","#BCF1F7");
			};
			
		});
		
	
		//LG FAQ expand code:
		$("p.lg_faq_ques").click(function(){
			//alert("Clicked!")
			$(this).parents("div.q-n-a").children("p.lg_faq_ans").toggle("fast");
		});
		$("span.faq_show").click(function() {
			$("p.lg_faq_ans").show("fast");
		});
		$("span.faq_hide").click(function() {
			$("p.lg_faq_ans").hide("fast");
		});
	
		//css("background-color","#ff0000")
		
		//to detect phone:
		/*var browserWidth = screen.width;
		var browserHeight = screen.height;
		alert("Width: " + browserWidth + ", Height: " + browserHeight)*/
 
 });


//-open popup window
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features)
}

//-open popup window
function winPOP(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features)
}

//control for instruction window
var bookWindow;
function newWindow(bookgif) {
	if (!bookWindow || bookWindow.closed) {
	bookWindow = window.open(bookgif,'bookWin','scrollbars=yes,width=250,height='+mainheight+',left='+leftPos+',top=1');
	//bookWindow.focus();
	}else{
		bookWindow.focus();
	}
}

//control to close instruction window
function closeInstructWindow() {
	if (bookWindow && !bookWindow.closed){
		bookWindow.close();
	}
}

function isDigits(str) {
        var i
        for (i = 0; i < str.length; i++) {
                mychar = str.charAt(i)
                if (mychar < "0" || mychar > "9")
                        return false
        }
        return true
}

function numbersonly(myfield, e, dec)
{
var key;
var keychar;

if (window.event)
   key = window.event.keyCode;
else if (e)
   key = e.which;
else
   return true;
keychar = String.fromCharCode(key);

// control keys
if ((key==null) || (key==0) || (key==8) || 
    (key==9) || (key==13) || (key==27) )
   return true;

// numbers
else if ((("0123456789").indexOf(keychar) > -1))
   return true;

// decimal point jump
else if (dec && (keychar == "."))
   {
   myfield.form.elements[dec].focus();
   return false;
   }
else
   return false;
}

function isEmpty(s)
      { return ((s == null) || (s.length == 0)) }
	  
function returnToTasks() {
	window.location.href='../../eval.asp?pid=54';
	
}

	  

	
