/************************************************************
 * fn: header.js
 * dt: 29AUG06@1805,22AUG06@1637h
 * by: dan concepcion
 * --------------------------------------------------------
 * This file holds the code for the header of the page, as well as
 * common functions for all of the pages.
 ************************************************************/
 
function client(link_mod){
	var thelink = link_mod + "clientform.htm";
	window.open(thelink, "","status=no,toolbar=no,location=no,menubar=no,directories=no,resizable=no,scrollbars=no,height=210,width=320");
}

function getHeader(){
	getHeader2("images/","html/", "", "");
}

function getHeader2(path_mod, link_mod, home_mod, page_ref){
	
	var path_logo = path_mod + 'flash/logo.swf?update=1';
	
	var tmpStr = '<table width="100%" border="0" cellspacing="0" cellpadding="0" style="background-color:#ffffff;">';
	tmpStr += '\n<tr>\n\t<td width="22%">';
	tmpStr += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="225" height="85" id="logo" align="middle">';
	tmpStr += '<param name="base" value="." />';
	tmpStr += '<param name="allowScriptAccess" value="sameDomain" />';
	tmpStr += '<param name="movie" value="' + path_logo + '" />';
	tmpStr += '<param name="quality" value="high" />';
	tmpStr += '<param name="bgcolor" value="#ffffff" />';
	tmpStr += '<embed src="' + path_logo + '" base="." quality="high" bgcolor="#ffffff" width="225" height="85" name="logo" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
	tmpStr += '</object>';
	tmpStr += '</td>';
	page_ref = "none";
	tmpStr += '\n\t<td width="78%" valign="top"><div class="client"><a href="https://rs2k501.discountasp.net/Reports/Pages/Folder.aspx?ItemPath=%2ftextaddictt%2fReports" target="_blank">CLIENT LOGIN</a></div><div class="sectionLinksArea">| ';
	
	/////////////////////////////////////////////////////////////
	//// LINKS HERE
	/////////////////////////////////////////////////////////////
	if (page_ref == "products") {
		tmpStr += '<span class="selectedpg">products</span> | ';
	} else {
		tmpStr += '<a href="' + link_mod + 'products.htm?page=products&showsection=default">products</a> | ';
	}
	
	if (page_ref == "services") {
		tmpStr += '<span class="selectedpg">services</span> | ';
	} else {
		tmpStr += '<a href="' + link_mod + 'services.htm?page=services&showsection=default">services</a> | ';
	}

	if (page_ref == "industry") {
		tmpStr += '<span class="selectedpg">industry partners</span> | ';
	} else {
		tmpStr += '<a href="' + link_mod + 'industry.htm?page=industry&showsection=default">industry partners</a> | ';
	}
	
	//if (page_ref == "news") {
	//	tmpStr += '<span class="selectedpg">news</span> | ';
	//} else {		
	//	tmpStr += '<a href="' + link_mod + 'news.htm">news</a> | ';
	//}
	
	if (page_ref == "about") {
		tmpStr += '<span class="selectedpg">about us</span> | ';
	} else {		
		tmpStr += '<a href="' + link_mod + 'about.htm">about us</a> | ';
	}
	
	if (page_ref == "contact") {
		tmpStr += '<span class="selectedpg">contact us</span> | ';
	} else {		
		tmpStr += '<a href="' + link_mod + 'contact.htm">contact us</a> |';
	}
	
	tmpStr += '</div></td>\n</tr>\n</table>';

	
	document.write(tmpStr);
	//alert('thepage = ' + thepage);

}


function hideall(){
	for(var i=1; i < contentAreas; i++){
	var theID = 'content' + i;
    	rowID = document.getElementById(theID); 
    	rowID.style.display = 'none';
	}
}

function hideAllSubContent(){
	for(var i=1; i < 5; i++){
	var theID = 'subcontent' + i;
    	rowID = document.getElementById(theID); 
    	rowID.style.display = 'none';
	}
}

function showall(){
	for(var i=1; i < contentAreas; i++){
		var theID = 'content' + i;
    	rowID = document.getElementById(theID); 
    	rowID.style.display = 'block';
	}
}

function onlyshow(theID){
	if((theID == 'subcontent1') || (theID == 'subcontent2') || (theID == 'subcontent3') || (theID == 'subcontent4')){
			getSubContent(theID);
	}

	hideall();
	//alertA(theID);
	rowID = document.getElementById(theID); 
    	rowID.style.display = 'block';

	//if (thepage == 'products') doSpecialOne(theID);
}

function getSubContent(theID){
	hideall();
	hideAllSubContent();

	if((theID == 'subcontent1') || (theID == 'subcontent2')){
		document.getElementById('submenu1').style.display = 'block';
		document.getElementById('submenu2').style.display = 'none';
	}

	if((theID == 'subcontent3') || (theID == 'subcontent4')){
		document.getElementById('submenu1').style.display = 'none'; 
		document.getElementById('submenu2').style.display = 'block';
	}

	document.getElementById(theID).style.display = 'block';
}

function doSpecialOne(theID){
	if(theID == 'content1'){//no1
		document.getElementById('submenu1').style.display = 'none';
		document.getElementById('submenu2').style.display = 'none';
	} //endif no1

	if(theID == 'content2'){//no2
		document.getElementById('submenu1').style.display = 'block';
		document.getElementById('submenu2').style.display = 'none';
	} //endif no2

	if(theID == 'content3'){//no3
		document.getElementById('submenu1').style.display = 'none';
		document.getElementById('submenu2').style.display = 'block';
	} //endif no3
}



//  page 
