<!--

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 swapClass(id,thisClass){
	if(document.all||document.getElementById){
		document.getElementById(id).className = thisClass;	
	} else {
		id.className = thisClass;
	}
}

function limitTextArea(form,field,limit){
	var thisField = document.forms[form][field];
	if(thisField.value.length > limit){
		thisField.value = thisField.value.slice(0, limit);
		thisField.focus();
	}
}

function makeNumeric(form,field){
	var thisField = document.forms[form][field];
	if(thisField.value != ""){
		if(isNaN(thisField.value)){
			thisField.value = thisField.value.slice(0, (thisField.value.length - 1));
			thisField.focus();
		}
	} else {
		thisField.value = "";
	}
}

function ShowAlert(title, alert_text){
	var text = title + "\n";
	text += "----------------------------------------------------------------\n";
	text += alert_text + "\n";
	alert(text);
	return false;
}

function Confirm(title, confirm_text, url){
	var text = title + "\n";
	text += "----------------------------------------------------------------\n";
	text += confirm_text + "\n";
	text += "----------------------------------------------------------------\n";
	var doublecheck = confirm(text);
	if(doublecheck != true){
		return false;
	} else {
		document.location = url;
	}
}

function checkNewsletterType(type){
	if (document.all||document.getElementById){
		obj = document.getElementById("newsletter_1")
	} else {
		obj = MM_findObj("newsletter_1")
	}
	if (obj != null){
		v = "hide";
		d = "none";
		if(type == 1){
			v = "show";
			d = "";
		}
		if (obj.style){
			obj=obj.style;
			v=(v=='show')?'visible':(v='hide')?'hidden':v;
			obj.visibility=v;
			obj.display=d;
		}
	}
}

function submitForm(varForm){
	var objForm = document.forms[varForm];
	objForm.submit();
}

function submitForm2(varForm){
	var objForm = document.forms[varForm];
	objForm.onsubmit();
	objForm.submit();
}

function Processing(form,button){

	var thisButton = document.forms[form][button];
	thisButton.value = "Please Wait..";
	thisButton.disabled = true;
	return true;

}

function SubmitUploadForm(form,strBarRef){
	strAppVersion = navigator.appVersion;
	if (document.forms[form]['File'].value != ""){
		if (strAppVersion.indexOf('MSIE') != -1 && strAppVersion.substr(strAppVersion.indexOf('MSIE')+5,1) > 4){
			if( strAppVersion.indexOf("Macintosh") != -1 && strAppVersion.charAt(0) >= 3 ){
				window.open(strBarRef + '&b=NN','','width=370,height=115', true);
			} else {
				winstyle = "dialogWidth=385px; dialogHeight:140px; center:yes";
				window.showModelessDialog(strBarRef + '&b=IE',null,winstyle);
			}
		} else {
			window.open(strBarRef + '&b=NN','','width=370,height=115', true);
		}
	}
	submitForm(form);
}

function ProcessingUpload(form,button,strBarRef){
	strAppVersion = navigator.appVersion;
	if (document.forms[form]['File'].value != ""){
		if (strAppVersion.indexOf('MSIE') != -1 && strAppVersion.substr(strAppVersion.indexOf('MSIE')+5,1) > 4){
			if( strAppVersion.indexOf("Macintosh") != -1 && strAppVersion.charAt(0) >= 3 ){
				window.open(strBarRef + '&b=NN','','width=370,height=115', true);
			} else {
				winstyle = "dialogWidth=385px; dialogHeight:140px; center:yes";
				window.showModelessDialog(strBarRef + '&b=IE',null,winstyle);
			}
		} else {
			window.open(strBarRef + '&b=NN','','width=370,height=115', true);
		}
	}
	//var thisButton = document.forms[form][button];
	//thisButton.value = "Please Wait..";
	//thisButton.disabled = true;
	return true;
}

function checkDiv(varDiv,varValue){
	var arrDivs = new Array();
	arrDivs = varDiv.split("#");
	for (a = 0; a <= arrDivs.length; a++){
		if(arrDivs[a] != null){
			blnHidden = false;
			if (document.all||document.getElementById){
				obj = document.getElementById(arrDivs[a]);
			} else {
				obj = MM_findObj(arrDivs[a]);
			}
			if(varValue){
				blnHidden = true;
			}
			if (obj != null){
				v = "show";
				d = "";
				if(blnHidden){
					v = "hide";
					d = "none";
				}
				if (obj.style){
					obj=obj.style;
					v=(v=='show')?'visible':(v='hide')?'hidden':v;
					obj.visibility=v;
					obj.display=d;
				}
			}
		}
	}
}

function checkField(objForm,varField,varCheck,varValue){
	var objField, blnDisabled, strClass;
	var arrFields = new Array();
	arrFields = varField.split("#");
	var arrValidate = new Array();
	arrValidate = varCheck.split("#");
	var arrCheck = new Array();
	for (a = 0; a <= arrFields.length; a++){
		if(arrFields[a] != null){
			blnDisabled = true;
			strClass = "disabledfield";
			objField = document.forms[objForm][arrFields[a]];
			if(arrValidate[a] != null){
				//alert(arrFields[a] + " - " + arrValidate[a]);
				arrCheck[a] = new Array();
				arrCheck[a] = arrValidate[a].split(",");
				for (b = 0; b <= arrCheck[a].length; b++){
					if (varValue == arrCheck[a][b]){
						blnDisabled = false;
						strClass = "formfields";
					}
				}
			}
			objField.className = strClass;
			objField.disabled = blnDisabled;
		}
	}
}

function openAsset(field){
	var url = "assetmanager/assetmanager.asp?ffilter=image";
	document.forms['details'][field].value = window.showModalDialog(url,window,
		"dialogWidth:600px;dialogHeight:500px;edge:Raised;center:Yes;help:No;Resizable:Yes;Maximize:Yes");
}

function GoWindowURL(url, name){
	var strWindowURL = url
	var intWidth = 0;
	var intHeight = 0;
				
	if (navigator.userAgent.indexOf("MSIE") > 0) {
		intWidth = document.body.clientWidth;
		intHeight = document.body.clientHeight;
	} else {
		intWidth = window.outerWidth;
		intHeight = window.outerHeight;
	}
	var intTop = 0;
	var intLeft = 0;
	var intResize  = 1; //0 = position specified above : 1 = dynamically positioned
	var intWindowWidth = 800;
	var intWindowHeight = 450;
	if(intResize == 1){
		intTop = ((intHeight - intWindowHeight) / 2);
		intLeft = ((intWidth - intWindowWidth) / 2);
	} else {
		intTop = 0;
		intLeft = 0;
	}
	var strWindowName = name;
	var strOptions = "toolbar=0" +
	",directories=0" +
	",status=0" +
	",menubar=0" +
	",resizable=no" +
	",scrollbars=yes" +
	",width=" + intWindowWidth +
	",height=" + intWindowHeight +
	",top=" + intTop +
	",left=" + intLeft;
	win2 = window.open(strWindowURL,strWindowName,strOptions);
	win2.focus();
}

function GoURL(strURL) {
	document.location.href = strURL;
}

function GoBack(){
	history.go(-1);
}

function ToTop(){
scroll(0,0)
}

//-->
