var itemforlightbox;

function lightboxrollover(site, el) {
	el.src = "images/lightbox/hover/" + site + ".png";
}

function lightboxrollout(site, el) {
	el.src = "images/lightbox/normal/" + site + ".png";
}



function changeitem(itemid) {
	for (i=0; i < itemarray.length; i++) {
		var separated = itemarray[i].split("|");
		
		//document.getElementById(separated[0]).className = "";
		if(separated[0] == itemid) { var changeme = i;
		}
	}

	var separated = itemarray[changeme].split("|");

	document.getElementById(itemid).className = "selected";

	document.getElementById("image").src = "images/gifts/" + separated[1];

	document.getElementById("name").innerHTML = separated[2];

	document.getElementById("description").innerHTML = separated[3];

	document.getElementById("iteminfo").innerHTML = (separated[2] + " - " + separated[4] + " referrals");

	document.getElementById("itemfield").value = separated[0];

	scroll(0, 0);

}

function itemrollover(id) {
	id.className = "selected";
	id.style.cursor = "pointer";
}

function itemrollout(id) {
	if(id.id != document.getElementById("itemfield").value) {
		id.className = "";
	}
}

function copy(text2copy) {
  if (window.clipboardData) {
    window.clipboardData.setData("Text",text2copy);
  } else {
    var flashcopier = 'flashcopier';
    if(!document.getElementById(flashcopier)) {
      var divholder = document.createElement('div');
      divholder.id = flashcopier;
      document.body.appendChild(divholder);
    }
    document.getElementById(flashcopier).innerHTML = '';
    var divinfo = '<embed src="_clipboard.swf" FlashVars="clipboard='+escape(text2copy)+'" width="0" height="0" type="application/x-shockwave-flash"></embed>';
    document.getElementById(flashcopier).innerHTML = divinfo;
  }
}
function copytoclipboard(texttocopy) {
	copy(texttoccopy);
}