/* JavaScript functions for the tsu site 
Version 1.0 8/8/2007   AVR
*/

// These functions are used on gallery pages to capture image data generated by the P7 JS.
// The image alt info and thumbnail url are saved as seession vars, then moved to database on checkout.

function getpix(act) {
	document.CartAdd.galfrmact.value=act;
	document.CartAdd.pixdata.value=document.getElementById("tsuimg").alt;
	ix = document.getElementsByTagName("td");
	ix1 = ix[2].getElementsByTagName("div");
	document.CartAdd.pixidx.value=ix1[0].innerHTML;
	vp = document.getElementById("p7GSvp");
    sc = document.getElementById("p7GSsc");
    im = sc.getElementsByTagName("IMG");
    for (i = 0; i < im.length; i++) {
    	if(im[i].className == "p7GSon") {
	 		document.CartAdd.pixurl.value=im[i].src;
			break;
       }
	}
	// Code to extract image count value -- expects a string like: (12 of 13): gets the 12
	ix2 = ix[0].getElementsByTagName("span");
	ct = ix2[0].innerHTML;
	document.CartAdd.pixnum.value=ct.substring(1,ct.indexOf(" "));
	document.CartAdd.submit();
	return true;
}


function subfrm(act) {
	document.CartAdd.galfrmact.value=act;
	document.CartAdd.submit();
	return true;
}

function vsubfrm(act) {
	document.CartView.viewfrmact.value=act;
	document.CartView.submit();
	return true;
}

function csubfrm(act) {
	document.CkoView.ckofrmact.value=act;
	document.CkoView.submit()
	return true;
}

function csubit() {
	document.CkoView.action="https://www.paypal.com/cgi-bin/webscr";
	document.CkoView.submit();
	return true;
}


function hidden() {
	document.body.style.overflow='hidden';
	return true;
}
