
	// GLOBAL GALLERY SCRIPTS

//Frame Title - PayPal enable - Zoom - Databox expand - Options -

var ie4=document.all;
var ns6=document.getElementById && !document.all;

//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 = ''
	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'}
var ppshow3 = ie4 ? document.all.ppshow3 : document.getElementById('ppshow3')

    if(ppshow3){		// HORIZ format
      if (databx.innerHTML.length > 40){
            	subStore   = text.substring(0,35)
	databx.innerHTML   = subStore + '...&nbsp;<div class="buttont1" onMouseOver="showTxt();" onMouseOut="hideTxt();">>>></div>'}
	}
    if(!ppshow3){		// VERT format
      if (databx.innerHTML.length > 70){
            	subStore   = text.substring(0,60)
	databx.innerHTML   = subStore + '...&nbsp;<div class="buttont1" onMouseOver="showTxt()" onMouseOut="hideTxt()">>>></div>'}
	}
}
//SHOW - HIDE DATATEXT OVERFLOW (Gold service only)
var picStore
  function showTxt(){
var databx  = ie4 ? document.all.databx : document.getElementById('databx')
var picText = ie4 ? document.all.picText: document.getElementById('picText')
var ppshow3 = ie4 ? document.all.ppshow3 : document.getElementById('ppshow3')
	databx.style.cursor = 'pointer'
	picStore            = picText.innerHTML
    if(ppshow3){		// HORIZ format
	picText.innerHTML   = '<div id="txtboxh">' + text + '</div>'}
    if(!ppshow3){		// VERT format
	picText.innerHTML   = '<div id="txtboxv">' + text + '</div>'}
}
  function hideTxt(){
	picText.innerHTML   = picStore
}

//SELF LOAD
function loadPage(){
    if (paypal_on == 1){
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')
	desc.innerHTML  = descr
	cost.innerHTML  = crncy +' '+ cost1

var icons = new Array(12)
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

var icondata = new Array(12)
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\',\''

var icondata2 = new Array(12)
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 + '\')">'

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 + 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 + 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 + 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){
	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)
var ie4=document.all;
var ns6=document.getElementById && !document.all;

 function pickItem(item,amount,shipping,title,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 curr = '&pound;'
var type = 'Print'

  if (currency != null){curr = currency}
  if (print    != null){type = print}

  if (item == 'p'){
	document.forms['paypal'].item_name.value  = title
	document.forms['paypal'].amount.value     = amount
	desc.innerHTML         = type;
}
  if (item == 'p2'){
	document.forms['paypal'].item_name.value  = title
	document.forms['paypal'].amount.value     = amount
	desc.innerHTML         = type;
}
  if(item == "ap"){
	document.forms['paypal'].item_name.value  = title
	document.forms['paypal'].amount.value     = amount
	desc.innerHTML         = '<span class="redb">Artists Proof</span>';
}
  if(item == "mp"){
	document.forms['paypal'].item_name.value  = title
	document.forms['paypal'].amount.value     = amount
	desc.innerHTML         = '<span class="redb">Matted Print</span>';
}
  if(item == "fp"){
	document.forms['paypal'].item_name.value  = title
	document.forms['paypal'].amount.value     = amount
	desc.innerHTML         = '<span class="redb">Framed Print</span>';
}
  if(item == "o"){
	document.forms['paypal'].item_name.value  = title
	document.forms['paypal'].amount.value     = amount
	desc.innerHTML         = '<span class="redb">Original</span>';
}
  if(item == "om"){
	document.forms['paypal'].item_name.value  = title
	document.forms['paypal'].amount.value     = amount
	desc.innerHTML         = '<span class="redb">Matted Original</span>';
}
  if(item == "of"){
	document.forms['paypal'].item_name.value  = title
	document.forms['paypal'].amount.value     = amount
	desc.innerHTML         = '<span class="redb">Original Framed</span>';
}
  if(item == "cv"){
	document.forms['paypal'].item_name.value  = title
	document.forms['paypal'].amount.value     = amount
  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
	desc.innerHTML         = 'Card &amp; envelope';
}
  if(item == "c2"){
	document.forms['paypal'].item_name.value  = title
	document.forms['paypal'].amount.value     = amount
  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
	desc.innerHTML         = '<span class="redb">Poster</span>';
}

 	price.style.backgroundColor =  '#d3f4f3';
 	if(price2){price2.style.backgroundColor=  '#d3f4f3'}
        cost.innerHTML         = curr + ' ' + document.forms['paypal'].amount.value
}

