//Start of Detect Browser
var yourBro = [];

//perform checks for different browsers
//Four variables will be created:
//yourBro[0] = browser code, yourBro[1] = browser name, yourBro[2] = operating system code, yourBro[3] = operating system name
//Browser code | Browser name
//-------------|----------------------------
//    ice      | ICEbrowser
//    op7      | Opera 7+
//    opr      | Opera 6-
//    ipn      | iPanel MicroBrowser
//    icb      | iCab
//    hjv      | HotJava
//    kde      | Konqueror / Safari
//    wtv      | WebTV
//    nbx      | Netgem NetBox
//    otv      | OpenTV
//    omn      | Omniweb
//    esc      | Escape
//    ns4      | Netscape 4
//    gek      | Gecko engine (Mozilla, Netscape 6+ etc.)
//    clu      | Clue browser
//    ie4      | Internet Explorer 4
//    ie5      | Internet Explorer 5+
//    oth      | an unknown browser
//Operating system code | Operating system name
//----------------------|----------------------------
//         lin          | Linux
//         unx          | Unix
//         mac          | MacOS
//         win          | Windows
//         wtv          | WebTV Platform
//         ngm          | Netgem
//         otv          | OpenTV Platform
//         oth          | an unknown operating system

if( navigator.vendor == 'KDE' || ( document.childNodes && !document.all && !navigator.taintEnabled ) ) { yourBro[0] = 'kde'; yourBro[1] = 'Konqueror / Safari / OmniWeb 4.5+'; }
else if( navigator.__ice_version ) { yourBro[0] = 'ice'; yourBro[1] = 'ICEbrowser'; }
else if( window.ScriptEngine && ScriptEngine().indexOf( 'InScript' ) + 1 ) { yourBro[0] = 'icb'; yourBro[1] = 'iCab'; }
else if( navigator.userAgent.toLowerCase().indexOf( 'hotjava' ) + 1 && typeof( navigator.accentColorName ) == 'undefined' ) { yourBro[0] = 'hjv'; yourBro[1] = 'HotJava'; }
else if( document.layers && !document.classes ) { yourBro[0] = 'omn'; yourBro[1] = 'Omniweb 4.2-'; }
else if( document.layers && !navigator.mimeTypes['*'] ) { yourBro[0] = 'esc'; yourBro[1] = 'Escape'; }
else if( document.layers ) { yourBro[0] = 'ns4'; yourBro[1] = 'Netscape 4'; }
else if( window.opera && document.childNodes ) { yourBro[0] = 'op7'; yourBro[1] = 'Opera 7+'; }
else if( navigator.userAgent.toLowerCase().indexOf( 'opera' ) + 1 ) { yourBro[0] = 'opr'; yourBro[1] = 'Opera 6-'; }
else if( navigator.appName.indexOf( 'WebTV' ) + 1 ) { yourBro[0] = 'wtv'; yourBro[1] = 'WebTV'; }
else if( navigator.userAgent.toLowerCase().indexOf( 'netgem' ) + 1 ) { yourBro[0] = 'nbx'; yourBro[1] = 'Netgem NetBox'; }
else if( navigator.userAgent.toLowerCase().indexOf( 'opentv' ) + 1 ) { yourBro[0] = 'otv'; yourBro[1] = 'OpenTV'; }
else if( navigator.userAgent.toLowerCase().indexOf( 'ipanel' ) + 1 ) { yourBro[0] = 'ipn'; yourBro[1] = 'iPanel MicroBrowser'; }
else if( document.getElementById && !document.childNodes ) { yourBro[0] = 'clu'; yourBro[1] = 'Clue browser'; }
else if( navigator.product == 'Gecko' ) { yourBro[0] = 'gek'; yourBro[1] = 'Gecko engine (Mozilla, Netscape 6+ etc.)'; }
else if( document.getElementById ) { yourBro[0] = 'ie5'; yourBro[1] = 'Internet Explorer 5+'; }
else if( document.all ) { yourBro[0] = 'ie4'; yourBro[1] = 'Internet Explorer 4'; }
else { yourBro[0] = 'oth'; yourBro[1] = 'an unknown browser'; }

//perform checks for different operating systems
if( navigator.userAgent.toLowerCase().indexOf( 'linux' ) + 1 ) { yourBro[2] = 'lin'; yourBro[3] = 'Linux'; }
else if( navigator.userAgent.toLowerCase().indexOf( 'x11' ) + 1 ) { yourBro[2] = 'unx'; yourBro[3] = 'Unix'; }
else if( navigator.userAgent.toLowerCase().indexOf( 'mac' ) + 1 ) { yourBro[2] = 'mac'; yourBro[3] = 'MacOS'; }
else if( navigator.userAgent.toLowerCase().indexOf( 'win' ) + 1 ) { yourBro[2] = 'win'; yourBro[3] = 'Windows'; }
else if( navigator.userAgent.toLowerCase().indexOf( 'webtv' ) + 1 ) { yourBro[2] = 'wtv'; yourBro[3] = 'WebTV Platform'; }
else if( navigator.userAgent.toLowerCase().indexOf( 'netgem' ) + 1 ) { yourBro[2] = 'ngm'; yourBro[3] = 'Netgem'; }
else if( navigator.userAgent.toLowerCase().indexOf( 'opentv' ) + 1 ) { yourBro[2] = 'otv'; yourBro[3] = 'OpenTV Platform'; }
else { yourBro[2] = 'oth'; yourBro[3] = 'an unknown operating system'; }

if (yourBro[0].substr(0, 2) == 'ie')
{
str = '_ro';
}
else
{
str = '';
} 
//End of Detect Browser

//Start Of Menu Text
// CHECK CLIENT BROWSER & PLATFORM
// Works: IE4+, NS4+, Opera

	var its;
	var browserName = '';
	var browserNameLong = '';
	var browserNew = '';
	var preloadFlag = false;
	var Macintosh = navigator.userAgent.indexOf('Mac')>0;

	function its() {
		var n = navigator;
		var ua = ' ' + n.userAgent.toLowerCase();
		var pl = n.platform.toLowerCase();
		var an = n.appName.toLowerCase();

		// browser version
		this.version = n.appVersion;
		this.nn = ua.indexOf('mozilla') > 0;

		// 'compatible' versions of mozilla aren't navigator
		if(ua.indexOf('compatible') > 0) {
			this.nn = false;
		}
		
		this.opera = ua.indexOf('opera') > 0;
		this.ie = ua.indexOf('msie') > 0;
		this.major = parseInt( this.version );
		this.minor = parseFloat( this.version );

		// platform
		this.mac = ua.indexOf('mac') > 0;
		this.win = ua.indexOf('win') > 0;

		// workaround for IE5 which reports itself as version 4.0
		if(this.ie) {
			if(ua.indexOf("msie 5") > 1) {
			var msieIndex = navigator.appVersion.indexOf("MSIE") + 5;
			this.major = parseFloat(navigator.appVersion.substr(msieIndex,3));
			}
		}

		return this;
	}

	function browserNaming() {
		its = new its();
		
		// is it a DOM-enabled browser?
		if (!document.getElementById) {
			browserNew = false;
		}
		else {
			browserNew = true;
		}

		// need the name, too
		if (its.opera) {
			browserName = "Opera";
		}
		else if (its.ie) {
			browserName = "IE";
		}
		else {
			browserName = "NS";
		}

		// and the number
		browserNameLong = browserName + its.major;
	}
	

// PRELOADING THE MOUSEOVER IMAGES
// Works: IE4+, NS4+, Opera

	function createObject(imgName,imgSrc) {
		if (loadingFlag) {
			eval(imgName + ' = new Image()');
			eval(imgName + '.src = "' + imgSrc + '"');
			return imgName;
		}
	}


// MOUSEOVER IMAGE SWITCHING
// Works: IE4+, NS4+, Opera
// Notes: NS4 needs the DIV-name in there if image is in a DIV

	function changeImage(layer,imgName,imgObj) {
		if (preloadFlag) {
			if (browserNew) {
				document.getElementById(imgName).src = eval(imgObj+'.src');
			}
			if ((!browserNew) && (browserName == "NS") && (layer!=null)) {
				eval('document.'+layer+'.document.images["'+imgName+'"].src = '+imgObj+'.src');
			}
			else {
				document.images[imgName].src = eval(imgObj+'.src');
			}
		}
	}




// DOM / SET PROPERTY
// Works: IE5+, NS6+, Opera

	function setIdProperty(id,property,value) {
		var styleObject = document.getElementById( id );
		if (styleObject != null) {
			styleObject = styleObject.style;
			styleObject[ property ] = value;
		}
	}




// HIDE AND SHOW LAYERS
// Works: IE4+, NS4+, Opera

	function hide(id) {
		if (browserNew) {
			setIdProperty(id,"visibility","hidden");
		}
		else {
			if (browserName == "NS") { document.layers[id].visibility = "hide"; }
			else { document.all[id].style.visibility = "hidden"; }
		}
	}

	function show(id) {
		if (browserNew) {
			setIdProperty(id,"visibility","visible");
		}
		else {
			if (browserName == "NS") { document.layers[id].visibility = "show"; }
			else { document.all[id].style.visibility = "visible"; }
		}
	}



        // GRABS THE BROWSER NAME
        browserNaming();

        // ANIMATED MENU VARS
        delay = 70;
        imgs = new Array();
        counter = new Array();
        peelingup = new Array();
        peelingdown = new Array();
        oldsection = 'front';
        currentsection = 'front';
        lastover = '';

        // MENUTEXT VARS
        texthome_desc = 'Home - Introduction to solution2u.com, what\'s new, add comment, view web info';
        textservices_desc = 'Services - All services offered: Web development, web hosting, web domain name';
        textportfolio_desc = 'Portfolio - View our latest works and design templates';
        textcontact_desc = 'Contact - What are you waiting for? Please don\'t hesitate to submit your enquiry now';
        
        // CHECKS THE INITIAL SECTION
        if (currentsection) {
            peelingup[currentsection] = 0;
            peelingdown[currentsection] = 1;
        }

        // MENU TEXT FUNCTIONS
        // For more info check out http://www.bosrup.com/web/overlib/
        var textLayerHtml;
        var dontShowTextLayer = 1;
        var showTimer = null;

        function menuTextOn(thisSection) {
            if (browserName != "Opera") {
                thisText = eval('text' + thisSection);
                if (thisSection == currentsection) { textLayerHtml = "<span class=\"menusml\">&nbsp;</span>"; }
                else { textLayerHtml = "<span class=\"menusml\">"+'&nbsp;&nbsp;'+thisText+"</span>"; }
                rewriteTextLayer(textLayerHtml, 'botoverdiv');
                hide('bottextoff');
                window.clearTimeout(showTimer);
                dontShowTextLayer = 1;
                show('botoverdiv');
                self.status = ' ' + eval('text' + thisSection) + ' ';
            }
        }

        function rewriteTextLayer(txt, id) {
            txt += "\n";
            // NS6
            if (browserNew && browserName == "NS") {
                botOver = document.getElementById(id);
                range = document.createRange();
                range.setStartBefore(botOver);
                domfrag = range.createContextualFragment(txt);
                while (botOver.hasChildNodes()) {
                    botOver.removeChild(botOver.lastChild);
                }
                botOver.appendChild(domfrag);
            }
            // IE 4+
            else {
                document.all[id].innerHTML = txt;
            }
        }

        function menuTextOff() {
            if (browserName != "Opera") {
                dontShowTextLayer = 0;
                hide('botoverdiv');
                self.status = '';
                showTimer = setTimeout("showNormalBottom()", 3000);
            }
        }

        function showNormalBottom() {
            if (dontShowTextLayer == 0) {
                show('bottextoff');
            }
        }
		//End Of Menu Text
		
// ANTI-SPAM

	function antispam(name,domain) {
    	document.location = "mailto:" + name + "@" + domain;
	}
	
// STATUS

	function s(txt) {
		self.status = txt;
	}

	
//Start of Fade Effect of Picture

highlighting = new Object();
theobject = new Object();

function high(object,max,imgdelay){
if (highlighting[object.id]){
highlighting[object.id]=clearInterval(highlighting[object.id]);
}
theobject[object.id] = object;
highlighting[object.id]=setInterval("highlightit(theobject["+object.id+"],"+max+")",imgdelay);
}

function low(object,min,imgdelay){
if (highlighting[object.id]){
highlighting[object.id]=clearInterval(highlighting[object.id]);
}
theobject[object.id] = object;
highlighting[object.id]=setInterval("dehighlightit(theobject["+object.id+"],"+min+")",imgdelay);
}

function highlightit(object,max){
if (object.style.MozOpacity<max*0.01)
object.style.MozOpacity=parseFloat(object.style.MozOpacity)+0.1;
else if (object.filters&&object.filters.alpha.opacity<max)
object.filters.alpha.opacity+=10;
else if (highlighting[object.id])
{
highlighting[object.id]=clearInterval(highlighting[object.id]);
}
if (object.style.MozOpacity==max*0.01 || object.filters&&object.filters.alpha.opacity==max) {
highlighting[object.id]=clearInterval(highlighting[object.id]);
}
}

function dehighlightit(object,min){
if (object.style.MozOpacity>min*0.01)
object.style.MozOpacity=parseFloat(object.style.MozOpacity)-0.1;
else if (object.filters&&object.filters.alpha.opacity>min){
object.filters.alpha.opacity-=10;
}
if (object.style.MozOpacity==min*0.01 || object.filters&&object.filters.alpha.opacity==min) {
highlighting[object.id]=clearInterval(highlighting[object.id]);
}
}

//End of Fade Effect of Picture

//Start of Loading Image
        loadingFlag = true;
		
        createObject('pichome','images/menu_home_ro.jpg');
        createObject('picservices','images/menu_services_ro.jpg');
        createObject('picportfolio','images/menu_portfolio_ro.jpg');
        createObject('piccontact','images/menu_contact_ro.jpg');
		
		loadingFlag = false;
//Start of Loading Image

//Add to favourite
function addfavorite(){
//for mozilla
 if ((typeof window.sidebar == "object") && (typeof window.sidebar.addPanel == "function"))
           {
           window.sidebar.addPanel ("Solution2u.com - Your Web Solution Provider", "http://www.solution2u.com","");
           }
else //for ie
{
	window.external.AddFavorite(location.href, document.title);
	}
}

//Pop up window
function enlarge(imageurl, width, height)
{
window.open('popup.php?imgurl=' + escape(imageurl),'propertyinfo','height=' + height + ',width=' + width + ',resizable=0,scrollbars=0,toolbar=0,status=0');
}