/* 
-----------------------------------------------------------------
	biz2328
	init.js
	
	Launch onload functions

	Created 02.10.2007 by DS
	Last Updated: See SVN	
	
	Includes these updates:	
	* Safari onload() fix 16.08.2007
-----------------------------------------------------------------
*/

//	Global Editable Variables

	var global_required_flash_version = 9; // v9 reqd for top right 'fullscreen' button functionality
	var global_latest_flash_version = 10;	
	var global_flash_bgcolor = '#666666';


// Trigger conditional functions
	
	var bodyClass; // also for moveFooter which is also called onresize
	var bodyId; // also for moveFooter which is also called onresize
	
	function init()
	{		
		if (whichbrowser.isHiFi)
		{	
			bodyClass = (document.body.className ? document.body.className : '');
			bodyId = (document.body.id ? document.body.id : '');			
		
			if ((whichbrowser.isSafari) && (whichbrowser.versionMinor < 522))
			{
				// if not Safari 3+ [reverse logic ;)]
			}
			else
			{
				enhanceForm();						
			}
			
			createImgRollovers();		
			
			moveFooter();
	
			// Help page:
			// inlineJavascriptTest();
			// inlineFlashTest();
			
			// Pop ups:
			
			checkIfPopup();			
			
			// linksToPopups() parameters: string to search hrefs for, popup width, popup height, scrollbars yes/no
			// 31.07.2008: popup widths increased by 30px to handle larger byline image
			linksToPopups('contact.php', 470, 600, 'yes');
			linksToPopups('terms.htm', 470, 600, 'yes');			
			linksToPopups('personalise-bizmo.htm', 600, 400, 'no');				
			
			if (bodyClass == 'popup')
			{
				insertPopUpCloser();	
				changeBackLinkToCloseLink();
			}
			makeFauxLinks();
			
			if (bodyId == 't-index')
			{
				generateFlash('t-index', '/resources/ui/media/', 'loader.swf', '100%', '100%', 'tab1=../../../blog.htm&amp;tab2=../../../order.php', '', ''); // flashvars aren't working				
			}
		}
	}	
	
	function dantest()
	{
		urlVar = getUrlHref();
		
		if (urlVar == 'test')
		{
			designDiv = document.createElement('div');
			designDiv.id = 'design';
			
			document.body.appendChild(designDiv);	
		}
	}
	
	function getUrlHref()
	{
		str = window.location.href;
		
		if (str.indexOf("?") != -1)
		{
			start = str.indexOf("?") + 1;
			end = str.length;
			return(str.substring(start, end));
		}
	}
	
//	ONLOAD Actions	

	window.onload = init;
	
//	ONRESIZE Actions		
	
	window.onresize = function() { if (whichbrowser.isHiFi) { moveFooter();} };	
