<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

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 MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function isInteger(val){
	for(var i=0;i<val.length;i++){
		if(!isDigit(val.charAt(i))){return false;}
	}
	return true;
}
	
function isDigit(num) {
	if (num.length>1){return false;}
	var string="1234567890";
	if (string.indexOf(num)!=-1){return true;}
	return false;
}

function NoClick(e) {
   if (bNS && e.which > 1){
      alert(strMsg);
      return false
   } else if (bIE && (event.button >1)) {
     alert(strMsg);
     return false;
   }
}

function showImage(intImageID) {
	ModelImage=window.open("/docs/popup_image.php?image_id=" + intImageID,'ModelImage','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=1,resizable=no,width=500,height=400');
}

function showSlideShow(intModelID) {
	ModelImage=window.open("/docs/popup_ss_image.php?user_id=" + intModelID,'ModelImage','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=1,resizable=no,width=500,height=400');
}

function doConfirm(strMessage, strField) {
	if (confirm(strMessage)) {
		document.frmMain[strField].value = "True";
		document.frmMain.submit();
	}
}

function isBlank(val){
	if(val==null) return true;
	for(var i=0;i<val.length;i++) {
		if ((val.charAt(i)!=' ')&&(val.charAt(i)!="\t")&&(val.charAt(i)!="\n")&&(val.charAt(i)!="\r")) return false;
	}
	return true;
}

function AddOption(strForm, strObject, strField) {
	if (isBlank(document[strForm][strField].value))	return false;
	for (var i=0; i < document[strForm][strField].length; i++) {
		if (document[strForm][strField].value == document[strForm][strObject](i).value)	{
			return false;
		}
	}
	var newOpt = new Option("*" + document[strForm][strField].value,  "--New--" + document[strForm][strField].value);
	document[strForm][strObject].options[document[strForm][strObject].length] = newOpt;
	document[strForm][strField].value = "";
}
	
function RemoveOption(strForm, strObject)	{
	if (document[strForm][strObject].selectedIndex != -1) {
		document[strForm][strObject].options[document[strForm][strObject].selectedIndex] = null;
	}
}

function SelectAllSelectList(strForm, strObject) {
	for (var i=0; i < document[strForm][strObject].length; i++)	{
		document[strForm][strObject](i).selected = true;
	}
}

function PushOption(strForm, strFrom, strTo) {
	if (document[strForm][strFrom].selectedIndex == -1) return false;
	if (document[strForm][strFrom](document[strForm][strFrom].selectedIndex).value > 0) {
		for (var i=0; i < document[strForm][strTo].length; i++) {
			if (document[strForm][strTo](i).value == document[strForm][strFrom](document[strForm][strFrom].selectedIndex).value) return false;
		}
		var newOpt = new Option(document[strForm][strFrom](document[strForm][strFrom].selectedIndex).innerText, document[strForm][strFrom](document[strForm][strFrom].selectedIndex).value);
		document[strForm][strTo].options[document[strForm][strTo].length] = newOpt;
	}
}

function getScheduleDetail(intScheduleTypeID,intPortfolioID, intYear, intMonth, intDay, intEdit) {
	intScheduleID = window.showModalDialog("/docs/popup_schedule_details.php?schedule_type_id=" + intScheduleTypeID + "&model_id=" + intPortfolioID + "&y=" + intYear + "&m=" + intMonth + "&d=" + intDay + "&edit=" + intEdit, null, "dialogHeight:400px;dialogWidth:450px");
	if (intScheduleID > 0 && intEdit == 1) {
		window.location = '/docs/edit_schedule.php?m=' + intMonth + '&y=' + intYear + '&schedule_type_id=' + intScheduleTypeID + '&model_id=' + intPortfolioID + '&schedule_id=' + intScheduleID;
	}else if(intScheduleID < 0 && intEdit == 1) {
		window.location = '/docs/edit_schedule.php?schedule_type_id=' + intScheduleTypeID + '&model_id=' + intPortfolioID + '&frmRemoveSchedule=True&intSchduleID=' + Math.abs(intScheduleID);
	}
}

function swapModelImage(intImageID) {
	window.MainModelImage.src = '/photos/1/large/' + intImageID + '.jpg';
}

function printCompcard(intModelID) {
	window.open("print_comp_card.php?model_id=" + intModelID, "SendCompCard", "width=730,height=500,left=0,top=0,menubar=no,location=no,toolbar=no,scrollbars=no,resizable=yes");
}

function emailCompcard(intModelID) {
	window.open("send_comp_card.php?model_id=" + intModelID, "SendCompCard", "width=525,height=350,left=0,top=0,menubar=no,location=no,toolbar=no,scrollbars=no,resizable=yes");
}

function printFlyer() {
	window.FlyerControls.style.display = "none";
	window.print();
	window.FlyerControls.style.display = "block";
}

function emailFlyer(intModelID) {
	window.open("send_flyer.php?model_id=" + intModelID, "SendFlyer", "width=525,height=350,left=0,top=0,menubar=no,location=no,toolbar=no,scrollbars=no,resizable=yes");
}

function showImageHelp() {
	window.showModalDialog("/docs/popup_image_help.php", null, "dialogHeight:400px;dialogWidth:450px");
}

function bodyOnload() {
	MM_preloadImages('/images/menu/menu_r2_c2_f2.gif','/images/menu/menu_r2_c3_f2.gif','/images/menu/menu_r2_c4_f2.gif','/images/menu/menu_r2_c5_f2.gif','/images/menu/menu_r2_c6_f2.gif','/images/menu/menu_r2_c7_f2.gif','/images/menu/menu_r3_c4_f2.gif','/images/menu/menu_r3_c3_f2.gif','/images/menu/menu_r3_c2_f2.gif');
}

//-->

