/*Disable right mouse click Script*/

var message="Function Disabled! This website, artwork, photographs and documents are protected under international copyright laws, enforced under the jurisdiction of England, Scotland and Wales with the express exclusion of the Law of Conflicts. Andrew Moore holds the copyright of all images, text and documents held within. Expections to this are made clear by author/artist credit where needed. Under no circumstances may content be copied from this website!";

///////////////////////////////////
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("alert(message);return false")






/*Check client screen Resolution - also acts as a best view tag*/
///////////////////////////////////
function checkScreenSize()
{
if(screen.width < 1024 || screen.height < 768) 
{ 
alert('This website is best viewed with screen resolution of 1024 x 768 or above.\nYour current resolution is ' + screen.width+  ' x ' + screen.height + '.\n') 
} 
}





/*Resize the Logo within the Header wrapper*/
///////////////////////////////////
function logoResize(){
/*auto resize logo depending on div height*/
var div_h = document.getElementById('header-wrapper').offsetHeight;
var img_h = div_h - 4;  /*header has upper border of 2px*/
document.write('<img class="LogoImageStyle" src="PageGraphics/sig_image_web.gif" style="height: ' + img_h + 'px ">')
}




/*Change the src tag of the main page iframe + prompt reload of iframe*/
///////////////////////////////////
function iframeChangeSrc(counter)
{
if(counter==1)
{
						/*change iframe src to fashion*/
/*alert('fashion');*/
MainFrame.location.href="http://www.andrewrmoore.com/galleries/fashion.htm";
}

if(counter==2)
{
						/*change iframe src to portrait*/
/*alert('portrait');*/
MainFrame.location.href="http://www.andrewrmoore.com/galleries/portrait.htm";
}

if(counter==3)
{
						/*change iframe src to events*/
/*alert('event');*/
MainFrame.location.href="http://www.andrewrmoore.com/galleries/events.htm";
}

if(counter==4)
{
						/*change iframe src to about me*/
/*alert('about me');*/
MainFrame.location.href="http://www.andrewrmoore.com/SecondaryPages/about.htm";
/*location.reload(true);*/     /*Used to reload entire page - dont use in this case*/
}

if(counter==5)
{
						/*change iframe src to contact*/
/*alert('contact');*/
MainFrame.location.href="http://www.andrewrmoore.com/SecondaryPages/contact.htm";
}
}




/*Resize event detection and reload*/
///////////////////////////////////
function resize()
{
Im_Resize();
window.reload();
}




/*Hack for Safari only - Runs Safari only scripting (changes CSS)*/
///////////////////////////////////
function safari_test()
{
isSafari3 = false;
if(window.devicePixelRatio)
{ 
isSafari3 = true;
var class_id_header = document.getElementById('header-wrapper');
var class_id_footer = document.getElementById('footer-wrapper');

class_id_header.style.width = '92%';
class_id_footer.style.width = '92%';
}
}


/*Script to get window frame size (inner dims) - browser compliant*/
///////////////////////////////////
function alertSize(mode) {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  if(mode == 0)
  {
  window.alert( 'Width = ' + myWidth );
  window.alert( 'Height = ' + myHeight );
  }
  if(mode == 1)
  {
  return myHeight;		/*used for the im_resize script*/
  }
}



/*Image resizing scripts - Dependant on page size!*/
///////////////////////////////////
function Im_Resize()
{
var min_im_height = 250;  	/*Normal size at 450px for lower resolution screens*/
var max_im_height = 700;	/*Max image size, still 62% of frame for 1050h*/
padding = 15;			/*Normal padding of 15px suitable for most monitors*/

/*Get window size*/
height = alertSize(1);

/*Logical sizing of image height parameter*/
if (height <= 400)
{
imheight = min_im_height - 50;
padding = 4;
}

if (height > 400 && height <= 500)
{
imheight = min_im_height;
padding = 6;
}

if (height > 500 && height <= 600)
{
imheight = 350;
padding = 8;
}

if (height > 600 && height <= 768)
{
imheight = 450;
padding = 10;
}

if (height > 768 && height <= 850)
{
imheight = 550;
padding = 13;
}

if (height > 850 && height <= 1050)
{
imheight = 650;
padding = 15;
}

if (height > 1050 && height <= 2000)
{
imheight = max_im_height;
padding = 18;
}

if (height > 2000)
{
imheight = max_im_height + 50;
padding = 20;
}

/*Change the IFrame CSS*/
iframeheight = imheight + 15;		/* +15px for the x-axis scroll bar*/
var IFrame = document.getElementById('MainFrame');
IFrame.style.height = iframeheight + 'px';
var ContentWrapper = document.getElementById('content-wrapper');
ContentWrapper.style.padding = padding + 'px';

/*alert('script changes image size!');*/
var innerdoc = IFrame.contentDocument || IFrame.contentWindow.document;

/*Image - 1*/
Image1 = innerdoc.getElementById('MainImg1');
Image1.style.height = imheight + 'px';

/*Image - 2*/
Image2 = innerdoc.getElementById('MainImg2');
Image2.style.height = imheight + 'px';

/*Image - 3*/
Image3 = innerdoc.getElementById('MainImg3');
Image3.style.height = imheight + 'px';

/*Image - 4*/
Image4 = innerdoc.getElementById('MainImg4');
Image4.style.height = imheight + 'px';

/*Image - 5*/
Image5 = innerdoc.getElementById('MainImg5');
Image5.style.height = imheight + 'px';

/*Image - 6*/
Image6 = innerdoc.getElementById('MainImg6');
Image6.style.height = imheight + 'px';

/*Image - 7*/
Image7 = innerdoc.getElementById('MainImg7');
Image7.style.height = imheight + 'px';

/*Image - 8*/
Image8 = innerdoc.getElementById('MainImg8');
Image8.style.height = imheight + 'px';

/*Image - 9*/
Image9 = innerdoc.getElementById('MainImg9');
Image9.style.height = imheight + 'px';

/*Image - 10*/
Image10 = innerdoc.getElementById('MainImg10');
Image10.style.height = imheight + 'px';

/*Image - 11*/
Image11 = innerdoc.getElementById('MainImg11');
Image11.style.height = imheight + 'px';

/*Image - 12*/
Image12 = innerdoc.getElementById('MainImg12');
Image12.style.height = imheight + 'px';

/*Image - 13*/
Image13 = innerdoc.getElementById('MainImg13');
Image13.style.height = imheight + 'px';

/*Image - 14*/
Image14 = innerdoc.getElementById('MainImg14');
Image14.style.height = imheight + 'px';

/*Image - 15*/
Image15 = innerdoc.getElementById('MainImg15');
Image15.style.height = imheight + 'px';

/*Image - 16*/
Image16 = innerdoc.getElementById('MainImg16');
Image16.style.height = imheight + 'px';

/*Image - 17*/
Image17 = innerdoc.getElementById('MainImg17');
Image17.style.height = imheight + 'px';

/*Image - 18*/
Image18 = innerdoc.getElementById('MainImg18');
Image18.style.height = imheight + 'px';

/*Image - 19*/
Image19 = innerdoc.getElementById('MainImg19');
Image19.style.height = imheight + 'px';

/*Image - 20*/
Image20 = innerdoc.getElementById('MainImg20');
Image20.style.height = imheight + 'px';

/*Image - 21*/
Image21 = innerdoc.getElementById('MainImg21');
Image21.style.height = imheight + 'px';






/*You can add more images to the gallery but must use consistant html tags and 
this javascript will need to be added to for images 8, 9 and 10 etc*/
/*Image - 21*/
/*Image21 = innerdoc.getElementById('MainImg21');*/
/*Image21.style.height = imheight + 'px';*/
}



/*Functions to add the load event handler to the Im_Resize script*/
/////////////////////////////////////////////
function iframeOnloadHandler(evnt) 
{
Im_Resize();
}
   
function addEventHandlers()
{
var ifrm = document.getElementById('MainFrame');
if (ifrm == null) return false;

if (ifrm.addEventListener) 
{
ifrm.addEventListener("load", iframeOnloadHandler, false);
}
else 
{
ifrm.attachEvent("onload", iframeOnloadHandler);
}
}

/*Function to change navigation tiles gifs to text and visa versa*/
/////////////////////////////////////////////
function NavChange()
{
Window_Height = alertSize(1);
if (Window_Height < 600)
{
var TextHTML1 = "<p class='NavigationFontStyle'>Fashion</p>";
var TextHTML2 = "<p class='NavigationFontStyle'>Portrait</p>";
var TextHTML3 = "<p class='NavigationFontStyle'>Events</p>";
document.getElementById('menu-links1').innerHTML = TextHTML1;
document.getElementById('menu-links2').innerHTML = TextHTML2;
document.getElementById('menu-links3').innerHTML = TextHTML3;


}	/*endif*/
}	/*end function*/


