var preloadImages = new Array();
var imageURLs = new Array('images/Text-Links-CampusBlvd-1.jpg','images/Text-Links-CampusBlvd-2.jpg','images/Text-Links-CampusBlvd-3.jpg');
for(var i=0;i<imageURLs.length;i++)
{
  preloadImages[i] = new Image();
  preloadImages[i].src = imageURLs[i];
}
var preloadTexts = new Array('CampusBlvd is a network of college websites that <BR />services consumers and search engine marketing<BR /> (SEM) companies by providing highly relevant text <BR />link placements. We offer monthly rented text  links<BR /> that appear on college websites that have hundreds<BR /> and thousands of .edu backlinks.','CampusAve is a network of college newspaper and <BR>collegetown classified websites that offers localized categories targeted at students, faculty, and staff.<BR> From jobs to apartments,CampusAve serves the needs and wants of every community member.','CampusHwy is a spring break travel center that will <BR>help you plan the spring break trip of a lifetime.<BR> From providing information on hotels in Mexico to destinations in Jamaica to resorts in the Bahamas,<BR> CampusHwy is your spring break student resource.');
var currentGlobalIndex = 1;
function changeIndexTextAndImage(index)
{
  currentGlobalIndex = index;
  var infoText = document.getElementById('info-text');
  var infoImage = document.getElementById('info-image');
  //infoText.innerHTML = preloadTexts[index-1];
  infoImage.style.backgroundImage = 'url('+imageURLs[index-1]+')'; 
  for(var i=1;i<=3;i++)
    document.getElementById('navigation-links-'+i).className = (index==i?'navigation-links-selected':'navigation-links');
 //CMPS_fade(infoText);
 //CMPS_fade(infoImage);	
}
function changeIndexTextAndImageAuto()
{
 currentGlobalIndex++;
 if(currentGlobalIndex>3)
  currentGlobalIndex = 1;
 changeIndexTextAndImage(currentGlobalIndex);
 setTimeout(changeIndexTextAndImageAuto,5000);
}


CMPS_fade = function(elm)
{
    function alpha_o() 
	{
	    alpha-=40;
		if(alpha<0)
		 alpha = 0;
		if(typeof elm.style.opacity == "string")
			elm.style.opacity = ''+((alpha)/100.0);
		else
		   elm.style.filter = 'alpha(opacity=' + alpha + ')';
		if (alpha > 0) 
		{
		  setTimeout(alpha_o, 50);
		}
		else
		 elm.style.display = 'none';
	  };
	alpha_o();
	var alpha = 0;
	var maxOpacity = 100;
	if(typeof elm.style.opacity == "string")
			elm.style.opacity = '0';
		else
		   elm.style.filter = 'alpha(opacity=0)';
	elm.style.display = 'block';
	 
	function alpha_f() 
	{
	    alpha+=20;
		if(alpha>maxOpacity)
		 alpha = maxOpacity;
		if(typeof elm.style.opacity == "string")
			elm.style.opacity = ''+((alpha)/100.0);
		else
		   elm.style.filter = 'alpha(opacity=' + alpha + ')';
		   
		if (alpha < maxOpacity) 
		{
		  setTimeout(alpha_f, 50);
		}
	  };
	alpha_f(); 
	  
	
}

function submitProposal(form,url,sessionParam)
{
 var req = url+'/ajaxapi.php?proposal_process=1&'+sessionParam+Campus_formToURL(form);
 dhtmlCampusLoadScript(req);
}


function proposalCallback(status,message,errorControl)
{
   if(status)
   {
            $("login_box").style.display ='none'; 
			var html = '<div style="height:120px;"></div><BR>\
			            <table width="510" height="115" align="center" bgColor="#E4FBEA"><tr><td width="100"><img src="/images/sign_smile_big.gif"></td>\
			            <td>\
						 <b style="font-size:14px">Success! One of our customer representatives will contact you within 24 hours</b><BR><BR>\
						 <BR>\
						 <BR>\
						 <a href="/" >Home page &gt;</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\
						 <a href="text_links_marketplace.htm">Marketplace&gt;</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\
						 <a href="about_text_links.htm">Learn About Text Links &gt;</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\
						</td>\
						</tr>\
						</table>';
			showCustomModalDialog(600,400,html,true);
			
   }
   else
   {
    $('proposal-error').innerHTML = message;
	CMPS_blink($('proposal-error'));
   }
}



var accWindCampusOnLoad =  window.onload;
window.onload = function()
{
   setTimeout(changeIndexTextAndImageAuto,3000);
  if(accWindCampusOnLoad)
    accWindCampusOnLoad();
 
}

 

