// Style sheet platform check

if ((navigator.userAgent.indexOf("Mac") != -1))
    document.write("<link rel='stylesheet' href='http://www.linkdup.com/v1/externals/m.css' type='text/css'>")
if (navigator.userAgent.indexOf('Win') != -1){
    if (navigator.appName.indexOf('Netscape') != -1) {
        document.write("<link rel='stylesheet' href='http://www.linkdup.com/v1/externals/n.css' type='text/css'>")
        }
   else {
        document.write("<link rel='stylesheet' href='http://www.linkdup.com/v1/externals/i.css' type='text/css'>")
        }
    }



// Send MyLink

var win=null;
function Send(mypage){
                window.open(mypage,'sendlink','width=240,height=410,top=100,left=310,scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no');
}


// Window opening

function openWin(url, width, height) {
        var win = window.open(url, '_blank','resizable=no,scrollbars=no,status=0,directories=no,toolbar=no,menubar=no,width='+width+',height='+height);
}




// Tech Check Boxes...

        function updatebox(prefix)
        {
//				alert("prefix is "+prefix);
				if (prefix>0) {
					fieldname="Technology-"+prefix;
				}
				else {
					fieldname="Technology";
				}
//				alert("fieldname is "+fieldname);
                document.spud[fieldname].value = "";
                for(var i = 1; i < 6; i++)
                {
                        if (i>1) document.spud[fieldname].value += "-";
                        if (prefix>0) {var b = prefix+"box" + i;}
						else {var b = "box" + i;}
                        if(document.spud[b].checked)
                        {
                                document.spud[fieldname].value += document.spud[b].value;
                        }
                        else
                        {
                                document.spud[fieldname].value += "-";
                        }
                }
        }

	function initmultiboxes() {

		for (var records=0;records<arguments.length;records++) {
			currentrecord=arguments[records];
//			alert("current record is "+currentrecord);
			if (currentrecord>0) {
				var tempstring=document.spud["Technology-"+currentrecord].value;
//				alert("tempstring is "+tempstring);
				for(var i = 0; i < 5; i++) {
					if (tempstring.substr((i*2),1) != "-") { // Its a hit
						var b = currentrecord+"box" + (i+1);
						document.spud[b].checked=true;
					}
				}
			}
		}
	}


	function initboxes() {

		var tempstring=document.spud.Technology.value;
		for(var i = 0; i < 5; i++) {

			if (tempstring.substr((i*2),1) != "-") { // Its a hit
				var b = "box" + (i+1);
				document.spud[b].checked=true;
			}
		}
	}



// Cookie Stuff...
// Use this function to retrieve a cookie.

function getCookie(name){
var cname = name + "=";
var dc = document.cookie;
    if (dc.length > 0) {
    begin = dc.indexOf(cname);
        if (begin != -1) {
        begin += cname.length;
        end = dc.indexOf(";", begin);
            if (end == -1) end = dc.length;
            return unescape(dc.substring(begin, end));
        }
    }
return null;
}

// Cookie Stuff...
// Use this function to save a cookie.

function setCookie(name, value, expires) {
document.cookie = name + "=" + escape(value) + "; path=/" +
((expires == null) ? "" : "; expires=" + expires.toGMTString());
}

// Cookie Stuff...
// Use this function to delete a cookie.

function delCookie(name) {
document.cookie = name + "=; expires=Thu, 01-Jan-70 00:00:01 GMT" +  "; path=/";
}

// Cookie Stuff...
// Function to retrieve form element's value.

function getValue(element) {
var value = getCookie(element.name);
    if (value != null) element.value = value;
}

// Cookie Stuff...
// Function to save form element's value.

function setValue(element) {
setCookie(element.name, element.value, exp);
}
var exp = new Date();
exp.setTime(exp.getTime() + (1000 * 60 * 60 * 24 * 31));




// Image Rollover Stuff


function jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.p) d.p=new Array();
    var i,j=d.p.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.p[j]=new Image; d.p[j++].src=a[i];}}
}

function swapImgRestore() { //v3.0
  var i,x,a=document.sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function findObj(n, d) { //v3.0
  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=findObj(n,d.layers[i].document); return x;
}

function swapImage() { //v3.0
  var i,j=0,x,a=swapImage.arguments; document.sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=findObj(a[i]))!=null){document.sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}



// Centered Window opening

var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h))):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);
if(win.focus){win.focus();}}


