var ajax = new Array();
function showhint(str,root)
{
	//alert(root);
  var index = ajax.length;
	ajax[index] = new sack();
		
	ajax[index].requestFile = root+'portfolio/showimg/'+str;
  
		// Specifying which file to get;
	ajax[index].onCompletion = function(){ createExistingBrochureList(index,str) };	// Specify function that will be executed after file has been found
	ajax[index].runAJAX();		// Execute AJAX function
}
function createExistingBrochureList(index,str)
{
	//var obj = document.getElementById('existingPicture');
	document.getElementById(str).innerHTML=ajax[index].response;
}
function showhint1(str,root)
{
	//alert(root);
  var index = ajax.length;
	ajax[index] = new sack();
		
	ajax[index].requestFile = root+'portfolio/showimg1/'+str;
  
		// Specifying which file to get;
	ajax[index].onCompletion = function(){ createExistingBrochureList1(index,str) };	// Specify function that will be executed after file has been found
	ajax[index].runAJAX();		// Execute AJAX function
}
function createExistingBrochureList1(index,str)
{
	//var obj = document.getElementById('existingPicture');
	document.getElementById(str).innerHTML=ajax[index].response;
}
function slideshow(str,root)
{
	//alert(root);
	var index = ajax.length;
	ajax[index] = new sack();
	ajax[index].requestFile = root+'portfolio/slideshow/'+str;
	ajax[index].onCompletion = function(){ slideshow1(index) };
	ajax[index].runAJAX();	
}
function slideshow1(index)
{
	var Divobj = document.getElementById('slideDiv');
	//alert(ajax[index].response);
	Divobj.innerHTML = '';
	Divobj.innerHTML=ajax[index].response;
	function startSlideshow() {
		var slideshow = new timedSlideShow($('mySlideshow'), mySlideData);
	}
	addLoadEvent(startSlideshow);
	
}
function flvplay(str,root,flvtype)
{
//   alert(str);
//   alert(root);
//   alert(flvtype);
	
	if(flvtype != '') var ft = '/'+flvtype;
	////////show hide data
	if(document.getElementById) {
		var shDV = document.getElementById('flvplaydiv');
		var hdDV = document.getElementById('rendID');
	} else if (document.all){
		var shDV = document.all['flvplaydiv'];
		var hdDV = document.all['rendID'];
	}
	hdDV.innerHTML = '';
	hdDV.style.display ='none';	
	shDV.style.display ='block';
	
  // css changes
  toggle(str);
	//
		 		
	var index = ajax.length;
	ajax[index] = new sack();
	ajax[index].requestFile = root+'portfolio/play/'+str+ft+ new  Date().getTime();
	ajax[index].onCompletion = function(){ flvplay1(index) };
	ajax[index].runAJAX();	
}

function flvplay1(index)
{
	//alert(ajax[index].response);
  document.getElementById('flvplaydiv').innerHTML=ajax[index].response;
	// for scrollinh
	new Effect.ScrollTo('outerDiv',{duration:1.0}); return false;
}


function flvPlayHome(str,root,flvtype)
{
// 	 alert(str);
// 	 alert(root);
// 	 alert(flvtype);
	 
	toggle (str);
	if(flvtype != '') var ft = '/'+flvtype;
	/////////show hide data
	if(document.getElementById) {
		var shDV = document.getElementById('flvplaydiv');
		var hdDV = document.getElementById('rendID');
	} else if (document.all){
		var shDV = document.all['flvplaydiv'];
		var hdDV = document.all['rendID'];
	}
	hdDV.innerHTML = '';
	hdDV.style.display ='none';	
	shDV.style.display ='block';

	var index = ajax.length;
	ajax[index] = new sack();
	//ajax[index].requestFile = root+'welcome/FLVplay/'+str+ft+ new  Date().getTime();
	ajax[index].requestFile = root+'welcome/FLVplay/'+str+ft+ new  Date().getTime();
	ajax[index].onCompletion = function(){ flvPlayHomeInn(index) };
	ajax[index].runAJAX();	
}

function flvPlayHomeInn(index)
{
	document.getElementById('flvplaydiv').innerHTML=ajax[index].response;
	// for scrollinh
	new Effect.ScrollTo('outerDiv',{duration:1.0}); return false;
}


function getClientProjects(root,sel)
{
  var client = sel.options[sel.selectedIndex].value;
  document.getElementById('v_projects').options.length = 0;	
  document.getElementById('v_projects').style.display='block';
  var index = ajax.length;
  ajax[index] = new sack();		
  ajax[index].requestFile = root+'clients/get_client_projects/'+client;
  ajax[index].onCompletion = function(){ createClientProjects(index) };	
  ajax[index].runAJAX();
}

function createClientProjects(index)
{
  var obj = document.getElementById('v_projects');
	eval(ajax[index].response);
}


function setProjSess(root,thisID)
{
// 		alert(root);
// 		alert(thisID);
    var index = ajax.length;
		ajax[index] = new sack();
		ajax[index].requestFile = root+'portfolio/testIt/'+thisID;
		// Specifying which file to get;
		ajax[index].onCompletion = function(){ createSess(index,thisID) };	
    // Specify function that will be executed after file has been found
		ajax[index].runAJAX();		// Execute AJAX function
}

function createSess(index,ID)
{
//  	var obj = document.getElementById(ID);
//   	alert (ajax[index].response);
//  	document.getElementById('projID').value=ajax[index].response;
}
