function initialiseBanners(){
	leftBanner = document.getElementById('divLeftBanner');
	content = document.getElementById('divContent');
	body = document.getElementById('tempBody');

	leftBanner.style.height = (document.body.clientHeight - 150)+ 'px';
	content.style.height = (document.body.clientHeight - 150)+ 'px';
	content.style.width = (document.body.clientWidth - 165)+ 'px';	
	
	body.onresize = function() {
		leftBanner.style.height = (document.body.clientHeight - 150)+ 'px';
		content.style.height = (document.body.clientHeight - 150)+ 'px';
		content.style.width = (document.body.clientWidth - 165)+ 'px';
	}		
}


currentNo = 0;   //denote unassigned
TOT_IMAGES = 4;


function PhoneModelChanged(){			
	var samsung = new Array("D500","D600","ZV50","Z540V");
	var nokia = new Array("6151","6230","6280","6680","N73");
	var erickson = new Array("K750i","K300i","K800i");
	var imate = new Array("K-Jam");
	var htc = new Array("TYTN");

	var phoneModels = new Array(samsung,nokia,erickson,imate,htc);
	
	selPhoneMakeElement = document.getElementById('selPhoneMake');
	selPhoneModelElement = document.getElementById('selPhoneModel');
	tmpModels = "";
	
	//remove all models in list		
	while (selPhoneModelElement.hasChildNodes())
	{
		selPhoneModelElement.removeChild(selPhoneModelElement.firstChild);
	}
	
	
	if(selPhoneMakeElement.selectedIndex > 0){
		for(i=0;i<phoneModels[selPhoneMakeElement.selectedIndex -1].length; i++){
			opt = document.createElement("option");
			optText = document.createTextNode((phoneModels[selPhoneMakeElement.selectedIndex -1])[i]);
			opt.appendChild(optText);
			selPhoneModelElement.appendChild(opt);
		}			
	}
}



function tempo(){	
	var tmpMarqueDiv = document.getElementById('divMarque');
	text = tmpMarqueDiv.innerText;	
	var tmpStr = "";
	var index = 0;
	
	while (tmpMarqueDiv.hasChildNodes())
	{
		tmpMarqueDiv.removeChild(tmpMarqueDiv.firstChild);
	}
		
	addNextChar(text, index);
	
}
	

function addNextChar(text, index){					
		if(index < text.length){			
			tmpMarqueDiv.innerText += text.charAt(index);
			index++;			
		}
		
		setTimeout('addNextChar(text, index)',1000);			
}	
	
function dislayGaleryImage(imgTag,show){
	imgPlaceHolder = document.getElementById('imgGalleryDisp');
	imageThumbails = document.getElementById('tblGallery').getElementsByTagName('img');
	var pathParts = imgTag.getAttribute('src').split('/');  //split the image path		
	var imgFileName = pathParts[pathParts.length - 1];   //get the thumbnail file name
	lastpos = imgTag.getAttribute('src').indexOf('thumbnail');
	
	if(show == true){				
		bigImagePath = imgTag.getAttribute('src').substring(0,lastpos) + imgFileName;
		imgPlaceHolder.src = bigImagePath;
		imgPlaceHolder.setAttribute("src",bigImagePath);		
		imgTag.style.border = "2px solid blue";
		for(i=0; i<imageThumbails.length; i++){
			if(imageThumbails[i] != imgTag){				
				imageThumbails[i].style.border = "0px solid blue";
			}
		}	
	}
	else{
		//imgTag.setAttribute('border','0');
		//imgPlaceHolder.setAttribute('src',imgGalleryPlaceHolder);
	}
	
}



