/* Primary nav img rollover func, by B. Hyslop */
	// arg[0]=img id, arg[1]=change status to */
function swap(){
var args=swap.arguments;
var path='';
var rollArray = new Array("navhome","your_home","navbiz","your_biz","naveservice","eservice","navaboutus","aboutus","navnews","news","navneedhelp","needhelp","navcontacts","contacts");

	imgID=rollArray[args[0]*2];
	imgFile=rollArray[args[0]*2+1];
	document.images[imgID].src='http://www.litesko.lt/i/'+path+imgFile+'_'+args[1]+'.gif';
} // end


function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function popWin()
{
	var args;
	args=popSite.arguments;
	window.open(args[0],args[1],'height=460,width=640,left=20,top=20,screenX=20,screenY=20,toolbar,location,scrollbars,menubar,resizable,status');
}

function popSite()
{
	var args;
	args=popSite.arguments;
	window.open(args[0],args[1],'height=460,width=640,left=20,top=20,screenX=20,screenY=20,toolbar,location,scrollbars,menubar,resizable,status');
}


function loadinparent(url, closeSelf){ // used by popups
	self.opener.location = url;
	if(closeSelf) self.close();
	}

// ************ added poll functions  - Jeff Held (j0hg) 12/2003 ***************
var doThePoll = false;	
function doPoll () {
	
	var theURL = document.URL;
	// determine pages poll appears on based on URL
	// rebates
	if (theURL.indexOf("/res/") != -1) {
		if (theURL.substr(-5,5) == "/res/") {
			doThePoll = true;
		}
		if(theURL.indexOf("/res/index.html") != -1) {
			doThePoll = true;
		}
	}
	if (theURL.indexOf("/res/rebates/") != -1) {
		doThePoll = true;
	}
	if (theURL.indexOf("/rebates/") != -1) {
		doThePoll = true;
	}
	if (theURL.indexOf("/biz/rebates/") != -1) {
		doThePoll = true;
	}
	// careers
	if (theURL.indexOf("/careers/") != -1) {
		if (theURL.substr(-9,9) == "/careers/") {
			doThePoll = true;
		}
		if(theURL.indexOf("/careers/index.html") != -1) {
			doThePoll = true;
		}
	}
	
	if (theURL.indexOf("/careers/mgmt_prof/index.html") != -1) {
		doThePoll = true;
	}
	if (theURL.indexOf("/careers/skilled/index.html") != -1) {
		doThePoll = true;
	}
	if (theURL.indexOf("/careers/college/index.html") != -1) {
		doThePoll = true;
	}
	if (theURL.indexOf("/careers/skilled/plant_security_technical_ecological/index.html") != -1) {
		doThePoll = true;
	}
	// understanding your bill
	if (theURL.indexOf("/res/understanding_bill/index.html") != -1) {
		doThePoll = true;
	}
	// biz
	if (theURL.indexOf("/biz/") != -1) {
		if (theURL.substr(-5,5) == "/biz/") {
			doThePoll = true;
		}
		if(theURL.indexOf("/biz/index.html") != -1) {
			doThePoll = true;
		}
	}
	// establishing service	
	if (theURL.indexOf("/customer_service/establishing_service/index.html") != -1) {
		doThePoll = true;
	}
	
	// not the rebate finder
	if (theURL.indexOf("rebate_finder") != -1) {
		doThePoll = false;
	}
	
	// alert(doThePoll);
	return doThePoll;
}

// launch script for survey JEFF HELD (j0hg) 10/2003 --

	var bites = document.cookie.split("; "); // break cookie into array of bites
	
	function launch() {
	// alert("Launch!");
		if (doThePoll){
			if (!getCookie("PollQuestion")) {
				if (!getCookie("v25")) {
					var URL = "/ask_survey.html";
					window.open(URL,"ask","height=190,width=312,status=no");
				}
			}	
		}
	}
	// name to search for is: PollQuestion
	function getCookie(name) { // use: getCookie("name");
	   for (var i=0; i < bites.length; i++) {
	     nextbite = bites[i].split("="); // break into name and value
	     if (nextbite[0] == name) // if name matches
	       return true; // return true
	   }
	// if there is no match
	   return false;
	}


var global_browser_message = "<strong>Please note:</strong> You are browsing the unformatted pge.com because your browser may not support Web standards. These standards allow us to deliver a more efficient, accessible site while ensuring its compatibility with both current and future browsers. If you wish to display the site as it was designed, please <a href='/help/'>upgrade your browser</a>";


		function upSize(){
			var increment = 2; // increment font grows in pixels
			var ptags = document.getElementById("content").getElementsByTagName("*");
			for (var i = 0; i < ptags.length; i++){
				var p = ptags[i];		
				var size = p.style.fontSize;
				var sizeInt = parseInt(getSize(size));
				var sizeUp = sizeInt + increment;
				p.style.fontSize = sizeUp + "px";			
			}
			// this keeps the title the same size
			var ttags = document.getElementById("content").getElementsByTagName("h1");
			for (var i = 0; i < ttags.length; i++){
				var t = ttags[i];		
				t.style.fontSize = "18px";			
			}
		
		}
		function downSize(){
			var increment = 2; // increment font shrinks in pixels
			var ptags = document.getElementById("content").getElementsByTagName("*");
			for (var i = 0; i < ptags.length; i++){
				var p = ptags[i];		
				var size = p.style.fontSize;
				var sizeInt = parseInt(getSize(size));
				var sizeUp = sizeInt - increment;
				if (sizeUp < 11){
					p.style.fontSize = "11px";
				} else {
					p.style.fontSize = sizeUp + "px";
				}			
			}
			// this keeps the title the same size
			var ttags = document.getElementById("content").getElementsByTagName("h1");
			for (var i = 0; i < ttags.length; i++){
				var t = ttags[i];		
				t.style.fontSize = "18px";			
			}
		
		}
		function getSize(size) {
			var theSizeInt = 11;
			if (size != "") {
				var sizeString = size;
			} else {
				var sizeString = theSizeInt + "px";
			}
			var sizeParts = sizeString.split("p");
			theSizeInt = parseInt(sizeParts[0]);
			return theSizeInt;
		}
// end increment code
	
	var currentCol = 0
	var previousCol = -1
	
	function CompareAlpha(a, b) {
		if (a[currentCol] < b[currentCol]) { return -1; }
		if (a[currentCol] > b[currentCol]) { return 1; }
		return 0;
	}
	
	function CompareAlphaIgnore(a, b) {
		strA = a[currentCol].toLowerCase();
		strB = b[currentCol].toLowerCase();
		if (strA < strB) { return -1; }
		else {
			if (strA > strB) { return 1; }
			else { return 0; }
		}
	}
	
	function CompareDate(a, b) {
		// this one works with date formats conforming to Javascript specifications, e.g. m/d/yyyy
		datA = new Date(a[currentCol]);
		datB = new Date(b[currentCol]);
		if (datA < datB) { return -1; }
		else {
			if (datA > datB) { return 1; }
			else { return 0; }
		}
	}
	
	function CompareNumeric(a, b) {
		//window.alert ("CompareNumeric");
		numA = a[currentCol]
		numB = b[currentCol]
		if (isNaN(numA)) { return 0;}
		else {
			if (isNaN(numB)) { return 0; }
			else { return numA - numB; }
		}
	}
	
	function TableSort(myTable, myCol, myType) {
	
		// Create a two-dimensional array and fill it with the table's content
		var mySource = document.getElementById(myTable);
		var myRows = mySource.rows.length;
		var myCols = mySource.rows[0].cells.length;
		currentCol = myCol
		myArray = new Array(myRows)
		for (i=0; i < myRows; i++) { // row 0 is the table head
			myArray[i] = new Array(myCols)
			for (j=0; j < myCols; j++) {
				myArray[i][j] = document.getElementById(myTable).rows[i].cells[j].innerHTML;
			}
		}
	
		if (myCol == previousCol) {
			myArray.reverse(); // clicked the same column as previously - reverse the sort
		}
		else { // clicked on a new column - sort as indicated
			switch (myType) {
				case "a":
					myArray.sort(CompareAlpha);
					break;
				case "ai":
					myArray.sort(CompareAlphaIgnore);
					break;
				case "d":
					myArray.sort(CompareDate);
					break;
				case "n":
					myArray.sort(CompareNumeric);
					break;
				default:
					myArray.sort()
			}
		}
		// Re-write the table contents
	for (i=0; i < myRows; i++) {
		for (j=0; j < myCols; j++) {
			mySource.rows[i].cells[j].innerHTML = myArray[i][j];
		}
	}
		previousCol = myCol; // remember the current sort column for the next pass
		// return 0;
	}
	
	/*
	-------------------------------------------------------------------------------
									End Table sort code
	-------------------------------------------------------------------------------	
	*/

