/* Javascript file for common admin functions
	AMW
 */

 /* LIST OF FUNCTION
 function popupWindow(url, f_width, f_height,f_resizable,f_scrollbars,winname)
(Pops up window with the url, width, height, scrollbars and resizable specified)

function confirmAction(message)
(Display a confirmation with the supplied message)
 */
 
 
function popupWindow(url, f_width, f_height,f_resizable,f_scrollbars,winname)
{	
	//Set width and height if not specified
	if (f_width==-1)	
		f_width=screen.width-40;
	
	if (f_height==-1)	
		f_height=screen.height-120;
		
	var f_left=0, f_top=0;
    if(screen){
        f_left=(screen.width-f_width)/2;
        f_top=((screen.height-f_height)/2)-30;
		if(f_top<0)
			f_top=0;
		
    } 
   return popup=open(url, winname, 'resizable='+f_resizable+',scrollbars='+f_scrollbars+',width='+f_width+',height='+f_height+',left='+f_left+',top='+f_top);
}

function confirmAction(message) {
if (confirm(message)) 
{
	return true;
}
else
	return false;
}

//- Detecting the Flash Plugin
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) { 
	plugin = parseInt(plugin.description.substring(plugin.description.indexOf(".")-1)) >= 3;
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
   && (navigator.userAgent.indexOf("Windows")>=0 )) {
	document.write('<SCRIPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('plugin = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3")))\n');
	document.write('</SCRIPT\> \n');
}


function showflash(Flash_File,Image_File,I_width,I_height,I_name,I_alt,l_align,l_pstext){
if (plugin)
	{
	if(I_width==0){
display='<embed name="'+I_name+'"src="'+(Flash_File)+'" quality=high pluginspage="'+
'http://www.macromedia.com/shockwave/download/index.cgi?'+
'P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" loop="true" scale="noborder"'+
'wmode="opaque" align="'+l_align+'" '+l_pstext+'>';	
	}
	else
	{
display='<embed name="'+I_name+'"src="'+(Flash_File)+'" quality=high pluginspage="'+
'http://www.macromedia.com/shockwave/download/index.cgi?'+
'P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash"'+
'width="'+(I_width)+'" height="'+I_height+'" loop="true" scale="noborder"'+
'wmode="opaque" align="'+l_align+'" '+l_pstext+'>';	
}
	}
  else
	{
display='<img alt="'+I_alt+'"+name="'+I_name+'"src="'+Image_File+'" width="100" height="100">'
	}

document.write(display);	
 }

function positionLogo(thisPosOffset){
	var logoStartLeft = (document.body.clientWidth/2) - 135 + thisPosOffset;	
	document.getElementById("franchiseDivLeft").style.left=logoStartLeft+'px';
	document.getElementById("franchiseDivLeft").style.display='block';	
}

