﻿// JScript File
function CalcDimensions(obj,w){
if(obj.width>w){
	var currWidth =obj.width;
	var currHeight=obj.height;
	
	obj.width = w;
	obj.height = currHeight/(currWidth/w);
	}
}

function ChangeMenu(obj,action){
   if(action==1){
		obj.style.fontWeight='bold';
		obj.style.background='#F0F0F0';
   }
   else{
		obj.style.fontWeight='normal';
		obj.style.background='white';
   }
}

function ChangeNews(obj,action){
   if(action==1){
		obj.style.background='#F0F0F0';
   }
   else{
		obj.style.background='white';
   }
}

function fnShowDialog2(ImageID){
    var RefPage = 'ImageViewer.aspx?ID='+ImageID;
	if(navigator.appName == "Microsoft Internet Explorer"){
	    var myObject = new Object();
		window.showModalDialog(RefPage, myObject, 'scroll:off;edge:sunken;status:no;dialogHeight:750px;dialogWidth:780px');
		//window.location.href=RefPage;
		

	}
	else{
	    var WindowObjectReference;
		WindowObjectReference = window.open(RefPage, "Gallery","menubar=no,location=yes,resizable=no,scrollbars=no,status=no,height=750px,width=780px,modal=yes,dialog=yes");
	}
}


function FTPLogin() {
    var username = 'jamessmith';
    var password = 'trinity';
    var server = 'crosserloughgfc.com';
    if (username && password && server) {
            window.open("ftp://" + username + ":" + 
              password + "@" + server, '_blank', 
              'toolbar=yes,location=yes,status=yes,' + 
              'scrollbars=auto,copyhistory=no,menubar=no,width=' 
              + ((screen.AvailWidth/2)-12) + ',height=' 
              + (screen.AvailHeight-124) +',left=' + ((screen.AvailWidth/2)) 
              + '),top=0,resizable=yes');
            }
        else {
            alert("NO BLANK FIELDS!");
            }
    }
