var couponwidthdefault='358';
var couponheightdefault='480';
var couponiddefault='1';

function validateForm(theForm)
	{
		// Customize these calls for your form
		// Start ------->
		if (!validFirstName(theForm.FirstName))
			return false;
		if (!validLastName(theForm.LastName))
			return false;
		if (!validRequired(theForm.Email,"email"))
			return false;
		if (!validEmail(theForm.Email,"Email",true))
			return false;
		if (!validRequired(theForm.vEmailAddress,"email"))
			return false;
		if (!validEmail(theForm.vEmailAddress,"Email",true))
			return false;
		// <--------- End
		//validateCustomForm(theForm);
		return true;
}

function validateFormChange(theForm)
	{
		if (!validRequired(theForm.Emailnew,"email"))
			return false;
		if (!validEmail(theForm.Emailnew,"Email",true))
			return false;
		//validateCustomForm(theForm);
		return true;
	}
	
function validateFormUnsubscribe(theForm)
	{
		if (!validRequired(theForm.vEmailAddress,"email"))
			return false;
		if (!validEmail(theForm.vEmailAddress,"Email",true))
			return false;
		//validateCustomForm(theForm);
		return true;
	}


function OpenCouponSpecial()
{
	var cgi = new Object();
      cgi.http_host = location.host;
      cgi.http_user_agent = navigator.userAgent;
      cgi.http_cookie = document.cookie;
      cgi.https = (location.protocol == 'https:\/\/') ? 'on' : 'off';
      cgi.path_info = (location.pathname.indexOf('?') != -1) ?
location.pathname.substring(0, location.pathname.indexOf('?')) :
location.pathname;
      cgi.query_string = (location.search) ?
((location.search.indexOf('#') != -1) ? location.search.substring(1,
location.search.indexOf('#')) : location.search.substring(1)) : '';
      cgi.script_name = cgi.path_info;
      cgi.http_referer = document.referrer;
	var LinkLocation =
"http://www.etnasystems.com/coupon/?COUPONID=136&OriginalReferer=" +
getCookie("JSREF") + "&OriginalPage=" + cgi['script_name'];
//alert("link=" + LinkLocation);
	openWindow(LinkLocation, 'Coupon', '358', '500');
}


function OpenCouponSpecialMiami()
{
	var cgi = new Object();
      cgi.http_host = location.host;
      cgi.http_user_agent = navigator.userAgent;
      cgi.http_cookie = document.cookie;
      cgi.https = (location.protocol == 'https:\/\/') ? 'on' : 'off';
      cgi.path_info = (location.pathname.indexOf('?') != -1) ?
location.pathname.substring(0, location.pathname.indexOf('?')) :
location.pathname;
      cgi.query_string = (location.search) ?
((location.search.indexOf('#') != -1) ? location.search.substring(1,
location.search.indexOf('#')) : location.search.substring(1)) : '';
      cgi.script_name = cgi.path_info;
      cgi.http_referer = document.referrer;
	var LinkLocation =
"http://www.etnasystems.com/coupon/?COUPONID=134&OriginalReferer=" +
getCookie("JSREF") + "&OriginalPage=" + cgi['script_name'];
//alert("link=" + LinkLocation);
	openWindow(LinkLocation, 'Coupon', '358', '500');
}

function OpenCouponConsultMiami()
{
	var cgi = new Object();
      cgi.http_host = location.host;
      cgi.http_user_agent = navigator.userAgent;
      cgi.http_cookie = document.cookie;
      cgi.https = (location.protocol == 'https:\/\/') ? 'on' : 'off';
      cgi.path_info = (location.pathname.indexOf('?') != -1) ?
location.pathname.substring(0, location.pathname.indexOf('?')) :
location.pathname;
      cgi.query_string = (location.search) ?
((location.search.indexOf('#') != -1) ? location.search.substring(1,
location.search.indexOf('#')) : location.search.substring(1)) : '';
      cgi.script_name = cgi.path_info;
      cgi.http_referer = document.referrer;
	var LinkLocation =
"http://www.etnasystems.com/coupon/?COUPONID=80&OriginalReferer=" +
getCookie("JSREF") + "&OriginalPage=" + cgi['script_name'];
//alert("link=" + LinkLocation);
	openWindow(LinkLocation, 'Coupon', '358', '450');
}




function OpenCouponSummer()
{
	var cgi = new Object();
      cgi.http_host = location.host;
      cgi.http_user_agent = navigator.userAgent;
      cgi.http_cookie = document.cookie;
      cgi.https = (location.protocol == 'https:\/\/') ? 'on' : 'off';
      cgi.path_info = (location.pathname.indexOf('?') != -1) ?
location.pathname.substring(0, location.pathname.indexOf('?')) :
location.pathname;
      cgi.query_string = (location.search) ?
((location.search.indexOf('#') != -1) ? location.search.substring(1,
location.search.indexOf('#')) : location.search.substring(1)) : '';
      cgi.script_name = cgi.path_info;
      cgi.http_referer = document.referrer;
	var LinkLocation =
"http://www.etnasystems.com/coupon/?COUPONID=32&OriginalReferer=" +
getCookie("JSREF") + "&OriginalPage=" + cgi['script_name'];
//alert("link=" + LinkLocation);
	openWindow(LinkLocation, 'Coupon', '358', '550');
}



function OpenCouponSpanish()
{
	var cgi = new Object();
      cgi.http_host = location.host;
      cgi.http_user_agent = navigator.userAgent;
      cgi.http_cookie = document.cookie;
      cgi.https = (location.protocol == 'https:\/\/') ? 'on' : 'off';
      cgi.path_info = (location.pathname.indexOf('?') != -1) ?
location.pathname.substring(0, location.pathname.indexOf('?')) :
location.pathname;
      cgi.query_string = (location.search) ?
((location.search.indexOf('#') != -1) ? location.search.substring(1,
location.search.indexOf('#')) : location.search.substring(1)) : '';
      cgi.script_name = cgi.path_info;
      cgi.http_referer = document.referrer;
	var LinkLocation =
"http://www.etnasystems.com/coupon/?COUPONID=57&OriginalReferer=" +
getCookie("JSREF") + "&OriginalPage=" + cgi['script_name'];
//alert("link=" + LinkLocation);
	openWindow(LinkLocation, 'Coupon', '358', '450');
}

function OpenCouponeBook()
{
	var cgi = new Object();
      cgi.http_host = location.host;
      cgi.http_user_agent = navigator.userAgent;
      cgi.http_cookie = document.cookie;
      cgi.https = (location.protocol == 'https:\/\/') ? 'on' : 'off';
      cgi.path_info = (location.pathname.indexOf('?') != -1) ?
location.pathname.substring(0, location.pathname.indexOf('?')) :
location.pathname;
      cgi.query_string = (location.search) ?
((location.search.indexOf('#') != -1) ? location.search.substring(1,
location.search.indexOf('#')) : location.search.substring(1)) : '';
      cgi.script_name = cgi.path_info;
      cgi.http_referer = document.referrer;
	var LinkLocation =
"http://www.etnasystems.com/coupon/?COUPONID=130&OriginalReferer=" +
getCookie("JSREF") + "&OriginalPage=" + cgi['script_name'];
//alert("link=" + LinkLocation);
	openWindow(LinkLocation, 'Coupon', '358', '500');
}

function OpenCoupon189()
{
	var cgi = new Object();
      cgi.http_host = location.host;
      cgi.http_user_agent = navigator.userAgent;
      cgi.http_cookie = document.cookie;
      cgi.https = (location.protocol == 'https:\/\/') ? 'on' : 'off';
      cgi.path_info = (location.pathname.indexOf('?') != -1) ?
location.pathname.substring(0, location.pathname.indexOf('?')) :
location.pathname;
      cgi.query_string = (location.search) ?
((location.search.indexOf('#') != -1) ? location.search.substring(1,
location.search.indexOf('#')) : location.search.substring(1)) : '';
      cgi.script_name = cgi.path_info;
      cgi.http_referer = document.referrer;
	var LinkLocation =
"http://www.etnasystems.com/coupon/?COUPONID=189&OriginalReferer=" +
getCookie("JSREF") + "&OriginalPage=" + cgi['script_name'];
//alert("link=" + LinkLocation);
	openWindow(LinkLocation, 'Coupon', '358', '500');
}

function OpenCoupon190()
{
	var cgi = new Object();
      cgi.http_host = location.host;
      cgi.http_user_agent = navigator.userAgent;
      cgi.http_cookie = document.cookie;
      cgi.https = (location.protocol == 'https:\/\/') ? 'on' : 'off';
      cgi.path_info = (location.pathname.indexOf('?') != -1) ?
location.pathname.substring(0, location.pathname.indexOf('?')) :
location.pathname;
      cgi.query_string = (location.search) ?
((location.search.indexOf('#') != -1) ? location.search.substring(1,
location.search.indexOf('#')) : location.search.substring(1)) : '';
      cgi.script_name = cgi.path_info;
      cgi.http_referer = document.referrer;
	var LinkLocation =
"http://www.etnasystems.com/coupon/?COUPONID=190&OriginalReferer=" +
getCookie("JSREF") + "&OriginalPage=" + cgi['script_name'];
//alert("link=" + LinkLocation);
	openWindow(LinkLocation, 'Coupon', '358', '500');
}

function OpenCoupon161()
{
	var cgi = new Object();
      cgi.http_host = location.host;
      cgi.http_user_agent = navigator.userAgent;
      cgi.http_cookie = document.cookie;
      cgi.https = (location.protocol == 'https:\/\/') ? 'on' : 'off';
      cgi.path_info = (location.pathname.indexOf('?') != -1) ?
location.pathname.substring(0, location.pathname.indexOf('?')) :
location.pathname;
      cgi.query_string = (location.search) ?
((location.search.indexOf('#') != -1) ? location.search.substring(1,
location.search.indexOf('#')) : location.search.substring(1)) : '';
      cgi.script_name = cgi.path_info;
      cgi.http_referer = document.referrer;
	var LinkLocation =
"http://www.etnasystems.com/coupon/?COUPONID=161&OriginalReferer=" +
getCookie("JSREF") + "&OriginalPage=" + cgi['script_name'];
//alert("link=" + LinkLocation);
	openWindow(LinkLocation, 'Coupon', '358', '500');
}

function OpenCoupon162()
{
	var cgi = new Object();
      cgi.http_host = location.host;
      cgi.http_user_agent = navigator.userAgent;
      cgi.http_cookie = document.cookie;
      cgi.https = (location.protocol == 'https:\/\/') ? 'on' : 'off';
      cgi.path_info = (location.pathname.indexOf('?') != -1) ?
location.pathname.substring(0, location.pathname.indexOf('?')) :
location.pathname;
      cgi.query_string = (location.search) ?
((location.search.indexOf('#') != -1) ? location.search.substring(1,
location.search.indexOf('#')) : location.search.substring(1)) : '';
      cgi.script_name = cgi.path_info;
      cgi.http_referer = document.referrer;
	var LinkLocation =
"http://www.etnasystems.com/coupon/?COUPONID=162&OriginalReferer=" +
getCookie("JSREF") + "&OriginalPage=" + cgi['script_name'];
//alert("link=" + LinkLocation);
	openWindow(LinkLocation, 'Coupon', '358', '500');
}

function OpenCoupon163()
{
	var cgi = new Object();
      cgi.http_host = location.host;
      cgi.http_user_agent = navigator.userAgent;
      cgi.http_cookie = document.cookie;
      cgi.https = (location.protocol == 'https:\/\/') ? 'on' : 'off';
      cgi.path_info = (location.pathname.indexOf('?') != -1) ?
location.pathname.substring(0, location.pathname.indexOf('?')) :
location.pathname;
      cgi.query_string = (location.search) ?
((location.search.indexOf('#') != -1) ? location.search.substring(1,
location.search.indexOf('#')) : location.search.substring(1)) : '';
      cgi.script_name = cgi.path_info;
      cgi.http_referer = document.referrer;
	var LinkLocation =
"http://www.etnasystems.com/coupon/?COUPONID=163&OriginalReferer=" +
getCookie("JSREF") + "&OriginalPage=" + cgi['script_name'];
//alert("link=" + LinkLocation);
	openWindow(LinkLocation, 'Coupon', '358', '500');
}

function OpenCoupon164()
{
	var cgi = new Object();
      cgi.http_host = location.host;
      cgi.http_user_agent = navigator.userAgent;
      cgi.http_cookie = document.cookie;
      cgi.https = (location.protocol == 'https:\/\/') ? 'on' : 'off';
      cgi.path_info = (location.pathname.indexOf('?') != -1) ?
location.pathname.substring(0, location.pathname.indexOf('?')) :
location.pathname;
      cgi.query_string = (location.search) ?
((location.search.indexOf('#') != -1) ? location.search.substring(1,
location.search.indexOf('#')) : location.search.substring(1)) : '';
      cgi.script_name = cgi.path_info;
      cgi.http_referer = document.referrer;
	var LinkLocation =
"http://www.etnasystems.com/coupon/?COUPONID=164&OriginalReferer=" +
getCookie("JSREF") + "&OriginalPage=" + cgi['script_name'];
//alert("link=" + LinkLocation);
	openWindow(LinkLocation, 'Coupon', '358', '500');
}

function OpenCoupon165()
{
	var cgi = new Object();
      cgi.http_host = location.host;
      cgi.http_user_agent = navigator.userAgent;
      cgi.http_cookie = document.cookie;
      cgi.https = (location.protocol == 'https:\/\/') ? 'on' : 'off';
      cgi.path_info = (location.pathname.indexOf('?') != -1) ?
location.pathname.substring(0, location.pathname.indexOf('?')) :
location.pathname;
      cgi.query_string = (location.search) ?
((location.search.indexOf('#') != -1) ? location.search.substring(1,
location.search.indexOf('#')) : location.search.substring(1)) : '';
      cgi.script_name = cgi.path_info;
      cgi.http_referer = document.referrer;
	var LinkLocation =
"http://www.etnasystems.com/coupon/?COUPONID=165&OriginalReferer=" +
getCookie("JSREF") + "&OriginalPage=" + cgi['script_name'];
//alert("link=" + LinkLocation);
	openWindow(LinkLocation, 'Coupon', '358', '500');
}

function OpenCoupon166()
{
	var cgi = new Object();
      cgi.http_host = location.host;
      cgi.http_user_agent = navigator.userAgent;
      cgi.http_cookie = document.cookie;
      cgi.https = (location.protocol == 'https:\/\/') ? 'on' : 'off';
      cgi.path_info = (location.pathname.indexOf('?') != -1) ?
location.pathname.substring(0, location.pathname.indexOf('?')) :
location.pathname;
      cgi.query_string = (location.search) ?
((location.search.indexOf('#') != -1) ? location.search.substring(1,
location.search.indexOf('#')) : location.search.substring(1)) : '';
      cgi.script_name = cgi.path_info;
      cgi.http_referer = document.referrer;
	var LinkLocation =
"http://www.etnasystems.com/coupon/?COUPONID=166&OriginalReferer=" +
getCookie("JSREF") + "&OriginalPage=" + cgi['script_name'];
//alert("link=" + LinkLocation);
	openWindow(LinkLocation, 'Coupon', '358', '500');
}

function openWindow(url,name, width, height) {
var popupWin;
	// if a window already exists, destroy it.
	if (popupWin && !popupWin.closed) {
               popupWin.close();
	}
	var attr = 'scrollbars=no,status=yes,width=' + width + ',height= ' + height  +',left=1,top=1,resizable=1';
   	popupWin = window.open(url, name, attr);
	popupWin.focus();
}

function OpenCouponWin(office,couponid,couponwidth,couponheight){
	if (couponwidth == undefined ){
		var couponwidth=couponwidthdefault;
	}
	if ( couponheight == undefined ){
		var couponheight=couponheightdefault;
	}
	if ( couponid == undefined ){
		var couponid=couponiddefault;
	}
	
	var cgi = new Object();
	cgi.http_host = location.host;
	cgi.http_user_agent = navigator.userAgent;
	cgi.http_cookie = document.cookie;
	cgi.https = (location.protocol == 'https:\/\/') ? 'on' : 'off';
	cgi.path_info = (location.pathname.indexOf('?') != -1) ? location.pathname.substring(0, location.pathname.indexOf('?')) : location.pathname;
	cgi.query_string = (location.search) ? ((location.search.indexOf('#') != -1) ? location.search.substring(1, location.search.indexOf('#')) : location.search.substring(1)) : '';
	cgi.script_name = cgi.path_info;
	cgi.http_referer = document.referrer;
	var LinkLocation = "/coupon/?COUPONID=" + couponid + "&location=" + office;
	//alert("link=" + LinkLocation);
	//openWindow(LinkLocation, 'Coupon', '358', '480');
	openWindow(LinkLocation, 'Coupon', couponwidth, couponheight);
}

// -------------------------------------------------------------------------- //
// referrerCookie.js
//
// Sets a cookie on the client recording the referrer
//
// -------------------------------------------------------------------------- //


/////////////////////////////////////////////////////////////
//
// setCookie()
//
// DESC:	Creates/overwrites a cookie
//
// USAGE:	setCookie(name, value, expires, path, domain, secure);
//
// INPUT:	name		- Name of the cookie
//			value		- Value of the cookie
//			[expires]	- Expiration date of the cookie (defaults to end of the current session)
//			[path]		- Path to which the cookie applies (defaults to entire domain)
//			[domain]	- Domain to which the cookies applies (defaults to current domain)
//			[secure]	- Boolean specifying if a secure connection is required (defaults to false)
//
// OUTPUT:	None
//
// CHANGED:	document.cookie
//
/////////////////////////////////////////////////////////////

function setCookie(name, value, expires, path, domain, secure)
{
	var curCookie = name + "=" + escape(value) +
		((expires) ? "; expires=" + expires.toGMTString() : "") +
		"; path=/" +
		((domain) ? "; domain=" + domain : "") +
		((secure) ? "; secure" : "");
	document.cookie = curCookie;
}


/////////////////////////////////////////////////////////////
//
// getCookie()
//
// DESC:	Returns the value of the specified cookie or NULL
//			if the specified cookie is undefined.
//
// USAGE:	value = getCookie(name);
//
// INPUT:	name		- Name of the cookie to be retrieved
//
// OUTPUT:	Value of the specified cookie or NULL
//
// CHANGED:	None
//
/////////////////////////////////////////////////////////////

function getCookie(name)
{
	var dc = document.cookie;
	var prefix = name + "=";
	var begin = dc.indexOf("; " + prefix);
	if (begin == -1)
	{
		begin = dc.indexOf(prefix);
		if (begin != 0) return null;
	} else {
		begin += 2;
	}
	var end = document.cookie.indexOf(";", begin);
	if (end == -1)
	{
		end = dc.length;
	}
	return unescape(dc.substring(begin + prefix.length, end));
}


/////////////////////////////////////////////////////////////
//
// deleteCookie()
//
// DESC:	Deletes the specified cookie
//
// USAGE:	deleteCookie(name, path, domain);
//
// INPUT:	name		- Name of the cookie to be deleted
//			[path]		- Path of the cookie to be deleted
//			[domain]	- Domain of the cookie to be deleted
//
// OUTPUT:	None
//
// CHANGED:	document.cookie
//
/////////////////////////////////////////////////////////////

function deleteCookie(name, path, domain)
{
	if ( getCookie(name) )
	{
		document.cookie = name + "=" + 
		((path) ? "; path=" + path : "") +
		((domain) ? "; domain=" + domain : "") +
		"; expires=Thu, 01-Jan-70 00:00:01 GMT";
	}
}


//
// Set referrer cookie if it doesn't already exist
//
if ( ! getCookie("JSREF") )
{
	// Set expiration date of 3 days
	var currDate = new Date();
	currDate.setTime(currDate.getTime() + 3 * 24 * 60 * 60 * 1000);

	// Set cookie
	setCookie("JSREF", document.referrer, currDate);
}

//------------------- Form Validation -------------------//
	
	function MM_findObj(n, d) { //v4.01
	  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
	    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	  if(!x && d.getElementById) x=d.getElementById(n); return x;
	}

	function YY_checkform() { //v4.71
	//copyright (c)1998,2002 Yaromat.com
	  var a=arguments,oo=true,v='',s='',err=false,r,o,at,o1,t,i,j,ma,rx,cd,cm,cy,dte;
	  for (i=1; i<a.length;i=i+4){
	    if (a[i+1].charAt(0)=='#'){r=true; a[i+1]=a[i+1].substring(1);}else{r=false}
	    o=MM_findObj(a[i].replace(/\[\d+\]/ig,""));
	    o1=MM_findObj(a[i+1].replace(/\[\d+\]/ig,""));
	    v=o.value;t=a[i+2];dv = o.defaultValue;
	    if (o.type=='text'||o.type=='password'||o.type=='hidden'){
	      if ((r&&v.length==0)||v==dv){err=true}
	      if (v.length>0)
	      if (t==1){ //fromto
	        ma=a[i+1].split('_');if(isNaN(v)||v<ma[0]/1||v > ma[1]/1){err=true}
	      } else if (t==2){
	        rx=new RegExp("^[\\w\.=-]+@[\\w\\.-]+\\.[a-zA-Z]{2,4}$");if(!rx.test(v))err=true;
	      } else if (t==3){ // date
	        ma=a[i+1].split("#");at=v.match(ma[0]);
	        if(at){
	          cd=(at[ma[1]])?at[ma[1]]:1;cm=at[ma[2]]-1;cy=at[ma[3]];
	          dte=new Date(cy,cm,cd);
	          if(dte.getFullYear()!=cy||dte.getDate()!=cd||dte.getMonth()!=cm){err=true};
	        }else{err=true}
	      } else if (t==4){ // time
	        ma=a[i+1].split("#");at=v.match(ma[0]);if(!at){err=true}
	      } else if (t==5){ // check this 2
	            if(o1.length)o1=o1[a[i+1].replace(/(.*\[)|(\].*)/ig,"")];
	            if(!o1.checked){err=true}
	      } else if (t==6){ // the same
	            if(v!=MM_findObj(a[i+1]).value){err=true}
	      }
	    } else
	    if (!o.type&&o.length>0&&o[0].type=='radio'){
	          at = a[i].match(/(.*)\[(\d+)\].*/i);
	          o2=(o.length>1)?o[at[2]]:o;
	      if (t==1&&o2&&o2.checked&&o1&&o1.value.length/1==0){err=true}
	      if (t==2){
	        oo=false;
	        for(j=0;j<o.length;j++){oo=oo||o[j].checked}
	        if(!oo){s+='* '+a[i+3]+'\n'}
	      }
	    } else if (o.type=='checkbox'){
	      if((t==1&&o.checked==false)||(t==2&&o.checked&&o1&&o1.value.length/1==0)){err=true}
	    } else if (o.type=='select-one'||o.type=='select-multiple'){
	      if(t==1&&o.selectedIndex/1==0){err=true}
	    }else if (o.type=='textarea'){
	      if(v.length<a[i+1] || v == 'Comments: *' || v == ''){err=true}
	    }
	    if (err){s+=a[i+3]+'\n'; err=false}
	  }
	  if (s!=''){alert('Please complete the following required fields:\n\n'+s)}
	  document.MM_returnValue = (s=='');
	}
	
	function removeText(formField) {
	  if (formField.defaultValue==formField.value) { formField.value = "" }
	} 
	function replaceText(formField) {
	  if (formField.value=="") { formField.value = formField.defaultValue }
	}
	function clearOptionals(formFields){
		fields = formFields.split(',')
		for(i=0;i<fields.length;i++){
			if (fields[i].charAt(0) == ' ') { 
				fields[i] = fields[i].substring(1);
			}
			removeText(document.getElementById(fields[i]));
		}
	}

//
// -------------------- TRANSPARENT IMAGE ROLLOVER CODE --------------------- //
//

function opacity(id, opacStart, opacEnd, millisec) {
	//speed for each frame
	var speed = Math.round(millisec / 100);
	var timer = 0;

	//determine the direction for the blending, if start and end are the same nothing happens
	if(opacStart > opacEnd) {
		for(i = opacStart; i >= opacEnd; i--) {
			setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
			timer++;
		}
	} else if(opacStart < opacEnd) {
		for(i = opacStart; i <= opacEnd; i++)
			{
			setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
			timer++;
		}
	}
}

//change the opacity for different browsers
function changeOpac(opacity, id) {
	var object = document.getElementById(id).style; 
	object.opacity = (opacity / 100);
	object.MozOpacity = (opacity / 100);
	object.KhtmlOpacity = (opacity / 100);
	object.filter = "alpha(opacity=" + opacity + ")";
}

function shiftOpacity(id, millisec) {
	//if an element is invisible, make it visible, else make it ivisible
	if(document.getElementById(id).style.opacity < .97) {
		//alert('ups' +document.getElementById(id).style.opacity);
		opacity(id, document.getElementById(id).style.opacity, 100, millisec);
	} else {
		//alert('down');
		opacity(id, 100, 0, millisec);
	}
}

function blendimage(divid, imageid, imagefile, millisec) {
	var speed = Math.round(millisec / 100);
	var timer = 0;
	
	//set the current image as background
	document.getElementById(divid).style.backgroundImage = "url(" + document.getElementById(imageid).src + ")";
	
	//make image transparent
	changeOpac(0, imageid);
	
	//make new image
	document.getElementById(imageid).src = imagefile;

	//fade in image
	for(i = 0; i <= 100; i++) {
		setTimeout("changeOpac(" + i + ",'" + imageid + "')",(timer * speed));
		timer++;
	}
}

function currentOpac(id, opacEnd, millisec) {
	//standard opacity is 100
	var currentOpac = 100;
	
	//if the element has an opacity set, get it
	if(document.getElementById(id).style.opacity < 100) {
		currentOpac = document.getElementById(id).style.opacity * 100;
	}

	//call for the function that changes the opacity
	opacity(id, currentOpac, opacEnd, millisec)
}

//
// ----------------- TRANSPARENT IMAGE ROLLOVER CODE -------------------- //
//
