function initPage() {

	
	strLocation = new String(document.location.href);
	strLocation = strLocation.split("/") 
	strPage = strLocation[strLocation.length-1];
	strLocation = strLocation[2];
	switch (strLocation){
		case "alphawww.patriotinsuranceco.com":
		case "alphasecure.patriot.com":
			strSecLocation = "http://alphasecure.patriotinsuranceco.com";
			strWebLocation = "http://alphawww.patriotinsuranceco.com";
		break
		case "devlwww.patriotinsuranceco.com":
		case "isoldev.patriotinsuranceco.com":
			strSecLocation = "http://isoldev.patriotinsuranceco.com";
			strWebLocation = "http://devlwww.patriotinsuranceco.com";
		break		
		case "qawww.patriotinsuranceco.com":
		case "isoldv2.patriotinsuranceco.com":
		case "isolqa.patriotinsuranceco.com":
			strSecLocation = "http://isoldqa.patriotinsuranceco.com";
			strWebLocation = "http://qawww.patriotinsuranceco.com";
		break
		default:
			strSecLocation = "https://secure.patriotinsuranceco.com";
			strWebLocation = "http://www.patriotinsuranceco.com";
		break
	}

   for (i=0;i<document.links.length;i++) 
   	{
   		linkString = new String(document.links[i].href);
		splitLink = linkString.split("/");
		newhref = linkString;
		if(splitLink[2] == "www.patriotinsuranceco.com")
		{
			newhref = strWebLocation;
			for(j=3;j<splitLink.length;j++)
				newhref = newhref + "/" + splitLink[j];
		}else{	
			if(splitLink[2] == "tsecure.patriotinsuranceco.com")
			{
				newhref = strSecLocation;
				for(j=3;j<splitLink.length;j++)
					newhref = newhref + "/" + splitLink[j];
			}
		}
		document.links[i].href = newhref;
   	}
	
	var args = initPage.arguments;


	if(parent.document.location != document.location)
	{
		parent.checkSize();
		parent.setSideImage(args[0],args[1],args[2]);
	}else{
		setSideImage(args[0],args[1],args[2]);
	}
	

}
	
function setSideImage(strImage,strAlt,strAlignment)
{	
	if(strImage != "")
		document.getElementById('sideImage').src = strImage;
	else
		document.getElementById('sideImage').src = 'images/side_space.gif';
	document.getElementById('sideImage').alt = strAlt;

}

function switchSide(strImage)
{
	if(strImage != "")
		document.getElementById('sideImage').src = strImage;
	else
		document.getElementById('sideImage').src = 'images/side_space.gif';
}
function checkSize()
{

    var cf;
    var newHeight;
	var newWidth;
	var url;
    if(contentFrame.document != null)
    {
        //ie style browser
        cf = contentFrame.document;
        newHeight = cf.body.scrollHeight;
        newWidth = cf.body.scrollWidth;
        url = cf.location.href;    
    }
    else
    {
        //mozilla style browser
        cf = contentFrame.contentDocument;
        newHeight = cf.documentElement.scrollHeight;
        newWidth = cf.documentElement.scrollWidth;

        url = cf.location.href;  
        document.getElementById("sideImageBox").style.height = parseInt(newHeight)-290; 
  
    }



	if(parseInt(newHeight) >  590 )
		document.getElementById("contentFrame").style.height = (parseInt(newHeight));  
	else
		document.getElementById("contentFrame").style.height = 600; 

	if(parseInt(newWidth) > 0)
	{
		//added 2-25-08 AR code to handle .net aspx pages 
		if(url.match("aspx"))
		{
			document.getElementById("contentFrame").style.width = 820;
		}
		else
		{		
			if (url.indexOf('index2.html') > 0 || url.indexOf('business_safety_services.html') > 0)
			{
				document.getElementById("contentFrame").style.width = 600;
			}
			else
				document.getElementById("contentFrame").style.width = (parseInt(newWidth)+10)
		}
	}

}
