﻿/*deltathree @ 2011*/
$(document).ready(function()
{ 	
	if(top.parent.frames.length>0)
	{ 
		var filePath = document.location.pathname;
	        var fileName = filePath.substr(filePath.lastIndexOf("/") + 1);	        
		switch(fileName)
		{
			case 'phoenix.zhtml':				
				$("#header").hide();
			        $("#headerImgSingle").hide();
			        $("#breadCrumbs").hide();
			        $(".toolbar").hide();
				$(".footer").hide();
				$(".mainArea").css('width', '90%');
				$(".mainArea").show();
				break;
		}
	}	
	document.body.style.display="block";
	//_replaceFramedLinks();
});

function _replaceFramedLinks()
{	
	$('a[href^="http://www.deltathree.com"]').each(function() { 
            $(this).attr('href', $(this).attr('href').replace("http://www.deltathree.com/", "http://www.deltathree.com/corporate/"));
            $(this).attr('target', '_parent');            
            if($(this).attr('href').indexOf('solutions.aspx')>0){
                $(this).attr('href', $(this).attr('href').replace("solutions.aspx", "Solutions-business-consumer-voip-services.aspx"));
            }else if($(this).attr('href').indexOf('hosted_consumer_VoIP_Solution.aspx')>0){
                $(this).attr('href', $(this).attr('href').replace("hosted_consumer_VoIP_Solution.aspx", "Hosted-customized-voip.aspx"));
            }else if($(this).attr('href').indexOf('resellers_overview.aspx')>0){
                $(this).attr('href', $(this).attr('href').replace("resellers_overview.aspx", "Resellers.aspx"));
            }else if($(this).attr('href').indexOf('consumers_overview.aspx')>0){
                $(this).attr('href', $(this).attr('href').replace("consumers_overview.aspx", "Brands-iconnecthere-joip.aspx"));
            }
        });
}
