﻿var vSetG=false;
var vP;
var vC;
function setcareer2x(id,video_name,clogo,pname,cname,coname)
	{
	  cid = id;
	  c1 = cname;
	  c2 = coname;
		if (video_name !='')
		{
			
      //SetVideo2(video_name);
			//document.images['clogo'].src='/images/careers/'+clogo;
			if (document.getElementById("cname2") )
				document.getElementById("cname2").innerHTML=cname+",&nbsp;&nbsp;"+coname;

			if (document.getElementById("cinfo"))
				document.getElementById("cinfo").style.display="none";
      
      load_text(1,'Career Description','1');
	
		}
	}

	function setcareer2(id, video_name, clogo, pname, cname, coname) {
		cid = id;
		c1 = cname;
		c2 = coname;
		if (video_name != '') {


			//SetVideo(video_name);
			//document.images['clogo'].src='/images/careers/'+clogo;
			
			document.getElementById("cname").innerHTML = pname + ",&nbsp;&nbsp;" + cname + ",&nbsp;&nbsp;" + coname;
			document.getElementById("cinfo").style.display = "none";
			load_text(1, 'Career Description', '1');
		}
	}
	
function setWebisode(webisodeID,webisodeDescription,webisodeDate,webisodeName,webisodeUrl,webisodeImageUrl)
	{
	  cid = webisodeID;
	  c1 = webisodeName;
	  c2 = webisodeDate;
		if (webisodeName !='')
		{
			//alert(webisodeUrl);
			PlayWebisode(webisodeID, webisodeName, webisodeUrl, webisodeImageUrl);
      
      //document.images['clogo'].src='/images/careers/'+clogo;
			//document.getElementById('cname').innerHTML = "<font class='f3'><b>" + webisodeName + ",&nbsp;&nbsp;" + webisodeDate + "</b></font>";
			document.getElementById('cname').innerHTML = "<font class='f3'><b>" + webisodeName + "</b></font>";
		}
	}	
	
	function setcareer_faq(video_name,quest)
	{
		if (video_name !='')
		{ 
      SetVideoFaq(video_name);
      //document.images['clogo'].src='/images/careers/'+clogo;
      document.getElementById('cname2').innerHTML="<font class='f2'><b>"+quest+"</b></font>";
      //document.getElementById("cinfo").style.display="none";
      document.getElementById("nav_main_video").style.display = 'block';
		}
	}
	
 function load_text(tid,link,id)
 { 
 
   //if (tid==66) //ementor: take them to the Ementor Question
   // var vLink = 'CareerMentorMe.asp?id='+cid+'&topic_id=topic'+tid+'&topic_name='+link;
   //else
    var vLink = 'CareerInfo.asp?id='+cid+'&topic_id=topic'+tid+'&topic_name='+link;
   
   if (link == 'FindJob')
   {
     var vLink = 'GetIndeed.asp?q='+escape(c1)+'&typ=1'+'&lmt=5';
     //alert(vLink);
   }
   if (link == 'FindInternship')
   {
     var vLink = 'GetIndeed.asp?q='+escape(c1)+' Internship&typ=1'+'&lmt=5';
     //alert(vLink);
   }   
    parent.frames['careerinfo'].document.location.href=vLink;
    document.getElementById("cinfo").style.display = "";

    setHeader(id);
 }	
 
  function load_faq(tid,link,id)
 { 
    var vLink = 'CareerFaq.asp?id='+cid;
    parent.frames['careerinfo'].document.location.href=vLink;
    document.getElementById("cinfo").style.display = "";
    setHeader(id);
 }

 function setHeader(id) {
 	for (x = 1; x < 10; x++) {
 		if (document.getElementById('a' + x)) {
 			document.getElementById('a' + x).style.color = '#ffffff';

 		}
 	}
 	document.getElementById('a' + id).style.color = '#D81F2A';
 	}

 
 function SetVideo(vName)
 {
		if (vName == '')
			return;
		document.vjsFlashPlayer.SetVariable("player:jsStop", "");
		document.vjsFlashPlayer.SetVariable("player:jsUrl", "http://d2z1rclb8iuw13.cloudfront.net/flash_video/" + vName + ".flv");
		//document.vjsFlashPlayer.SetVariable("player:jsPlay", "");
	}


 function PlayWebisode(vId,vName,vUrl,vImgURL)
 {
		if (vName == '')
			return;
//		document.vjsFlashPlayer.SetVariable("player:jsStop", "");
		if (vUrl != '') {
			flashvars.imagePath = vImgURL;
			flashvars.videoPath = vUrl;
			//params.videoAutoPlay = 'true';
			swfobject.embedSWF("/video-player.swf", "flashDiv", stageW, stageH, "9.0.0", false, flashvars, params, attributes);
			//document.vjsFlashPlayer.SetVariable("player:jsUrl", vUrl);
		}
 }

 function SetVideoFaq(vName)
 {
		if (vName == '')
			return;
		flashvars.videoPath = "http://d2z1rclb8iuw13.cloudfront.net/flash_qa/" + vName;
		params.videoAutoPlay = 'true';
		swfobject.embedSWF("/video-player.swf", "flashDiv", stageW, stageH, "9.0.0", false, flashvars, params, attributes);


		//document.vjsFlashPlayer.SetVariable("player:jsStop", "");
		//document.vjsFlashPlayer.SetVariable("player:jsUrl", "http://carcrnrtv.vo.llnwd.net/o16/flash_qa/" + vName);
		//document.vjsFlashPlayer.SetVariable("player:jsPlay", "");
 }
 
function EMentorWin() {
 mywin = window.open('/mentordetail.asp','memdetail','width=700,height=400,scrollbars=yes');
}
 
function SetTopNav(vElem)
{
  //alert(document.getElementById('tn_scoop').id);
  document.getElementById(vElem).style.backgroundImage="url('/images/topNav/red_gradient_29.jpg')";
}
function ReSetTopNav(vElem,bActive)
{
  //alert(document.getElementById('tn_scoop').id);
  if (bActive==1)
    document.getElementById(vElem).style.backgroundImage="url('/images/topNav/red_gradient_29.jpg')";
  else
    document.getElementById(vElem).style.backgroundImage="url('/images/topNav/blue_gradient_29.jpg')";
}

function SetCSButton(vElem)
{
  //alert(document.getElementById('tn_scoop').id);
  document.getElementById(vElem).style.backgroundImage="url('/images/topNav/red_gradient_29.jpg')";
}
function ReSetCSButton(vElem)
{
  //alert(document.getElementById('tn_scoop').id);
  document.getElementById(vElem).style.backgroundImage="url('/images/topNav/blue_gradient_29.jpg')";
}

function SearchSelect(elem)
{
  document.getElementById('search_secondary_career').style.display='none';
  document.getElementById('search_secondary_company').style.display='none';
  document.getElementById('search_secondary_degree').style.display='none';
  document.getElementById('search_secondary_industry').style.display='none';
  document.getElementById('search_secondary_description').style.display = 'none';
  var divid='search_secondary_' + elem.value;
  document.getElementById(divid).style.display='inline';
  if (elem.value=='company')
    SetCompanySearch();
  if (elem.value=='career')
    SetCareerSearch();    

}


function SearchPopulate(elem)
{
  var divid = 'search_secondary_' + elem;
  var sOutput = "";

  
  if (elem=='degree')
  {
      sOutput = '<select name="cmbSearchByDegree" size="1" class="selectSml" style="width:210px;">';
      sOutput = sOutput + '<option class="sd" value="1">Associate’s Degree</option>';
      sOutput = sOutput + '<option class="sd" value="2">Bachelor’s Degree</option>';
      sOutput = sOutput + '<option class="sd" value="3">Master’s Degree</option>';
      sOutput = sOutput + '<option class="sd" value="4">Doctoral Degree</option>';
      sOutput = sOutput + '<option class="sd" value="5">Certification</option>';
      sOutput = sOutput + '<option class="sd" value="6">License</option>';
      sOutput = sOutput + '<option class="sd" value="7">Apprenticeship</option>';
      sOutput = sOutput + '<option class="sd" value="8">Hight School Diploma</option>';
      sOutput = sOutput + '</select>';
      //document.getElementById(divid).innerHTML = sOutput;


      //for (var i = 0; i < 8; i++) {
      //    if (document.frmSearch.cmbSearchByDegree.options[i].value == bDegree)
      //        document.frmSearch.cmbSearchByDegree.options[i].selected = true;
      //}      
  }
  
  if (elem=='career')
  {
      sOutput = '<input type="text" name="txtSearchCareer" id="txtSearchCareer" size="30"/>';
      document.getElementById(divid).innerHTML = sOutput;
  }

  if (elem == 'description') {
  	sOutput = '<input type="text" name="txtSearchCareer" id="txtSearchCareer" size="30"/>';
  	document.getElementById(divid).innerHTML = sOutput;
  }    
    
  if (elem=='company')
  {
      sOutput = '<input type="text" name="txtSearchCompany" id="txtSearchCompany" size="30"/>';
      document.getElementById(divid).innerHTML = sOutput;
  }
  
  
  if (elem=='industry')
  {
      sOutput = '<select name="cmbSearchByIndustry" id="cmbSearchByIndustry" size="1" class="selectSml" style="width:210px;">';
      sOutput = sOutput + '<option class="sd" value="1">Accounting</option>';
      sOutput = sOutput + '<option class="sd" value="2">Advertising & PR</option>';
      sOutput = sOutput + '<option class="sd" value="4">Agriculture & Natural Resources</option>';
      sOutput = sOutput + '<option class="sd" value="3">Architecture & Interior Design</option>';
      sOutput = sOutput + '<option class="sd" value="5">Biotech/ Pharmaceutical</option>';
      sOutput = sOutput + '<option class="sd" value="6">Building & Construction</option>';
      sOutput = sOutput + '<option class="sd" value="7">Business/ Entrepreneur</option>';
      sOutput = sOutput + '<option class="sd" value="23">Communications</option>';
      sOutput = sOutput + '<option class="sd" value="8">Education</option>';
      sOutput = sOutput + '<option class="sd" value="9">Engineering</option>';
      sOutput = sOutput + '<option class="sd" value="10">Entertainment</option>';
      sOutput = sOutput + '<option class="sd" value="11">Fashion</option>';
      sOutput = sOutput + '<option class="sd" value="12">Finance</option>';
      sOutput = sOutput + '<option class="sd" value="13">Government</option>';
      sOutput = sOutput + '<option class="sd" value="14">Health Care</option>';
      sOutput = sOutput + '<option class="sd" value="15">Hospitality/ Tourism</option>';
      sOutput = sOutput + '<option class="sd" value="16">Human Services</option>';
      sOutput = sOutput + '<option class="sd" value="17">Investment Banking</option>';
      sOutput = sOutput + '<option class="sd" value="18">Public Safety & Security</option>';
      sOutput = sOutput + '<option class="sd" value="19">Sales & Marketing</option>';
      sOutput = sOutput + '<option class="sd" value="20">Science</option>';
      sOutput = sOutput + '<option class="sd" value="21">Technology</option>';
      sOutput = sOutput + '<option class="sd" value="22">Transportation and Materials Moving</option>';
      sOutput = sOutput + '</select>';
      //document.getElementById(divid).innerHTML = sOutput;

     //for (var i = 0; i < 23; i++) {
     //  if (document.frmSearch.cmbSearchByIndustry.options[i].value == bIndustry)
     //  document.frmSearch.cmbSearchByIndustry.options[i].selected = true;
     //} 

 
  }

  //UpdateSearchValue(elem);
}

function UpdateSearchValue(elem)
{
return false;
}

function doSearch(pForm)
{
  pForm.method="post";
  pForm.action="/jobs/default.asp";
  pForm.submit();
}

function GlobalSearchSelect(elem)
{
  document.getElementById('global_search_career').style.display='none';
  document.getElementById('global_search_company').style.display='none';
  document.getElementById('global_search_scoop').style.display='none';
  var divid='global_search_' + elem.value;
  document.getElementById(divid).style.display='inline';
  if (elem.value == 'career')
    SetCareerSearch();
}


function doGlobalSearch(pForm)
{
  if (pForm.cmbGlobalSearchType.value == 'career')
    pForm.action="/jobs/default.asp";
  else if (pForm.cmbGlobalSearchType.value == 'company')
    pForm.action="/companies/default.asp";
  else if (pForm.cmbGlobalSearchType.value == 'scoop')
    pForm.action="/scoop/default.asp";
    
  pForm.method="post";
  pForm.submit();
}

function SetGraphics(iMax)
{
  if (vSetG == false)
  {
    vSetG = true;
    var v = vP;
    var d = vC;
    var v1 = v.split(',');
    var d1 = d.split(',');
    for (i=6;i<=iMax;i++)
    {
      
     document.images('c_head'+i).src='/images/careers/head_'+v1[i]+'.jpg';
     document.images('c_comp'+i).src='/images/careers/'+d1[i];
    }
  }
}

function toggleBox2(szDivID, iState) // 1 visible, 0 hidden
{
            if(document.layers)         //NN4+
            {
              document.layers[szDivID].display = iState ? "block" : "none";
            }
            else if(document.getElementById)         //gecko + IE 5+
            {
      			 var obj = document.getElementById(szDivID);
             obj.style.display = iState ? "block" : "none";
            }
            else if(document.all)    // IE 4
            {
               document.all[szDivID].style.display = iState ? "block" : "none";
            }

}

function smartToggleBox(szDivID)
{
	if(document.getElementById)         //gecko + IE 5+
    {
    	var obj = document.getElementById(szDivID);
    	if(obj.style.display == "block")
			toggleBox2(szDivID, 0);
		else
			toggleBox2(szDivID, 1);
    }   	
}


function handlePostLink(link){

    //toggleBox2('comment_bot',1);
    toggleBox2('post_box', 1);
    return false;
}


function submitComment(cid,uid,cName)
{

var isInError;
var vPath;
 
	var comment = document.getElementById("taReplyComments").value;
	if(comment == "" || IsMeaningless(comment)) {
	   displayMessage("commentBodyReplyError", "You must specify a comment.");
	   isInError = true;
	}


	if(isInError)
	   return;
	  //c1 = replace(c1,'/''','');

	  document.getElementById("taReplyComments").value = '';

  var vPath = "/comments/insertcomments.asp?vid="+cid+"&uid="+uid+"&commt="+comment+"&cName="+cName;
  //alert(vPath);
	makeHttpRequest(vPath,'insert_comment');
}

function submitScoopComment(cid, uid, cName)
{

var isInError;
var vPath;
 
	var comment = document.getElementById("taReplyComments").value;
	if(comment == "" || IsMeaningless(comment)) {
	   displayMessage("commentBodyReplyError", "You must specify a comment.");
	   isInError = true;
	}


	if(isInError)
	   return;
	  //c1 = replace(c1,'/''','');

	  document.getElementById("taReplyComments").value = '';

	  var vPath = "/comments/insertcomments.asp?sid=" + cid + "&uid=" + uid + "&commt=" + comment + "&cName=" + cName;
  //alert(vPath);
	makeHttpRequest(vPath,'insert_comment');
}


function insert_comment(vVal) {
	document.getElementById('comment_bot').innerHTML = vVal + document.getElementById('comment_bot').innerHTML;
}


// social media

// user update status
function submitStatusUpdate(uid,bAll) {

	var isInError;
	var vPath;

	var sStatus = document.getElementById("StatusText").value;
	if (sStatus.length > 160) {
		alert("Please keep the length of Status under 160 characters")
		isInError = true;
	}
	if (sStatus == "" || IsMeaningless(sStatus)) {
		alert("You must enter Status.");
		isInError = true;
	}


	if (isInError)
		return;
	//c1 = replace(c1,'/''','');

	document.getElementById("StatusText").value = '';

	var vPath = "/member/actions/updatestatus.asp?uid=" + uid + "&stat=" + sStatus;

	//alert(vPath);
	
	if (bAll==1) 
		makeHttpRequest(vPath, 'update_all');
	else
		makeHttpRequest(vPath, 'update_status');
	
}

// company update status
function submitCompanyStatusUpdate(uid, bAll) {

	var isInError;
	var vPath;

	var sStatus = document.getElementById("StatusText").value;
	var bScope = document.getElementById("cbVisible").value;
	
	if (sStatus.length > 160) {
		alert("Please keep the length of Status under 160 characters")
		isInError = true;
	}
	if (sStatus == "" || IsMeaningless(sStatus)) {
		alert("You must enter Status.");
		isInError = true;
	}


	if (isInError)
		return;
	//c1 = replace(c1,'/''','');

	document.getElementById("StatusText").value = '';
	

		var vPath = "/companies/actions/updatestatus.asp?uid=" + uid + "&stat=" + sStatus + "&scope=" + bScope;

	if (bAll == 1)
		makeHttpRequest(vPath, 'update_all');
	else
		makeHttpRequest(vPath, 'update_status');

}

// university update status
function submitUniversityStatusUpdate(uid, bAll) {

	var isInError;
	var vPath;

	var sStatus = document.getElementById("StatusText").value;
	var bScope = document.getElementById("cbVisible").value;

	if (sStatus.length > 160) {
		alert("Please keep the length of Status under 160 characters")
		isInError = true;
	}
	if (sStatus == "" || IsMeaningless(sStatus)) {
		alert("You must enter Status.");
		isInError = true;
	}


	if (isInError)
		return;
	//c1 = replace(c1,'/''','');

	document.getElementById("StatusText").value = '';


	var vPath = "/universities/actions/updatestatus.asp?uid=" + uid + "&stat=" + sStatus + "&scope=" + bScope;
	if (bAll == 1)
		makeHttpRequest(vPath, 'update_all');
	else
		makeHttpRequest(vPath, 'update_status');

}



function update_all(vVal) {

	if (document.getElementById('userStatusTop')) {
		document.getElementById('userStatusTop').innerHTML = vVal;
		if (document.getElementById('divuserTopStatus').style.display == 'none')
			document.getElementById('divuserTopStatus').style.display = '';
	}
//	else
//		alert('panic');

	if (document.getElementById('mystatus'))
		document.getElementById('mystatus').innerHTML = vVal;
//	else
//		alert('panic 2');
	
}

function update_status(vVal) {

	if (document.getElementById('mystatus'))
		document.getElementById('mystatus').innerHTML = vVal;
//	else
//		alert('panic 2');
	
}



// follow
function doFollowing(bf,uGUID) {

	var isInError;
	var vPath;

	
	if (isInError)
		return;

	var vPath = "/member/actions/follow.asp?bf=" + bf + "&uid=" + uGUID;
	makeHttpRequest(vPath, 'follow_done');
}

function follow_done(vVal) {

	if (document.getElementById('contact_follow'))
		document.getElementById('contact_follow').innerHTML = vVal;
//	else
//		alert('panic');
}

// recruiting company
function doRecruit(bf, uGUID) {

	var isInError;
	var vPath;


	if (isInError)
		return;

	var vPath = "/universities/actions/recruit.asp?bf=" + bf + "&uid=" + uGUID;
	makeHttpRequest(vPath, 'recruit_done');
}

function recruit_done(vVal) {

	if (document.getElementById('recruit_company'))
		document.getElementById('recruit_company').innerHTML = vVal;
	//	else
	//		alert('panic');
}


// core school
function doCoreSchool(bf, uGUID) {

	var isInError;
	var vPath;


	if (isInError)
		return;

	var vPath = "/companies/actions/coreschool.asp?bf=" + bf + "&uid=" + uGUID;
	makeHttpRequest(vPath, 'coreschool_done');
}

function coreschool_done(vVal) {

	if (document.getElementById('core_school'))
		document.getElementById('core_school').innerHTML = vVal;
	//	else
	//		alert('panic');
}



// remove as a friend , reject request
function FriendAction(vAction, u1, u2) {
	if (vAction == 'remove') {
		var x = confirm('Are you sure you want to Remove Connection?')
		if (x)
			document.location.href = "/member/actions/removefriend.asp?u1=" + u1 + "&u2=" + u2;
	}
	if (vAction == 'cancel') {
		var x = confirm('Are you sure you want to delete this connection?')
		if (x)
			document.location.href = "/member/actions/cancelpendingfriend.asp?u1=" + u1 + "&u2=" + u2;
	}	
			
}

// remove activity message
function DeleteActivityMessage(u1,sID,aID) {
	var x = confirm('Are you sure you want to delete this activity message?')
	if (x) {
		var vPath = "/member/actions/removeMessage.asp?u1=" + u1 + "&sID=" + sID + "&aID=" + aID;
		makeHttpRequest(vPath, 'remove_message_done');
	}
}

function remove_message_done(vVal) {
	if (document.getElementById(vVal)) {
		document.getElementById(vVal).style.visibility = 'hidden';
		document.getElementById(vVal).style.display = 'none';
	}
//	else
//		alert('panic');
}


function set_univ_state(vState) {
	if (vState == ''){
		alert('Please Select a State')
		return false;
	}
	var vPath = "/include/_univ_load.asp?v=" + vState;
	makeHttpRequest(vPath, 'pop_univ');
	
}
function pop_univ(vVal) {
	var arr1 = new Array()
	arr1 = vVal.split('~');
	var arrVal = new Array();
	var arrTxt = new Array();
	arrVal = arr1[0].split('#');
	arrTxt = arr1[1].split('#');
	if (document.getElementById('univ_show')) {

		if (document.getElementById('univ_show').style.display == 'none')
			document.getElementById('univ_show').style.display = '';
	}
	document.univsearch.INUN_ID.options.length = 0;
	addOption(document.univsearch.INUN_ID, '', '');
	for (var i = 0; i < arrVal.length; ++i) {
		addOption(document.univsearch.INUN_ID, arrTxt[i],arrVal[i]);
	}
}

function addOption(selectbox, text, value) {
	var optn = document.createElement("OPTION");
	optn.text = text;
	optn.value = value;
	selectbox.options.add(optn);
}

function makeHttpRequest(url, callback_function, return_xml) 
{ 
   var http_request = false; 
   var bFF = FireFoxDetect();
   if (!bFF) { // IE 
   	try {
   		http_request = new ActiveXObject("Msxml2.XMLHTTP");
   	} catch (e) {
   		try {
   			http_request = new ActiveXObject("Microsoft.XMLHTTP");
   		} catch (e) { 
   			try {
   				  http_request = new XMLHttpRequest(); 
   			} catch (e) { }
   		}	
   	}
   }
   else {
	 // Mozilla, Safari,... 
       http_request = new XMLHttpRequest(); 
       //http_request = new ActiveXObject("Msxml2.XMLHTTP"); 
       if (http_request.overrideMimeType) { 
           http_request.overrideMimeType('text/xml'); 
       } 
    }

   if (!http_request) { 
       alert('Unfortunatelly you browser doesn\'t support this feature.'); 
       return false; 
   } 
   http_request.onreadystatechange = function() { 
       if (http_request.readyState == 4) { 
           if (http_request.status == 200) { 
               if (return_xml) { 
                   eval(callback_function + '(http_request.responseXML)'); 
               } else { 
                   eval(callback_function + '(http_request.responseText)'); 
               } 
           } else { 
               //alert('There was a problem with the request.(Code: ' + http_request.status + ')'); 
           } 
       } 
   } 
   http_request.open('GET', url, true); 
   http_request.send(null); 
}


function FireFoxDetect()
{

if (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)){ //test for Firefox/x.x or Firefox x.x (ignoring remaining digits);
 var ffversion=new Number(RegExp.$1) // capture x.x portion and store as a number
 if (ffversion>=3)
  return true;
 else if (ffversion>=2)
  return true;
 else if (ffversion>=1)
  return true;
}
else
 return false;
}

function IsMeaningless(str){
	var tempStr = str.split(" ");
	for (i = 0; i < tempStr.length; i++)
	{
		if(tempStr[i] != "")
		{
			return false;
		}
	}
	return true;
}


function displayMessage(divId, messageText){
   document.getElementById(divId).innerHTML = messageText;
   document.getElementById(divId).style.display="block";
}

function onMissingAvatar(img){
   img.src = "http://media1.break.com/static/live/v1/img/site/avatar_mini.gif";
}


function checkreturn(sFrm) {
	if (event.keyCode == 13) {
		event.returnValue = false;
		sFrm.submit();
	}
}


function SetUnivState(vState) {

	var isInError;
	var vPath;

	var vPath = "/Universities/include/_University_Search.asp?step=1&st=" + vState ;
	//alert(vPath);
	makeHttpRequest(vPath, 'set_state');
}

function SetUnivList(v_val,school_name) {

	var isInError;
	var vPath;
	var vPath = "/Universities/include/_University_Search.asp?step=2&st=" + v_val.value + "&sh=" + school_name;
	makeHttpRequest(vPath, 'set_univ');
}


function set_state(x_data) {
	//alert(x_data);
	if ( document.getElementById("univ_state") )
		document.getElementById("univ_state").innerHTML = x_data;
}

function set_univ(x_data) {
//	alert(x_data);
	if (document.getElementById("univ_list"))
		document.getElementById("univ_list").innerHTML = x_data;
}

function Linkify(inputText) {
	//URLs starting with http://, https://, or ftp://
var replacePattern1 = /(\b(https?|ftp):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gim;     
var replacedText = inputText.replace(replacePattern1, '<a href="$1" target="_blank">$1</a>');      
//URLs starting with www. (without // before it, or it'd re-link the ones done above)     
var replacePattern2 = /(^|[^\/])(www\.[\S]+(\b|$))/gim;     
var replacedText = replacedText.replace(replacePattern2, '$1<a href="http://$2" target="_blank">$2</a>');
//Change email addresses to mailto:: links
var replacePattern3 = /(\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,6})/gim;
var replacedText = replacedText.replace(replacePattern3, '<a href="mailto:$1">$1</a>');
return replacedText;
} 
