//<!--
//alert ("functions JS Included");
var statusbar = null;
var customHTMLname = "";
var xmlhttp=false;
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
try {
	 xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e) 
{
	try 
	{
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	} 
	catch (E) 
	{
		xmlhttp = false;
	}
}
if (!xmlhttp && typeof XMLHttpRequest!='undefined') 
{
	xmlhttp = new XMLHttpRequest();
}

function resetBorder(element)
{
    element = document.getElementById(element+'Image');
    element.className = "unselectedBorder";
}

function setBorder(element)
{
    element = document.getElementById(element+'Image');
    element.className = "selectedBorder";
}

function setMapProductVars(movieElement,city,mclimb,mwalk,fall,approach,fell,via,hill,altitude,paths,productID)
{
   // alert(movieElement+ ',   ' +city+ ',   ' +mclimb+ ',   ' +mwalk+ ',   ' +fall+ ',   ' +approach+ ',   ' +fell+ ',   ' +via+ ',   ' +hill+ ',   ' +altitude+ ',   ' +paths + ', '+ productID)


    setFlashVariables(movieElement,'ProductID',productID)
    setFlashVariables(movieElement,'city',city)
    setFlashVariables(movieElement,'mclimb',mclimb)
    setFlashVariables(movieElement,'mwalk',mwalk)
    setFlashVariables(movieElement,'fall',fall)
    setFlashVariables(movieElement,'approach',approach)
    setFlashVariables(movieElement,'fell',fell)
    setFlashVariables(movieElement,'via',via)
    setFlashVariables(movieElement,'hill',hill)
    setFlashVariables(movieElement,'altitude',altitude)
    setFlashVariables(movieElement,'paths',paths)    
    getFlashMovieObject(movieElement).Rewind();
    getFlashMovieObject(movieElement).Play();

}

function setFlashVariables(movieElement,vName,vValue)
{

    if (document.getElementById(movieElement))
    {
        
        try
        {
            document.getElementById(movieElement).SetVariable(vName,vValue);
        }
        catch(Exception)
        {
            var cmd = "window.document." + movieElement + ".SetVariable('" + vName+ "','" + vValue + "');";
            eval(cmd);
        }
        
        
    } 
}

function setFlashVariableList(movieElement,query)
{

    if (document.getElementById(movieElement))
    {
        var keyvalue;
        var chunk = query.split("&");
        for(i in chunk)
        {
            keyvalue = chunk[i].split("=");
            setFlashVariables(movieElement,keyvalue[0],keyvalue[1]);
        }
        
    }

}

function setPreviewImage(Element)
{
    var ImageToShow
    var oldImage
    if (Element)
    {
        $('MainImage').setAttribute('oldImage',$('MainImage').src);
        $('MainImage').src = Element.getAttribute('prevImage');
    }
}

function restorePreviewImage()
{
    if ($('MainImage'))
    {
        $('MainImage').src = $('MainImage').getAttribute('oldImage');
    }
}

function setClass(ID,newClass)
{
    if (document.getElementById(ID))
    {
        document.getElementById(ID).className = newClass;
    }
}
function renderMove(element,file,width,height)
{
   var ipixHTML =    "<object  CLASSID='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B' CODEBASE='http://www.apple.com/qtactivex/qtplugin.cab' height='"+height+"' width='"+width+"'>\n"
   + "<param name='src' value='"+file+"'>\n" 
   + "<param name='controller' value='true'>\n" 
   + "<param name='AUTOPLAY' VALUE='true'>\n" 
   + "<param name='target' value='myself'>\n" 
   + "<param name='type' value='application/x-oleobject'>\n" 
   + "<param name='bgcolor' value='white'>\n" 
   + "<embed bgcolor='white' src='"+file+"' pluginspage='http://www.apple.com/quicktime/download/' controller='false' autoplay='true' target='myself' bgcolor='white'  height='"+height+"' width='"+width+"'>\n" 
   + "</object>";
   // alert(ipixHTML);
    document.getElementById(element).innerHTML = ipixHTML;
    

}

function deleteValue(object,equals,text)
{
    if(equals)
    {
        if (object.value == text)
        {
            object.value = ''
        }
     }
     else
     {
        object.value = ''
     }
    
}

function appendText(elements,Source,seperator)
{
    var elementsArray = elements.split(',');
    for(elem in elementsArray)
    {
        //
        if (Source.getAttribute('oldValue') != '')
        {
            document.getElementById(elementsArray[elem]).value = document.getElementById(elementsArray[elem]).value.replace(Source.getAttribute('oldValue'),Source.value);
        }
        else
        {
            document.getElementById(elementsArray[elem]).value += seperator + Source.value;
        }
    }
    
}

function setText(elements,Source)
{
    var elementsArray = elements.split(',');
    for(elem in elementsArray)
    {
        if (Source.getAttribute('oldValue') != '')
        {
            document.getElementById(elementsArray[elem]).value = document.getElementById(elementsArray[elem]).value.replace(Source.getAttribute('oldValue'),Source.value);
        }
        else
        {
            document.getElementById(elementsArray[elem]).value = Source.value;
        }
    }   

}

function setEText(elements,Source)
{
    var elementsArray = elements.split(',');
    for(elem in elementsArray)
    {
       document.getElementById(elementsArray[elem]).value = Source.options[Source.selectedIndex].text;
    }
}

function setValue(elements,Source)
{
   
}

function setOldValue(Element)
{
    Element.setAttribute('oldValue',Element.value);
}


function featuredEventEndRowView(rowID)
{
    document.getElementById(rowID).style.display = "";
}
var cmshelp = false;
//window.body.addEventListener('click',helpOnClick,false);
function toggleCmsHelp()
{
    if (cmshelp)
    {
        alert('Turning CMS Help Off');
        cmshelp = false;
        resetLinks();
    }
    else
    {
        alert('Turning CMS Help On');
        inactivelinks();
        cmshelp = true;
    }
}



function goToUrl(Element)
{
    if (Element.value != "")
    {
        window.location.href=Element.value;
    }
}
function resetLinks()
{
        var plink = document.getElementsByTagName("a");
        for(x=0;x<plink.length;x++)
        {
            plink[x].disable = false;
            plink[x].onclick = '';
            
            
        }
}
function inactivelinks()
{
        var plink = document.getElementsByTagName("a");
        for(x=0;x<plink.length;x++)
        {
            plink[x].disabled = true;
            plink[x].onclick = new Function("return false;");
        }
        
}



function helpOnClick()
{
    if (cmshelp)
    {
        var Data;
        var element;
        event.cancelBubble  = true;
        if (event.stopPropagation)
        {
            event.stopPropagation();
        }
        if (event.srcElement)
        {
            element = event.srcElement;
            if (element.innerText != "")
            {
                Data = element.innerText;
            }
            else
            {
                if (element.id != "")
                {
                    Data = element.id;
                }
                else
                {
                    Data = element.name;
                }
            }
            
        }
        var url = window.location.href;
        url = url.replace("http://");
        url = url.substring(url.indexOf("/"));
        url = url.substring(0,url.lastIndexOf("?"))
        //alert('Asking For Help On Page ' + url + ' on ' + Data);
        var e = window.event;
	    e.cancelBubble = true;
	    if (e.stopPropagation) e.stopPropagation();
	    
	        var formdata;
            formdata = 'url='+escape(url)+'&item='+escape(Data);
            xmlhttp.open("POST","/admin/helpRequest.asp",true);
            xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
            xmlhttp.setRequestHeader("Content-length", formdata.length);
            xmlhttp.onreadystatechange = handleHelpRequest;
            xmlhttp.send(formdata);
	    
    
    }

}

function handleHelpRequest()
{
    if (xmlhttp.readyState == 4)
    {
       
        
        if (xmlhttp.status == 200)
        {
            //alert();

            if (xmlhttp.responseText == "error!")
            {
                alert('Issue with help response');
            }
        }

        
    }
}

function featuredEventView(tableID, feID)
{
    //alert(tableID)
    //alert(feID)
    var Tab = document.getElementById(tableID);
		Tb = Tab.tBodies[0];

		for(var i=0; i<Tb.childNodes.length;i++)
		{
		    //alert(Tb.childNodes[i].nodeType)
		    if (Tb.childNodes[i].nodeType == 1)
		    {
		        if ((Tb.childNodes[i].getAttribute('feID') == (feID)) || (Tb.childNodes[i].getAttribute('feID') =='leave'))
			    {
				    Tb.childNodes[i].style.display = "";
			    }
			    else
			    {
			        Tb.childNodes[i].style.display = "none";
			    }
			}
			
		}
}


function statusbarWrite(line)
{
    if (statusbar)
    {
        statusbar.innerHTML = line;
    }
}
function saveAsCustomHTMLState()
{
    if (xmlhttp.readyState == 4)
    {
        statusbarWrite("Attempting to retrieve data");
        
        if (xmlhttp.status == 200)
        {
            //alert();
            writeCustomHTML(xmlhttp.responseText);
        }
        else
        {
            statusbarWrite("Unable to retrive data");
            alert('Save failed. Please check internet connection.\n If no issue then please contact an administrator');
        }
        
    }

}

function writeCustomHTMLState()
{
    if (xmlhttp.readyState == 4)
    {
        if (xmlhttp.status == 200)
        {
            if (xmlhttp.responseText == "success")
            {
                statusbarWrite("File saved successfully");
                alert('File Saved');
                
            }
            else
            {
                statusbarWrite("Failed");
                alert(xmlhttp.responseText);
                alert('Please contact an administrator');
            }
        }
        else
        {
            statusbarWrite("Failed to save.");
            alert('Save failed. Please check internet connection.\n If no issue then please contact an administrator');
        }
    }
}

function writeCustomHTML(data)
{

    if (xmlhttp)
    {
            var formdata;
            formdata = "";
            formdata = 'name='+escape(customHTMLname)+'&data='+escape(data);
            //alert(formdata);
            statusbarWrite("Attempting to save.");
            xmlhttp.open("POST","/admin/saveCustomHTML.asp",true);
            xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
            xmlhttp.setRequestHeader("Content-length", formdata.length);
            xmlhttp.onreadystatechange = writeCustomHTMLState;
            xmlhttp.send(formdata);
    }
    else
    {
        alert('Your browser does not support this feature.');
    }

}

function saveAsCustomHTML(moduleID,name,reportTo)
{
    //requests
       
        statusbar = document.getElementById(reportTo);
        customHTMLname = name;
         //alert('Called');
        
        if (xmlhttp)
        {
            //alert('Requesting Page');
            statusbarWrite("Requesting Page");
            xmlhttp.open("GET","/admin/rendermodule.asp?ModuleID="+moduleID,true);
            xmlhttp.onreadystatechange = saveAsCustomHTMLState;
            xmlhttp.send(null);
            
            
        }
        else
        {
            alert('Your browser does not support this feature.');
        }
        
        
}


function highlight(element)
{
    
    elementparent = element.parentNode;
    while (elementparent.getAttribute("hoverClass") == null)
    {
        elementparent = elementparent.parentNode;
        
    }
    element.className += " " + elementparent.getAttribute("hoverClass");
    //alert('Done');
}
function removehighlight(element)
{
    elementparent = element.parentNode;
    while (elementparent.getAttribute("hoverClass") == null)
    {
        elementparent = elementparent.parentNode;
        
    }
    //alert(element.className);
    element.className = element.className.replace(" " + elementparent.getAttribute("hoverClass"),"");
    element.className = element.className.replace(elementparent.getAttribute("hoverClass",""));
}

function emailThisPage()
{
    window.open('/emailafriend.asp','','width=542,height=446,toolbar=no,location=no,directories=no,status=no,scrollbars=no,menubar=no,resizable=no,');
}

function checkbid()
{
	TopBid = document.getElementById('TopBid');
	MyBid = document.getElementById('bid');
	if (parseInt(TopBid.value) > parseInt(MyBid.value))
	{
		
		alert("Your bid is not higher than the highest bid");
		return false;
	}
	else
	{
		return true;
	}
}

function getUID()
{

var oDate = new Date;
return (oDate.getUTCMilliseconds()*Math.random(1000));
}
function Genpassword(oElement)
{
		document.getElementById('MyFrame').src = '/_includes/genpassword.asp?element='+oElement;
			
}

function ViewFile(oElement)
{
	oElement = document.getElementById(oElement);
	var URL = oElement.value;
	window.open(oElement.value,'Viewfile','');
}

function UploadFile(URL)
{
	window.open(URL,'Upload','');
}

function toggleView(oElementID)
{
	if (document.getElementById(oElementID).style.display==""){document.getElementById(oElementID).style.display="none";}
	else{document.getElementById(oElementID).style.display="";}
}

function changeSelect(oElementID,iIndex)
{
	document.getElementById(oElementID).selectedIndex = iIndex;
}

function isEmail(field)
{
	return !(field.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/)!=-1);
}

function isNumeric(field)
{
	return (field.search(/^[-|+]*\d*.{1}\d*$/)!=-1);
}


function toggleStatus(oElementName)
{
	if(document.getElementById(oElementName).disabled == false){document.getElementById(oElementName).disabled = true}
	else{document.getElementById(oElementName).disabled = false}
}



function Decimalise(n) 
{
 var s = "" + Math.round(n * 100) / 100
 var i = s.indexOf('.')
 if (i < 0) return s + ".00"
 var t = s.substring(0, i + 1) + 
 s.substring(i + 1, i + 3)
 if (i + 2 == s.length) t += "0"
 return t
}


function swapImg(oImg)
{
src = oImg.src
if (src.search('on') ==-1){oImg.src =src.replace('_off','_on')}
else {oImg.src=src.replace('_on','_off')} 
}


function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function clearTextBoxText(txtBox){
	txtBox.value = '';
}

function GetPrices(wdsCode,URL){
	window.open("/ProductPrice.asp?WDSNo=" + wdsCode+"&U="+URL, "ProdWin", "height=250,width=600,toolbar=no,location=no,directories=no,status=no")
}
function RingForAQuote(){
	window.open("/ringforaquote.asp", "RingForAQuote", "height=280,width=674,toolbar=no,location=no,directories=no,status=no")
}
function WDSCODEREG(data)
{
alert(data);
Expression = '[\d]{0,}-[\d]{0,}'
var preg = new RegExp(Expression);
if ( data.match(preg))
{
	return true;
}
else
{
	return false;
}
	
}

//<!--
//alert ("functions JS Included");
function validate(oForm,verbose){
//alert("running");
index=0;
var message='';
var loop=1;
var Style;
var validForm=true;
var validField=false;
var oTest;
var nElements=oForm.elements.length;
var formfeedback=oForm.getAttribute("feedback");
while(index<nElements){
oTest=oForm.elements[index];
type=oTest.type;
customScript=oTest.getAttribute("customScript");
name=oTest.getAttribute("name");
field=oTest.value;
fieldfeedback=oTest.getAttribute("feedback");
max=oTest.getAttribute("max");
min=oTest.getAttribute("min");
vtype=oTest.getAttribute("vtype");
vname=oTest.getAttribute("vname");
dField=oTest.getAttribute("dfield");
dValue=oTest.getAttribute("dvalue");
mandatory=oTest.getAttribute("mandatory");
warning=oTest.getAttribute("warning");
validCustom=true;
validFormat=true;
validRange=true;
validChars=true;
validMandatory=true;
validSelect=true;
validRadio=true;
if(customScript!=null){
validCustom=(eval(customScript))}
else{
validCustom='true';
if(dField!=null){
var dVal=eval("document.getElementById('"+dField+"')")
if(dVal.type=='radio'||dVal.type=='select-one'||dVal.type=='checkbox'){
var dStatus =(dValue=='true') 
if(dVal.status==dStatus)
mandatory='true'
else
mandatory='false'}		
else{
if(!isEmpty(dVal.value))
mandatory='true'
else
mandatory='false'}}
switch(type){
case'password':
case'text':
case'textarea':
if(!isEmpty(field))	{
validChars=true;
switch(vtype){
case'text':
field=field.replace(/"/g,"`");
validFormat=true;
break;
case'numeric':
validFormat = (field.search(/^([-|+]){0,1}(\d){0,}(\.){0,1}(\d){0,}$/) !=-1);
break;
case'email':
validFormat=(field.search(/\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/)!=-1);
break;
case'url':
validFormat=(field.search(/^((\w+):\/\/)([\w.]+)(\/)?(\S*)$/)!=-1);
break;
case'Date'://uk format
validFormat=(field.search(/(((0[1-9]|[12][0-9]|3[01])([\/])(0[13578]|10|12)([\/])(\d{4}))|(([0][1-9]|[12][0-9]|30)([\/])(0[469]|11)([\/])(\d{4}))|((0[1-9]|1[0-9]|2[0-8])([\/])(02)([\/])(\d{4}))|((29)(\.|-|\/)(02)([\/])([02468][048]00))|((29)([\/])(02)([\/])([13579][26]00))|((29)([\/])(02)([\/])([0-9][0-9][0][48]))|((29)([\/])(02)([\/])([0-9][0-9][2468][048]))|((29)([\/])(02)([\/])([0-9][0-9][13579][26])))$/)!=-1);
//(field.search(/^((mon|tue|wed|thur|fri|sat|sun){1}\w{0,3}(day)?)(\\|\/|\s|.|-)?(1|2|3|)[0-9]((st|nd|rd|th)?){1}(\\|\/|\s|.|-){1}(((jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(r|((t)?e)|o|y)?(uary|ch|((m)?ber)|il|aust)?)|((1|2)?[0-9])){1}(\\|\/|\s|.|-){1}((19|20)?\d{2})$/)!=-1);
break;
case'Time':
validFormat=(field.search(/^(20|21|22|23|[01]\d|\d)(([:.][0-5]\d){1,2})$/)!=-1);
break;
case'Date/Time':
validFormat=(field.search(/(((0[1-9]|[12][0-9]|3[01])([\/])(0[13578]|10|12)([\/])(\d{4}))|(([0][1-9]|[12][0-9]|30)([\/])(0[469]|11)([\/])(\d{4}))|((0[1-9]|1[0-9]|2[0-8])([\/])(02)([\/])(\d{4}))|((29)(\.|-|\/)(02)([\/])([02468][048]00))|((29)([\/])(02)([\/])([13579][26]00))|((29)([\/])(02)([\/])([0-9][0-9][0][48]))|((29)([\/])(02)([\/])([0-9][0-9][2468][048]))|((29)([\/])(02)([\/])([0-9][0-9][13579][26])))\s(20|21|22|23|[01]\d|\d)(([:.][0-5]\d){1,2})$/)!=-1);
break;
case'filename':
validFormat=(field.search(/^((\\\\[\w]+)|([A-Za-z]:\\))?([(\w|\s)+]+\\)?[\w]+[.{1}](jpg|bmp|gif|jpeg|pdf|doc|xls|mdb|ppt|txt|rtf)$/)!=-1);
break;
case'phone':
validFormat=(field.search(/^\d{4}\s*\d\s*\d{2}\s*\d\s*\d\s*\d{2}$/)!=-1);	
break;	
case'CC':
validFormat=(field.search(/^\d{4}\s*\d{4}\s*\d{4}\s*\d{4}\s*$/)!=-1);
break;	
case'Postcode':
validFormat=(field.search(/^(([A-PR-UWYZ]{1,2}[0-9]{1,2}[ABEHJMNPRVWXY]?)\s?([0-9][ABD-HJLNP-UW-Z]{2})|(GIR)\s?(0AA))$/)!=-1);
break;	
case'password':
//validFormat=(field.search(\w)!=-1);
break;
case 'WDSCODE':
validFormat=(field.search(/[\\d]{0,}-[\\d]{0,}/) !=-1);
break;
default:
validformat = true
break;
}			
switch(vtype){
case'numeric':
if(min!=null){
if(field.length<min){
validRange=false;
msgRange="\nIt is smaller then the minimum allowed value of "+min+"."}}
if(max!=null){
if(field.length>max){
validRange=false;
msgRange="\nIt is larger then the maximum allowed value of "+max+"."}}	
default:
if(min!=null){
if(field.length<min){
validRange=false;
msgRange="\nIt is smaller then the minimum allowed size of "+min+"."}}
if(max!=null){
if(field.length>max){
validRange=false;
msgRange="\nIt is larger then the maximum allowed size of "+max+"." }}}}		
else{
if(mandatory=='true')
validMandatory=false;}	
break;	
case'checkbox':
case'radio':
validRadio=false;
while(index<nElements){
oTest=oForm.elements[index];
if(oTest.name!=name){
index--
break;}
if(mandatory=='true')
validRadio=(validRadio||oTest.status);
else{
validRadio=true
validMandatory=true}
index++}
break;
case'hidden':		
case'button':		
break;
case'select-one':
if((oTest.selectedIndex==-1)||(oTest.value==''))
{
if(mandatory=='true')
validMandatory=false;
else
validMandatory=true;
}
else
validMandatory=true;
break;
default:
break;}}
validField=((validCustom=='true')&&validFormat&&validRange&&validChars&&validMandatory&&validRadio)
if(!validField){
if(formfeedback!='none'||fieldfeedback!=null){
message+='\nYou have not correctly filled in the '+vname+' field.'
if(!validChars)
//message+="\nIt contains invalid characters."
if(!validFormat)
message+="\n'+vname+' is not in the correct format."
if(!validRange)
//message+=msgRange
if(!validRadio)
//message+="\nDoes not have a value selected."
if(!validMandatory)
//message+="\n'+vname+' is a required field and does not appear to contain a value."
if(validCustom!='true')
message+=validCustom}}
if(!validField)
Style='#ff6600';
else
Style='';
switch(type){
case'select-one':
if(oTest.parentElement.tagName!='SPAN'){
var oMySelect=oTest;
var oNewSpan=document.createElement("SPAN");
oMySelect.parentElement.insertBefore(oNewSpan,oMySelect);
var oClone=oMySelect.cloneNode(true);
oNewSpan.insertAdjacentElement("afterbegin",oClone);
oMySelect.removeNode(true);
oClone.selectedIndex =oMySelect.selectedIndex;}
else
oNewSpan=oTest.parentElement
if(!validField)
oNewSpan.style.border="2px solid "+Style;
else
oNewSpan.style.border="none"
break;
default:
oForm.elements[index].style.borderColor=Style;
break;}
validForm=(validForm&&(validField||(warning=='true')))
if((formfeedback=='incremental'||fieldfeedback=='incremental')&&!validField)
break;
index++}
//if(!verbose)
//return true;
if(validForm)
return validForm;
else{
if(formfeedback!='none'||fieldfeedback=='incremental'){
message+='\nPlease correct the appropriate entries and resubmit.'
alert(message)}
return validForm;}}
function isEmpty(str){
if(str.length==0){
return true;}
if(str.search(/\S/)==-1){
return true;}
return false;}

function checkForm(oForm){
var index=0;
var oElements=oForm.elements.length;
var formUsed=false;
while(index<oElements){
var oTest=oForm.elements[index];
var type=oTest.type;
switch(type){
case'text':
case'textarea':	
formUsed=(formUsed || !isEmpty(oTest.value));
break;
case'checkbox':
formUsed=(formUsed || oTest.status);
break;
case 'select-one':
formUsed=(formUsed || (oTest.selectedIndex==-1)||(oTest.value==''));
break;
default:
//ignore everything else}
break;}
if(formUsed) break;
index++}
if(formUsed)
return true;
else
return false;}

  function launch(element)
		    {

		        var normalImage;
		       
		       // normalImage = element.src.substring(0,element.src.lastIndexOf("_")) + element.src.substring(element.src.lastIndexOf("_")+2);
		       normalImage = element.src.substring(0,element.src.lastIndexOf("_")) + element.src.substring(element.src.lastIndexOf("."));
		        
                ImageWindow = window.open("/iView.asp?image="+normalImage,"iView","toolbar=no,resizeable=no,status=no");
                
		       
		       

		    }
	
	
function l360(file)
{
    window.open('/360.asp?file='+file,'','width=590,height=400,toolbar=no,location=no,directories=no,status=no,scrollbars=no,menubar=no,resizable=no,');
}	   

function getFlashMovieObject(movieName)
{
  if (window.document[movieName]) 
  {
      return window.document[movieName];
  }
  if (navigator.appName.indexOf("Microsoft Internet")==-1)
  {
    if (document.embeds && document.embeds[movieName])
      return document.embeds[movieName]; 
  }
  else // if (navigator.appName.indexOf("Microsoft Internet")!=-1)
  {
    return document.getElementById(movieName);
  }
}
 
 


//-->