function showcodes(hv,cv,url2) {

		{	
			var NumDiv = 1;
			if ( document.getElementById ) 
				{
					while ( document.getElementById( 'hvcode' + NumDiv) )
						{
							SetDiv = document.getElementById( 'hvcode' + NumDiv );
							if ( SetDiv && SetDiv.className != '' )
								{
document.getElementById( 'hvcode' + NumDiv ).className = "couponshow2";
document.getElementById( 'cvcode' + NumDiv ).className = "couponhidden";
								}
							NumDiv++;
						}
				}	
			}

var top=(screen.height-640)/2;
var left=(screen.width-900)/2;
window.open(url2,'getc');

}


var XMLHttpRequestObject = false;
if (window.XMLHttpRequest)
{
  XMLHttpRequestObject = new XMLHttpRequest();
}
else if (window.ActiveXObject)
{
  XMLHttpRequestObject = new ActiveXObject("Microsoft.XMLHTTP");
}
  
function TellaFirends(gID, ColorID)
{
  if(XMLHttpRequestObject)
  {
    var srcData = "data.php?gID="+gID+"&cID="+ColorID;
    var obj = document.getElementById("showDiv_"+gID);
    document.getElementById("showDiv_"+gID).style.display=(document.getElementById("showDiv_"+gID).style.display!="none")? "none" : "";
    XMLHttpRequestObject.open("GET", srcData);
    XMLHttpRequestObject.onreadystatechange = function()
    {
//      switch(XMLHttpRequestObject.readyState)
//      {
//       case 1 : 
//          obj.innerHTML = '<center><img src=\'images/loading.gif\' width=15 height=15 alt=loading....></center>';
//       case 4 :
//       if (XMLHttpRequestObject.status == 200)
//       {
//	       obj.innerHTML = XMLHttpRequestObject.responseText;
//       } else {
//	       obj.innerHTML = 'Error getting from php result....';
//       } 
//	       break;
//       }
      if (XMLHttpRequestObject.readyState == 4 &&
          XMLHttpRequestObject.status == 200)
      {
        obj.innerHTML = XMLHttpRequestObject.responseText;
      }

    }
    XMLHttpRequestObject.send(null);
  }
}

/***********************************************
* Fixed ToolTip script- c Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
		
var tipwidth='10px' //default tooltip width
var tipbgcolor='lightyellow'  //tooltip bgcolor
var disappeardelay=2000  //tooltip disappear speed onMouseout (in miliseconds)
var vertical_offset="-25px" //horizontal offset of tooltip from anchor link
var horizontal_offset="220px" //horizontal offset of tooltip from anchor link

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="fixedtipdiv" style="visibility:hidden;width:'+tipwidth+';background-color:'+tipbgcolor+'" ></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function showhide(obj, e, visible, hidden, tipwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top=-500
if (tipwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=tipwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=(whichedge=="rightedge")? parseInt(horizontal_offset)*-1 : parseInt(vertical_offset)*-1
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
}
return edgeoffset
}

function fixedtooltip(menucontents, obj, e, tipwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidetip()
dropmenuobj=document.getElementById? document.getElementById("fixedtipdiv") : fixedtipdiv
dropmenuobj.innerHTML=menucontents

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", tipwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}
}

function hidetip(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidetip(){
if (ie4||ns6)
delayhide=setTimeout("hidetip()",disappeardelay)
}

function clearhidetip(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}


		var clip = null;
					
		function init() {
			// setup single ZeroClipboard object for all our elements
			clip = new ZeroClipboard.Client();
			clip.setHandCursor( true );
			
			// assign a common mouseover function for all elements using jQuery
			$('a.getcode').mouseover( function() {
				// set the clip text to our innerHTML
				clip.setText( this.innerHTML );
				clip.this_href = this.href; 
				// reposition the movie over our element
				// or create it if this is the first time
				if (clip.div) {
					clip.receiveEvent('mouseout', null);
					clip.reposition(this);
				}
				else clip.glue(this);
				
				// gotta force these events due to the Flash movie
				// moving all around.  This insures the CSS effects
				// are properly updated.
				clip.receiveEvent('mouseover', null);
		    var link = clip.this_href
		    clip.addEventListener('complete', function(client, text) {
        stylea='top=0'+',left='+screen.width/2+',height='+screen.height/2+',width='+screen.width/2+',status=yes,toolbar=yes,menubar=yes,location=yes,scrollbars=yes,resizable=yes';win2=window.open(clip.this_href,'getc',stylea);win2.blur();window.focus();return false; 
			  //popup(link);
			/*hideddrivetip('');*/
        });				
			} );
			$('a.codepage').mouseover( function() {
				// set the clip text to our innerHTML
				clip.setText( this.innerHTML );
				clip.this_href = this.href; 
				// reposition the movie over our element
				// or create it if this is the first time
				if (clip.div) {
					clip.receiveEvent('mouseout', null);
					clip.reposition(this);
				}
				else clip.glue(this);
				
				// gotta force these events due to the Flash movie
				// moving all around.  This insures the CSS effects
				// are properly updated.
				clip.receiveEvent('mouseover', null);
		    var link = clip.this_href
		    clip.addEventListener('complete', function(client, text) {
        stylea='top=0'+',left='+screen.width/2+',height='+screen.height/2+',width='+screen.width/2+',status=yes,toolbar=yes,menubar=yes,location=yes,scrollbars=yes,resizable=yes';win2=window.open(clip.this_href,'getc',stylea);win2.blur();window.focus();return false; 
			  //popup(link);
			/*hideddrivetip('');*/
        });				
			} );			
		}
		
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 MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}

