
		/***********************************************
		* IFrame SSI script- © Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
		* Visit DynamicDrive.com for hundreds of original DHTML scripts
		* This notice must stay intact for legal use
		***********************************************/
		
		//Input the IDs of the IFRAMES you wish to dynamically resize to match its content height:
		//Separate each ID with a comma. Examples: ["myframe1", "myframe2"] or ["myframe"] or [] for none:
		var iframeids=["main"]
		
		//Should script hide iframe from browsers that don't support this script (non IE5+/NS6+ browsers. Recommended):
		var iframehide="yes"
		
		function dyniframesize() {
		var dyniframe=new Array()
		for (i=0; i<iframeids.length; i++){
		
		if (document.getElementById){ //begin resizing iframe procedure
		dyniframe[dyniframe.length] = document.getElementById(iframeids[i]);
		if (dyniframe[i] && !window.opera){
		dyniframe[i].style.display="block"
		if (dyniframe[i].contentDocument && dyniframe[i].contentDocument.body.offsetHeight) //ns6 syntax
		dyniframe[i].height = dyniframe[i].contentDocument.body.offsetHeight; 
		else if (dyniframe[i].Document && dyniframe[i].Document.body.scrollHeight) //ie5+ syntax
		dyniframe[i].height = dyniframe[i].Document.body.scrollHeight;
		}
		}
		//reveal iframe for lower end browsers? (see var above):
		if ((document.all || document.getElementById) && iframehide=="no"){
		var tempobj=document.all? document.all[iframeids[i]] : document.getElementById(iframeids[i])
		tempobj.style.display="block"
		}
		}
		}
		
		if (window.addEventListener)
		window.addEventListener("load", dyniframesize, false)
		else if (window.attachEvent)
		window.attachEvent("onload", dyniframesize)
		else
		window.onload=dyniframesize
		
//*******************************************************************************************
//*******************************************************************************************
//*******************************************************************************************
//*******************************************************************************************

	id = new String (" ") ; 	//"tr1","tr2" .... ,"tr6"
	
	a = new Array(5);		//THE NUMBER OF PAGES OR BUTTONS
	a[0]= false ;
	a[1]= false ;
	a[2]= false ;
	a[3]= false ;
	a[4]= false ;
	a[5]= false ;
	

	//WHEN THE MOUSE PASSES THE BUTTON LINK
	
	function mOver(id)
	{
				switch(id)
				{
					case "tr1" :
						if (window.tr1.style.background=='url(html/graphics/buttonActive.gif)')
						{
							window.tr1.style.background='url(html/graphics/buttonActive.gif)';
						}
						else
						{
							window.tr1.style.background='url(html/graphics/buttonHover.gif)';
						}
						break;
					case "tr2" :
						if (window.tr2.style.background=='url(html/graphics/buttonActive.gif)')
						{
							window.tr2.style.background='url(html/graphics/buttonActive.gif)';
						}
						else
						{
							window.tr2.style.background='url(html/graphics/buttonHover.gif)';
						}
						break;	
					case "tr3" :
						if (window.tr3.style.background=='url(html/graphics/buttonActive.gif)')
						{
							window.tr3.style.background='url(html/graphics/buttonActive.gif)';
						}
						else
						{
							window.tr3.style.background='url(html/graphics/buttonHover.gif)';
						}
						break;		
					case "tr4" :
						if (window.tr4.style.background=='url(html/graphics/buttonActive.gif)')
						{
							window.tr4.style.background='url(html/graphics/buttonActive.gif)';
						}
						else
						{
							window.tr4.style.background='url(html/graphics/buttonHover.gif)';
						}
						break;		
					case "tr5" :
						if (window.tr5.style.background=='url(html/graphics/buttonActive.gif)')
						{
							window.tr5.style.background='url(html/graphics/buttonActive.gif)';
						}
						else
						{
							window.tr5.style.background='url(html/graphics/buttonHover.gif)';
						}
						break;		
					case "tr6" :
						if (window.tr6.style.background=='url(html/graphics/buttonActive.gif)')
						{
							window.tr6.style.background='url(html/graphics/buttonActive.gif)';
						}
						else
						{
							window.tr6.style.background='url(html/graphics/buttonHover.gif)';
						}
						break;	
					case "tr7" :
						if (window.tr7.style.background=='url(html/graphics/buttonActive.gif)')
						{
							window.tr7.style.background='url(html/graphics/buttonActive.gif)';
						}
						else
						{
							window.tr7.style.background='url(html/graphics/buttonHover.gif)';
						}
						break;																																							
					default :
						
				}
	}

	
	
	//WHEN THE MOUSE LEAVES THE BUTTON LINK
	
	function mOut(id)
	{
		
				switch(id)
				{
					case "tr1" :
						if (window.tr1.style.background=='url(html/graphics/buttonActive.gif)')
						{
							window.tr1.style.background='url(html/graphics/buttonActive.gif)';
						}
						else
						{
							window.tr1.style.background='url(html/graphics/buttonBase.gif)';
						}
						break;
					case "tr2" :
						if (window.tr2.style.background=='url(html/graphics/buttonActive.gif)')
						{
							window.tr2.style.background='url(html/graphics/buttonActive.gif)';
						}
						else
						{
							window.tr2.style.background='url(html/graphics/buttonBase.gif)';
						}
						break;	
					case "tr3" :
						if (window.tr3.style.background=='url(html/graphics/buttonActive.gif)')
						{
							window.tr3.style.background='url(html/graphics/buttonActive.gif)';
						}
						else
						{
							window.tr3.style.background='url(html/graphics/buttonBase.gif)';
						}
						break;		
					case "tr4" :
						if (window.tr4.style.background=='url(html/graphics/buttonActive.gif)')
						{
							window.tr4.style.background='url(html/graphics/buttonActive.gif)';
						}
						else
						{
							window.tr4.style.background='url(html/graphics/buttonBase.gif)';
						}
						break;		
					case "tr5" :
						if (window.tr5.style.background=='url(html/graphics/buttonActive.gif)')
						{
							window.tr5.style.background='url(html/graphics/buttonActive.gif)';
						}
						else
						{
							window.tr5.style.background='url(html/graphics/buttonBase.gif)';
						}
						break;		
					case "tr6" :
						if (window.tr6.style.background=='url(html/graphics/buttonActive.gif)')
						{
							window.tr6.style.background='url(html/graphics/buttonActive.gif)';
						}
						else
						{
							window.tr6.style.background='url(html/graphics/buttonBase.gif)';
						}
						break;	
					case "tr7" :
						if (window.tr7.style.background=='url(html/graphics/buttonActive.gif)')
						{
							window.tr7.style.background='url(html/graphics/buttonActive.gif)';
						}
						else
						{
							window.tr7.style.background='url(html/graphics/buttonBase.gif)';
						}
						break;																																							
					default :
						
				}
	}

	var ns4class=''
	
	
//*******************************************************************************************
//*******************************************************************************************
//*******************************************************************************************
//*******************************************************************************************

		
			//configure the two variables below to match yoursite's own info
			var bookmarkurl="http://www.pestboss.com"
			var bookmarktitle="PestBoss - Pest Control Web Mamagement System"
		
			function addbookmark(){
			if (document.all)
			window.external.AddFavorite(bookmarkurl,bookmarktitle)
			}
			
//*******************************************************************************************
//*******************************************************************************************
//*******************************************************************************************
//*******************************************************************************************


			function changePage(pageId, lang)
			{
				switch(pageId)
				{
					case "tr1" :
						parent.main.location='html/pages/about.asp?lang='+lang;
						//parent.title.location='html/title/title.asp?lang='+lang+'&page='+pageId;
						window.tr1.style.background='url(html/graphics/buttonActive.gif)';
						window.tr2.style.background='url(html/graphics/buttonBase.gif)';
						window.tr3.style.background='url(html/graphics/buttonBase.gif)';
						window.tr4.style.background='url(html/graphics/buttonBase.gif)';
						window.tr5.style.background='url(html/graphics/buttonBase.gif)';
						window.tr6.style.background='url(html/graphics/buttonBase.gif)';
						window.tr7.style.background='url(html/graphics/buttonBase.gif)';	
						break;
					case "tr2" :
						parent.main.location='html/pages/roadMap.asp?lang='+lang;
						//parent.title.location='html/title/title.asp?lang='+lang+'&page='+pageId;
						window.tr1.style.background='url(html/graphics/buttonBase.gif)';
						window.tr2.style.background='url(html/graphics/buttonActive.gif)';
						window.tr3.style.background='url(html/graphics/buttonBase.gif)';
						window.tr4.style.background='url(html/graphics/buttonBase.gif)';
						window.tr5.style.background='url(html/graphics/buttonBase.gif)';
						window.tr6.style.background='url(html/graphics/buttonBase.gif)';		
						window.tr7.style.background='url(html/graphics/buttonBase.gif)';		
						break;	
					case "tr3" :
						parent.main.location='html/pages/presentations.asp?lang='+lang;
						//parent.title.location='html/title/title.asp?lang='+lang+'&page='+pageId;
						window.tr1.style.background='url(html/graphics/buttonBase.gif)';
						window.tr2.style.background='url(html/graphics/buttonBase.gif)';
						window.tr3.style.background='url(html/graphics/buttonActive.gif)';
						window.tr4.style.background='url(html/graphics/buttonBase.gif)';
						window.tr5.style.background='url(html/graphics/buttonBase.gif)';
						window.tr6.style.background='url(html/graphics/buttonBase.gif)';		
						window.tr7.style.background='url(html/graphics/buttonBase.gif)';	
						break;		
					case "tr4" :
						parent.main.location='html/pages/screenShots.asp?lang='+lang;
						//parent.title.location='html/title/title.asp?lang='+lang+'&page='+pageId;
						window.tr1.style.background='url(html/graphics/buttonBase.gif)';
						window.tr2.style.background='url(html/graphics/buttonBase.gif)';
						window.tr3.style.background='url(html/graphics/buttonBase.gif)';
						window.tr4.style.background='url(html/graphics/buttonActive.gif)';
						window.tr5.style.background='url(html/graphics/buttonBase.gif)';
						window.tr6.style.background='url(html/graphics/buttonBase.gif)';
						window.tr7.style.background='url(html/graphics/buttonBase.gif)';		
						break;		
					case "tr5" :
						parent.main.location='html/pages/forum.asp?lang='+lang;
						//parent.title.location='html/title/title.asp?lang='+lang+'&page='+pageId;
						window.tr1.style.background='url(html/graphics/buttonBase.gif)';
						window.tr2.style.background='url(html/graphics/buttonBase.gif)';
						window.tr3.style.background='url(html/graphics/buttonBase.gif)';
						window.tr4.style.background='url(html/graphics/buttonBase.gif)';
						window.tr5.style.background='url(html/graphics/buttonActive.gif)';
						window.tr6.style.background='url(html/graphics/buttonBase.gif)';	
						window.tr7.style.background='url(html/graphics/buttonBase.gif)';		
						break;		
					case "tr6" :
						parent.main.location='html/pages/systemLogin.asp?lang='+lang;
						//parent.title.location='html/title/title.asp?lang='+lang+'&page='+pageId;
						window.tr1.style.background='url(html/graphics/buttonBase.gif)';
						window.tr2.style.background='url(html/graphics/buttonBase.gif)';
						window.tr3.style.background='url(html/graphics/buttonBase.gif)';
						window.tr4.style.background='url(html/graphics/buttonBase.gif)';
						window.tr5.style.background='url(html/graphics/buttonBase.gif)';
						window.tr6.style.background='url(html/graphics/buttonActive.gif)';	
						window.tr7.style.background='url(html/graphics/buttonBase.gif)';	
						break;		
					case "tr7" :
						if(lang == 'Heb') {
							parent.main.location='html/pages/form.asp?siteLanguage='+lang;
						} else if(lang == 'En') {
							parent.main.location='html/pages/formEn.asp?siteLanguage='+lang;
						}
						//parent.title.location='html/title/title.asp?lang='+lang+'&page='+pageId;
						window.tr1.style.background='url(html/graphics/buttonBase.gif)';
						window.tr2.style.background='url(html/graphics/buttonBase.gif)';
						window.tr3.style.background='url(html/graphics/buttonBase.gif)';
						window.tr4.style.background='url(html/graphics/buttonBase.gif)';
						window.tr5.style.background='url(html/graphics/buttonBase.gif)';
						window.tr6.style.background='url(html/graphics/buttonBase.gif)';
						window.tr7.style.background='url(html/graphics/buttonActive.gif)';		
						break;																																							
					default :
				}
			}
		
//*******************************************************************************************
//*******************************************************************************************
//*******************************************************************************************
//*******************************************************************************************

		//////////////////////////////////////////////////////////////////////////////////////////////////
		function isFieldBlank(theField) 
		{
		        if(theField.value == "")
		                return true;
		        else
		                return false;
		}
		
		//////////////////////////////////////////////////////////////////////////////////////////////////	
		//////////////////////////////////////////////////////////////////////////////////////////////////
		///////////////////  A VALIDATION FUNCTION FOR PHONE TEXT FIELDS /////////////////////////////////
		//////////////////////////////////////////////////////////////////////////////////////////////////
			    function isPhone(theField) 
				{
			        var inStr = theField.value;
			        var inLen = inStr.length;
					
			           for(var i=0; i<inLen; i++) 
					   {
			                var ch = inStr.substring(i,i+1)
			                if ( ch == "1" || ch == "2" || ch == "3" || ch == "4" || ch == "5" || ch == "6" || ch == "7" || ch == "8" || ch == "9" || ch == "0" || ch == "-" || ch == "(" || ch == ")" )
							{
								return true;
							}
			                   
			     	   }
				return false;
				}
				
		///////////////////////////////////////////////////////////////////////////////////////////////////	
//////////////////////////////////////////////////////////////////////////////////////////////////
//////////////  REPLACE FUNCTION FOR SPECIAL PROBLEMATIC CHARACTERS LIKE -  //////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////
var replace1;
var replace2;
	
replace1 = '"';
replace2 = "'";

function fixFields(form)
{
	var j;
	for (j=0 ; j<form.length ; j++)
	{
		form[j].value = replace(form[j].value,replace1,'``');
		form[j].value = replace(form[j].value,replace2,'`');
		form[j].value = replace(form[j].value,'<','');
		form[j].value = replace(form[j].value,'>','');
	}
}

function replace(string,text,by) 
{
	// Replaces text with by in string
    var strLength = string.length, txtLength = text.length;
    if ((strLength == 0) || (txtLength == 0)) return string;

    var i = string.indexOf(text);
    if ((!i) && (text != string.substring(0,txtLength))) return string;
    if (i == -1) return string;

    var newstr = string.substring(0,i) + by;

    if (i+txtLength < strLength)
        newstr += replace(string.substring(i+txtLength,strLength),text,by);
    return newstr;
}
		
//////////////////////////////////////////////////////////////////////////////////////////////////	
///////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////// A VALIDATION FUNCTION FOR EMAILS TEXT FIELDS  ///////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////		
function isEmail(theField) {
	if(theField.value == "")
		{
                return false;
		}

        inStr = theField.value;
        inLen = inStr.length;
	var bA=false;


	   for(var i=0; i<inLen; i++)
	   {
		var ch = inStr.substring(i,i+1)
		if (ch == "@")
			bA=true;
	   }
	   
	   for(var i=0; i<inLen; i++)
	   {
		var ch = inStr.substring(i,i+1)
		if (ch == ".")
			bA=true;
	   }	   

	   if (bA==false)
	   {
		   return false;
	   }

           for(var i=0; i<inLen; i++)
	   {
                var ch = inStr.substring(i,i+1)
                if ((ch >= "a" && "z" >= ch))
				{
					return true;
				}
				else
				{
					return false;
				}
            }
	return true;
}
		
//////////////////////////////////////////////////////////////////////////////////////////////////	
