<!--



/*

  *    Artex Studios R.A.P.I.D Library;

  *    File        : atx_image_fx.js;

  *    Function    : images effects and controller; 

  *    Author      : James Gober (Artex Studios);

  *    Copyright   : © 2007 The Artex Studios Company LLC. 

  *                  All rights reserved;

  *    Support     : support.artexstudios.com;

*/



// - > Image preLoader



var preloaded = new Array();

function preload_images() {

    for (var i = 0; i < arguments.length; i++){

        preloaded[i] = new Image();

        preloaded[i].src = arguments[i];

    };

};



preload_images(

    '../images/damon_hover.png',

    '../images/tony_hover.png',

    '../images/deray_hover.png',

    '../images/kevin_hover.png',

    '../images/mike_hover.png',

    '../images/alex_hover.png',

    '../images/earthquake_hover.png',

	'../images/sponsorship_on.png',

	'../images/thescoop_on.png',

	'./images/scoop.png',

    '../images/scoop.png',

	'./images/chocolate.png',

    '../images/chocolate.png',

	'./images/fire.png',

    '../images/fire.png',

	'./images/laughter.png',

    '../images/laughter.png',

	'../images/home_intro.png',

	'./images/home_intro.png',

	'../images/mbanner_bottom.png',

	'./images/mbanner_bottom.png',

	'../images/mbanner_top.png',

	'./images/mbanner_middle.png',

	'./images/claudia-1.jpg',

	'./images/claudia-2.jpg',

	'./images/claudia-3.jpg',

	'./images/claudia-4.jpg',

	'.images/ocean.jpg',

	'../images/sponsorship_on.png',

	'../images/thescoop_on.png',

	'./images/scoop.png',

    '../images/scoop.png',

	'./images/chocolate.png',

    '../images/chocolate.png',

	'./images/fire.png',

    '../images/fire.png',

	'./images/laughter.png',

    '../images/laughter.png',

	'../images/home_intro.png',

	'./images/home_intro.png',

	'../images/mbanner_bottom.png',

	'./images/mbanner_bottom.png',

	'../images/mbanner_top.png',

	'./images/mbanner_middle.png'	

);





// - > Image mouseover rollover effects



function imageOver(imgSrc, imgName)

{

  if (imgSrc == null) {

	  return false;

  }

  if (imgName == null) {

	  return false;

  }



  over = new Array()

  over[0] = new Image()

  over[0].src = imgSrc



  document.getElementById(imgName).src = over[0].src;

  return true;

}



function imageOut(imgSrc, imgName)

{

  if (imgSrc == null) {

	  return false;

  }

  if (imgName == null) {

	  return false;

  }



  out = new Array()  

  out[0] = new Image()

  out[0].src = imgSrc



  document.getElementById(imgName).src = out[0].src;

  return true;

}



// - > Change Image BG



function change_image (image_name, new_image) {   // change image;

         if (image_name == null) {

             return false;

         }

         if (new_image == null) {

             return false;

         }



         document.getElementById(image_name).src = new_image;

         return true;

}



function change_bg_image (image_name, new_image, image_url, cont) {   // change background image;



         var content=new Array()

		 content[0] = '<table style="width: 418px; height: 111px;" cellspacing="0px" cellpadding="0px" border="0"><tr><td style="width: 418px; height: 20px;"><b style="color: #d21500; font-size: 16pt;">Joke of the Week:</b></td></tr><tr><td style="width: 418px; height: 10px;"></td></tr><tr><td style="width: 418px; height: 12px;"><b style="font-size: 10pt;">What\'s the difference between a prostitute and a drug dealer?</b></td></tr><tr><td style="width: 418px; height: 10px;"></td></tr><tr><td style="width: 418px; height: 15px;"><b style="font-size: 10pt; color: #d21500;">A prostitute can sell her CRACK more than once!!!!</b></td></tr><tr><td style="width: 418px; height: 35px;"></td></tr></table>';

 		 content[1] = '<table style="width: 418px; height: 111px;" cellspacing="0px" cellpadding="0px" border="0"><tr><td style="width: 418px; height: 20px;"><b style="color: #d21500; font-size: 16pt;">Featuring Sundaes Best</b></td></tr><tr><td style="width: 418px; height: 10px;"></td></tr><tr><td style="width: 418px; height: 12px;"><b style="font-size: 10pt;"></b></td></tr><tr><td style="width: 418px; height: 10px;"></td></tr><tr><td style="width: 418px; height: 15px;"><b style="font-size: 10pt; color: #d21500;"></b></td></tr><tr><td style="width: 418px; height: 35px;"></td></tr></table>';

		 content[2] = '<table style="width: 418px; height: 111px;" cellspacing="0px" cellpadding="0px" border="0"><tr><td style="width: 418px; height: 20px;"><b style="color: #d21500; font-size: 16pt;">CS Events</b></td></tr><tr><td style="width: 418px; height: 10px;"></td></tr><tr><td style="width: 418px; height: 12px;"><b style="font-size: 10pt;"></b></td></tr><tr><td style="width: 418px; height: 10px;"></td></tr><tr><td style="width: 418px; height: 15px;"><b style="font-size: 10pt; color: #d21500;"></b></td></tr><tr><td style="width: 418px; height: 35px;"></td></tr></table>';

		 content[3] = '<table style="width: 418px; height: 111px;" cellspacing="0px" cellpadding="0px" border="0"><tr><td style="width: 418px; height: 20px;"><a href="/firstimpressions/index.html" style="text-decoration:none;"><b style="color: #d21500; font-size: 16pt; text-decoration: none;"><font style="text-decoration: none;">First Impressions</b></font></a></td></tr><tr><td style="width: 418px; height: 10px;"></td></tr><tr><td style="width: 418px; height: 12px;"><b style="font-size: 10pt;"></b></td></tr><tr><td style="width: 418px; height: 10px;"></td></tr><tr><td style="width: 418px; height: 15px;"><b style="font-size: 10pt; color: #d21500;"></b></td></tr><tr><td style="width: 418px; height: 35px;"></td></tr></table>';



         function showCont(cont) {

			 var show

			 switch (cont) {

				 case 'cont_1' : show = content[0];

				 break;

				 case 'cont_2' : show = content[1];

				 break;

				 case 'cont_3' : show = content[2];

				 break;

				 case 'cont_4' : show = content[3];

			 }

			 return show;

		 }

		 

         var display = showCont(cont)

		 

		 if (image_name == null) {

             return false;

         }

         if (new_image == null) {

             return false;

         }

		 if (new_image == 'images/sundaes_best.png') {

			 var change_img = "<a href='" + image_url + "'><img src='" + new_image + "' name='img1' border='0' /></a>";

		 }

         //var img_func = document.getElementById(image_name).innerHTML;

		 var change_img = "<a href='" + image_url + "'><img src='" + new_image + "' border='0' /></a>";

		 document.getElementById(image_name).innerHTML = change_img;

		 document.getElementById('joke').innerHTML = display;



		 return true;

}



// - > New Window Popup



var newwindow = '';



function popUp(url,height) {

	if (!newwindow.closed && newwindow.location)

	{

		newwindow.location.href = url;

	}

	else

	{

		newwindow=window.open(url,'name','width=500,height=' + height + ',scrollbars=1');

		if (!newwindow.opener) newwindow.opener = self;

	}

	if (window.focus) {newwindow.focus()}

	return false;

}



function Open(url) {

	if (!newwindow.closed && newwindow.location)

	{

		newwindow.location.href = url;

	}

	else

	{

		newwindow=window.open(url,'name','height=673,width=500,scrollbars=1');

		if (!newwindow.opener) newwindow.opener = self;

	}

	if (window.focus) {newwindow.focus()}

	return false;

}





/* Banner Rotator */



var maxnumber = 4;

var randomnumber=Math.floor(Math.random()*maxnumber);

 

var img_swap=new Array()

img_swap[0]="claudia-1.jpg";

img_swap[1]="claudia-2.jpg";

img_swap[2]="claudia-3.jpg";

img_swap[3]="claudia-4.jpg";

 

function generate_next_image() {

      randomnumber++;

      if (randomnumber >= maxnumber) {

          randomnumber = 0;

      }

      return randomnumber;

}

 

function swap_random_banner() {

      change_bg_image('1','./images/'+img_swap[randomnumber],'#','cont_2')

      generate_next_image();

      return true;

}



// -->
