$(document).ready(function(){
	$("a.newwindow").click(function(){	
		var popup = openPopUp("frameset.html",'taleo',900,600,'yes');
		theUrl = $(this).attr("href");				
		frameList = popup.frames;		
		setTimeout("frameList.frames[1].location = theUrl",1000);
		return false;
	});
});

$(document).ready(function(){
	$("a.newwindownoframe").click(function(){	
		var theUrl = $(this).attr("href");
		var popup = openPopUp(theUrl,'taleo',900,600,'yes');
		return false;
	});
});

function detectPopupBlocker() {
		var test = window.open(null,"","width=100,height=100");
		try {
				test.close();
				alert("Pop-ups not blocked.");
				
		} catch (e) {
				alert("Pop-ups blocked.");
		}
}


	
function taleoform(){
	//detectPopupBlocker();		
		categoryId = $("#categoryId").val();
		locationId = $("#locationId").val();					
		var popup = openPopUp("frameset.html",'taleo',900,600,'yes');					
		theUrl="http://ldschurch.taleo.net/servlets/CareerSection?art_ip_action=FlowDispatcher&flowTypeNo=13&pageSeq=1&art_servlet_language=en&csNo=2&eventname=200&searchmode=advanced&category="+categoryId+"&location="+locationId;		
		frameList = popup.frames;		
		setTimeout("frameList.frames[1].location = theUrl",1000);
}

function taleoformkeyword(){
		keywordId = $("#keywordId").val();
		var popup = openPopUp("frameset.html",'taleo',900,600,'yes');					
    	theUrl="http://ldschurch.taleo.net/servlets/CareerSection?art_ip_action=FlowDispatcher&flowTypeNo=13&pageSeq=1&art_servlet_language=en&csNo=2&eventname=200&searchmode=advanced&locationId=&categoryId=&keyword="+keywordId+"&x=40&y=20";
    	frameList = popup.frames;		
		setTimeout("frameList.frames[1].location = theUrl",1000);
}

function openPopUp(url,winname, width, height, scrolling) { //v2.0
    if (!width) width = 320;
    if (!height) height = 240;
    if (!scrolling) scrolling = "auto"; 
    features = "width="+width+","
             + "height="+height+","
             + "toolbar=yes,"
			 + "resizable=yes,"
             + "location=yes,"
             + "status=yes,"
             + "menubar=yes,"
             + "scrollbars="+scrolling+","
             + "top="+(window.screen.height-height)/2+","
             + "left="+(window.screen.width-width)/2;
    var newWindow = window.open(url,winname,features); 

	return newWindow;
}