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_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
//
function email(user) {
	document.write('<a href="mailto:' + user + '@iwebsolutions.co.uk" title="Email ' + user + '@iwebsolutions.co.uk!">');
	document.write(user + '@iwebsolutions.co.uk');
	document.write('</a>'); 
}

function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			if (oldonload) {
				oldonload();
			}
			func();
		}
	}
}

//
// The URL of the live web site
var myURL = "http://www.iwebsolutions.co.uk/";
//
/* Global browser sniffs */
//
var agt			=	navigator.userAgent.toLowerCase();
var is_mac    	= 	(agt.indexOf("mac")!=-1);
var is_pc    	= 	(agt.indexOf("win")!=-1);
var is_linux	= 	(agt.indexOf("linux")!=-1);
var is_ie     	= 	(agt.indexOf("msie")!= -1); 
var is_firefox 	= 	(agt.indexOf("firefox")!= -1); 
var is_opera	=	(agt.indexOf("opera")!= -1);
var is_safari	=	(agt.indexOf("safari")!=-1);
// display the quick nav pane to all the browsers except ie on a mac
if(!(is_mac && is_ie) && !is_linux) {
	document.write('<style type="text/css" media="screen">div#hContainer {display:block;}</style>'); 
}

// fixes the strapline height in opera
if(is_opera) {
	document.write('<style type="text/css" media="screen">div#strapline p {height:69px;}</style>'); 
}

// detect safari so we can apply a text decoration to other browsers for the links in the quick nav
if(!is_safari){
	var nonSafariCss = '<style type="text/css" media="screen">'
	+ 'div#hCont div a:hover {text-decoration:underline;}'
	+ '</style>';
	document.write(nonSafariCss); 
}
//
/* Filters for transparencies */
//
var pageFilters = '<style type="text/css" media="screen">'
// the alpha hovers for images
+	'a.alpha:hover {opacity:0.5; filter:alpha(opacity=50);-moz-opacity:0.5; background-color:#fff;}';
//
if(is_pc && is_ie) {
	// Quick nav bar
	pageFilters	= pageFilters
	+ 	'div#header {filter:alpha(opacity=95);}'
	+	'div.sh1 {filter:alpha(opacity=15);}'
	+	'div.sh2 {filter:alpha(opacity=10);}';
}
//
if(is_pc || is_safari) {
	pageFilters	= pageFilters
	// Portfolio full screen bg
	+ 	'div#portfolioBG {background-color:#fff;filter:alpha(opacity=80);-moz-opacity:0.8;opacity:0.8;}'
} else {
	pageFilters	= pageFilters
	// Portfolio full screen bg
	+	'div#portfolioBG {background-image:url('+myURL+'images/misc/portfolioViewBg.png) !important;}'
}
//
pageFilters	= pageFilters
+	'</style>';
document.write(pageFilters);