/*------------------------------------------------------------
	Document Text Sizer- Copyright 2003 - Taewook Kang.  All rights reserved.
	Coded by: Taewook Kang (txkang.REMOVETHIS@hotmail.com)
	Web Site: http://txkang.com
	Script featured on Dynamic Drive (http://www.dynamicdrive.com)
	
	Please retain this copyright notice in the script.
	License is granted to user to reuse this code on 
	their own website if, and only if, 
	this entire copyright notice is included.
--------------------------------------------------------------*/

//Specify affected tags. Add or remove from list:

//var tgs=new Array('div','td','tr');
var tgs=new Array('td','tr');

//Specify spectrum of different font sizes:
//var szs=new Array( 'xx-small','x-small','small','medium','large','x-large','xx-large' );

var szs=new Array( '10px','12px','14px','16px','18px','20px','22px' );

var startSz=2;


function tsize( trgt,inc ) {
	if(!document.getElementById)
	{
		return
	}
	
	var d=document,cEl=null,sz=startSz,i,j,cTags;
	
	//sz += inc;
	sz=inc;
	
	if( sz < 0 )
	{ 
		sz=0;
	}
	if( sz > 6 )
	{
		sz=6;
	}
	
	startSz=sz;
		
	if( !( cEl=d.getElementById( trgt ) ) ) cEl=d.getElementsByTagName( trgt )[ 0 ];

	cEl.style.fontSize=szs[ sz ];

	for ( i=0 ; i < tgs.length ; i++ ) 
	{
		cTags=cEl.getElementsByTagName( tgs[ i ] );
		
		for ( j=0 ; j < cTags.length ; j++ ) 
		{		
			cTags[ j ].style.fontSize=szs[ sz ];
		}
	}
}

///////////////////////////////////sniffer//////////////////////////////////

//////////////////////////////////Javascript/////////////////////////////////


//CS1.1


///////////////////////////////////////
//
//  Client sniffer by Brothercake
//  http://www.brothercake.com/
//
///////////////////////////////////////


var exclude=1;
var agt=navigator.userAgent.toLowerCase();
var win=0;var mac=0;var lin=1;
if(agt.indexOf('win')!=-1){win=1;lin=0;}
if(agt.indexOf('mac')!=-1){mac=1;lin=0;}
var lnx=0;if(lin){lnx=1;}
var ice=0;
var ie=0;var ie4=0;var ie5=0;var ie6=0;var com=0;var ie7=0;var dcm;
var op5=0;var op6=0;var op7=0;var op8=0;var op9=0;
var ns4=0;var ns6=0;var ns7=0;
var mz7=0;
var kde=0;
var saf=0;
if(typeof navigator.vendor!="undefined"&&navigator.vendor=="KDE"){
	var thisKDE=agt;
	var splitKDE=thisKDE.split("konqueror/");
	var aKDE=splitKDE[1].split("; ");
	var KDEn=parseFloat(aKDE[0]);
	if(KDEn>=2.2){
		kde=1;
		ns6=1;
		exclude=0;
		}
	}
else if(agt.indexOf('webtv')!=-1){exclude=1;}
else if(typeof window.opera!="undefined"){
	exclude=0;
	if(/opera[\/ ][5]/.test(agt)){op5=1;}
	if(/opera[\/ ][6]/.test(agt)){op6=1;}
	if(/opera[\/ ][7]/.test(agt)){op7=1;}
	if(/opera[\/ ][8]/.test(agt)){op8=1;}
	if(/opera[\/ ][9]/.test(agt)){op9=1;}
	}
else if(typeof document.all!="undefined"&&!kde){
	exclude=0;
	ie=1;
	if(typeof document.getElementById!="undefined"){
		ie4=1;
		if(agt.indexOf("msie 7")!=-1)
		{
			ie7=1;
		}
		if(agt.indexOf("msie 5")!=-1)
		{
			ie5=1;
			dcm=document.compatMode;
			if(dcm!="BackCompat"){com=1;}
		}
		else if(agt.indexOf("msie 6")!=-1){
			ie6=1;
			
			}
		}
	else{ie4=1;}
	}
else if(typeof document.getElementById!="undefined"){
	exclude=0;
	if(agt.indexOf("netscape/6")!=-1 || agt.indexOf("netscape6")!=-1){ns6=1;}
	else if(agt.indexOf("netscape/7")!=-1 || agt.indexOf("netscape7")!=-1){ns6=1;ns7=1;}
	else if(agt.indexOf("gecko")!=-1){ns6=1;mz7=1;}
	if(agt.indexOf("safari")!=-1 || (typeof document.childNodes!="undefined"&&typeof document.all=="undefined"&&typeof navigator.taintEnabled=="undefined")){mz7=0;ns6=1;saf=1;}
	}
else if((agt.indexOf('mozilla')!=-1)&&(parseInt(navigator.appVersion)>=4)){
	exclude=0;
	ns4=1;
	if(typeof navigator.mimeTypes['*']=="undefined"){
		exclude=1;
		ns4=0;
		}
	}
if(agt.indexOf('escape')!=-1){exclude=1;ns4=0;}
if(typeof navigator.__ice_version!="undefined"){exclude=1;ie4=0;}
// End -->

// Cursor position of the tooltip relative to the mouse in pixel //
var offsetx=12;
var offsety= 8;

function newelement(newid)
{ 
    if(document.createElement)
    { 
        var el=document.createElement('div'); 
        el.id=newid;     
        with(el.style)
        { 
            display='none';
            position='absolute';
        } 
        el.innerHTML='&nbsp;'; 
        document.body.appendChild(el); 
    } 
} 
var c_ie5=(document.getElementById&&document.all); 
var c_ns6=(document.getElementById&&!document.all); 
var ua=navigator.userAgent.toLowerCase();
var isapple=(ua.indexOf('applewebkit')!=-1 ? 1 : 0);
function getmouseposition(e)
{
    if(document.getElementById)
    {
        var iebody=(document.compatMode&&
        	document.compatMode!='BackCompat') ? 
        		document.documentElement : document.body;
        pagex=(isapple==1 ? 0:(c_ie5)?iebody.scrollLeft:window.pageXOffset);
        pagey=(isapple==1 ? 0:(c_ie5)?iebody.scrollTop:window.pageYOffset);
        mousex=(c_ie5)?event.x:(c_ns6)?clientX=e.clientX:false;
        mousey=(c_ie5)?event.y:(c_ns6)?clientY=e.clientY:false;

        var lixlpixel_tooltip=document.getElementById('tooltip');
        lixlpixel_tooltip.style.left=(mousex+pagex+offsetx) + 'px';
        lixlpixel_tooltip.style.top=(mousey+pagey+offsety) + 'px';
    }
}
function tooltip(tip)
{
    if(!document.getElementById('tooltip')) newelement('tooltip');
    var lixlpixel_tooltip=document.getElementById('tooltip');
    lixlpixel_tooltip.innerHTML=tip;
    lixlpixel_tooltip.style.display='block';
    document.onmousemove=getmouseposition;
}
function exit()
{
    document.getElementById('tooltip').style.display='none';
}

function showTranslationEmailContents()
		{
			document.getElementById("divExpandTranslationEmailContents").style.display="none";
			document.getElementById('divTranslationEmailContents').style.display="block";
		}
function hideTranslationEmailContents()
		{
			document.getElementById("divExpandTranslationEmailContents").style.display="block";
			document.getElementById('divTranslationEmailContents').style.display="none";
		}
//-->

function showMediaRequestContents()
		{
			document.getElementById("divExpandMediaRequestContents").style.display="none";
			document.getElementById('divMediaRequestContents').style.display="block";
		}
function hideMediaRequestContents()
		{
			document.getElementById("divExpandMediaRequestContents").style.display="block";
			document.getElementById('divMediaRequestContents').style.display="none";
		}
//-->

function showSheMagazineContents()
		{
			document.getElementById("divExpandSheMagazineContents").style.display="none";
			document.getElementById('divSheMagazineContents').style.display="block";
		}
function hideSheMagazineContents()
		{
			document.getElementById("divExpandSheMagazineContents").style.display="block";
			document.getElementById('divSheMagazineContents').style.display="none";
		}
//-->

function showInstructions()
		{
			document.getElementById("divExpand").style.display="none";
			document.getElementById('divInstructions').style.display="block";
		}
function hideInstructions()
		{
			document.getElementById("divExpand").style.display="block";
			document.getElementById('divInstructions').style.display="none";
		}
//-->
/* Form Help Functions */
function FormHelpful(objElement)
{
if(document.getElementById(objElement)){document.getElementById(objElement).className = "hi";}
}

function FormHelpfulBlur(objElement)
{
if(document.getElementById(objElement)){document.getElementById(objElement).className = "";}
}
//-->
/* Form Help Functions */
function FormAlert(objElement)
{
if(document.getElementById(objElement)){document.getElementById(objElement).className = "hi";}
}

function FormAlertBlur(objElement)
{
if(document.getElementById(objElement)){document.getElementById(objElement).className = "";}
}
//-->
/* Browser Close Message */
//-->
function openWin(URL,width,height,scroll,resize, status, menubar, toolbar, location, directories, winName) {
	noUrl = false	
	if (URL == "" || URL == null) { URL="about:blank"; noUrl=true }
	if (width == "" || width == null ) { width = 640 }
	if (height == "" || height == null ) { height = 480 }
	if (width == "*" ) { 
		width = (screen.availWidth * (100/99)) ;
		if (width > 800) width="800"; //since the site isn't wider than 800px, there's no point in opening in fullscreen mode, it just looks silly!
	}
	if (height == "*" ) { 
	height =  (screen.availHeight * (100/95));
		if (height > 580) height="580";//since the site isn't taller than 800px, there's no point in opening in fullscreen mode, it just looks silly!
	}
	if (scroll == "" || scroll == null ) { scroll = 1 }
	if (resize == "" || resize == null ) { resize = 1 }
	if (status == "" || status == null ) { status = 1 }
	if (menubar == "" || menubar == null) {menubar=0}
	if (toolbar == "" || toolbar == null) {toolbar=0}
	if (location == "" || location == null) {location=0}
	if (directories == "" || directories == null) {directories=0}
	if (winName == "" || winName == null) {winName="NEW"}
	
	PARMS = 'toolbar='+toolbar +',location='+location +',directories='+directories +',status='+status +',menubar='+menubar +',scrollbars=' + scroll + ',resizable=' + resize + ',width=' + width + ',height=' + height
  var newWin = window.open(URL,winName,PARMS);
	/* newWin.screenX = 0;
  newWin.screenY = 0; */
	if (noUrl) {
		newWin.document.writeln("<BR><BR><FONT color='red'>It seems like you forgot to put in a value for URL when you called for <I>openWin()</I></FONT>")
		newWin.document.close()
	}
	return;
}
