var couponwidthdefault='358';
var couponheightdefault='480';
var couponiddefault='53';

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');
}

//
// -------------------- 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 -------------------- //
//