
	// GLOBAL GALLERY SCRIPTS

//Frame Title - PayPal enable - Zoom - Databox expand - Options -

  var ie4 = document.all
  var ns6 = document.getElementById&&!document.all
  var ns  = navigator.userAgent.indexOf('Netscape') != -1 && navigator.userAgent.indexOf('Gecko') != -1
  var opr = navigator.userAgent.indexOf('Opera/') != -1 | navigator.userAgent.indexOf('Opera ') != -1;   // Opera identifying Opera or Other
  var moz = navigator.userAgent.indexOf('Gecko') != -1

//FRAME TITLE
if (top != self) top.document.title = document.title;

//ENABLE PAYPAL
function ppOn(){
var ppshow1 = ie4 ? document.all.ppshow1 : document.getElementById('ppshow1');
var ppshow2 = ie4 ? document.all.ppshow2 : document.getElementById('ppshow2');
var ppshow3 = ie4 ? document.all.ppshow3 : document.getElementById('ppshow3')
var ppshow4 = ie4 ? document.all.ppshow4 : document.getElementById('ppshow4')
    if (paypal_on == 0){
	ppshow1.innerHTML = ''
	      if (ppshow2){ppshow2.innerHTML = ''}
	      if (ppshow3){
		ppshow3.innerHTML = '<img src="px.gif" width="1" height="21" border="0"><br>'
		ppshow4.innerHTML = ''}}
}

//DATABOX ON
var text
var subStore

 function databox_on(){
  var databx  = ie4 ? document.all.databx : document.getElementById('databx')
   if (databx.innerHTML.length > 6){
	        text   = databx.innerHTML
    databx.className       = 'databox'
    databx.style.marginTop = '10px'
    }else{databx.className = 'databx'}

    if(format =='GH'){				// < gold HORIZ format
      if (databx.innerHTML.length > 40){
	databx.style.height = '16px'
            	subStore  = text.substring(0,30)
	databx.innerHTML    = subStore + '...&nbsp;<div class="buttont1" onMouseOver="showTxt()" onMouseOut="hideTxt()">>>></div>'}
	}
    if(format =='SH'){				// < silver HORIZ format
      if (databx.innerHTML.length > 75){
	databx.style.height = '16px'
            	subStore  = text.substring(0,70)
	databx.innerHTML    = subStore + '...&nbsp;<div class="buttont1" onMouseOver="showTxt()" onMouseOut="hideTxt()">>>></div>'}
	}
    if(format =='GV'|format =='SV'){		// < all VERT format
      if (databx.innerHTML.length > 70){
	databx.style.height = '50px'
            	subStore  = text.substring(0,40)
	databx.innerHTML    = subStore + '...&nbsp;<div class="buttont1" onMouseOver="showTxt()" onMouseOut="hideTxt()">>>></div>'}
	}
}

//SHOW - HIDE Artists name if title too long to accommodate it
 function artist_on(){
  var artist  = ie4 ? document.all.artist : document.getElementById('artist')
  var title   = ie4 ? document.all.title  : document.getElementById('title')
    if(format =='GH'){				// < gold HORIZ format
       if (title.innerHTML.length > 136){
	 artist.style.display = 'none'}
 }
}

//SHOW - HIDE DATATEXT OVERFLOW
var picStore
  function showTxt(){
var databx  = ie4 ? document.all.databx : document.getElementById('databx')
var picText = ie4 ? document.all.picText: document.getElementById('picText')
	databx.style.cursor = 'pointer'
	picStore            = picText.innerHTML
    if(format =='GH'|format =='SH'){		// HORIZ format
	picText.innerHTML   = '<div id="txtboxh">' + text + '</div>'
	var txtboxh = ie4 ? document.all.txtboxh : document.getElementById('txtboxh')
	if(moz){txtboxh.style.height  = '300px'
		txtboxh.style.width   = '420px'}}
    if(format =='GV'|format =='SV'){		// VERT format
	picText.innerHTML   = '<div id="txtboxv">' + text + '</div>'
	var txtboxv = ie4 ? document.all.txtboxv : document.getElementById('txtboxv')
	if(moz){txtboxv.style.height  = '410px'
		txtboxv.style.width   = '298px'}}
}
  function hideTxt(){
var picText = ie4 ? document.all.picText: document.getElementById('picText')
	picText.innerHTML   = picStore
}

//SELF LOAD
function loadPage(){
    if (paypal_on == 1){
var pp_box = ie4 ? document.all.pp_box : document.getElementById('pp_box')
var pp_boxh= ie4 ? document.all.pp_boxh : document.getElementById('pp_boxh')
var price = ie4 ? document.all.price : document.getElementById('price')
var desc  = ie4 ? document.all.desc : document.getElementById('desc')
var cost  = ie4 ? document.all.cost : document.getElementById('cost')
var icona = ie4 ? document.all.icona : document.getElementById('icona')
var iconb = ie4 ? document.all.iconb : document.getElementById('iconb')
var iconc = ie4 ? document.all.iconc : document.getElementById('iconc')
    if (pp_box){pp_box.className = 'pp_box'}
    if (pp_boxh){pp_boxh.className = 'pp_boxh'}
    if (format == 'GV'){price.style.backgroundColor = 'white'}
	desc.innerHTML  = descr
	cost.innerHTML  = crncy +' '+ cost1

var icons = new Array(15)
icons[0]  = 'pr'	//	print
icons[1]  = 'mp'	//	matted print
icons[2]  = 'ap'	//	artists proof
icons[3]  = 'o'	//	original
icons[4]  = 'of'	//	framed original
icons[5]  = 'cv'	//	canvas print
icons[6]  = 'card'	//	card - single
icons[7]  = 'cards'	//	cards - pack
icons[8]  = 'blank'	//	-
icons[9]  = 'om'	//	matted original
icons[10] = 'pstr'	//	poster
icons[11] = 'fp'	//	framed print
icons[12] = 'apm'	//	matted AP
icons[13] = 'p2'	//	print - small- second size
icons[14] = 'mug'	//	mugs

var icondata = new Array(15)
icondata[0]  = '<img src="../type_icon1.gif" width=28 height=38 border=0 onMouseOver="pickItem(\'p\',\''
icondata[1]  = '<img src="../type_icon_mt.gif" width=28 height=38 border=0 onMouseOver="pickItem(\'mp\',\''
icondata[2]  = '<img src="../type_icon_ap.gif" width=28 height=38 border=0 onMouseOver="pickItem(\'ap\',\''
icondata[3]  = '<img src="../type_icon_orig.gif" width=28 height=38 border=0 onMouseOver="pickItem(\'o\',\''
icondata[4]  = '<img src="../type_icon_orig_fr.gif" width=28 height=38 border=0 onMouseOver="pickItem(\'of\',\''
icondata[5]  = '<img src="../type_icon_cv.gif" width=28 height=38 border=0 onMouseOver="pickItem(\'cv\',\''
icondata[6]  = '<img src="../type_icon_card.gif" width=28 height=38 border=0 onMouseOver="pickItem(\'c1\',\''
icondata[7]  = '<img src="../type_icon_cards.gif" width=28 height=38 border=0 onMouseOver="pickItem(\'c2\',\''
icondata[8]  = '<img src="../type_icon0.gif" width=28 height=38 border=0>'
icondata[9]  = '<img src="../type_icon_orig_mt.gif" width=28 height=38 border=0 onMouseOver="pickItem(\'om\',\''
icondata[10] = '<img src="../type_icon_pstr.gif" width=28 height=38 border=0 onMouseOver="pickItem(\'pstr\',\''
icondata[11] = '<img src="../type_icon_fp.gif" width=28 height=38 border=0 onMouseOver="pickItem(\'fp\',\''
icondata[12] = '<img src="../type_icon_ap_mt.gif" width=28 height=38 border=0 onMouseOver="pickItem(\'apm\',\''
icondata[13]  = '<img src="../type_icon2.gif" width=28 height=38 border=0 onMouseOver="pickItem(\'p2\',\''
icondata[14]  = '<img src="../type_icon_mug.gif" width=28 height=38 border=0 onMouseOver="pickItem(\'mug\',\''

var icondata2 = new Array(15)
icondata2[0]  = '\',\'' + title + ' (print only)\',\'' + crncy + '\')">'
icondata2[1]  = '\',\'' + title + ' (matted print)\',\'' + crncy + '\')">'
icondata2[2]  = '\',\'' + title + ' (artists proof)\',\'' + crncy + '\')">'
icondata2[3]  = '\',\'' + title + ' (original artwork)\',\'' + crncy + '\')">'
icondata2[4]  = '\',\'' + title + ' (original framed)\',\'' + crncy + '\')">'
icondata2[5]  = '\',\'' + title + ' (print on canvas)\',\'' + crncy + '\')">'
icondata2[6]  = '\',\'' + title + ' (card)\',\'' + crncy + '\')">'
icondata2[7]  = '\',\'' + title + ' (cards)\',\'' + crncy + '\')">'
icondata2[8]  = '<img src="../type_icon0.gif" width=28 height=38 border=0>'
icondata2[9]  = '\',\'' + title + ' (Mattted original)\',\'' + crncy + '\')">'
icondata2[10] = '\',\'' + title + ' (Poster)\',\'' + crncy + '\')">'
icondata2[11] = '\',\'' + title + ' (Framed Print)\',\'' + crncy + '\')">'
icondata2[12] = '\',\'' + title + ' (Matted Artists Proof)\',\'' + crncy + '\')">'
icondata2[13] = '\',\'' + title + ' (small print only)\',\'' + crncy + '\')">'
icondata2[14] = '\',\'' + title + ' (Mug)\',\'' + crncy + '\')">'

iconx = icondata.length

icona.innerHTML = icondata[8]
 if (icon1 != ''){
  for (var i = 0; i<iconx; i++){
	if (icons[i] == icon1){break}}
	icona.innerHTML = icondata[i] + cost1 + '\',\'' + ship1 + icondata2[i]}
iconb.innerHTML = icondata[8]
 if (icon2 != ''){
  for (var i = 0; i<iconx; i++){
	if (icons[i] == icon2){break}}
	iconb.innerHTML = icondata[i] + cost2 + '\',\'' + ship2 + icondata2[i]}
iconc.innerHTML = icondata[8]
 if (icon3 != ''){
  for (var i = 0; i<iconx; i++){
	if (icons[i] == icon3){break}}
	iconc.innerHTML = icondata[i] + cost3 + '\',\'' + ship3 + icondata2[i]}
}}


//FULL - DETAIL VIEW (ZOOM - Gold service only)
function swapImg(){
var zoom = ie4 ? document.all.zoom : document.getElementById('zoom')
    if (curImg != newImg){
	document.pic.src = newImg;
	curImg = newImg;
	zoom.innerHTML ='<div class="buttonz1" onMouseOver="this.className=\'buttonz2\'" onMouseOut="this.className=\'buttonz1\'" onClick = "swapImg()">full image</div>'
}else{
	document.pic.src = fImg;
	curImg = fImg;
	zoom.innerHTML ='<div class="buttonz1" onMouseOver="this.className=\'buttonz2\'" onMouseOut="this.className=\'buttonz1\'" onClick = "swapImg()">close-up</div>'
}
}

function dView(){
if (zoomOn == 1){
   dImg = fImg.substring(0,fImg.indexOf('--'))+'d'+fImg.substring(fImg.indexOf('--'))
 newImg = dImg
	output = '<div id="zoom"><div class="buttonz1" onMouseOver="this.className=\'buttonz2\'" onMouseOut="this.className=\'buttonz1\'" onClick = "swapImg()">close-up</div></div>'
	return output
}else{
	return ""
}
}

//FULL - OPTIONS (image options - Gold service only)

 function pickItem(item,amount,shipping,title,is,currency,print){
var price = ie4 ? document.all.price : document.getElementById('price')
var price2= ie4 ? document.all.price2: document.getElementById('price2')
var cost  = ie4 ? document.all.cost  : document.getElementById('cost')
var desc  = ie4 ? document.all.desc  : document.getElementById('desc')
var type = descr
var ship =  document.forms['paypal'].shipping.value

  if (currency != null){curr = currency}
  if (shipping != ''){ship = shipping}

  if (item == 'p'){
	document.forms['paypal'].item_name.value  = title
	document.forms['paypal'].amount.value     = amount
	document.forms['paypal'].shipping.value   = ship
	document.forms['paypal'].shipping2.value  = ship
	desc.innerHTML         = type
}
  if (item == 'p2'){
	document.forms['paypal'].item_name.value  = title
	document.forms['paypal'].amount.value     = amount
	document.forms['paypal'].shipping.value   = ship
	document.forms['paypal'].shipping2.value  = ship
	desc.innerHTML         = '<span class="redb">Small print</span>'
}
  if(item == "ap"){
	document.forms['paypal'].item_name.value  = title
	document.forms['paypal'].amount.value     = amount
	document.forms['paypal'].shipping.value   = ship
	document.forms['paypal'].shipping2.value  = ship
	desc.innerHTML         = '<span class="redb">Artists Proof</span>'
}
  if(item == "apm"){
	document.forms['paypal'].item_name.value  = title
	document.forms['paypal'].amount.value     = amount
	document.forms['paypal'].shipping.value   = ship
	document.forms['paypal'].shipping2.value  = ship
	desc.innerHTML         = '<span class="redb">Matted Artists Proof</span>';
}
  if(item == "mp"){
	document.forms['paypal'].item_name.value  = title
	document.forms['paypal'].amount.value     = amount
	document.forms['paypal'].shipping.value   = ship
	document.forms['paypal'].shipping2.value  = ship
	desc.innerHTML         = '<span class="redb">Matted Print</span>';
}
  if(item == "fp"){
	document.forms['paypal'].item_name.value  = title
	document.forms['paypal'].amount.value     = amount
	document.forms['paypal'].shipping.value   = ship
	document.forms['paypal'].shipping2.value  = ship
	desc.innerHTML         = '<span class="redb">Framed Print</span>';
}
  if(item == "o"){
	document.forms['paypal'].item_name.value  = title
	document.forms['paypal'].amount.value     = amount
	document.forms['paypal'].shipping.value   = ship
	document.forms['paypal'].shipping2.value  = ship
	desc.innerHTML         = '<span class="redb">Original</span>';
}
  if(item == "om"){
	document.forms['paypal'].item_name.value  = title
	document.forms['paypal'].amount.value     = amount
	document.forms['paypal'].shipping.value   = ship
	document.forms['paypal'].shipping2.value  = ship
	desc.innerHTML         = '<span class="redb">Matted Original</span>';
}
  if(item == "of"){
	document.forms['paypal'].item_name.value  = title
	document.forms['paypal'].amount.value     = amount
	document.forms['paypal'].shipping.value   = ship
	document.forms['paypal'].shipping2.value  = ship
	desc.innerHTML         = '<span class="redb">Original Framed</span>';
}
  if(item == "cv"){
	document.forms['paypal'].item_name.value  = title
	document.forms['paypal'].amount.value     = amount
	document.forms['paypal'].shipping.value   = ship
	document.forms['paypal'].shipping2.value  = ship
  if (print == null){desc.innerHTML = '<span class="redb">Print on canvas</span>'
			}else{
                     desc.innerHTML = '<span class="redb">' + type + '</span>'};
}
  if(item == "c1"){
	document.forms['paypal'].item_name.value  = title
	document.forms['paypal'].amount.value     = amount
	document.forms['paypal'].shipping.value   = ship
	document.forms['paypal'].shipping2.value  = ship
	desc.innerHTML         = 'Card &amp; envelope';
}
  if(item == "c2"){
	document.forms['paypal'].item_name.value  = title
	document.forms['paypal'].amount.value     = amount
	document.forms['paypal'].shipping.value   = ship
	document.forms['paypal'].shipping2.value  = ship
  if (print == null){desc.innerHTML = 'Cards &amp; envelopes'
			}else{
                     desc.innerHTML = type}
}
  if(item == "pstr"){
	document.forms['paypal'].item_name.value  = title
	document.forms['paypal'].amount.value     = amount
	document.forms['paypal'].shipping.value   = ship
	document.forms['paypal'].shipping2.value  = ship
	desc.innerHTML         = '<span class="redb">Poster</span>';
}
  if(item == "mug"){
	document.forms['paypal'].item_name.value  = title
	document.forms['paypal'].amount.value     = amount
	document.forms['paypal'].shipping.value   = ship
	document.forms['paypal'].shipping2.value  = ship
	desc.innerHTML         = 'Mug'
}

 	price.style.backgroundColor =  '#d3f4f3';
 	if(price2){price2.style.backgroundColor=  '#d3f4f3'}
        cost.innerHTML         = crncy + ' ' + document.forms['paypal'].amount.value
}
