var hasFlash;

function detectFlash() {
  hasFlash = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
  if(hasFlash) {
    hasFlash = parseInt(hasFlash.description.substring( hasFlash.description.indexOf(".") -1 )) >= 6;
  } else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE") >= 0
   && (navigator.userAgent.indexOf("Windows 95") >= 0
   || navigator.userAgent.indexOf("Windows 98") >= 0
   || navigator.userAgent.indexOf("Windows ME") >= 0
   || navigator.userAgent.indexOf("Windows NT") >= 0)) {
    document.write('<script language="VBScript"> \n');
    document.write('on error resume next \n' );
    document.write('hasFlash = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6")))\n' );
    document.write('<\/script>');
  }
}

function hideLayer(id) {
  var lyr = getElemRefs(id);
  if (lyr && lyr.css) {
    lyr.css.display = "none";
   // lyr.css.visibility = "hidden";
  }
}


function switchImg(galNo,imgNo) {
	getElemRefs('main_img').src = unescape('/images/'+galNo+'/jpg/glc_'+imgNo+'.jpg');
	//alert (unescape('/images/07/jpg/glc_'+imgNo+'.jpg'));
}


function getElemRefs(id) {
  var el = (document.getElementById)? document.getElementById(id): (document.all)? document.all[id]: (document.layers)? getLyrRef(id,document): null;
  if (el) el.css = (el.style)? el.style: el;
  return el;
}

function scantxt(txtfield) {
	if (txtfield.value.indexOf('http') == -1) {
		return true;
	}
	return false;
}
