
// ***** Btn Rollover *****
function roll(imgName,imgState) {
   try{
      document.images[imgName].src = imgState
   }catch( e ){}
}
// ***********************************************************************

// ***** Preload Rollover Images ***************************************
if (document.images) {

    var imgArray = new Array();
	preloadImage( imgArray, "/images/spacer.gif" );
	preloadImage( imgArray, "/images/main_background.jpg" );
	preloadImage( imgArray, "/images/nav/the_game_ON.gif" );
	preloadImage( imgArray, "/images/nav/community_ON.gif" );
	preloadImage( imgArray, "/images/nav/media_ON.gif" );
	preloadImage( imgArray, "/images/nav/register_ON.gif" );
	preloadImage( imgArray, "/images/nav/news_ON.gif" );
	preloadImage( imgArray, "/images/nav/home_ON.gif" );
	
	preloadImage( imgArray, "/images/nav/sub_videos_ON.gif" );
	preloadImage( imgArray, "/images/nav/sub_screenshots_ON.gif" );
	preloadImage( imgArray, "/images/nav/sub_concept_art_ON.gif" );
	preloadImage( imgArray, "/images/nav/sub_other_downloads_ON.gif" );
	preloadImage( imgArray, "/images/nav/sub_description_ON.gif" );
	preloadImage( imgArray, "/images/nav/sub_faqs_ON.gif" );
	preloadImage( imgArray, "/images/nav/sub_pricing_ON.gif" );
	preloadImage( imgArray, "/images/nav/sub_back_story_ON.gif" );
	preloadImage( imgArray, "/images/nav/sub_classes_ON.gif" );
	
	preloadImage( imgArray, "/images/tab/assault_ON.gif" );
	preloadImage( imgArray, "/images/tab/recon_ON.gif" );
	preloadImage( imgArray, "/images/tab/medic_ON.gif" );
	preloadImage( imgArray, "/images/tab/robotic_ON.gif" );
	preloadImage( imgArray, "/images/tab/screenshots_ON.gif" );
	preloadImage( imgArray, "/images/tab/concept_art_ON.gif" );
	preloadImage( imgArray, "/images/tab/video_ON.gif" );
	preloadImage( imgArray, "/images/tab/devices_ON.gif" );
	preloadImage( imgArray, "/images/tab/post_commonwealth_OVER.png" );
	preloadImage( imgArray, "/images/tab/pre_commonwealth_OVER.png" );
	
	preloadImage( imgArray, "/images/btn/register_ON.gif" );
}

function preloadImage( imageArray, imageSrc ) {
    var img = new Image();
    img.src = imageSrc;
    imageArray[ imageSrc ] = img;
}

// *********************************************************************

// *********************************************************************
// Function to create pop-up windows at a custom size.
// w = width
// h = height
// d = directories
// l = location
// m = menubar
// r = resizeable
// sc = scrollbars
// st = status
// t = toolbar
// EXAMPLE CALL: <a href="javascript:popUp('[URL]','[WINDOW NAME]',400,300,1,1,0,0,0,0,0);">LINK</a>
// *********************************************************************
function popUp(URL,name,w,h,d,l,m,r,sc,st,t) {
	var featureStr = "";
	featureStr = "width=" + w + ",height=" + h + ",directories=" + d + ",location=" + l + ",menubar=" + m + ",resizable=" + r + ",scrollbars=" + sc + ",status=" + st + ",toolbar=" + t;
	window.open(URL,name,featureStr);
}

