var imgurl;



function getImgurl() {



        var pos = location.pathname.indexOf("/");



        var lastSlash = 0;



        while ( pos != -1 )



        {



        	if (pos != -1) { lastSlash = pos; }



                pos = location.pathname.indexOf("/",pos+1);



        }



        		



        



        var triadic = location.pathname.substr(lastSlash+1, location.pathname.length-4-lastSlash);



        imgurl = "../html/fullImg/";



        imgurl=imgurl.concat(triadic);



        imgurl=imgurl.concat(".jpg");



}







function launchimg()



{



h=fullImage.height;



w=fullImage.width;



var specs = "height=";



specs=specs.concat(h);



specs=specs.concat(",width=");



specs=specs.concat(w);



newwin = window.open('','ase',specs);



newwin.document.open();



newwin.document.write("<HEAD><TITLE>theSERGE.com Media Window</TITLE></HEAD>");



newwin.document.write("<BODY bgcolor=#000000><table height=\"100%\" width=\"100%\"><tr><td valign=center align=center><IMG SRC=\"", imgurl, "\"></td></tr></table></BODY>");



newwin.document.close();



wi=w+100;



hi=h+100;



newwin.resizeTo(wi, hi);



newwin.focus();



}







function newImage(arg) {



		rslt = new Image();



		rslt.src = arg;



		return rslt;



}







function preloadImages() {



	        getImgurl();



                icon_homeO = newImage("../html/topbarImg/icon_home.gif");



		icon_aboutO = newImage("../html/topbarImg/icon_about.gif");



		icon_portfolioO = newImage("../html/topbarImg/icon_portfolio.gif");



		icon_contactO = newImage("../html/topbarImg/icon_contact.gif");



		buttonO = newImage("../html/topbarImg/button.gif");



		topbarO = newImage("../html/topbarImg/topbar.gif");



                spacerO = newImage("../html/topbarImg/spacer.gif");



                backgroundO = newImage("../html/tableImg/background.gif");



                smallSergeO = newImage("../html/tableImg/smallSerge.gif");



		fullImage = newImage(imgurl);



}







function make_visible(id)



{



var img = document.getElementById(id);



img.style.visibility = "visible";



}







function make_hidden(id)



{



var img = document.getElementById(id);



img.style.visibility = "hidden";



}







function button_show(left)



{



var img = document.getElementById("button");



img.style.visibility = "visible";



img.style.left = left + "px";



}







function button_hide()

{



var img = document.getElementById("button");



img.style.visibility = "hidden";



}



function openGallery(name)

{

var path="../html/galleries/galleryThumbs.php?gallery=" + name;
var scrWidth = screen.width-25;
if (screen.width < 1024)

{
        var configuration = 'height=500,width=' + scrWidth + ',left=10,screenX=10,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,location=no,directories=no,status=no';
	window.open(path,'galleryWin',config=configuration);

}

else

{
        var configuration = 'height=605,width=' + scrWidth + ',left=10,screenX=10,toolbar=no,menubar=no,scrollbars=no,resizable=yes,location=no,directories=no,status=no';
        window.open(path,'galleryWin',config=configuration);

}

}



function backOver(state)

{

var img = document.getElementById('backButton');

if(state == 'over')

{

 img.style.borderLeft = "2px solid #82B088";

 img.style.borderBottom = "1px solid #82B088";

 img.style.padding = "1px";

 img.style.marginLeft = "-2px";

 img.style.marginBottom = "-1px";

 

}

if(state == 'normal')

{

 img.style.borderLeft = "0";

 img.style.borderBottom = "0";

 img.style.padding = "0";

 img.style.marginLeft = "0";

 img.style.marginBottom = "0";

 

}

if(state == 'down')

{

 img.style.borderLeft = "2px solid #330000";

 img.style.borderBottom = "1px solid #330000";

 img.style.padding = "1px";

 img.style.marginLeft = "-2px";

 img.style.marginBottom = "-1px";

}

}



function revertLinks (id)

{

var thinger = document.getElementById(id);

thinger.style.background = "#C2D9C5";

thinger.style.paddingLeft = "0";

thinger.style.color = "#330000";

thinger.style.borderLeft = "15px solid #330000";



}

