// PRA Ltd
//
// Author: Dan Richards, Orpheus Software Ltd
// 12-Apr-2007

// Pre-load images
if (document.images) {
//  MM_preloadImages('img/tab_home_sel.png','img/tab_makeup_sel.png','img/tab_nails_sel.png','img/tab_gallery_sel.png','img/tab_links_sel.png','img/tab_contact_sel.png');

 tab1_on =new Image();  tab1_on.src ="img/tab_home_sel.png";
 tab1_off=new Image();  tab1_off.src="img/tab_home.png";
 tab2_on =new Image();  tab2_on.src ="img/tab_makeup_sel.png";
 tab2_off=new Image();  tab2_off.src="img/tab_makeup.png";
 tab3_on =new Image();  tab3_on.src ="img/tab_nails_sel.png";
 tab3_off=new Image();  tab3_off.src="img/tab_nails.png";
 tab4_on =new Image();  tab4_on.src ="img/tab_gallery_sel.png";
 tab4_off=new Image();  tab4_off.src="img/tab_gallery.png";
 tab5_on =new Image();  tab5_on.src ="img/tab_links_sel.png";
 tab5_off=new Image();  tab5_off.src="img/tab_links.png";
 tab6_on =new Image();  tab6_on.src ="img/tab_contact_sel.png";
 tab6_off=new Image();  tab6_off.src="img/tab_contact.png";
}


function movr(k) {
 if (document.images) 
  eval('document.tab'+k+'.src=tab'+k+'_on.src');
}

function mout(k) {
 if (document.images) 
  eval('document.tab'+k+'.src=tab'+k+'_off.src');
}


function getViewportSize() {
 var size = [0, 0];
 if (typeof window.innerWidth != 'undefined') {
   size = [ window.innerWidth, window.innerHeight ];
 }
 else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0) {
   size = [ document.documentElement.clientWidth, document.documentElement.clientHeight ];
 } else {
   size = [ document.getElementsByTagName('body')[0].clientWidth, document.getElementsByTagName('body')[0].clientHeight ];
 }
 return size;
}

/*
window.onload = window.onresize = function() { 
  var size = getViewportSize();
  var h = size[1] - 100;
  var c = document.getElementById('content_wrap');
  if (typeof c != 'undefined') {
    c.style.height = h;
  }
  // allow IE browser scrollbars if viewport is small
  if (size[0] < 800) {
    document.body.scroll='auto';
  }  
//window.status="Viewport: "+size[0]+"x"+size[1];
};
*/

function bigimg(img_name) {
	new_win = window.open("","new_win","toolbar=0,scrollbars=0,location=0,resizable=1,width=300,height=300,left=40,top=40");
	new_win.document.open();
	new_win.document.writeln('<html><head><title>AK Make Up - '+img_name+'</title></head>');
	new_win.document.writeln('<body onLoad="resizePage();" bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onClick="self.close()" onBlur="self.close()">');
	new_win.document.writeln('<img src="./gallery/'+img_name+'" id=imgID alt="Click to close">');
	new_win.document.writeln('<script>function resizePage() { img = document.images[0]; window.resizeTo(img.width+12,img.height+30) } </\script>');
	new_win.document.writeln('</body></html>');
	new_win.document.close();
	new_win.focus();
}

function contactSubmit() {
 var f=document.forms[0];
 var bOK=true;

 if (f.fullname.value=="") {
 	 alert("Please enter your name");
 	 f.fullname.focus();
 	 return;
 }

 if (f.phone.value=="" && f.email.value=="") {
 	 alert("Please enter either a contact telephone number or email address");
 	 f.email.focus();
 	 return;
 }

 if (f.enquiry.value=="") {
 	 alert("Please enter the details of your enquiry");
 	 f.enquiry.focus();
 	 return;
 }

 f.submit(); 
}


