//softectxt.js


var timerID = 0 ;
var right_size = 120 ;
var top_size = 0;
var left_size = -40 ;
var bottom_size = 80 ;
var link_length ;
var link_steps = 10 ;

function Is() {
//alert("function is") ;

	var agent = navigator.userAgent.toLowerCase();
	this.major = parseInt(navigator.appVersion);
	this.minor = parseFloat(navigator.appVersion);
	this.ns  = ((agent.indexOf('mozilla')!=-1) && ((agent.indexOf('spoofer')==-1) && (agent.indexOf('compatible') == -1)));
	this.ns2 = (this.ns && (this.major == 3));
	this.ns3 = (this.ns && (this.major == 3));
	this.ns4 = (this.ns && (this.major >= 4));
	this.ie   = (agent.indexOf("msie") != -1);
	this.ie3  = (this.ie && (this.major == 2));
	this.ie4  = (this.ie && (this.major >= 4));
	this.op3 = (agent.indexOf("opera") != -1);
}

var is = new Is() 

if(is.ns4) {
	doc = "document";
	sty = "";
	htm = ".document"
} else if(is.ie4) {
	doc = "document.all";
	sty = ".style";
	htm = ""
}

var count = 0;

function preLoad() {

//alert("preLoad") ;

	anilineLyr = new Image();
	anilineLyr.onload = loadCheck;
	anilineLyr.src = "images/bluetop.gif";

	cloudsLyr = new Image();
	cloudsLyr.onload = loadCheck;
	cloudsLyr.src = "images/clouds.gif";

	sunsetLyr = new Image();
	sunsetLyr.onload = loadCheck;
	sunsetLyr.src = "images/sunset.jpg";

	goldsLyr = new Image();
	goldsLyr.onload = loadCheck;
	goldsLyr.src = "images/golds.gif";

	gymLyr = new Image();
	gymLyr.onload = loadCheck;
	gymLyr.src = "images/gym.gif";

	eyeLyr = new Image();
	eyeLyr.onload = loadCheck;
	eyeLyr.src = "images/eye.gif";
	eyeLyr = eval(doc + '["eyeLayer"]' + sty);
	eyeLyr.left = 125 ;
	eyeLyr.top = 112 ;
	eyeLyr.visibility = "visible";

// counter

	// not counted on load unless on server
	count_er = new Image();
	//count_er.onload = loadCheck;
	count_er.src = "counter/counter.exe?link=softec-usa&amp;style=numbers";

	layerSetup() ;
}

var link_type ;

function setuplinks() {
// slide in links
	link_length-- ;
	if(link_length == 0) {
	 link_type-- ;
	 if(link_type == 0) {
	  setupSunsetTimer() ;
	  } else { link_length = link_steps ; }
	 }
	switch (link_type){
	 case 6:
		// scope
		scopeLyr = eval(doc + '["scopeLayer"]' + sty);
		if(link_length == 10) {
		//scopeLyr.left = 178 ;
		scopeLyr.left = -20 ;
		scopeLyr.top = 40 ;
		scopeLyr.visibility = "visible";
		 }
		else {
		 scopeLyr.left = scopeTable[link_length] ;
		 }
		break ;
	 case 5:
		// services
		servicesLyr = eval(doc + '["servicesLayer"]' + sty);
		if(link_length == 10) {
		//servicesLyr.left = 123 ;
		servicesLyr.left = -20 ;
		servicesLyr.top = 68 ;
		servicesLyr.visibility = "visible";
		 }
		else {
		 servicesLyr.left = servicesTable[link_length] ;
		 }
		break ;
	 case 4:
		// design
		designLyr = eval(doc + '["designLayer"]' + sty);
		if(link_length == 10) {
		//designLyr.left = 102 ;
		designLyr.left = -20 ;
		designLyr.top = 93 ;
		designLyr.visibility = "visible";
		 }
		else {
		 designLyr.left = designTable[link_length] ;
		 }
		break ;
	 case 3:
		//hosting
		hostingLyr = eval(doc + '["hostingLayer"]' + sty);
		if(link_length == 10) {
		//hostingLyr.left = 82 ;
		hostingLyr.left = -20 ;
		hostingLyr.top = 120 ;
		hostingLyr.visibility = "visible";
		 }
		else {
		 hostingLyr.left = hostingTable[link_length] ;
		 }
		break ;
	 case 2:
		//pricing
		pricingLyr = eval(doc + '["pricingLayer"]' + sty);
		if(link_length == 10) {
		//pricingLyr.left = 73 ;
		pricingLyr.left = -20 ;
		pricingLyr.top =  145 ;
		pricingLyr.visibility = "visible" ; 
		 }
		else {
		 pricingLyr.left = pricingTable[link_length] ;
		 }
		break ;
	 case 1:
		//e-mail
		emailLyr = eval(doc + '["emailLayer"]' + sty);
		if(link_length == 10) {
		//emailLyr.left = 68 ;
		emailLyr.left = -20 ;
		emailLyr.top = 177 ;
		emailLyr.visibility = "visible";
		 }
		else {
		 emailLyr.left = emailTable[link_length] ;
		 }
	 }
}

function setupSunsetTimer() {
	sunset_loc = sunset_start ;
	sunset_layer = 2 ;
	sunset_path = 0 ;
	timerID = setInterval("sunsetTimer()",sunset_speed);
}

function sunsetTimer() {
	if(sunset_path == 0){
		sunset_loc += sunset_step ;
		if(sunset_loc >= sunset_right) {
			sunset_path = 1 ;
			sunset_layer = 0 ;
		}
	}
	else {
		sunset_loc -= sunset_step ;
		if(sunset_loc <= sunset_left) {
			sunset_path = 0 ;
			sunset_layer = 2 ;
		}
	}
	sunsetLyr = eval(doc + '["sunsetLayer"]' + sty);
	sunsetLyr.left = sunset_loc ;
	sunsetLyr.zIndex = sunset_layer ;
}

function loadCheck() {
	count++;

//alert(count) ;

//	if(count == 1) {
//		layerSetup();
//	}
}

var sunset_layer = 0 ;
var sunset_speed = 50 ;
var sunset_start = 210 ;
var sunset_step = 2 ;
var sunset_left = 10 ;
var sunset_right = 310
var sunset_loc ;
var sunset_path ;

var flags_width = 578 ;
var counter_width = 100 ;
var softec_width = 146 ;
var button_top = 205 ;
var scope_width = 70 ;
var services_width = 82 ;
var design_width = 71 ;
var hosting_width = 77 ;
var pricing_width = 73 ;
var email_width = 70 ;
var aniline_width = 325 ;
var aniline_top = -3 ;
var text_width = 275 ;
var text_height = 185 ;
var links_width = 420 ;
var links_vsize = 300 ;

function layerSetup() {
//alert("layerSetup") ;
	var textloc ;
	var linxloc ;

	// blue top
	anilineLyr = eval(doc + '["anilineLayer"]' + sty);
	anilineLyr.left = -40 ;
	anilineLyr.top = 0 ;
	anilineLyr.visibility = "visible";

	// clouds top
	cloudsLyr = eval(doc + '["cloudsLayer"]' + sty);
	cloudsLyr.left = 73 ;
	cloudsLyr.top = -10  ;
	cloudsLyr.visibility = "visible";

	// sunset 
	sunsetLyr = eval(doc + '["sunsetLayer"]' + sty);
	sunsetLyr.left = sunset_start ;
	sunsetLyr.top = 235  ;
	sunsetLyr.visibility = "visible";

	// gold swish
	goldsLyr = eval(doc + '["goldsLayer"]' + sty);
	goldsLyr.left = 30 ;
	goldsLyr.top =  175  ;
	goldsLyr.visibility = "visible";

	// gymnast
	gymLyr = eval(doc + '["gymLayer"]' + sty);
	gymLyr.left = 255 ;
	gymLyr.top =  235  ;
	gymLyr.visibility = "visible";

	// counter
	counterLyr = eval(doc + '["counterLayer"]' + sty);
	counterLyr.left = 10 ; 
	counterLyr.top = 250  ;
//	counterLyr.visibility = "visible";

	countertextLyr = eval(doc + '["countertextLayer"]' + sty);
	countertextLyr.left = (available_width/2) - 50 ; 
	countertextLyr.top = 285 ;
//	countertextLyr.visibility = "visible";

	if ((available_width/2) < text_width) { 
		textloc = (available_width/2); }
	else { textloc =  available_width-text_width ; }
	textLyr = eval(doc + '["textLayer"]' + sty);
	textLyr.left = textloc  ;
	textLyr.top = 5 ;
	textLyr.visibility = "visible";

	if ( text_height  < (available_height - links_vsize)) { 
		linxloc = (available_height-links_vsize); }
	else { linxloc =  text_height ; }
	linkstextLyr = eval(doc + '["linksLayer"]' + sty);
	linkstextLyr.left = (available_width - links_width) ;
	linkstextLyr.top = linxloc ;
	linkstextLyr.visibility = "visible";

	arraySetup();

	doTextButtons(0, 1) ;
	doTextButtons(1, 1) ;
	doTextButtons(2, 1) ;
	doTextButtons(3, 1) ;
	doTextButtons(4, 1) ;
	doTextButtons(5, 1) ;
	doTextButtons(6, 1) ;
	doTextButtons(7, 1) ;

	doText(6) ;

	link_length = link_steps ;
	link_type = 7 ;
	timerID = setInterval("setuplinks()",2);
}
function arrayValues(msg, delay) {
	this.message = msg;
	this.delay = delay;
}

function arraySetup() {
//alert("arraySetup") ;

	msgArray = new Array() ;
	msgArray[0] = new arrayValues("<font face='Arial' size='2' style='text-decoration: none'><b>Scope</b><br><br>Concept and Start-up<br>Content Organization<br>Creative Design<br>Website Appraisal<br>Customer Quality Services</font>",1) ;
	msgArray[1] = new arrayValues("<font face='Arial' size='2' style='text-decoration: none'><b>Services</b><br><br>Counters<br>Stat Tracking</font>",1) ;
	msgArray[2] = new arrayValues("<font face='Arial' size='2' style='text-decoration: none'><b>Design</b><br><br>Graphics, HTML,  & JavaScripts</font>",1) ;
	msgArray[3] = new arrayValues("<font face='Arial' size='2' style='text-decoration: none'><b>Hosting</b><br><br>Setup hosting at your favorite hosting service</font>",1) ;
	msgArray[4] = new arrayValues("<font face='Arial' size='2' style='text-decoration: none'><b>Pricing</b><br><br><b>> Websites</b> Starting at $1500</font>",1) ;
	msgArray[5] = new arrayValues("<font face='Arial' size='3' style='text-decoration: none'><a href='mailto:larry@softec-usa.com'>click here to<br>e-mail us</a></font>",1) ;
	msgArray[6] = new arrayValues("<font face='Arial' size='3' style='text-decoration: none'><b>www.softec-usa.com</b></font>",1) ;

	textArray = new Array() ;
	textArray[0] = new arrayValues('<a href="" onMouseOver="scopeOver(); return true;" ><font face="Arial" size="2" style="text-decoration: none">scope</font></a>', 1) ;
	textArray[1] = new arrayValues('<a href="" onMouseOver="servicesOver(); return true;" ><font face="Arial"  size="2" style="text-decoration: none">services</font></a>', 1) ;
	textArray[2] = new arrayValues('<a href="" onMouseOver="designOver(); return true;" ><font face="Arial"  size="2" style="text-decoration: none">design</font></a>', 1) ;
	textArray[3] = new arrayValues('<a href="" onMouseOver="hostingOver(); return true;" ><font face="Arial"  size="2" style="text-decoration: none">hosting</font></a>', 1) ;
	textArray[4] = new arrayValues('<a href="" onMouseOver="pricingOver(); return true;" ><font face="Arial"  size="2" style="text-decoration: none">pricing</font></a>', 1) ;
	textArray[5] = new arrayValues('<a href="mailto:larry@softec-usa.com" onMouseOver="emailOver(); return true;"><font face="Arial" size="2" style="text-decoration: none">e-mail</font></a>', 1) ;
	textArray[6] = new arrayValues("hits:", 1) ;
textArray[7] = new arrayValues('<table border="0" cellpadding="0" cellspacing="0" width="400"><tr><td width="100%"><font face="Arial"  size="4 style="text-decoration: none"><b>www.softec-usa.com</b></font></td></tr></table>',1) ;

	emailTable = new Array() ;
	emailTable[1] = 68;
	emailTable[2] = 59;
	emailTable[3] = 50;
	emailTable[4] = 42;
	emailTable[5] = 34;
	emailTable[6] = 26;
	emailTable[7] = 18;
	emailTable[8] = 10;
	emailTable[9] = -2;
	emailTable[10]= -10;

	pricingTable = new Array() ;
	pricingTable[1] = 73;
	pricingTable[2] = 65;
	pricingTable[3] = 57;
	pricingTable[4] = 49;
	pricingTable[5] = 41;
	pricingTable[6] = 33;
	pricingTable[7] = 25;
	pricingTable[8] = 17;
	pricingTable[9] = 9;
	pricingTable[10]= -10;

	hostingTable = new Array() ;
	hostingTable[1] = 82;
	hostingTable[2] = 73;
	hostingTable[3] = 64;
	hostingTable[4] = 55;
	hostingTable[5] = 46;
	hostingTable[6] = 37;
	hostingTable[7] = 28;
	hostingTable[8] = 20;
	hostingTable[9] = 8;
	hostingTable[10]= -10;

	designTable = new Array() ;
	designTable[1] = 102;
	designTable[2] = 91;
	designTable[3] = 80;
	designTable[4] = 69;
	designTable[5] = 57;
	designTable[6] = 44;
	designTable[7] = 33;
	designTable[8] = 22;
	designTable[9] = 11;
	designTable[10]= -10;

	servicesTable = new Array() ;
	servicesTable[1] = 123;
	servicesTable[2] = 110;
	servicesTable[3] = 96;
	servicesTable[4] = 83;
	servicesTable[5] = 69;
	servicesTable[6] = 56;
	servicesTable[7] = 42;
	servicesTable[8] = 19;
	servicesTable[9] = 5;
	servicesTable[10]= -10;

	scopeTable = new Array() ;
	scopeTable[1] = 178;
	scopeTable[2] = 158;
	scopeTable[3] = 138;
	scopeTable[4] = 118;
	scopeTable[5] = 98;
	scopeTable[6] = 68;
	scopeTable[7] = 48;
	scopeTable[8] = 28;
	scopeTable[9] = 8;
	scopeTable[10]= -10;

}

//var messages = 6 ;
var text_index = 1;
var text_styles = 4 ;
var text_count = 10 ;
var pix_count = 2 ;

function doText(txt) {
//alert("doText") ;

	text_HTML = eval (doc + '["textLayer"]' + htm) ;

	var msg ;

	if (txt == 5) {
		msg = '<TABLE BORDER="0" WIDTH="100%" HEIGHT = "100%"><TR><TD ALIGN=LEFT><FONT CLASS=text8>' + msgArray[txt].message + '</TD></TR></TABLE>';
//	} else if (txt == 4) {
//		msg = '<TABLE BORDER="0" WIDTH="100%" HEIGHT = "100%"><TR><TD ALIGN=LEFT><FONT CLASS=text7>' + msgArray[txt].message + '</TD></TR></TABLE>';
//	} else {
//		msg = '<TABLE BORDER="0" WIDTH="100%" HEIGHT = "100%"><TR><TD ALIGN=LEFT><FONT CLASS=text6 SIZE="2">' + msgArray[txt].message + '</TD></TR></TABLE>';

	} else {
		msg = '<TABLE BORDER="0" WIDTH="100%" HEIGHT = "100%"><TR><TD ALIGN=LEFT><FONT CLASS=text7>' + msgArray[txt].message + '</TD></TR></TABLE>';
	}

	if(is.ns4) {
		text_HTML.write(msg) ;
		text_HTML.close() ;
	} else {
		text_HTML.innerHTML = msg ;
	}
}


function designOver() {
	doText(2) ;
	doTextButtons(2, 0) ;
}

function designOut() {
	doText(6) ;
	doTextButtons(2, 1) ;
}

function emailOver() {
	doText(5) ;
	doTextButtons(5, 0) ;
}

function emailOut() {
	doText(6) ;
	doTextButtons(5, 1) ;
}

function hostingOver() {
	doText(3) ;
	doTextButtons(3, 0) ;
}

function hostingOut() {
	doText(6) ;
	doTextButtons(3, 1) ;
}

function pricingOver() {
	doText(4) ;
	doTextButtons(4, 0) ;
}

function pricingOut() {
	doText(6) ;
	doTextButtons(4, 1) ;
}

function servicesOver() {
	doText(1) ;
	doTextButtons(1, 0) ;
}

function servicesOut() {
	doText(6) ;
	doTextButtons(1, 1) ;
}

function scopeOver() {
	doText(0) ;
	doTextButtons(0, 0) ;
}

function scopeOut() {
	doText(6) ;
	doTextButtons(0, 1) ;
}

function doTextButtons(txt, type) {
//alert("doTextButtons") ;

	var textHTML ;

	if(txt == 0) {
		textHTML = eval (doc + '["scopeLayer"]' + htm) ;
	} else if(txt == 1) {
		textHTML = eval (doc + '["servicesLayer"]' + htm) ;
	} else if(txt == 2) {
		textHTML = eval (doc + '["designLayer"]' + htm) ;
	} else if(txt == 3) {
		textHTML = eval (doc + '["hostingLayer"]' + htm) ;
	} else if(txt == 4) {
		textHTML = eval (doc + '["pricingLayer"]' + htm) ;
	} else if(txt == 5) {
		textHTML = eval (doc + '["emailLayer"]' + htm) ;
	} else if(txt == 6) {
		textHTML = eval (doc + '["countertextLayer"]' + htm) ;
	} else if(txt == 7) {
		textHTML = eval (doc + '["linksLayer"]' + htm) ;
	} 
	var msg ;

	if (txt == 6) {
		msg = '<TABLE BORDER="0" WIDTH="100%" HEIGHT = "100%"><TR><TD ALIGN=LEFT><font class=text4>' + textArray[txt].message + '</font></TD></TR></TABLE>';
	} else {
		if(type == 2) {
			msg = '<TABLE BORDER="0" WIDTH="100%" HEIGHT = "100%"><TR><TD ALIGN=LEFT><font class=text4>' + textArray[txt].message + '</TD></TR></TABLE>';
		} else {
		 if(txt == 7) {
			msg = '<TABLE BORDER="0" WIDTH="100%" HEIGHT = "100%"><TR><TD>' + textArray[txt].message + '</TD></TR></TABLE>';
		 } else {
			msg = '<TABLE BORDER="0" WIDTH="100%" HEIGHT = "100%"><TR><TD ALIGN=LEFT><font class=text5>' + textArray[txt].message + '</font></TD></TR></TABLE>';
		 }
		}
	}

	if(is.ns4) {
		textHTML.write(msg) ;
		textHTML.close() ;
	} else {
		textHTML.innerHTML = msg ;
	}
}
