function paCreateRollOvers(){
	if(document.getElementById){
		var paImages = document.getElementsByTagName('IMG');
		var paButtons = document.getElementsByTagName('INPUT');
	}else if(document.all && navigator.userAgent.indexOf('Mac')==-1){
		var paImages = document.all['mouseovers'].all.tags('IMG');
		var paButtons = document.all['mouseovers'].all.tags('INPUT');
	}else return;
	paPreloads = new Object();

	for (var i = 0; i < paImages.length; i++){
		var paImageOffSrc = paImages[i].src + "";
		if(paImageOffSrc.indexOf("_off.") != -1){
			var paImageOnSrc = paImageOffSrc.replace(/_off\./g, "_on.");
			paPreloads['paImageOff_' + i] = new Image();
			paPreloads['paImageOff_' + i].src = paImageOffSrc;
			paPreloads['paImageOn_' + i] = new Image();
			paPreloads['paImageOn_' + i].src = paImageOnSrc;
			/*paPreloads['paImageOn_' + i].onerror = function(){this.src='/images/blank.gif';}*/
			paImages[i].onmouseover = function(){this.src = this.src.replace(/_off\./g, "_on.");}
			paImages[i].onmouseout = function(){this.src = this.src.replace(/_on\./g, "_off.");}
		}
	} 

	for (var i = 0; i < paButtons.length; i++){
		if(paButtons[i].src){
		var paImageOffSrc = paButtons[i].src + "";
		if(paImageOffSrc.indexOf("_off.") != -1){
			var paImageOnSrc = paImageOffSrc.replace(/_off\./g, "_on.");
			paPreloads['paImageOff_' + i] = new Image();
			paPreloads['paImageOff_' + i].src = paImageOffSrc;
			paPreloads['paImageOn_' + i] = new Image();
			paPreloads['paImageOn_' + i].src = paImageOnSrc;
			/*paPreloads['paImageOn_' + i].onerror = function(){this.src='/images/blank.gif';}*/
			paButtons[i].onmouseover = function(){this.src = this.src.replace(/_off\./g, "_on.");}
			paButtons[i].onmouseout = function(){this.src = this.src.replace(/_on\./g, "_off.");}
		}
		}
	} 
}
	

window.onload = paCreateRollOvers;

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function hide(id){ 
if (document.getElementById){ 
obj = document.getElementById(id); 
obj.style.display = "none"; 
} 
} 

function show(id){ 
if (document.getElementById){ 
obj = document.getElementById(id); 
obj.style.display = ""; 
} 
}

function showhide(id){ 
if (document.getElementById){
obj = document.getElementById(id); 
if (obj.style.display == "none"){ 
obj.style.display = ""; 
} else { 
obj.style.display = "none"; 
} 
} 
} 
function expandi(i){
    $("#togller"+i).removeClass('accToggler'+i+'').addClass('accToggler'+i+'Open');
		$("#row"+i).slideToggle("slow");
	}
	function collapsei(i){
		$("#togller"+i+"").removeClass('accToggler'+i+'Open').addClass('accToggler'+i);
		$("#row"+i).slideToggle("slow");
	}
function showhide2(id) { 
	if (document.getElementById) {
		obj = document.getElementById(id);
		objMain = document.getElementById('prepaidAir');
		if (obj.style.display == "none") {
			obj.style.display = "";
			objMain.style.height = "415px";
		} else { 
			obj.style.display = "none";
			objMain.style.height = "292px";
		}
	} 
} 

myUrl = location.href;
mySub1 = ".php";
mySub2 = "-all.php";

function leftFromSubStringToBeginningOfFullString(fullString, subString) {
if (fullString.lastIndexOf(subString) == -1) {
return "";
} else {
return fullString.substring(0, fullString.lastIndexOf(subString));
}
}

function viewall() {
myText = leftFromSubStringToBeginningOfFullString(myUrl, mySub1);
document.write('<A HREF="');
document.write(myText); 
document.write('-all.php">');
document.write('View All');
document.write('</A>');
}

function normalview() {
myText = leftFromSubStringToBeginningOfFullString(myUrl, mySub2);
document.write('<A HREF="');
document.write(myText); 
document.write('.php">');
document.write('View Larger Photos');
document.write('</A>');
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
 eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
   if (restore) selObj.selectedIndex=0;
   }

function textCounter(field,cntfield,maxlimit) {
if (field.value.length > maxlimit) // if too long...trim it!
field.value = field.value.substring(0, maxlimit);
// otherwise, update 'characters left' counter
else
cntfield.value = maxlimit - field.value.length;
}
function EnsureNumeric()
{
     var k = window.event.keyCode;
     if (( k < 48 || k > 57) && k != 8 && k != 13 && k != 44) {window.event.returnValue = false; }
}
function CheckPhoneNumber(ob){
     f=ob.form;
     n=ob.name;
     v=ob.value;
     nextfield=0;
     currfield=parseInt(n.substr(n.length-1,1));
     fn=n.substr(0,n.length-1);
     if(currfield<3) nextfield=currfield+1;
     if(nextfield){
          if(v.length>=3){
               f[fn+nextfield].focus();
          }
     }
}

function out_cost(par){
/*	par=Math.floor(par)+Math.round((par-Math.floor(par))*100)/100;
//	par=par.toFixed(2);
	t=Math.round(100*(par-Math.floor(par)));
	if(t==0) return(par+'.00');
	if((t%10)==0) return(par+'0');*/
	oc_res=par.toFixed(2)
	if(par>=1000){
		r1=oc_res.substring(oc_res.length-6);
		r2=oc_res.substring(0,oc_res.length-6);
		oc_res=r2+','+r1;
	}
	return(oc_res);
}
