//v1.7
// Flash Player Version Detection
// Detect Client Browser type
// Copyright 2005-2007 Adobe Systems Incorporated.  All rights reserved.
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;

function ControlVersion()
{
	var version;
	var axo;
	var e;

	// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry

	try {
		// version will be set for 7.X or greater players
		axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		version = axo.GetVariable("$version");
	} catch (e) {
	}

	if (!version)
	{
		try {
			// version will be set for 6.X players only
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
			
			// installed player is some revision of 6.0
			// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
			// so we have to be careful. 
			
			// default to the first public version
			version = "WIN 6,0,21,0";

			// throws if AllowScripAccess does not exist (introduced in 6.0r47)		
			axo.AllowScriptAccess = "always";

			// safe to call for 6.0r47 or greater
			version = axo.GetVariable("$version");

		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 4.X or 5.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = axo.GetVariable("$version");
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 3.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = "WIN 3,0,18,0";
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 2.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			version = "WIN 2,0,0,11";
		} catch (e) {
			version = -1;
		}
	}
	
	return version;
}

// JavaScript helper required to detect Flash Player PlugIn version information
function GetSwfVer(){
	// NS/Opera version >= 3 check for Flash plugin in plugin array
	var flashVer = -1;
	
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
			var descArray = flashDescription.split(" ");
			var tempArrayMajor = descArray[2].split(".");			
			var versionMajor = tempArrayMajor[0];
			var versionMinor = tempArrayMajor[1];
			var versionRevision = descArray[3];
			if (versionRevision == "") {
				versionRevision = descArray[4];
			}
			if (versionRevision[0] == "d") {
				versionRevision = versionRevision.substring(1);
			} else if (versionRevision[0] == "r") {
				versionRevision = versionRevision.substring(1);
				if (versionRevision.indexOf("d") > 0) {
					versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
				}
			}
			var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
		}
	}
	// MSN/WebTV 2.6 supports Flash 4
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
	// WebTV 2.5 supports Flash 3
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
	// older WebTV supports Flash 2
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
	else if ( isIE && isWin && !isOpera ) {
		flashVer = ControlVersion();
	}	
	return flashVer;
}

// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
{
	versionStr = GetSwfVer();
	if (versionStr == -1 ) {
		return false;
	} else if (versionStr != 0) {
		if(isIE && isWin && !isOpera) {
			// Given "WIN 2,0,0,11"
			tempArray         = versionStr.split(" "); 	// ["WIN", "2,0,0,11"]
			tempString        = tempArray[1];			// "2,0,0,11"
			versionArray      = tempString.split(",");	// ['2', '0', '0', '11']
		} else {
			versionArray      = versionStr.split(".");
		}
		var versionMajor      = versionArray[0];
		var versionMinor      = versionArray[1];
		var versionRevision   = versionArray[2];

        	// is the major.revision >= requested major.revision AND the minor version >= requested minor
		if (versionMajor > parseFloat(reqMajorVer)) {
			return true;
		} else if (versionMajor == parseFloat(reqMajorVer)) {
			if (versionMinor > parseFloat(reqMinorVer))
				return true;
			else if (versionMinor == parseFloat(reqMinorVer)) {
				if (versionRevision >= parseFloat(reqRevision))
					return true;
			}
		}
		return false;
	}
}

function AC_AddExtension(src, ext)
{
  if (src.indexOf('?') != -1)
    return src.replace(/\?/, ext+'?'); 
  else
    return src + ext;
}

function AC_Generateobj(objAttrs, params, embedAttrs) 
{ 
  var str = '';
  if (isIE && isWin && !isOpera)
  {
    str += '<object ';
    for (var i in objAttrs)
    {
      str += i + '="' + objAttrs[i] + '" ';
    }
    str += '>';
    for (var i in params)
    {
      str += '<param name="' + i + '" value="' + params[i] + '" /> ';
    }
    str += '</object>';
  }
  else
  {
    str += '<embed ';
    for (var i in embedAttrs)
    {
      str += i + '="' + embedAttrs[i] + '" ';
    }
    str += '> </embed>';
  }

  document.write(str);
}

function AC_FL_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_SW_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
     , null
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    

    switch (currArg){	
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie":	
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblclick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "codebase":
      case "id":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "width":
      case "height":
      case "align":
      case "vspace": 
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}
function isValidEmail(emailId) 
{
    if (emailId.toLowerCase().search(/^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/) != -1)
        return true;
    else
        return false;
}
var sessionExpirationTimerId;
window.onerror = function(message, url, line)
{
    if (message == "'window.open(...)' is null or not an object")
    {
        alert('autofunds.com has detected that popups have been disabled, and is unable to open the requested page. Please make sure to always allow popups for this site. Once the popup blocker has been disabled, please try this request again.')
        GE_processingDisplayWindow(0);
    }
    else if(/MSIE (\d+\.\d+);/.test(navigator.userAgent))
    {
        var browser=navigator.appName;
        var b_version=navigator.appVersion;
        var version=parseFloat(b_version);
        var msg = "URL : " + url.replace(/&/g,'$');
        msg += " Line No : " + line ;
        msg += " Error : " + message;
        msg += " Browser name: " + browser;
        if (navigator.appVersion.indexOf("MSIE") != -1)    
            version = parseFloat(navigator.appVersion.split("MSIE")[1]); 
        msg += " Browser version: " + version;
        
        callAjaxPrime2('/aspx/xml/general/JSErrorHandler.aspx?JSError=' + msg , 'common_JSErrorHandler_CallBack' , 'errorFailure' )
    }
}
function common_JSErrorHandler_CallBack(xmlDoc)
{
    if( xmlDoc.getElementsByTagName('error')[0].firstChild.data == "OK" )
    {
        alert('There was an error while processing your request. The Technical Support Team has been notified. Please try the request later.');
    }
}
function AF_getEvent(e) {
    if (window.event){
        var e = window.event;
    }
    return e;
}
function $(strElementID){
	return document.getElementById(strElementID);
}


function addEvent( obj, type, fn ) {
  if ( obj.attachEvent ) {
    obj['e'+type+fn] = fn;
    obj[type+fn] = function(){obj['e'+type+fn]( window.event );}
    obj.attachEvent( 'on'+type, obj[type+fn] );
  } else
    obj.addEventListener( type, fn, false );
}
function removeEvent( obj, type, fn ) {
  if ( obj.detachEvent ) {
    obj.detachEvent( 'on'+type, obj[type+fn] );
    obj[type+fn] = null;
  } else
    obj.removeEventListener( type, fn, false );
}

// returns an array of width and height - cross browser compatible in strict and quirks mode
function getClientWidthHeight(){
  var myWidth = 0, myHeight = 0;
  if(typeof(window.innerWidth) == 'number'){
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  }else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)){
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  }else if(document.body && (document.body.clientWidth || document.body.clientHeight)){
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  return [myWidth,myHeight];
}

// returns an array of scrollTop/Left
function getScrollXY() {
  var scrOfX = 0, scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
    scrOfX = window.pageXOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
    scrOfX = document.body.scrollLeft;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
    scrOfX = document.documentElement.scrollLeft;
  }
  return [scrOfX, scrOfY];
}

// global mouse position
var AF_MouseX, AF_MouseY;

function getMousePos(e){
    if (!e)
    var e = window.event||window.Event;
    
    if('undefined' != typeof e.pageX){
        AF_MouseX = e.pageX;
        AF_MouseY = e.pageY;
    }else{
        AF_MouseX = e.clientX + getScrollXY()[0]; //document.body.scrollLeft;
        AF_MouseY = e.clientY + getScrollXY()[1]; //document.body.scrollTop;
    }
}
// You need to tell Mozilla to start listening:
if(window.Event && document.captureEvents){ document.captureEvents(Event.MOUSEMOVE); }
// Then assign the mouse handler
addEvent(document,'mouseover',getMousePos);

function getKeyCode(e){
    if (!e)
    var e = window.event||window.Event;
    if (e.target) targ = e.target;
	else if (e.srcElement) targ = e.srcElement;
	if(targ.id == 'myPopup_Login_Password' && e.keyCode == 13)
	{
	    if (e.stopPropagation)
	    {	        
		    e.stopPropagation();
		    e.preventDefault();
	    }
	    else
	    {
	        e.returnValue=false;
            e.cancel = true;
        }
        if(/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)){}
        else { $('img_myPopup_Login_Submit').click(); }
	}
}
// You need to tell Mozilla to start listening:
if(window.Event && document.captureEvents){ document.captureEvents(Event.KEYDOWN); }
// Then assign the keydown handler
addEvent(document,'keydown',getKeyCode);

function clone(obj)
{
    if(obj == null || typeof(obj) != 'object')
        return obj;
    var temp = obj.constructor();
    for(var key in obj)
        temp[key] = clone(obj[key]);
    return temp;
}
function getCookieValue(cookieName,key)
{
    var results = document.cookie.match ( '(^|;) ?' + cookieName + '=([^;]*)(;|$)' );
    if(results)
    {
        results = unescape(results[2]);
        var values = results.split('&');
        var value;
        for(var i=0; i<values.length; i++)
        {
            value = values[i].split('=');
            if(value.length == 2)
            {
                if(value[0] == key)
                {
                    if(values[i].split('=')[1] == null || values[i].split('=')[1] == 'undefined')
                    {
                        window.location.href='/ASPX/common/SessionExpiration.aspx';
                    }
                    else
                    {
                        return values[i].split('=')[1];
                    }
                }
            }
        }        
        window.location.href='/ASPX/common/SessionExpiration.aspx';
    }
    else
    {
        window.location.href='/ASPX/common/SessionExpiration.aspx';
    }
}
// isValidDate( month, day, year) --> returns [true] || [a string which is the error]

// noSpecialChar	(object)
// noSpecialChar2	(object)
// noNumbers		(object)
// onlyNumbers		(object)
// onlyNumbersNoDec	(object) 

//---------------------------------------
function gotoFocus ( objID ) {
	if ( objID.length >  0 ) { 
		if( document.getElementById(objID) ) { 	document.getElementById(objID).focus() ;  } 
	} 
}

//---------------------------------------
function isValidDate( month, day, year) {
	month = parseInt(month,10) ; day = parseInt(day,10) ; year = parseInt(year,10) ; 
	if ( ( month == "" || day == "" || year == "" ) || (isNaN(month)||isNaN(day)||isNaN(year)) )	{ return ("Not a valid date -->\n") ; }
	else if ( (month > 12 ) || isNaN(month) ) 		{ return ("Not a valid month \n") ;}
	else if ( (day > 31 ) || isNaN(day) ) 			{ return ("Not a valid date \n") ;}
	else if ( (year<1900)||(year>2080) ) 			{ return ("Not a valid year \n") ;}
	else	{
		var arrDate = new Array("0","31","28","31","30","31","30","31","31","30","31","30","31")    
		if ( month != 2)	{
			if ( day > parseInt(arrDate[month]) ) {
				return ("The date selected should be less than or equal to " + arrDate[month].toString() + " in " + myGetMonth(month).toString() + "--> \n")
			}
		}
		else	{
			if ((year % 4) == 0)	{
				if( day > 29 )	{ return ( "The date selected should be less than or equal to 29 in February, " + year + " -->\n" ) }
			}			
			else if( day > 28) { return (" The date selected should be less than or equal to 28 in February, " + year + " -->\n") }
		}
	}
	
	return true ;
		
	function myGetMonth( int ) {
		int = parseInt(int)
		var monthIndex = new Array ( 2 )
		monthIndex[0] = new Array ( 1,2,3,4,5,6,7,8,9,10,11,12 )
		monthIndex[1] = new Array ( "January",'Febuary','March','April','May','June','July','August','September','October','November','December' )
		for ( q = 1 ; q!=12 ; ++q ) {
			if ( int == monthIndex[0][q] ) {
				return ( monthIndex[1][q] )
			}
		}
		return ( "" )
	}

}

function selectValueSet(selectName, value) {
    eval('selectObject = document.getElementById("' + selectName + '");');
    for(i=0; i<selectObject.length; i++)
    {
        if(selectObject[i].value == value)
        {
            selectObject.selectedIndex = i;
            break;
        }
    }
}

function GetPagingLinks(intCurrentPage, intPageSize, intTotalRows, strJSFunctionName)
{
    var numVeh = intTotalRows;
    var currentPage = intCurrentPage;
    var getPageLinksURL = "";
    var VehPerPage = intPageSize;

    var TotalPages_Count = (Math.floor(numVeh / VehPerPage)) + 1;
    if((numVeh % VehPerPage) == 0 &&  numVeh != 0){
        TotalPages_Count -= 1;
    }

    if(currentPage > 0){
        getPageLinksURL += "<a href='javascript:void(0);' onclick='" + strJSFunctionName + "(0)'>First Page</a>";
        getPageLinksURL += " | ";
        getPageLinksURL += "<a href='javascript:void(0);' onclick='" + strJSFunctionName + "(" + (currentPage - 1) + ")'>Previous</a>";
        getPageLinksURL += " | ";
    }

    var Npg, n_First, n_Last, myText;
    Npg = Math.max(0, (currentPage - 2));

    var N;
    for(N = 0; N <= 4; N++){

        if(Npg < TotalPages_Count){
            if(N != 0){
                getPageLinksURL += " | ";
            }
            n_First = (Npg * VehPerPage) + 1;
            n_Last = Math.min((n_First + VehPerPage) - 1, numVeh);
            if(n_First == n_Last){
                myText = n_First;
            }else{
                myText = n_First + " - " + n_Last;
            }

            if(currentPage == Npg){
                getPageLinksURL += myText + " of " + numVeh + " ";
            }else{
                getPageLinksURL += "<a href='javascript:void(0);' onclick='" + strJSFunctionName + "(" + Npg + ")'>" + myText + "</a>";
            }
        }
        Npg += 1;
    }

    if(currentPage != (TotalPages_Count - 1)){
        getPageLinksURL += " | ";
        getPageLinksURL += "<a href='javascript:void(0);' onclick='" + strJSFunctionName + "(" + (currentPage + 1) + ")'>Next Page</a>";
        getPageLinksURL += " | ";
        getPageLinksURL += "<a href='javascript:void(0);' onclick='" + strJSFunctionName + "(" + (TotalPages_Count - 1) + ")'>Last Page</a>";
    }
    return getPageLinksURL;   
}

function checkAllCheckBoxes(tableId){
    if (document.getElementById(tableId) != null) {
        var objInputs = document.getElementById(tableId).getElementsByTagName("input");
        for(var i=0; i<objInputs.length; i++)
        {
            if (objInputs[i].type == 'checkbox')
            {
                objInputs[i].checked = 'checked';
            }
        }
        
    }
}

function uncheckAllCheckBoxes(tableId) {
    if (document.getElementById(tableId) != null) {
        var objInputs = document.getElementById(tableId).getElementsByTagName("input");
        for(var i=0; i<objInputs.length; i++)
        {
            if (objInputs[i].type == 'checkbox')
            {
                objInputs[i].checked = '';
            }
        }
        
    }
}

function onlyNumbers(o) {
	if ( !isNaN(o.value) ){ return ; }

	var n = 0 , A, D ;
	while ( n < o.value.length ) {
		A = ( (o.value.charAt(n) >= '0' ) && (o.value.charAt(n) <= '9' ) )
		D =   (o.value.charAt(n) == '.' ) 
		if 	( A || D ) { ++n }
		else {
			if( n==0 ){ o.value = o.value.slice(n+1,o.value.length) }
			else if ( n == o.value.length) { o.value = o.value.slice(0,n-1) }
			else { 	o.value = o.value.slice(0,n) + o.value.slice(n+1,o.value.length) }
		}
		
	}
}
function onlyNumbersNoDec(o) {
	if ( !isNaN(o.value) ){
		return
	}

	var n = 0 , A, D ;
	while ( n < o.value.length ) {
		A = ( (o.value.charAt(n) >= '0' ) && (o.value.charAt(n) <= '9' ) )
		if 	( A ) { ++n }
		else {
			if( n==0 ){ o.value = o.value.slice(n+1,o.value.length) }
			else if ( n == o.value.length) { o.value = o.value.slice(0,n-1) }
			else { o.value = o.value.slice(0,n) + o.value.slice(n+1,o.value.length) }
		}
		
	}
}
function tableRowOver( obj , direction ) {
	if( direction == "1") {
		if( obj.className == "row_A") { 	obj.className = "row_A_u" }
		else if( obj.className == "row_B") { obj.className = "row_B_u" }
	}
	else if ( direction == "0") {
		if( obj.className == "row_A_u") { obj.className = "row_A" }
		else if( obj.className == "row_B_u") { obj.className = "row_B" }
	}
}

function fixRowFormating( tableID , val0 ) {
	var classValue = "row_A"
	
	for( var i = val0 ; i != document.getElementById(tableID).getElementsByTagName('tr').length ; ++i) {
		if (((document.getElementById(tableID).getElementsByTagName('tr')[i].style.display).length == 0 ) ||( (document.getElementById(tableID).getElementsByTagName('tr')[i].style.display).toLowerCase()  == "block"   )) {
			document.getElementById(tableID).getElementsByTagName('tr')[i].className = classValue
			if(classValue == "row_A") { classValue = "row_B" }
			else { classValue = "row_A" }
		}
		
	}
}

//used with 'onKeyPress' -------------
//Ex: onKeyPress="formatOnlyNumbersWithPeriod()"
function onKeyPressOnlyNumbersWithPeriod() {
    var event = AF_getEvent(window.event);
	if(event.keyCode <48 || event.keyCode>57) {
		if(event.keyCode != 46) {
			return event.returnValue = false;
		}
	}
	
}
function onKeyPressOnlyNumbers() {
    var event = AF_getEvent(window.event);
	if(event.keyCode <48 || event.keyCode>57) {
			return event.returnValue = false;
	}
	
}

function getObjOffsetPos(obj,mode) {
    var iPos = 0 ;
    while(obj.tagName != "BODY" && obj.tagName != "HTML") {
    if (mode == "L") { iPos += obj.offsetLeft; }
    else if(mode == "T") { iPos += obj.offsetTop; }
    obj = obj.offsetParent;
    }
    return iPos;
}

function clearRowsFromTable(tableID,KeeperRowNum ) {
	if ( document.getElementById(tableID) ) {
		var tbl = document.getElementById(tableID)
		var lastRow = tbl.rows.length;
		while(lastRow > KeeperRowNum) { tbl.deleteRow(lastRow - 1); lastRow = tbl.rows.length ; }
	}
}


//---------------------------------------
// Used to set the style for the new "Input.buttons"
function btn0(oThis,mode) {
	oThis.getElementsByTagName('IMG')[0].src = "/IMAGES/buttons/btn"+mode+"_L.gif"
	oThis.getElementsByTagName('IMG')[1].src = "/IMAGES/buttons/btn"+mode+"_R.gif"
	oThis.getElementsByTagName('TD')[1].className = "btn"+mode+"txt"
}


function trim(stringToTrim)
{
    stringToTrim = String(stringToTrim);
	return stringToTrim.replace(/^\s+|\s+$/g,"");
}    	

//Check for null values for double and integer..
function checkForMinVal(val,type)
{
   if (type == "double")
   {
        if (decRound(val) == decRound(-1.7976931348623157e+308))
           val = '';
   }             
   else if (type == "int")
   {
        if (val == -2147483648)
           val = '';
   }
   else if(type == "decimal")
   {
        if (val == -7.922816251426434e+28)
            val = '';
   }        
   return val;       
}


function getDollar(value)
{
    value = value + ''
    if (value.indexOf('-') == 0)
        value = "-" + "$" + value.replace(/-/,'');
    else
        value = "$" + value;
        
    return value;
}

function getCharCount(obj){
    if(typeof obj != 'object'){ obj = document.getElementById(obj); }
    return obj.value.length;
}

function getNumeric(str){  // returns a string.
    var alpha, code, newstr = '';
    for(var i = 0; i < str.length; ++i){
        alpha = str.charAt(i);
		code = alpha.charCodeAt(0);
		if((code > 47 && code<58)){
		    newstr += alpha;
		}
    }
    return newstr;
}

function getAlphaNumeric(str){  // returns a string.
    var alpha, code, newstr = '';
    for(var i = 0; i < str.length; ++i){
        alpha = str.charAt(i);
		code = alpha.charCodeAt(0);
		if((code > 47 && code<58) || (code > 64 && code<91) || (code > 96 && code<123)){
		    newstr += alpha;
		}
    }
    return newstr;
}

function only_AlphaNumeric(o){
	var n = 0 , A, D ;
	while (n < o.value.length){
		A = ((o.value.charAt(n) >= '0' ) && (o.value.charAt(n) <= '9' ) || ((o.value.charAt(n) >= 'A') && (o.value.charAt(n) <= 'Z')) || ((o.value.charAt(n) >= 'a') && (o.value.charAt(n) <= 'z')))
		if(A){ 
		    ++n; 
		}else{
			if(n==0){ o.value = o.value.slice(n+1,o.value.length); }
			else if(n == o.value.length) { o.value = o.value.slice(0,n-1); }
			else{ o.value = o.value.slice(0,n) + o.value.slice(n+1,o.value.length); }
		}
	}
}


function SetMouseoverClass(obj, mode)
{
    if(mode == 1){
        obj.className='comboOff';
    }else if(mode == 2){ obj.className='comboOn'; }
}


//------------------------------------------------------------------------------------------------------------------------------------------------
//Layered popup call while page is getting loaded

var GE_myPopup_IsPageLoaded = false     //this variable is reset in Global_Embeded.inc.htm
var GE_myPopup_invoked_function_param = '';   //this variable would have the param which identifies the user invoked layared popup start function.

function GE_myPopup_invoke_start_function(arg)
{
    if (GE_myPopup_IsPageLoaded)
    {
        GE_processingDisplayWindow(0);
        switch (arg)
        {
            case ('Tool_NADA') :
                myPopup_Nada_Load();
                break;
            case ('Tool_Galves') :
                myPopup_Galves_Load()
                break; 
            case ('Element_Settings') :
                myPopup_Element_Settings_Open2()
                break; 
            case ('postCraigsList') :
                myPopupManageInventory_Detail_PostCraigsList(myPopup_postCraigsList_iID,myPopup_postCraigsList_days);
                break;
            case ('postAd') :
                myPopupManageInventory_Detail_Post_PostAd(myPopup_PostAd_InventoryId,myPopup_PostAd_ProdCode,myPopup_PostAd_days);
                break; 
            case ('DealerFeedback') :
                GE_DealerFeedback_openPopup2();
                break; 
            case ('Tool_FedExShip') :
                myPopup_Fedex_Load();
                break; 
            case ('Tool_FedExTrack') :
                myPopup_Fedex_Tracker_Load();
                break; 
            case ('NewVehicle') :
                myPopup_ManageInventory_Detail_start(0);
                break;
            case ('EditVehicle_Direct') : //Inventory -> Inventory List -> Edit
                myPopup_ManageInventory_Detail_start(inventory_MainList_InventoryId, inventory_MainList_SequenceId);
                break; 
            case ('EditVehicle_Deal') : //Deal -> Inventory List -> Edit
                inventory_GetMainList_CheckPurchaseType(inventory_MainList_InventoryId, inventory_MainList_Vin, inventory_MainList_MilesOut);
                break;
            case ('Tool_CCRecharge') :
                myPopup_CreditCard_Charge_Load();
                break;  
             case ('Deal_Stage') :
                myPopup_ManageDeal_Stage_Load1(myPopup_ManageDeal_Stage_DealID);
                break;  
            case ('Form_Print') :
				startPrintPopup_main(GE_PrintForms_mode,GE_PrintForms_ButtonID ,GE_PrintForms_oBaseValueType ,GE_PrintForms_oBaseValueID , GE_PrintForms_FormNameQuery)
                break; 
            case ('NewCustomer') :
                myPopup_ManageCustomer_Detail_Start(0); 
                break;
            case ('EditCustomer_Direct') : //Customer -> Customer List -> Edit
                myPopup_ManageCustomer_Detail_Start(Customer_MainList_CustomerId, Customer_MainList_RowId);
                break; 
            case ('EditCustomer_Deal') : //Deal -> Customer List -> Edit
                customer_GetMainList_GoToDealsPage(Customer_MainList_CustomerId);
                break;
            case ('pageLoad_DisableVendorFields') : //myPopupv2_genericVendors-main.js
                pageLoad_DisableVendorFields_Main();
                break;
            case ('User_Manager') : //User management
                myPopup_ManageEmployee_openList(1);
                break;
        }
        GE_myPopup_invoked_function_param = '';
        //if(arg != 'EditVehicle_Direct' && arg != 'EditVehicle_Deal'){ GE_processingDisplayWindow(0); }
    }
    else
    {
        GE_myPopup_invoked_function_param = arg;
        GE_processingDisplayWindow(1);
    }
    

}

//to handle specifically for Element settings layered popup
var myPopup_Element_Settings_elementCode = '';  
function myPopup_Element_Settings_Open(elementCode)
{
    myPopup_Element_Settings_elementCode = elementCode;
    GE_myPopup_invoke_start_function('Element_Settings');
}

//to handle specifically for Craiglist link in inventory list screen
var myPopup_postCraigsList_days = '';  
var myPopup_postCraigsList_iID = '';  
function postCraigsList2(iID, days)
{
    GE_AlertWindow_3a();
    myPopup_postCraigsList_iID = iID;
    myPopup_postCraigsList_days = days;
    GE_myPopup_invoke_start_function('postCraigsList');
}
//to handle specifically for PostAd link in inventory list screen
var myPopup_PostAd_InventoryId = '';
var myPopup_PostAd_ProdCode = '';
var myPopup_PostAd_days = '';
function postPostAd(inventoryId,prodCode,days)
{
    GE_AlertWindow_3a();
    myPopup_PostAd_InventoryId = inventoryId;
    myPopup_PostAd_ProdCode = prodCode;
    myPopup_PostAd_days = days;
    GE_myPopup_invoke_start_function('postAd');
}
//to handle specifically for Inventory Edit link in inventory list screen
var inventory_MainList_InventoryId = '';
var inventory_MainList_SequenceId = '';
function common_inventory_MainList_EditInventory_Direct(invId, seqId)
{
    inventory_MainList_InventoryId = invId;
    inventory_MainList_SequenceId = seqId;
    GE_myPopup_invoke_start_function('EditVehicle_Direct');
}

/* to handle specifically for Inventory Edit link in inventory list screen 
for inventory selection from Deals page */
var inventory_MainList_Vin = '';
var inventory_MainList_MilesOut = '';
function common_inventory_MainList_EditInventory_Deal(invId, vin, milesOut)
{
    inventory_MainList_InventoryId = invId;
    inventory_MainList_Vin = vin;
    inventory_MainList_MilesOut = milesOut;
    GE_myPopup_invoke_start_function('EditVehicle_Deal');
}

//to handle specifically for Customer Edit link in Customer list screen
var Customer_MainList_CustomerId = '';
var Customer_MainList_RowId = '';
function common_Customer_MainList_EditCustomer_Direct(custId, rowId)
{
    Customer_MainList_CustomerId = custId;
    Customer_MainList_RowId = rowId;
    GE_myPopup_invoke_start_function('EditCustomer_Direct');
}

/* to handle specifically for Inventory Edit link in inventory list screen 
for inventory selection from Deals page */
function common_Customer_MainList_EditCustomer_Deal(custId)
{
    Customer_MainList_CustomerId = custId;
    GE_myPopup_invoke_start_function('EditCustomer_Deal');
}


/* Deal module - Deal Stage*/
var myPopup_ManageDeal_Stage_DealID = '';
function myPopup_ManageDeal_Stage_Load(id)
{
    myPopup_ManageDeal_Stage_DealID = id;
    GE_myPopup_invoke_start_function('Deal_Stage');
}


function startPrintPopup(mode,ButtonID,oBaseValueType,oBaseValueID,FormNameQuery)
{
    GE_PrintForms_mode 				= mode;
    GE_PrintForms_oBaseValueType  	= oBaseValueType;
    GE_PrintForms_oBaseValueID  	= oBaseValueID;
    GE_PrintForms_ButtonID   		= ButtonID;
    GE_PrintForms_FormNameQuery 	= FormNameQuery;
	GE_myPopup_invoke_start_function('Form_Print');
}


function pageLoad_DisableVendorFields()
{
    GE_myPopup_invoke_start_function('pageLoad_DisableVendorFields')
}



function GE_DealerFeedback_openPopup()
{
    GE_myPopup_invoke_start_function('DealerFeedback')
}
//------------------------------------------------------------------------------------------------------------------------------------------------


function CopytoClip(id)
{
    window.clipboardData.setData('Text' , $(id).value );
}

function isValidEmail(emailId) 
{

    if (emailId.toLowerCase().search(/^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/) != -1)
        return true;
    else
        return false;
}/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.7.0
*/
if(typeof YAHOO=="undefined"||!YAHOO){var YAHOO={};}YAHOO.namespace=function(){var A=arguments,E=null,C,B,D;for(C=0;C<A.length;C=C+1){D=(""+A[C]).split(".");E=YAHOO;for(B=(D[0]=="YAHOO")?1:0;B<D.length;B=B+1){E[D[B]]=E[D[B]]||{};E=E[D[B]];}}return E;};YAHOO.log=function(D,A,C){var B=YAHOO.widget.Logger;if(B&&B.log){return B.log(D,A,C);}else{return false;}};YAHOO.register=function(A,E,D){var I=YAHOO.env.modules,B,H,G,F,C;if(!I[A]){I[A]={versions:[],builds:[]};}B=I[A];H=D.version;G=D.build;F=YAHOO.env.listeners;B.name=A;B.version=H;B.build=G;B.versions.push(H);B.builds.push(G);B.mainClass=E;for(C=0;C<F.length;C=C+1){F[C](B);}if(E){E.VERSION=H;E.BUILD=G;}else{YAHOO.log("mainClass is undefined for module "+A,"warn");}};YAHOO.env=YAHOO.env||{modules:[],listeners:[]};YAHOO.env.getVersion=function(A){return YAHOO.env.modules[A]||null;};YAHOO.env.ua=function(){var C={ie:0,opera:0,gecko:0,webkit:0,mobile:null,air:0,caja:0},B=navigator.userAgent,A;if((/KHTML/).test(B)){C.webkit=1;}A=B.match(/AppleWebKit\/([^\s]*)/);if(A&&A[1]){C.webkit=parseFloat(A[1]);if(/ Mobile\//.test(B)){C.mobile="Apple";}else{A=B.match(/NokiaN[^\/]*/);if(A){C.mobile=A[0];}}A=B.match(/AdobeAIR\/([^\s]*)/);if(A){C.air=A[0];}}if(!C.webkit){A=B.match(/Opera[\s\/]([^\s]*)/);if(A&&A[1]){C.opera=parseFloat(A[1]);A=B.match(/Opera Mini[^;]*/);if(A){C.mobile=A[0];}}else{A=B.match(/MSIE\s([^;]*)/);if(A&&A[1]){C.ie=parseFloat(A[1]);}else{A=B.match(/Gecko\/([^\s]*)/);if(A){C.gecko=1;A=B.match(/rv:([^\s\)]*)/);if(A&&A[1]){C.gecko=parseFloat(A[1]);}}}}}A=B.match(/Caja\/([^\s]*)/);if(A&&A[1]){C.caja=parseFloat(A[1]);}return C;}();(function(){YAHOO.namespace("util","widget","example");if("undefined"!==typeof YAHOO_config){var B=YAHOO_config.listener,A=YAHOO.env.listeners,D=true,C;if(B){for(C=0;C<A.length;C=C+1){if(A[C]==B){D=false;break;}}if(D){A.push(B);}}}})();YAHOO.lang=YAHOO.lang||{};(function(){var B=YAHOO.lang,F="[object Array]",C="[object Function]",A=Object.prototype,E=["toString","valueOf"],D={isArray:function(G){return A.toString.apply(G)===F;},isBoolean:function(G){return typeof G==="boolean";},isFunction:function(G){return A.toString.apply(G)===C;},isNull:function(G){return G===null;},isNumber:function(G){return typeof G==="number"&&isFinite(G);},isObject:function(G){return(G&&(typeof G==="object"||B.isFunction(G)))||false;},isString:function(G){return typeof G==="string";},isUndefined:function(G){return typeof G==="undefined";},_IEEnumFix:(YAHOO.env.ua.ie)?function(I,H){var G,K,J;for(G=0;G<E.length;G=G+1){K=E[G];J=H[K];if(B.isFunction(J)&&J!=A[K]){I[K]=J;}}}:function(){},extend:function(J,K,I){if(!K||!J){throw new Error("extend failed, please check that "+"all dependencies are included.");}var H=function(){},G;H.prototype=K.prototype;J.prototype=new H();J.prototype.constructor=J;J.superclass=K.prototype;if(K.prototype.constructor==A.constructor){K.prototype.constructor=K;}if(I){for(G in I){if(B.hasOwnProperty(I,G)){J.prototype[G]=I[G];}}B._IEEnumFix(J.prototype,I);}},augmentObject:function(K,J){if(!J||!K){throw new Error("Absorb failed, verify dependencies.");}var G=arguments,I,L,H=G[2];if(H&&H!==true){for(I=2;I<G.length;I=I+1){K[G[I]]=J[G[I]];}}else{for(L in J){if(H||!(L in K)){K[L]=J[L];}}B._IEEnumFix(K,J);}},augmentProto:function(J,I){if(!I||!J){throw new Error("Augment failed, verify dependencies.");}var G=[J.prototype,I.prototype],H;for(H=2;H<arguments.length;H=H+1){G.push(arguments[H]);}B.augmentObject.apply(this,G);},dump:function(G,L){var I,K,N=[],O="{...}",H="f(){...}",M=", ",J=" => ";if(!B.isObject(G)){return G+"";}else{if(G instanceof Date||("nodeType" in G&&"tagName" in G)){return G;}else{if(B.isFunction(G)){return H;}}}L=(B.isNumber(L))?L:3;if(B.isArray(G)){N.push("[");for(I=0,K=G.length;I<K;I=I+1){if(B.isObject(G[I])){N.push((L>0)?B.dump(G[I],L-1):O);}else{N.push(G[I]);}N.push(M);}if(N.length>1){N.pop();}N.push("]");}else{N.push("{");for(I in G){if(B.hasOwnProperty(G,I)){N.push(I+J);if(B.isObject(G[I])){N.push((L>0)?B.dump(G[I],L-1):O);}else{N.push(G[I]);}N.push(M);}}if(N.length>1){N.pop();}N.push("}");}return N.join("");},substitute:function(V,H,O){var L,K,J,R,S,U,Q=[],I,M="dump",P=" ",G="{",T="}",N;for(;;){L=V.lastIndexOf(G);if(L<0){break;}K=V.indexOf(T,L);if(L+1>=K){break;}I=V.substring(L+1,K);R=I;U=null;J=R.indexOf(P);if(J>-1){U=R.substring(J+1);R=R.substring(0,J);}S=H[R];if(O){S=O(R,S,U);}if(B.isObject(S)){if(B.isArray(S)){S=B.dump(S,parseInt(U,10));}else{U=U||"";N=U.indexOf(M);if(N>-1){U=U.substring(4);}if(S.toString===A.toString||N>-1){S=B.dump(S,parseInt(U,10));}else{S=S.toString();}}}else{if(!B.isString(S)&&!B.isNumber(S)){S="~-"+Q.length+"-~";Q[Q.length]=I;}}V=V.substring(0,L)+S+V.substring(K+1);}for(L=Q.length-1;L>=0;L=L-1){V=V.replace(new RegExp("~-"+L+"-~"),"{"+Q[L]+"}","g");}return V;},trim:function(G){try{return G.replace(/^\s+|\s+$/g,"");}catch(H){return G;}},merge:function(){var J={},H=arguments,G=H.length,I;for(I=0;I<G;I=I+1){B.augmentObject(J,H[I],true);}return J;},later:function(N,H,O,J,K){N=N||0;H=H||{};var I=O,M=J,L,G;if(B.isString(O)){I=H[O];}if(!I){throw new TypeError("method undefined");}if(!B.isArray(M)){M=[J];}L=function(){I.apply(H,M);};G=(K)?setInterval(L,N):setTimeout(L,N);return{interval:K,cancel:function(){if(this.interval){clearInterval(G);}else{clearTimeout(G);}}};},isValue:function(G){return(B.isObject(G)||B.isString(G)||B.isNumber(G)||B.isBoolean(G));}};B.hasOwnProperty=(A.hasOwnProperty)?function(G,H){return G&&G.hasOwnProperty(H);}:function(G,H){return !B.isUndefined(G[H])&&G.constructor.prototype[H]!==G[H];};D.augmentObject(B,D,true);YAHOO.util.Lang=B;B.augment=B.augmentProto;YAHOO.augment=B.augmentProto;YAHOO.extend=B.extend;})();YAHOO.register("yahoo",YAHOO,{version:"2.7.0",build:"1799"});(function(){YAHOO.env._id_counter=YAHOO.env._id_counter||0;var E=YAHOO.util,L=YAHOO.lang,m=YAHOO.env.ua,A=YAHOO.lang.trim,d={},h={},N=/^t(?:able|d|h)$/i,X=/color$/i,K=window.document,W=K.documentElement,e="ownerDocument",n="defaultView",v="documentElement",t="compatMode",b="offsetLeft",P="offsetTop",u="offsetParent",Z="parentNode",l="nodeType",C="tagName",O="scrollLeft",i="scrollTop",Q="getBoundingClientRect",w="getComputedStyle",a="currentStyle",M="CSS1Compat",c="BackCompat",g="class",F="className",J="",B=" ",s="(?:^|\\s)",k="(?= |$)",U="g",p="position",f="fixed",V="relative",j="left",o="top",r="medium",q="borderLeftWidth",R="borderTopWidth",D=m.opera,I=m.webkit,H=m.gecko,T=m.ie;E.Dom={CUSTOM_ATTRIBUTES:(!W.hasAttribute)?{"for":"htmlFor","class":F}:{"htmlFor":"for","className":g},get:function(y){var AA,Y,z,x,G;if(y){if(y[l]||y.item){return y;}if(typeof y==="string"){AA=y;y=K.getElementById(y);if(y&&y.id===AA){return y;}else{if(y&&K.all){y=null;Y=K.all[AA];for(x=0,G=Y.length;x<G;++x){if(Y[x].id===AA){return Y[x];}}}}return y;}if(y.DOM_EVENTS){y=y.get("element");}if("length" in y){z=[];for(x=0,G=y.length;x<G;++x){z[z.length]=E.Dom.get(y[x]);}return z;}return y;}return null;},getComputedStyle:function(G,Y){if(window[w]){return G[e][n][w](G,null)[Y];}else{if(G[a]){return E.Dom.IE_ComputedStyle.get(G,Y);}}},getStyle:function(G,Y){return E.Dom.batch(G,E.Dom._getStyle,Y);},_getStyle:function(){if(window[w]){return function(G,y){y=(y==="float")?y="cssFloat":E.Dom._toCamel(y);var x=G.style[y],Y;if(!x){Y=G[e][n][w](G,null);if(Y){x=Y[y];}}return x;};}else{if(W[a]){return function(G,y){var x;switch(y){case"opacity":x=100;try{x=G.filters["DXImageTransform.Microsoft.Alpha"].opacity;}catch(z){try{x=G.filters("alpha").opacity;}catch(Y){}}return x/100;case"float":y="styleFloat";default:y=E.Dom._toCamel(y);x=G[a]?G[a][y]:null;return(G.style[y]||x);}};}}}(),setStyle:function(G,Y,x){E.Dom.batch(G,E.Dom._setStyle,{prop:Y,val:x});},_setStyle:function(){if(T){return function(Y,G){var x=E.Dom._toCamel(G.prop),y=G.val;if(Y){switch(x){case"opacity":if(L.isString(Y.style.filter)){Y.style.filter="alpha(opacity="+y*100+")";if(!Y[a]||!Y[a].hasLayout){Y.style.zoom=1;}}break;case"float":x="styleFloat";default:Y.style[x]=y;}}else{}};}else{return function(Y,G){var x=E.Dom._toCamel(G.prop),y=G.val;if(Y){if(x=="float"){x="cssFloat";}Y.style[x]=y;}else{}};}}(),getXY:function(G){return E.Dom.batch(G,E.Dom._getXY);},_canPosition:function(G){return(E.Dom._getStyle(G,"display")!=="none"&&E.Dom._inDoc(G));},_getXY:function(){if(K[v][Q]){return function(y){var z,Y,AA,AF,AE,AD,AC,G,x,AB=Math.floor,AG=false;if(E.Dom._canPosition(y)){AA=y[Q]();AF=y[e];z=E.Dom.getDocumentScrollLeft(AF);Y=E.Dom.getDocumentScrollTop(AF);AG=[AB(AA[j]),AB(AA[o])];if(T&&m.ie<8){AE=2;AD=2;AC=AF[t];G=S(AF[v],q);x=S(AF[v],R);if(m.ie===6){if(AC!==c){AE=0;AD=0;}}if((AC==c)){if(G!==r){AE=parseInt(G,10);}if(x!==r){AD=parseInt(x,10);}}AG[0]-=AE;AG[1]-=AD;}if((Y||z)){AG[0]+=z;AG[1]+=Y;}AG[0]=AB(AG[0]);AG[1]=AB(AG[1]);}else{}return AG;};}else{return function(y){var x,Y,AA,AB,AC,z=false,G=y;if(E.Dom._canPosition(y)){z=[y[b],y[P]];x=E.Dom.getDocumentScrollLeft(y[e]);Y=E.Dom.getDocumentScrollTop(y[e]);AC=((H||m.webkit>519)?true:false);while((G=G[u])){z[0]+=G[b];z[1]+=G[P];if(AC){z=E.Dom._calcBorders(G,z);}}if(E.Dom._getStyle(y,p)!==f){G=y;while((G=G[Z])&&G[C]){AA=G[i];AB=G[O];if(H&&(E.Dom._getStyle(G,"overflow")!=="visible")){z=E.Dom._calcBorders(G,z);}if(AA||AB){z[0]-=AB;z[1]-=AA;}}z[0]+=x;z[1]+=Y;}else{if(D){z[0]-=x;z[1]-=Y;}else{if(I||H){z[0]+=x;z[1]+=Y;}}}z[0]=Math.floor(z[0]);z[1]=Math.floor(z[1]);}else{}return z;};}}(),getX:function(G){var Y=function(x){return E.Dom.getXY(x)[0];};return E.Dom.batch(G,Y,E.Dom,true);},getY:function(G){var Y=function(x){return E.Dom.getXY(x)[1];};return E.Dom.batch(G,Y,E.Dom,true);},setXY:function(G,x,Y){E.Dom.batch(G,E.Dom._setXY,{pos:x,noRetry:Y});},_setXY:function(G,z){var AA=E.Dom._getStyle(G,p),y=E.Dom.setStyle,AD=z.pos,Y=z.noRetry,AB=[parseInt(E.Dom.getComputedStyle(G,j),10),parseInt(E.Dom.getComputedStyle(G,o),10)],AC,x;if(AA=="static"){AA=V;y(G,p,AA);}AC=E.Dom._getXY(G);if(!AD||AC===false){return false;}if(isNaN(AB[0])){AB[0]=(AA==V)?0:G[b];}if(isNaN(AB[1])){AB[1]=(AA==V)?0:G[P];}if(AD[0]!==null){y(G,j,AD[0]-AC[0]+AB[0]+"px");}if(AD[1]!==null){y(G,o,AD[1]-AC[1]+AB[1]+"px");}if(!Y){x=E.Dom._getXY(G);if((AD[0]!==null&&x[0]!=AD[0])||(AD[1]!==null&&x[1]!=AD[1])){E.Dom._setXY(G,{pos:AD,noRetry:true});}}},setX:function(Y,G){E.Dom.setXY(Y,[G,null]);},setY:function(G,Y){E.Dom.setXY(G,[null,Y]);},getRegion:function(G){var Y=function(x){var y=false;if(E.Dom._canPosition(x)){y=E.Region.getRegion(x);}else{}return y;};return E.Dom.batch(G,Y,E.Dom,true);},getClientWidth:function(){return E.Dom.getViewportWidth();},getClientHeight:function(){return E.Dom.getViewportHeight();},getElementsByClassName:function(AB,AF,AC,AE,x,AD){AB=L.trim(AB);AF=AF||"*";AC=(AC)?E.Dom.get(AC):null||K;if(!AC){return[];}var Y=[],G=AC.getElementsByTagName(AF),z=E.Dom.hasClass;for(var y=0,AA=G.length;y<AA;++y){if(z(G[y],AB)){Y[Y.length]=G[y];}}if(AE){E.Dom.batch(Y,AE,x,AD);}return Y;},hasClass:function(Y,G){return E.Dom.batch(Y,E.Dom._hasClass,G);},_hasClass:function(x,Y){var G=false,y;if(x&&Y){y=E.Dom.getAttribute(x,F)||J;if(Y.exec){G=Y.test(y);}else{G=Y&&(B+y+B).indexOf(B+Y+B)>-1;}}else{}return G;},addClass:function(Y,G){return E.Dom.batch(Y,E.Dom._addClass,G);},_addClass:function(x,Y){var G=false,y;if(x&&Y){y=E.Dom.getAttribute(x,F)||J;if(!E.Dom._hasClass(x,Y)){E.Dom.setAttribute(x,F,A(y+B+Y));G=true;}}else{}return G;},removeClass:function(Y,G){return E.Dom.batch(Y,E.Dom._removeClass,G);},_removeClass:function(y,x){var Y=false,AA,z,G;if(y&&x){AA=E.Dom.getAttribute(y,F)||J;E.Dom.setAttribute(y,F,AA.replace(E.Dom._getClassRegex(x),J));z=E.Dom.getAttribute(y,F);if(AA!==z){E.Dom.setAttribute(y,F,A(z));Y=true;if(E.Dom.getAttribute(y,F)===""){G=(y.hasAttribute&&y.hasAttribute(g))?g:F;y.removeAttribute(G);}}}else{}return Y;},replaceClass:function(x,Y,G){return E.Dom.batch(x,E.Dom._replaceClass,{from:Y,to:G});
},_replaceClass:function(y,x){var Y,AB,AA,G=false,z;if(y&&x){AB=x.from;AA=x.to;if(!AA){G=false;}else{if(!AB){G=E.Dom._addClass(y,x.to);}else{if(AB!==AA){z=E.Dom.getAttribute(y,F)||J;Y=(B+z.replace(E.Dom._getClassRegex(AB),B+AA)).split(E.Dom._getClassRegex(AA));Y.splice(1,0,B+AA);E.Dom.setAttribute(y,F,A(Y.join(J)));G=true;}}}}else{}return G;},generateId:function(G,x){x=x||"yui-gen";var Y=function(y){if(y&&y.id){return y.id;}var z=x+YAHOO.env._id_counter++;if(y){if(y[e].getElementById(z)){return E.Dom.generateId(y,z+x);}y.id=z;}return z;};return E.Dom.batch(G,Y,E.Dom,true)||Y.apply(E.Dom,arguments);},isAncestor:function(Y,x){Y=E.Dom.get(Y);x=E.Dom.get(x);var G=false;if((Y&&x)&&(Y[l]&&x[l])){if(Y.contains&&Y!==x){G=Y.contains(x);}else{if(Y.compareDocumentPosition){G=!!(Y.compareDocumentPosition(x)&16);}}}else{}return G;},inDocument:function(G,Y){return E.Dom._inDoc(E.Dom.get(G),Y);},_inDoc:function(Y,x){var G=false;if(Y&&Y[C]){x=x||Y[e];G=E.Dom.isAncestor(x[v],Y);}else{}return G;},getElementsBy:function(Y,AF,AB,AD,y,AC,AE){AF=AF||"*";AB=(AB)?E.Dom.get(AB):null||K;if(!AB){return[];}var x=[],G=AB.getElementsByTagName(AF);for(var z=0,AA=G.length;z<AA;++z){if(Y(G[z])){if(AE){x=G[z];break;}else{x[x.length]=G[z];}}}if(AD){E.Dom.batch(x,AD,y,AC);}return x;},getElementBy:function(x,G,Y){return E.Dom.getElementsBy(x,G,Y,null,null,null,true);},batch:function(x,AB,AA,z){var y=[],Y=(z)?AA:window;x=(x&&(x[C]||x.item))?x:E.Dom.get(x);if(x&&AB){if(x[C]||x.length===undefined){return AB.call(Y,x,AA);}for(var G=0;G<x.length;++G){y[y.length]=AB.call(Y,x[G],AA);}}else{return false;}return y;},getDocumentHeight:function(){var Y=(K[t]!=M||I)?K.body.scrollHeight:W.scrollHeight,G=Math.max(Y,E.Dom.getViewportHeight());return G;},getDocumentWidth:function(){var Y=(K[t]!=M||I)?K.body.scrollWidth:W.scrollWidth,G=Math.max(Y,E.Dom.getViewportWidth());return G;},getViewportHeight:function(){var G=self.innerHeight,Y=K[t];if((Y||T)&&!D){G=(Y==M)?W.clientHeight:K.body.clientHeight;}return G;},getViewportWidth:function(){var G=self.innerWidth,Y=K[t];if(Y||T){G=(Y==M)?W.clientWidth:K.body.clientWidth;}return G;},getAncestorBy:function(G,Y){while((G=G[Z])){if(E.Dom._testElement(G,Y)){return G;}}return null;},getAncestorByClassName:function(Y,G){Y=E.Dom.get(Y);if(!Y){return null;}var x=function(y){return E.Dom.hasClass(y,G);};return E.Dom.getAncestorBy(Y,x);},getAncestorByTagName:function(Y,G){Y=E.Dom.get(Y);if(!Y){return null;}var x=function(y){return y[C]&&y[C].toUpperCase()==G.toUpperCase();};return E.Dom.getAncestorBy(Y,x);},getPreviousSiblingBy:function(G,Y){while(G){G=G.previousSibling;if(E.Dom._testElement(G,Y)){return G;}}return null;},getPreviousSibling:function(G){G=E.Dom.get(G);if(!G){return null;}return E.Dom.getPreviousSiblingBy(G);},getNextSiblingBy:function(G,Y){while(G){G=G.nextSibling;if(E.Dom._testElement(G,Y)){return G;}}return null;},getNextSibling:function(G){G=E.Dom.get(G);if(!G){return null;}return E.Dom.getNextSiblingBy(G);},getFirstChildBy:function(G,x){var Y=(E.Dom._testElement(G.firstChild,x))?G.firstChild:null;return Y||E.Dom.getNextSiblingBy(G.firstChild,x);},getFirstChild:function(G,Y){G=E.Dom.get(G);if(!G){return null;}return E.Dom.getFirstChildBy(G);},getLastChildBy:function(G,x){if(!G){return null;}var Y=(E.Dom._testElement(G.lastChild,x))?G.lastChild:null;return Y||E.Dom.getPreviousSiblingBy(G.lastChild,x);},getLastChild:function(G){G=E.Dom.get(G);return E.Dom.getLastChildBy(G);},getChildrenBy:function(Y,y){var x=E.Dom.getFirstChildBy(Y,y),G=x?[x]:[];E.Dom.getNextSiblingBy(x,function(z){if(!y||y(z)){G[G.length]=z;}return false;});return G;},getChildren:function(G){G=E.Dom.get(G);if(!G){}return E.Dom.getChildrenBy(G);},getDocumentScrollLeft:function(G){G=G||K;return Math.max(G[v].scrollLeft,G.body.scrollLeft);},getDocumentScrollTop:function(G){G=G||K;return Math.max(G[v].scrollTop,G.body.scrollTop);},insertBefore:function(Y,G){Y=E.Dom.get(Y);G=E.Dom.get(G);if(!Y||!G||!G[Z]){return null;}return G[Z].insertBefore(Y,G);},insertAfter:function(Y,G){Y=E.Dom.get(Y);G=E.Dom.get(G);if(!Y||!G||!G[Z]){return null;}if(G.nextSibling){return G[Z].insertBefore(Y,G.nextSibling);}else{return G[Z].appendChild(Y);}},getClientRegion:function(){var x=E.Dom.getDocumentScrollTop(),Y=E.Dom.getDocumentScrollLeft(),y=E.Dom.getViewportWidth()+Y,G=E.Dom.getViewportHeight()+x;return new E.Region(x,y,G,Y);},setAttribute:function(Y,G,x){G=E.Dom.CUSTOM_ATTRIBUTES[G]||G;Y.setAttribute(G,x);},getAttribute:function(Y,G){G=E.Dom.CUSTOM_ATTRIBUTES[G]||G;return Y.getAttribute(G);},_toCamel:function(Y){var x=d;function G(y,z){return z.toUpperCase();}return x[Y]||(x[Y]=Y.indexOf("-")===-1?Y:Y.replace(/-([a-z])/gi,G));},_getClassRegex:function(Y){var G;if(Y!==undefined){if(Y.exec){G=Y;}else{G=h[Y];if(!G){Y=Y.replace(E.Dom._patterns.CLASS_RE_TOKENS,"\\$1");G=h[Y]=new RegExp(s+Y+k,U);}}}return G;},_patterns:{ROOT_TAG:/^body|html$/i,CLASS_RE_TOKENS:/([\.\(\)\^\$\*\+\?\|\[\]\{\}])/g},_testElement:function(G,Y){return G&&G[l]==1&&(!Y||Y(G));},_calcBorders:function(x,y){var Y=parseInt(E.Dom[w](x,R),10)||0,G=parseInt(E.Dom[w](x,q),10)||0;if(H){if(N.test(x[C])){Y=0;G=0;}}y[0]+=G;y[1]+=Y;return y;}};var S=E.Dom[w];if(m.opera){E.Dom[w]=function(Y,G){var x=S(Y,G);if(X.test(G)){x=E.Dom.Color.toRGB(x);}return x;};}if(m.webkit){E.Dom[w]=function(Y,G){var x=S(Y,G);if(x==="rgba(0, 0, 0, 0)"){x="transparent";}return x;};}})();YAHOO.util.Region=function(C,D,A,B){this.top=C;this.y=C;this[1]=C;this.right=D;this.bottom=A;this.left=B;this.x=B;this[0]=B;this.width=this.right-this.left;this.height=this.bottom-this.top;};YAHOO.util.Region.prototype.contains=function(A){return(A.left>=this.left&&A.right<=this.right&&A.top>=this.top&&A.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(E){var C=Math.max(this.top,E.top),D=Math.min(this.right,E.right),A=Math.min(this.bottom,E.bottom),B=Math.max(this.left,E.left);if(A>=C&&D>=B){return new YAHOO.util.Region(C,D,A,B);
}else{return null;}};YAHOO.util.Region.prototype.union=function(E){var C=Math.min(this.top,E.top),D=Math.max(this.right,E.right),A=Math.max(this.bottom,E.bottom),B=Math.min(this.left,E.left);return new YAHOO.util.Region(C,D,A,B);};YAHOO.util.Region.prototype.toString=function(){return("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+", height: "+this.height+", width: "+this.width+"}");};YAHOO.util.Region.getRegion=function(D){var F=YAHOO.util.Dom.getXY(D),C=F[1],E=F[0]+D.offsetWidth,A=F[1]+D.offsetHeight,B=F[0];return new YAHOO.util.Region(C,E,A,B);};YAHOO.util.Point=function(A,B){if(YAHOO.lang.isArray(A)){B=A[1];A=A[0];}YAHOO.util.Point.superclass.constructor.call(this,B,A,B,A);};YAHOO.extend(YAHOO.util.Point,YAHOO.util.Region);(function(){var B=YAHOO.util,A="clientTop",F="clientLeft",J="parentNode",K="right",W="hasLayout",I="px",U="opacity",L="auto",D="borderLeftWidth",G="borderTopWidth",P="borderRightWidth",V="borderBottomWidth",S="visible",Q="transparent",N="height",E="width",H="style",T="currentStyle",R=/^width|height$/,O=/^(\d[.\d]*)+(em|ex|px|gd|rem|vw|vh|vm|ch|mm|cm|in|pt|pc|deg|rad|ms|s|hz|khz|%){1}?/i,M={get:function(X,Z){var Y="",a=X[T][Z];if(Z===U){Y=B.Dom.getStyle(X,U);}else{if(!a||(a.indexOf&&a.indexOf(I)>-1)){Y=a;}else{if(B.Dom.IE_COMPUTED[Z]){Y=B.Dom.IE_COMPUTED[Z](X,Z);}else{if(O.test(a)){Y=B.Dom.IE.ComputedStyle.getPixel(X,Z);}else{Y=a;}}}}return Y;},getOffset:function(Z,e){var b=Z[T][e],X=e.charAt(0).toUpperCase()+e.substr(1),c="offset"+X,Y="pixel"+X,a="",d;if(b==L){d=Z[c];if(d===undefined){a=0;}a=d;if(R.test(e)){Z[H][e]=d;if(Z[c]>d){a=d-(Z[c]-d);}Z[H][e]=L;}}else{if(!Z[H][Y]&&!Z[H][e]){Z[H][e]=b;}a=Z[H][Y];}return a+I;},getBorderWidth:function(X,Z){var Y=null;if(!X[T][W]){X[H].zoom=1;}switch(Z){case G:Y=X[A];break;case V:Y=X.offsetHeight-X.clientHeight-X[A];break;case D:Y=X[F];break;case P:Y=X.offsetWidth-X.clientWidth-X[F];break;}return Y+I;},getPixel:function(Y,X){var a=null,b=Y[T][K],Z=Y[T][X];Y[H][K]=Z;a=Y[H].pixelRight;Y[H][K]=b;return a+I;},getMargin:function(Y,X){var Z;if(Y[T][X]==L){Z=0+I;}else{Z=B.Dom.IE.ComputedStyle.getPixel(Y,X);}return Z;},getVisibility:function(Y,X){var Z;while((Z=Y[T])&&Z[X]=="inherit"){Y=Y[J];}return(Z)?Z[X]:S;},getColor:function(Y,X){return B.Dom.Color.toRGB(Y[T][X])||Q;},getBorderColor:function(Y,X){var Z=Y[T],a=Z[X]||Z.color;return B.Dom.Color.toRGB(B.Dom.Color.toHex(a));}},C={};C.top=C.right=C.bottom=C.left=C[E]=C[N]=M.getOffset;C.color=M.getColor;C[G]=C[P]=C[V]=C[D]=M.getBorderWidth;C.marginTop=C.marginRight=C.marginBottom=C.marginLeft=M.getMargin;C.visibility=M.getVisibility;C.borderColor=C.borderTopColor=C.borderRightColor=C.borderBottomColor=C.borderLeftColor=M.getBorderColor;B.Dom.IE_COMPUTED=C;B.Dom.IE_ComputedStyle=M;})();(function(){var C="toString",A=parseInt,B=RegExp,D=YAHOO.util;D.Dom.Color={KEYWORDS:{black:"000",silver:"c0c0c0",gray:"808080",white:"fff",maroon:"800000",red:"f00",purple:"800080",fuchsia:"f0f",green:"008000",lime:"0f0",olive:"808000",yellow:"ff0",navy:"000080",blue:"00f",teal:"008080",aqua:"0ff"},re_RGB:/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i,re_hex:/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i,re_hex3:/([0-9A-F])/gi,toRGB:function(E){if(!D.Dom.Color.re_RGB.test(E)){E=D.Dom.Color.toHex(E);}if(D.Dom.Color.re_hex.exec(E)){E="rgb("+[A(B.$1,16),A(B.$2,16),A(B.$3,16)].join(", ")+")";}return E;},toHex:function(H){H=D.Dom.Color.KEYWORDS[H]||H;if(D.Dom.Color.re_RGB.exec(H)){var G=(B.$1.length===1)?"0"+B.$1:Number(B.$1),F=(B.$2.length===1)?"0"+B.$2:Number(B.$2),E=(B.$3.length===1)?"0"+B.$3:Number(B.$3);H=[G[C](16),F[C](16),E[C](16)].join("");}if(H.length<6){H=H.replace(D.Dom.Color.re_hex3,"$1$1");}if(H!=="transparent"&&H.indexOf("#")<0){H="#"+H;}return H.toLowerCase();}};}());YAHOO.register("dom",YAHOO.util.Dom,{version:"2.7.0",build:"1799"});YAHOO.util.CustomEvent=function(D,C,B,A){this.type=D;this.scope=C||window;this.silent=B;this.signature=A||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}var E="_YUICEOnSubscribe";if(D!==E){this.subscribeEvent=new YAHOO.util.CustomEvent(E,this,true);}this.lastError=null;};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(A,B,C){if(!A){throw new Error("Invalid callback for subscriber to '"+this.type+"'");}if(this.subscribeEvent){this.subscribeEvent.fire(A,B,C);}this.subscribers.push(new YAHOO.util.Subscriber(A,B,C));},unsubscribe:function(D,F){if(!D){return this.unsubscribeAll();}var E=false;for(var B=0,A=this.subscribers.length;B<A;++B){var C=this.subscribers[B];if(C&&C.contains(D,F)){this._delete(B);E=true;}}return E;},fire:function(){this.lastError=null;var K=[],E=this.subscribers.length;if(!E&&this.silent){return true;}var I=[].slice.call(arguments,0),G=true,D,J=false;if(!this.silent){}var C=this.subscribers.slice(),A=YAHOO.util.Event.throwErrors;for(D=0;D<E;++D){var M=C[D];if(!M){J=true;}else{if(!this.silent){}var L=M.getScope(this.scope);if(this.signature==YAHOO.util.CustomEvent.FLAT){var B=null;if(I.length>0){B=I[0];}try{G=M.fn.call(L,B,M.obj);}catch(F){this.lastError=F;if(A){throw F;}}}else{try{G=M.fn.call(L,this.type,I,M.obj);}catch(H){this.lastError=H;if(A){throw H;}}}if(false===G){if(!this.silent){}break;}}}return(G!==false);},unsubscribeAll:function(){var A=this.subscribers.length,B;for(B=A-1;B>-1;B--){this._delete(B);}this.subscribers=[];return A;},_delete:function(A){var B=this.subscribers[A];if(B){delete B.fn;delete B.obj;}this.subscribers.splice(A,1);},toString:function(){return"CustomEvent: "+"'"+this.type+"', "+"context: "+this.scope;}};YAHOO.util.Subscriber=function(A,B,C){this.fn=A;this.obj=YAHOO.lang.isUndefined(B)?null:B;this.overrideContext=C;};YAHOO.util.Subscriber.prototype.getScope=function(A){if(this.overrideContext){if(this.overrideContext===true){return this.obj;}else{return this.overrideContext;}}return A;};YAHOO.util.Subscriber.prototype.contains=function(A,B){if(B){return(this.fn==A&&this.obj==B);}else{return(this.fn==A);}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+this.obj+", overrideContext: "+(this.overrideContext||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var H=false;var I=[];var J=[];var G=[];var E=[];var C=0;var F=[];var B=[];var A=0;var D={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9};var K=YAHOO.env.ua.ie?"focusin":"focus";var L=YAHOO.env.ua.ie?"focusout":"blur";return{POLL_RETRYS:2000,POLL_INTERVAL:20,EL:0,TYPE:1,FN:2,WFN:3,UNLOAD_OBJ:3,ADJ_SCOPE:4,OBJ:5,OVERRIDE:6,lastError:null,isSafari:YAHOO.env.ua.webkit,webkit:YAHOO.env.ua.webkit,isIE:YAHOO.env.ua.ie,_interval:null,_dri:null,DOMReady:false,throwErrors:false,startInterval:function(){if(!this._interval){var M=this;var N=function(){M._tryPreloadAttach();};this._interval=setInterval(N,this.POLL_INTERVAL);}},onAvailable:function(S,O,Q,R,P){var M=(YAHOO.lang.isString(S))?[S]:S;for(var N=0;N<M.length;N=N+1){F.push({id:M[N],fn:O,obj:Q,overrideContext:R,checkReady:P});}C=this.POLL_RETRYS;this.startInterval();},onContentReady:function(P,M,N,O){this.onAvailable(P,M,N,O,true);},onDOMReady:function(M,N,O){if(this.DOMReady){setTimeout(function(){var P=window;if(O){if(O===true){P=N;}else{P=O;}}M.call(P,"DOMReady",[],N);},0);}else{this.DOMReadyEvent.subscribe(M,N,O);}},_addListener:function(O,M,Y,S,W,b){if(!Y||!Y.call){return false;}if(this._isValidCollection(O)){var Z=true;for(var T=0,V=O.length;T<V;++T){Z=this.on(O[T],M,Y,S,W)&&Z;}return Z;}else{if(YAHOO.lang.isString(O)){var R=this.getEl(O);if(R){O=R;}else{this.onAvailable(O,function(){YAHOO.util.Event.on(O,M,Y,S,W);});return true;}}}if(!O){return false;}if("unload"==M&&S!==this){J[J.length]=[O,M,Y,S,W];return true;}var N=O;if(W){if(W===true){N=S;}else{N=W;}}var P=function(c){return Y.call(N,YAHOO.util.Event.getEvent(c,O),S);};var a=[O,M,Y,P,N,S,W];var U=I.length;I[U]=a;if(this.useLegacyEvent(O,M)){var Q=this.getLegacyIndex(O,M);if(Q==-1||O!=G[Q][0]){Q=G.length;B[O.id+M]=Q;G[Q]=[O,M,O["on"+M]];E[Q]=[];O["on"+M]=function(c){YAHOO.util.Event.fireLegacyEvent(YAHOO.util.Event.getEvent(c),Q);};}E[Q].push(a);}else{try{this._simpleAdd(O,M,P,b);}catch(X){this.lastError=X;this.removeListener(O,M,Y);return false;}}return true;},addListener:function(N,Q,M,O,P){return this._addListener(N,Q,M,O,P,false);},addFocusListener:function(N,M,O,P){return this._addListener(N,K,M,O,P,true);},removeFocusListener:function(N,M){return this.removeListener(N,K,M);},addBlurListener:function(N,M,O,P){return this._addListener(N,L,M,O,P,true);},removeBlurListener:function(N,M){return this.removeListener(N,L,M);},fireLegacyEvent:function(R,P){var T=true,M,V,U,N,S;V=E[P].slice();for(var O=0,Q=V.length;O<Q;++O){U=V[O];if(U&&U[this.WFN]){N=U[this.ADJ_SCOPE];S=U[this.WFN].call(N,R);T=(T&&S);}}M=G[P];if(M&&M[2]){M[2](R);}return T;},getLegacyIndex:function(N,O){var M=this.generateId(N)+O;if(typeof B[M]=="undefined"){return -1;}else{return B[M];}},useLegacyEvent:function(M,N){return(this.webkit&&this.webkit<419&&("click"==N||"dblclick"==N));},removeListener:function(N,M,V){var Q,T,X;if(typeof N=="string"){N=this.getEl(N);}else{if(this._isValidCollection(N)){var W=true;for(Q=N.length-1;Q>-1;Q--){W=(this.removeListener(N[Q],M,V)&&W);}return W;}}if(!V||!V.call){return this.purgeElement(N,false,M);}if("unload"==M){for(Q=J.length-1;Q>-1;Q--){X=J[Q];if(X&&X[0]==N&&X[1]==M&&X[2]==V){J.splice(Q,1);return true;}}return false;}var R=null;var S=arguments[3];if("undefined"===typeof S){S=this._getCacheIndex(N,M,V);}if(S>=0){R=I[S];}if(!N||!R){return false;}if(this.useLegacyEvent(N,M)){var P=this.getLegacyIndex(N,M);var O=E[P];if(O){for(Q=0,T=O.length;Q<T;++Q){X=O[Q];if(X&&X[this.EL]==N&&X[this.TYPE]==M&&X[this.FN]==V){O.splice(Q,1);break;}}}}else{try{this._simpleRemove(N,M,R[this.WFN],false);}catch(U){this.lastError=U;return false;}}delete I[S][this.WFN];delete I[S][this.FN];
I.splice(S,1);return true;},getTarget:function(O,N){var M=O.target||O.srcElement;return this.resolveTextNode(M);},resolveTextNode:function(N){try{if(N&&3==N.nodeType){return N.parentNode;}}catch(M){}return N;},getPageX:function(N){var M=N.pageX;if(!M&&0!==M){M=N.clientX||0;if(this.isIE){M+=this._getScrollLeft();}}return M;},getPageY:function(M){var N=M.pageY;if(!N&&0!==N){N=M.clientY||0;if(this.isIE){N+=this._getScrollTop();}}return N;},getXY:function(M){return[this.getPageX(M),this.getPageY(M)];},getRelatedTarget:function(N){var M=N.relatedTarget;if(!M){if(N.type=="mouseout"){M=N.toElement;}else{if(N.type=="mouseover"){M=N.fromElement;}}}return this.resolveTextNode(M);},getTime:function(O){if(!O.time){var N=new Date().getTime();try{O.time=N;}catch(M){this.lastError=M;return N;}}return O.time;},stopEvent:function(M){this.stopPropagation(M);this.preventDefault(M);},stopPropagation:function(M){if(M.stopPropagation){M.stopPropagation();}else{M.cancelBubble=true;}},preventDefault:function(M){if(M.preventDefault){M.preventDefault();}else{M.returnValue=false;}},getEvent:function(O,M){var N=O||window.event;if(!N){var P=this.getEvent.caller;while(P){N=P.arguments[0];if(N&&Event==N.constructor){break;}P=P.caller;}}return N;},getCharCode:function(N){var M=N.keyCode||N.charCode||0;if(YAHOO.env.ua.webkit&&(M in D)){M=D[M];}return M;},_getCacheIndex:function(Q,R,P){for(var O=0,N=I.length;O<N;O=O+1){var M=I[O];if(M&&M[this.FN]==P&&M[this.EL]==Q&&M[this.TYPE]==R){return O;}}return -1;},generateId:function(M){var N=M.id;if(!N){N="yuievtautoid-"+A;++A;M.id=N;}return N;},_isValidCollection:function(N){try{return(N&&typeof N!=="string"&&N.length&&!N.tagName&&!N.alert&&typeof N[0]!=="undefined");}catch(M){return false;}},elCache:{},getEl:function(M){return(typeof M==="string")?document.getElementById(M):M;},clearCache:function(){},DOMReadyEvent:new YAHOO.util.CustomEvent("DOMReady",this),_load:function(N){if(!H){H=true;var M=YAHOO.util.Event;M._ready();M._tryPreloadAttach();}},_ready:function(N){var M=YAHOO.util.Event;if(!M.DOMReady){M.DOMReady=true;M.DOMReadyEvent.fire();M._simpleRemove(document,"DOMContentLoaded",M._ready);}},_tryPreloadAttach:function(){if(F.length===0){C=0;if(this._interval){clearInterval(this._interval);this._interval=null;}return;}if(this.locked){return;}if(this.isIE){if(!this.DOMReady){this.startInterval();return;}}this.locked=true;var S=!H;if(!S){S=(C>0&&F.length>0);}var R=[];var T=function(V,W){var U=V;if(W.overrideContext){if(W.overrideContext===true){U=W.obj;}else{U=W.overrideContext;}}W.fn.call(U,W.obj);};var N,M,Q,P,O=[];for(N=0,M=F.length;N<M;N=N+1){Q=F[N];if(Q){P=this.getEl(Q.id);if(P){if(Q.checkReady){if(H||P.nextSibling||!S){O.push(Q);F[N]=null;}}else{T(P,Q);F[N]=null;}}else{R.push(Q);}}}for(N=0,M=O.length;N<M;N=N+1){Q=O[N];T(this.getEl(Q.id),Q);}C--;if(S){for(N=F.length-1;N>-1;N--){Q=F[N];if(!Q||!Q.id){F.splice(N,1);}}this.startInterval();}else{if(this._interval){clearInterval(this._interval);this._interval=null;}}this.locked=false;},purgeElement:function(Q,R,T){var O=(YAHOO.lang.isString(Q))?this.getEl(Q):Q;var S=this.getListeners(O,T),P,M;if(S){for(P=S.length-1;P>-1;P--){var N=S[P];this.removeListener(O,N.type,N.fn);}}if(R&&O&&O.childNodes){for(P=0,M=O.childNodes.length;P<M;++P){this.purgeElement(O.childNodes[P],R,T);}}},getListeners:function(O,M){var R=[],N;if(!M){N=[I,J];}else{if(M==="unload"){N=[J];}else{N=[I];}}var T=(YAHOO.lang.isString(O))?this.getEl(O):O;for(var Q=0;Q<N.length;Q=Q+1){var V=N[Q];if(V){for(var S=0,U=V.length;S<U;++S){var P=V[S];if(P&&P[this.EL]===T&&(!M||M===P[this.TYPE])){R.push({type:P[this.TYPE],fn:P[this.FN],obj:P[this.OBJ],adjust:P[this.OVERRIDE],scope:P[this.ADJ_SCOPE],index:S});}}}}return(R.length)?R:null;},_unload:function(T){var N=YAHOO.util.Event,Q,P,O,S,R,U=J.slice(),M;for(Q=0,S=J.length;Q<S;++Q){O=U[Q];if(O){M=window;if(O[N.ADJ_SCOPE]){if(O[N.ADJ_SCOPE]===true){M=O[N.UNLOAD_OBJ];}else{M=O[N.ADJ_SCOPE];}}O[N.FN].call(M,N.getEvent(T,O[N.EL]),O[N.UNLOAD_OBJ]);U[Q]=null;}}O=null;M=null;J=null;if(I){for(P=I.length-1;P>-1;P--){O=I[P];if(O){N.removeListener(O[N.EL],O[N.TYPE],O[N.FN],P);}}O=null;}G=null;N._simpleRemove(window,"unload",N._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var M=document.documentElement,N=document.body;if(M&&(M.scrollTop||M.scrollLeft)){return[M.scrollTop,M.scrollLeft];}else{if(N){return[N.scrollTop,N.scrollLeft];}else{return[0,0];}}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(O,P,N,M){O.addEventListener(P,N,(M));};}else{if(window.attachEvent){return function(O,P,N,M){O.attachEvent("on"+P,N);};}else{return function(){};}}}(),_simpleRemove:function(){if(window.removeEventListener){return function(O,P,N,M){O.removeEventListener(P,N,(M));};}else{if(window.detachEvent){return function(N,O,M){N.detachEvent("on"+O,M);};}else{return function(){};}}}()};}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;EU.onFocus=EU.addFocusListener;EU.onBlur=EU.addBlurListener;
/* DOMReady: based on work by: Dean Edwards/John Resig/Matthias Miller */
if(EU.isIE){YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,YAHOO.util.Event,true);var n=document.createElement("p");EU._dri=setInterval(function(){try{n.doScroll("left");clearInterval(EU._dri);EU._dri=null;EU._ready();n=null;}catch(ex){}},EU.POLL_INTERVAL);}else{if(EU.webkit&&EU.webkit<525){EU._dri=setInterval(function(){var rs=document.readyState;if("loaded"==rs||"complete"==rs){clearInterval(EU._dri);EU._dri=null;EU._ready();}},EU.POLL_INTERVAL);}else{EU._simpleAdd(document,"DOMContentLoaded",EU._ready);}}EU._simpleAdd(window,"load",EU._load);EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();}YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(A,C,F,E){this.__yui_events=this.__yui_events||{};var D=this.__yui_events[A];if(D){D.subscribe(C,F,E);
}else{this.__yui_subscribers=this.__yui_subscribers||{};var B=this.__yui_subscribers;if(!B[A]){B[A]=[];}B[A].push({fn:C,obj:F,overrideContext:E});}},unsubscribe:function(C,E,G){this.__yui_events=this.__yui_events||{};var A=this.__yui_events;if(C){var F=A[C];if(F){return F.unsubscribe(E,G);}}else{var B=true;for(var D in A){if(YAHOO.lang.hasOwnProperty(A,D)){B=B&&A[D].unsubscribe(E,G);}}return B;}return false;},unsubscribeAll:function(A){return this.unsubscribe(A);},createEvent:function(G,D){this.__yui_events=this.__yui_events||{};var A=D||{};var I=this.__yui_events;if(I[G]){}else{var H=A.scope||this;var E=(A.silent);var B=new YAHOO.util.CustomEvent(G,H,E,YAHOO.util.CustomEvent.FLAT);I[G]=B;if(A.onSubscribeCallback){B.subscribeEvent.subscribe(A.onSubscribeCallback);}this.__yui_subscribers=this.__yui_subscribers||{};var F=this.__yui_subscribers[G];if(F){for(var C=0;C<F.length;++C){B.subscribe(F[C].fn,F[C].obj,F[C].overrideContext);}}}return I[G];},fireEvent:function(E,D,A,C){this.__yui_events=this.__yui_events||{};var G=this.__yui_events[E];if(!G){return null;}var B=[];for(var F=1;F<arguments.length;++F){B.push(arguments[F]);}return G.fire.apply(G,B);},hasEvent:function(A){if(this.__yui_events){if(this.__yui_events[A]){return true;}}return false;}};(function(){var A=YAHOO.util.Event,C=YAHOO.lang;YAHOO.util.KeyListener=function(D,I,E,F){if(!D){}else{if(!I){}else{if(!E){}}}if(!F){F=YAHOO.util.KeyListener.KEYDOWN;}var G=new YAHOO.util.CustomEvent("keyPressed");this.enabledEvent=new YAHOO.util.CustomEvent("enabled");this.disabledEvent=new YAHOO.util.CustomEvent("disabled");if(C.isString(D)){D=document.getElementById(D);}if(C.isFunction(E)){G.subscribe(E);}else{G.subscribe(E.fn,E.scope,E.correctScope);}function H(O,N){if(!I.shift){I.shift=false;}if(!I.alt){I.alt=false;}if(!I.ctrl){I.ctrl=false;}if(O.shiftKey==I.shift&&O.altKey==I.alt&&O.ctrlKey==I.ctrl){var J,M=I.keys,L;if(YAHOO.lang.isArray(M)){for(var K=0;K<M.length;K++){J=M[K];L=A.getCharCode(O);if(J==L){G.fire(L,O);break;}}}else{L=A.getCharCode(O);if(M==L){G.fire(L,O);}}}}this.enable=function(){if(!this.enabled){A.on(D,F,H);this.enabledEvent.fire(I);}this.enabled=true;};this.disable=function(){if(this.enabled){A.removeListener(D,F,H);this.disabledEvent.fire(I);}this.enabled=false;};this.toString=function(){return"KeyListener ["+I.keys+"] "+D.tagName+(D.id?"["+D.id+"]":"");};};var B=YAHOO.util.KeyListener;B.KEYDOWN="keydown";B.KEYUP="keyup";B.KEY={ALT:18,BACK_SPACE:8,CAPS_LOCK:20,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,META:224,NUM_LOCK:144,PAGE_DOWN:34,PAGE_UP:33,PAUSE:19,PRINTSCREEN:44,RIGHT:39,SCROLL_LOCK:145,SHIFT:16,SPACE:32,TAB:9,UP:38};})();YAHOO.register("event",YAHOO.util.Event,{version:"2.7.0",build:"1799"});YAHOO.register("yahoo-dom-event", YAHOO, {version: "2.7.0", build: "1799"});
//function myPopup_XXX_openPopup() {} // should be located in myPopup_XXX.js file
//function myPopup_XXX_closePopup() {}

var CurrentPopup = '';

function openPopup(myPopupID,widthPX,heightPX) {
	if( $(myPopupID) ) {
		self.setTimeout(myPopupID+"_openPopup()", 10 )
		objectsTagVisiblity(0) ; selectsVisibility(0) ;

		myPopupGlassLayer(1)
		
		$(myPopupID).style.display = "block";
		CurrentPopup = myPopupID;

		setPopupParams();
		$(myPopupID).focus();
		
	} else { window.status = "Error opening popup: "+myPopupID }
}
function setPopupParams()
{
    if(CurrentPopup != ''){
        var widthPX = parseInt($(CurrentPopup).offsetWidth);
        var heightPX = parseInt($(CurrentPopup).offsetHeight);
    	
        var clientHeight = getClientWidthHeight()[1]; var clientWidth = getClientWidthHeight()[0];
        var scrollTop = getScrollXY()[1]; var scrollLeft = getScrollXY()[0];
    	
        var pop_scrollLeft = scrollLeft   + ((clientWidth - widthPX ) /2);
        $(CurrentPopup).style.left = pop_scrollLeft + 'px';
    	
        var MinAllowedHeightOfPopup = 50
        var calcHeightOfPopup = scrollTop  + Math.max(((clientHeight - heightPX ) /2),0)
        $(CurrentPopup).style.top = Math.max(calcHeightOfPopup,MinAllowedHeightOfPopup) + 'px';
        
        var Loading = $('DIV_myGlassLayer_Loading');
        if(Loading && Loading.style.display == "block"){
            Loading.style.left = scrollLeft   + ((clientWidth - 200 ) /2)+ 'px'; 
            Loading.style.top = scrollTop  + Math.max(((clientHeight - 25 ) /2),0)+ 'px'; 
        }
    }
}

function closePopup(myPopupID,CloseGlassLayer) {
	if (CloseGlassLayer=="1") { myPopupGlassLayer(0) ; }
	$(myPopupID).style.display = "none"
	
	objectsTagVisiblity(1) ; selectsVisibility(1) ;
	self.setTimeout(myPopupID+"_closePopup()", 10 )
	CurrentPopup = '';
}

function objectsTagVisiblity(makeVisible) {
	var displayMode = "block"
	if  (makeVisible == "0") { displayMode = "none" ; }
	
    var objects = document.getElementsByTagName("object");
    for (var i = 0; i < objects.length; i++)  {
        objects[i].style.display = displayMode;
    }
}

function myPopupGlassLayer(mode) {
    var clientHeight = getClientWidthHeight()[1]; var clientWidth = getClientWidthHeight()[0];
    var scrollTop = getScrollXY()[1]; var scrollLeft = getScrollXY()[0];
	if (mode == 1) {
		objectsTagVisiblity(0) ; selectsVisibility(0) ;
		if ( $('myGlassLayer') ) {
			$('myGlassLayer').style.width = document.body.scrollWidth + 'px';
			$('myGlassLayer').style.height = Math.max(clientHeight,document.body.scrollHeight) + 'px'; //document.body.offsetHeight-20
			
			$('myGlassLayer').style.left = 0 + 'px';
			$('myGlassLayer').style.top = 0 + 'px';
			$('myGlassLayer').style.display = "block"	
				
		}
		if ( $('DIV_myGlassLayer_Loading') ) {
			$('DIV_myGlassLayer_Loading').style.left = scrollLeft   + ((clientWidth - 200 ) /2) + 'px';
			$('DIV_myGlassLayer_Loading').style.top = scrollTop  + Math.max(((clientHeight - 25 ) /2),0) + 'px';
			$('DIV_myGlassLayer_Loading').style.display = "block";
			$('DIV_myGlassLayer_Loading').style.zIndex = 50;
		}
	}
	else {  //(mode == 0)
		if ( $('myGlassLayer') ) {  $('myGlassLayer').style.display = "none" ; $('DIV_myGlassLayer_Loading').style.display = "none" } 
		objectsTagVisiblity(1) ; selectsVisibility(1) ; 
	}
}

function PopupMaskResize()
{
    var MyGlass = $('myGlassLayer');

    if(MyGlass){ 
        var clientHeight = getClientWidthHeight()[1]; var clientWidth = getClientWidthHeight()[0];
        var scrollTop = getScrollXY()[1]; var scrollLeft = getScrollXY()[0];
        MyGlass.style.width = document.body.scrollWidth + 'px'; 
        MyGlass.style.height = Math.max(clientHeight,document.body.scrollHeight) + 'px';
    }
    setPopupParams();
}

function PopupObjsResize()
{
    for(var i = 0; i < RunningPopups.length; ++i){
        RunningPopups[i].ReSize();    
    }
}
function PopupObjsCenter()
{
    for(var i = 0; i < RunningPopups.length; ++i){
        RunningPopups[i].Center();    
    }
}

var StackingZIndex = 5000;
var RunningPopups = [];

function AF_Popup(PopupID){
    var dt = new Date();
    var GlassLayer = "AF_GlassID_" + PopupID + '_' + dt.getTime();
    var popupid = PopupID;
    this.MyPopupID = PopupID;
    this.WidthPX;
    this.HeightPX;
    this.IsModel = true;
    this.SetClass = "afGlass";
    this.ShowLoading = true;
    this.IsShowing = false; // is the popup being shown already, ie., the Show() method has been called.
    this.BackgroundVisibility = true;
    this.Zindex;

    this.SetPopupParams = function(){
        if($(GlassLayer)){ 
            var clientHeight = getClientWidthHeight()[1]; var clientWidth = getClientWidthHeight()[0];
            var scrollTop = getScrollXY()[1]; var scrollLeft = getScrollXY()[0];
            
            if(this.IsModel == true){             
                var MyGlass = $(GlassLayer);
                
                MyGlass.style.width = document.body.scrollWidth + 'px'; 
                MyGlass.style.height = Math.max(clientHeight,document.body.scrollHeight)+ 1000 + 'px';
                
                var Loading = $('DIV_myGlassLayer_Loading');
	            if(Loading && Loading.style.display == "block" && this.ShowLoading){
		            Loading.style.left = scrollLeft   + ((clientWidth - 200 ) /2) + 'px'; 
		            Loading.style.top = scrollTop  + Math.max(((clientHeight - 25 ) /2),0) + 'px'; 
	            }
		    }		            
        }              
    };

    this.Show = function(){
        if($(this.MyPopupID) && this.IsShowing == false){
   	        var clientHeight = getClientWidthHeight()[1]; var clientWidth = getClientWidthHeight()[0];
   	        var scrollTop = getScrollXY()[1]; var scrollLeft = getScrollXY()[0];
   	        
            if(this.IsModel == true){  
		        if(this.BackgroundVisibility == false){
		            this.SetClass = "afNoGlass";
		            objectsTagVisiblity(0) ; selectsVisibility(0);
		        }
            
                var MyGlass = document.createElement("DIV");
                MyGlass.id = GlassLayer;
                MyGlass.className = this.SetClass;
                if(this.Zindex){
                    MyGlass.style.zIndex = this.Zindex;
                }else{
                    StackingZIndex += 1;
                    MyGlass.style.zIndex = StackingZIndex;
                }
                MyGlass.style.position = "absolute";
                document.body.appendChild(MyGlass);
		        //self.setTimeout(this.MyPopupID+"_openPopup()", 10);
        		            
	            MyGlass.style.left = '0px';
	            MyGlass.style.top = '0px';
                MyGlass.style.display = "block";
                MyGlass.style.padding = '0px';
                MyGlass.style.margin = '0px';
                
	            if($('DIV_myGlassLayer_Loading') && this.ShowLoading){
		            $('DIV_myGlassLayer_Loading').style.left = scrollLeft   + ((clientWidth - 200 ) /2) + 'px'; 
		            $('DIV_myGlassLayer_Loading').style.top = scrollTop  + Math.max(((clientHeight - 25 ) /2),0) + 'px'; 
		            $('DIV_myGlassLayer_Loading').style.display = "block";
		            StackingZIndex += 1;
		            $('DIV_myGlassLayer_Loading').style.zIndex = StackingZIndex;
	            }
		    }
    		
    		$(this.MyPopupID).style.position = "absolute"; 
    		$(this.MyPopupID).style.display = "block"; 

            this.SetPopupParams(this);
            this.Center();
            if(this.Zindex){
                $(this.MyPopupID).style.zIndex = this.Zindex + 1;
            }else{
                StackingZIndex += 1;
                $(this.MyPopupID).style.zIndex = StackingZIndex;
            }
            this.IsShowing = true;
            RunningPopups.push(this);
            $(this.MyPopupID).focus();   
                        

        }
    };
    
    this.Close = function(){
        if($(this.MyPopupID)){
            $(this.MyPopupID).style.display = "none";
            this.WidthPX = null; this.HeightPX = null;
            if(this.IsModel == true){
                var MyGlass = $(GlassLayer);
                if(MyGlass){ document.body.removeChild(MyGlass); }
                if(!this.Zindex){ StackingZIndex -= 1; }
                this.HideLoading();
            }
            this.IsShowing = false;
            self.setTimeout(this.MyPopupID+"_closePopup()", 10);
        	if(this.BackgroundVisibility == false){
	            objectsTagVisiblity(1) ; selectsVisibility(1);
	        }
            RunningPopups.pop();
        }
    };
    
    this.HideLoading =  function(){
        if($('DIV_myGlassLayer_Loading') && this.ShowLoading){
            $('DIV_myGlassLayer_Loading').style.zIndex = 50;
            $('DIV_myGlassLayer_Loading').style.display = "none";
        }
    };
    
    this.ReSize = function(){
        this.SetPopupParams();
        this.Center();
    };
    
    this.Reset = function(){
        $(this.MyPopupID).style.width = 'auto'; 
        this.WidthPX = parseInt($(this.MyPopupID).offsetWidth) + 'px'; 
        //this.HeightPX = null;
    };
    
    this.Center = function(){
        var clientHeight = getClientWidthHeight()[1]; var clientWidth = getClientWidthHeight()[0];
        var scrollTop = getScrollXY()[1]; var scrollLeft = getScrollXY()[0];
   		$(this.MyPopupID).style.height = 'auto'; 

        if(!this.WidthPX){ this.WidthPX = parseInt($(this.MyPopupID).offsetWidth) + 'px'; }
        if(!this.HeightPX){ this.HeightPX = parseInt($(this.MyPopupID).offsetHeight) + 'px'; }
        $(this.MyPopupID).style.width = this.WidthPX; $(this.MyPopupID).style.height = this.HeightPX;
          
        var pop_scrollLeft = scrollLeft + ((clientWidth - parseInt(this.WidthPX)) /2) 
        $(this.MyPopupID).style.left = pop_scrollLeft+ 'px'; 
    	
        var MinAllowedHeightOfPopup = 50
        var calcHeightOfPopup = scrollTop + Math.max(((clientHeight - parseInt(this.HeightPX)) /2),0)
        $(this.MyPopupID).style.top = Math.max(calcHeightOfPopup,MinAllowedHeightOfPopup) + 'px'; 
        
        var Loading = $('DIV_myGlassLayer_Loading');
        if(Loading && Loading.style.display == "block" && this.ShowLoading){
            Loading.style.left = scrollLeft   + ((clientWidth - 200 ) /2) + 'px'; 
            Loading.style.top = scrollTop  + Math.max(((clientHeight - 25 ) /2),0) + 'px'; 
        }
    };
};

var AF_Alerts = {
	confirm: function(title, message, buttons, callback, width, height, PopupState) {
		if( title == null ) title = 'Confirm';
		if(PopupState == null){ PopupState = 0; }
		AF_Alerts._show('confirm', title, message, buttons, function(result){
			if(callback){ callback(result); }
		}, width, height, PopupState);
	},

	_show: function(type, title, message, buttons, callback, width, height, PopupState) {
		switch(type){
			case 'confirm':
    	        $('htmlTD_myPopup_confirm1_Question').innerHTML = title;
			
			    $('myPopup_Confirm_Ok').style.display = 'none';
			    $('myPopup_Confirm_Yes').style.display = 'none';
			    $('myPopup_Confirm_No').style.display = 'none';
			    $('myPopup_Confirm_Continue').style.display = 'none'; 
			    $('myPopup_Confirm_Cancel').style.display = 'none';
			
			    if(buttons.match(/ok/gi)){ $('myPopup_Confirm_Ok').style.display = ''; }
			    if(buttons.match(/yes/gi)){ $('myPopup_Confirm_Yes').style.display = ''; }
			    if(buttons.match(/no/gi)){ $('myPopup_Confirm_No').style.display = ''; }
			    if(buttons.match(/continue/gi)){ $('myPopup_Confirm_Continue').style.display = ''; }
			    if(buttons.match(/cancel/gi)){ $('myPopup_Confirm_Cancel').style.display = ''; }
			    
			    $('myPopup_Confirm_Message').innerHTML = message;
	            if(width){ myPopup_Confirm.WidthPX = width + 'px'; }
	            if(height){ myPopup_Confirm.HeightPX = height + 'px'; } 
	       		$(myPopup_Confirm.MyPopupID).style.width = 'auto';
   	            myPopup_Confirm.Show();

			    $('myPopup_Confirm_Ok').onclick = function(){
				    if(PopupState == 0){
					    myPopup_Confirm.Close();
					}    
					if( callback ){ callback(1); }
				};
			    $('myPopup_Confirm_Yes').onclick = function(){
				    if(PopupState == 0){
					    myPopup_Confirm.Close();
					}    
					if( callback ){ callback(1); }
				};
				$('myPopup_Confirm_No').onclick = function(){
				    if(PopupState == 0){
					    myPopup_Confirm.Close();
					}    
					if( callback ){ callback(2); }
				};
				$('myPopup_Confirm_Cancel').onclick = function(){
				    if(PopupState == 0){
					    myPopup_Confirm.Close();
					}    
					if( callback ){ callback(3); }
				};
				$('myPopup_Confirm_Continue').onclick = function(){
				    if(PopupState == 0){
					    myPopup_Confirm.Close();
					}    
					if( callback ){ callback(4); }
				};
				
				$('myPopup_Confirm1').focus();
			break;
		}
	}
}

// eg:  AFConfirm("Confirm?", "Do you want to save the changes you have made?", "ok|yes|no|continue|cancel", ConfirmCallback, 200, 100);
// width/height are optional, ok/yes both returns 1. no = 2, cancel = 3, continue = 4. 
// PopupState: 0 = close alert popup on clicking the buttons(default), 1 = do not close.
var AFConfirm = function(title, message, buttons, callback, width, height, PopupState) {
    AF_Alerts.confirm(title, message, buttons, callback, width, height, PopupState);
}

function CenterNewVin()
{
    var clientHeight = getClientWidthHeight()[1]; var clientWidth = getClientWidthHeight()[0];
    var scrollTop = getScrollXY()[1]; var scrollLeft = getScrollXY()[0];
    var VinNew = $('divVinNew');
        
    if(VinNew && VinNew.style.display == "block"){
        VinNew.style.left = scrollLeft   + ((clientWidth - 255 ) /2) + 'px';
        VinNew.style.top = scrollTop  + ((clientHeight - 45 ) /2) + 'px';
    }
}

function RePositionAlerts()
{
    var scrollTop = getScrollXY()[1]; var scrollLeft = getScrollXY()[0];
    var clientHeight = getClientWidthHeight()[1]; var clientWidth = getClientWidthHeight()[0];
    var width = 0;
    if($('GE_AlertLayer')){
        width = $('GE_AlertLayer').offsetWidth;
	    $('GE_AlertLayer').style.left = Math.max( 0, GE_AlertWindow_3_X - width  + 10) + scrollLeft + 'px';
	    $('GE_AlertLayer').style.top = Math.max(0, GE_AlertWindow_3_Y - 12 ) + scrollTop + 'px';
	}
	if($('GE_AlertLayerPopup')){
        width = $('GE_AlertLayerPopup').offsetWidth;
	    $('GE_AlertLayerPopup').style.left = Math.max( 0, GE_AlertWindow_3_X - width  + 10) + scrollLeft + 'px';
	    $('GE_AlertLayerPopup').style.top = Math.max(0, GE_AlertWindow_3_Y - 12 ) + scrollTop + 'px';
	}
}

// creates a blue box. the id element should contain a div which holds the actual content. eg:  <div id='id'><div>content...</div></div>
function AF_BoxBlue(id, titleHtml)
{
    var dt = new Date();
    var counter = 1;
    var mainid = "AF_PopID_" + id + '_' + (counter) + '_' + dt.getTime();

    var parent = $(id);
    parent.className = 'afBox_blue_v2'
    var first = parent.firstChild;
    var MyGlass = document.createElement("DIV");
    MyGlass.id = mainid;
    MyGlass.className = 'afBox_blue_v2_emright';
    parent.insertBefore(MyGlass, first);
    
    mainid = "AF_PopID_" + id + '_' + (++counter) + '_' + dt.getTime();
    MyGlass1 = document.createElement("DIV");
    MyGlass1.id = mainid;
    MyGlass1.className = 'afBox_blue_v2_middlebg';
    MyGlass.appendChild(MyGlass1);
    MyGlass1.innerHTML = '<div class="afBox_blue_v2_topleft"></div><div class="afBox_blue_v2_topcontent">' + titleHtml + '</div><div class="afBox_blue_v2_topright"></div>';
    
    mainid = "AF_PopID_" + id + '_' + (++counter) + '_' + dt.getTime();
    MyGlass2 = document.createElement("DIV");
    MyGlass2.id = mainid;
    MyGlass2.className = 'afBox_blue_v2_contentMain';
    MyGlass.appendChild(MyGlass2);
    MyGlass2.appendChild(first);
    
    MyGlass.innerHTML += '<div class="afBox_blue_v2_footerD"><div class="afBox_blue_v2_footerL"></div><div class="afBox_blue_v2_footerR"></div></div>';
}


addEvent(window,'resize',pageResize);
addEvent(window,'resize',PopupMaskResize);
//addEvent(window,'scroll',PopupMaskResize);
addEvent(window,'resize',PopupObjsResize);
//addEvent(window,'scroll',PopupObjsCenter);
addEvent(window,'resize',CenterNewVin);
//addEvent(window,'scroll',CenterNewVin);
//addEvent(window,'scroll',RePositionAlerts);
addEvent(window,'resize',RePositionAlerts);

function PopupKeyCheck(e) {
	var targ;
	if (!e){ var e = window.event; }
	if (e.target){ targ = e.target; 
	}else if (e.srcElement){ targ = e.srcElement; }
	
    if (targ.nodeType == 3){ // defeat Safari bug
        targ = targ.parentNode;
    }    
    var obj = null;
    if(RunningPopups.length > 0){
        obj = $(RunningPopups[RunningPopups.length-1].MyPopupID);
    }else if(CurrentPopup != ''){ obj = $(CurrentPopup); }
    
    if(obj){
        if(YAHOO.util.Dom.isAncestor(obj, targ) || (obj.id == 'myPopup_ManageInventory_Detail' && $("divVinNew").style.display == "block" && YAHOO.util.Dom.isAncestor($("divVinNew"), targ))){ 
            //window.status = targ.id;
        }else{
            obj.focus();
        }
    }
}

addEvent(document,'keydown',PopupKeyCheck);//------------------------------------------------------------
//OnKeyPress
		//OnKeyPress="onlyNumbers_KC(this)"
		//OnKeyPress="onlyNumbers_KC(this)"
//OnKeyUp
	//OnKeyUp="autoTab_numOnly		(this, maxlength? )"
	//*OnKeyUp="autoTab_noSpecChar	(this, maxlength? )"
	//OnKeyUp="autoTab_noSpecChar2	(this, maxlength? )"
	//*OnKeyUp="autoTab_noNumbers	(this, maxlength? )"
	//OnKeyUp="autoTab				(this, maxlength? )"
	//--getIndex		(eCtrl) 
	//--containsElement	(arr, ele)
//------------------------------------------------------------

//OnKeyPress

		function onlyAmounts_KC() {
		    var event = AF_getEvent(window.event);
			if(event.keyCode <48 || event.keyCode>57) {
				if(event.keyCode != 46) { return event.returnValue = false; }
			}
			
		}
		//OnKeyPress="onlyNumbers_KC(this)"
		function onlyNumbers_KC( o )  {
		    var event = AF_getEvent(o);
			if ( ( event.keyCode <= 57 ) && ( event.keyCode >= 48) ) { }
				else { event.returnValue = false; }
		}
		
		//OnKeyPress="onlyNumbersPlusA_KC(this)"
		function onlyNumbersPlusA_KC( o )  {
		    var event = AF_getEvent(o);
			if ( ( event.keyCode <= 57 ) && ( event.keyCode >= 48) ) { }
			else if ( event.keyCode == 32 ) {} // " "
			else if ( event.keyCode == 45 ) {} // -	
			else if ( event.keyCode == 47 ) {} // /
			else if ( event.keyCode == 40 ) {} // (
			else if ( event.keyCode == 41 ) {} // )
				else { event.returnValue = false; }
		}
		
//		//OnKeyPress="noSpecialChar2_KC(this)"
//		function noSpecialChar2_KC( o )  {
//			var A = ( event.keyCode <= 57 ) && ( event.keyCode >= 48)	// (0 - 9)
//			var B = ( event.keyCode <= 90 ) && ( event.keyCode >= 65)	// (a - z)
//			var C = ( event.keyCode <= 122 ) && ( event.keyCode >= 97)	// (A - Z)
//			if ( A || B || C ) {
//			}
//				else { 	event.returnValue = false; }
//		}
		

//OnKeyUp
		//OnKeyUp="autoTab_numOnly(this, maxlength? )"
		function autoTab_numOnly( o, maxlength)  {
		    var event = AF_getEvent(o);
			filter = [0,8,9,16,17,18,37,38,39,40,46];
			if( ( o.value.length >= maxlength) && (!containsElement(filter, event.keyCode)) && (event.ctrlKey!=true) && (event.button==0) ) {
				o.form[(getIndex(o)+1) % o.form.length].focus();
				//o.form[(getIndex(o)+1) % o.form.length].select()
			}
				else {
					onlyNumbers(o)
					//if( ( o.value.length >= maxlength) ) {
					//	o.form[(getIndex(o)+1) % o.form.length].focus();
					//}
				}
			return ;
		}
		
		//OnKeyUp="autoTab_noSpecChar(this, maxlength? )"
		function autoTab_noSpecChar( o, maxlength)  { }
		
//		//OnKeyUp="autoTab_noSpecChar2(this, maxlength? )"
//		function autoTab_noSpecChar2( o, maxlength)  {
//			filter = [0,8,9,16,17,18,37,38,39,40,46];
//			
//			if( ( o.value.length >= maxlength) && (!containsElement(filter, event.keyCode)) && (event.ctrlKey!=true) && (event.button==0) ) {
//				o.form[(getIndex(o)+1) % o.form.length].focus();
//			}
//				else { noSpecialChar2(o) }
//			return ;
//		}
		
		//OnKeyUp="autoTab_noNumbers(this, maxlength? )"
		function autoTab_noNumbers( o, maxlength)  { }
		
		//OnKeyUp="autoTab(this, maxlength? )"
		function autoTab( o, maxlength)  {
		    var event = AF_getEvent(o);
			filter = [0,8,9,16,17,18,37,38,39,40,46];
			
			if( ( o.value.length >= maxlength) && (!containsElement(filter, event.keyCode)) && (event.ctrlKey!=true) && (event.button==0)) {
				o.form[(getIndex(o)+1) % o.form.length].focus();
			}
				else { 	/*no validation */ }
			return ;
		}
		
//---Used for OnKeyUp() -------------------
function getIndex(eCtrl) {
	 var index = -1, i = 0, found = false;
	 while (i < eCtrl.form.length && index == -1) {
		if (eCtrl.form[i] == eCtrl) { index = i; }
		else {i++; }
	 }
	 return index;
}
function containsElement(arr, ele){
	var found = false, index = 0;
	while( (!found) && (index < arr.length) ) {
		if(arr[index] == ele) { found = true; }
		else { index++; }
	}
	return found;
}// JavaScript Document
/*
formatTextBox 	-->	
convertToInt 	-->	
formatNum 		-->	Formats Text box's (neg --> pos)
decRound 		-->	Round to nerest 2 decimal Round
*/

// allow only positive money values
function formatTextBox (object) {
	var num = object.value

	if ( num == "" ) {  return ; }
		else if ( isNaN(num) ) 		{ num = "" }
		else if( num >= 0) 			{ num = ( decRound( num ) )  }
		else  /* (value < 0 ) */ 	{ num = ( decRound( 0 - num ) ) }
			
	object.value = num
}

function formatNum(value) {
	var returnValue = ""

	if ( isNaN( value) ) 		{ returnValue = "&nbsp;" + 0.00 + "&nbsp;"  }
	else if( value >= 0) 		{ returnValue = "&nbsp;" + formatNumC(value) + "&nbsp;" }
	else  /* (value < 0 ) */	{ returnValue = "(" + formatNumC(0 - value) + ")"  }
			
	return returnValue ;
}
function formatNumC(num) {
	var myVal = decRound(num), iLast = myVal.length
	if( myVal.indexOf('.') ==  (myVal.length-3)) {
		switch (myVal.length) {
			case  7: case  8: case  9:  myVal = myVal.substring(0,iLast-6) + "," + myVal.substring(iLast-6,iLast) ; break ;
			case 10: case 11: case 12:  myVal = myVal.substring(0,iLast-9) + "," + myVal.substring(iLast-9,iLast-6) + "," + myVal.substring(iLast-6,iLast) ; break ;
			case 13: case 14: case 15:  myVal = myVal.substring(0,iLast-12) + "," + myVal.substring(iLast-12,iLast-9) + "," + myVal.substring(iLast-9,iLast-6) + "," + myVal.substring(iLast-6,iLast) ; break ;
		}
	}
	return myVal ;
}
function formatNumInt(num) {
	if ( !isNaN(num) ) {
		var isNeg = false ; num = parseInt(num).toString()
		if (num <0) { isNeg = true ; num = (0 - num) ; 	}
		
		var iLast = num.length 
		switch ( num.length ) {
			case  4: case  5: case  6:  num = num.substring(0,iLast-3) + "," + num.substring(iLast-3,iLast) ; break ;
			case  7: case  8: case  9:  num = num.substring(0,iLast-6) + "," + num.substring(iLast-6,iLast-3) + ", "+ num.substring(iLast-3,iLast) ; break ;
			case 10: case 11: case 12:  num = num.substring(0,iLast-9) + "," + num.substring(iLast-9,iLast-6) + "," + num.substring(iLast-6,iLast-3) + ", "+ num.substring(iLast-3,iLast) ; break ;
		}
		if (isNeg) { num = "-"+num}
	} else { num = "" }
	return num ;
}

function decRound(num) { return (decRound1(num)) }
function decRound1( number ) {
	if ( isNaN( number ) ) { return "0.00" }
	if ( Math.abs( number ) < 0.0049 ) { return "0.00" }
	// number = parseFloat(number)
	
	var arynum = (number.toString()).split('.')
	
	//a number without a decimal
	if (arynum.length == 1) {
		if( isNaN(parseInt(arynum[0])) ) 	{ return ("0.00") ; }
		else 								{ return ( arynum[0]+'.00') ; }
	}
	
	//a num with a decmal
	else {
		//decimal at end - nn.
		if(arynum[1].length == 0) 		{ return ( arynum[0] + '.00' ) }
		
		// nn.n
		else if(arynum[1].length == 1) { return (arynum[0].toString() + '.' +  arynum[1].toString() + '0') }
		
		// nn.nn
		else if(arynum[1].length == 2) { return (arynum[0].toString() + '.' + arynum[1].toString() ) }
		else {
			var dec = arynum[1].slice(0,2)
			//rounding necessay & truncation -- XXX.nn5
			if (arynum[1].charAt(2) >= 5) {
				//whole number is incremented
				if ( dec == "99" ) {
					//alert(arynum[0])
					//negitive whole number
					if ( arynum[0].toString().charAt(0) == '-' ) 	{ return ( (--arynum[0]).toString() + '.00' ) }
					//positive whole number
					else 											{ return ( (++arynum[0]).toString() + '.00' ) }
				}
				//hundreth place is incremented
				else if ( dec <  9 )								{ return ( (arynum[0]).toString() + '.0' + (++dec).toString()  ) }
				//tenths place is incremented
				else 												{ return ( arynum[0].toString() + '.' +  (++dec).toString() ) }
			}
			
			// no rounding necessay & truncation -- XXX.nn0
			else 													{ return ( arynum[0].toString() + '.' +  dec.toString() ) }
		}
	}
}

function dateVerifiction( obj ) {
	var sDate = new Date (3003,01,01)
	if ( !isNaN(obj.value) ) {
		if( obj.value.length==0 ) {
		}
			else if( obj.value.length==6 ) {
				sDate.setYear( parseInt("20" + obj.value.substring(4,6)) )
				sDate.setMonth( parseInt(obj.value.substring(0,2),10)-1 )
				sDate.setDate( parseInt( obj.value.substring(2,4),10) )
			}
			else if( obj.value.length==8 ) {
				sDate.setYear( parseInt( obj.value.substring(4,8) ,10) )
				sDate.setMonth( parseInt(obj.value.substring(0,2) ,10)-1 )
				sDate.setDate( parseInt( obj.value.substring(2,4) ,10 ) )
			}
	}
		else if (obj.value.split('/').length == 3) {
			if( !isNaN( obj.value.split('/')[0] ) && !isNaN( obj.value.split('/')[1] ) && !isNaN( obj.value.split('/')[2] ) ) {
				if( obj.value.split('/')[2].length == 2 ) {
					sDate.setYear(  parseInt( "20" + obj.value.split('/')[2] ,10 ) )
				} 
					else if ( obj.value.split('/')[2].length == 4 )  {
						sDate.setYear(  parseInt( obj.value.split('/')[2],10 ) )
					}
				sDate.setMonth( parseInt( obj.value.split('/')[0],10 )-1 )
				sDate.setDate(  parseInt( obj.value.split('/')[1],10 ) )
			}
		}

	//-------------------------
	if ( sDate.getFullYear() != "3003" ) {
		var month = "00" + parseInt(sDate.getMonth() + 1 ,10)
		var day = "00" + sDate.getDate().toString()
		
		var year = sDate.getFullYear().toString()
		if( year.length == 2 ) {
			year = "19" + year  
		}
		obj.value = month.substring(month.length -2,month.length) + "/" + day.substring(day.length -2,day.length) + "/" + year
	}
	else {
		obj.value = ""
	}
}

function formatVin(vin, separation, mode)
{
    if(vin.length < 17){
        return "";
    }

    if(separation == 1){ // hypen
        if(mode == 1){ // insert hypen
            vin = vin.replace(/-/,"");
            return vin.slice(0,11) + "-" + vin.slice(11,17);
        }else if(mode == 2){ // remove hypen
            return vin.replace(/-/,"");
        }
    }else if(separation == 2){ // bold   
        if(mode == 1){ // insert bold
            vin = vin.replace(/<strong>/i,"");
            vin = vin.replace(/<\/strong>/i,"");
            return vin.slice(0,11) + "<strong>" + vin.slice(11,17) + "</strong>";
        }else if(mode == 2){ // remove bold
            vin = vin.replace(/<strong>/i,"");
            return vin.replace(/<\/strong>/i,"");
        }
    }else if(separation == 3){ // underline
        if(mode == 1){ // insert underline
            vin = vin.replace(/<u>/i,"");
            vin = vin.replace(/<\/u>/i,"");
            return vin.slice(0,11) + "<u>" + vin.slice(11,17) + "</u>";
        }else if(mode == 2){ // remove underline
            vin = vin.replace(/<u>/i,"");
            return vin.replace(/<\/u>/i,"");
        }
//    }else if(separation == 3){ // red color  
//        if(mode == 1){ // insert red
//            vin = vin.replace(/<span style=color:red;>/i,"");
//            vin = vin.replace(/<\/span>/i,"");
//            return vin.slice(0,11) + "<span style=color:red;>" + vin.slice(11,17) + "</span>";
//        }else if(mode == 2){ // remove red
//            vin = vin.replace(/<span style=color:red;>/i,"");
//            return vin.replace(/<\/span>/i,"");
//        }
    }
}
// OnKeyPress="onlyNumbersPlusA_KC(this)" onKeyUp="formatPhone_onKeyUp(this)" onBlur="formatPhone_onBlur(this,'ErrorImgId_XXX',true)"
// OnKeyPress="onlyNumbersPlusA_KC(this)" onKeyUp="formatSSN_onKeyUp(this)" onBlur="formatSSN_onBlur(this,'ErrorImgId_XXX',true)"
// OnKeyPress="onlyNumbersPlusA_KC(this)" onKeyUp="formatDate_onKeyUp(this)" onBlur="formatDate_onBlur(this,'ErrorImgId_XXX',true)"

// <img id="E6" src="../images/pics/alertsymbol2.jpg" class="DynAlertImg" >


//formatPhone

function formatPhone_onKeyUp(obj) {
	if (keyCodeOK()) {
		if(!isPhoneFormat(obj.value)) {
			obj.value = makePhoneFormat(getIntegersOnly(obj.value),false) ; 
		}
	}
}

function formatPhone_onBlur(obj,errIMGid,isRequired) {
	obj.value = makePhoneFormat(getIntegersOnly(obj.value),false) ;
	if ((!isPhoneFormat(obj.value))&&(obj.value.length > 0) ) { 	
		if(document.getElementById(errIMGid)) { 
			document.getElementById(errIMGid).style.visibility = "visible" ;
		 	//document.getElementById(errIMGid).alt = "Number not vaild";
		 	document.getElementById(errIMGid).title = "Number not vaild";  
			//obj.focus()
		}
	}
	else if ( (isRequired)&&(obj.value.length == 0) ) {
		if(document.getElementById(errIMGid)) { 
			document.getElementById(errIMGid).style.visibility = "visible" ;
		 	//document.getElementById(errIMGid).alt = "Required Field";
		 	document.getElementById(errIMGid).title = "Required Field";  
			//obj.focus()
		}
	}
		else {
			if(document.getElementById(errIMGid)) { document.getElementById(errIMGid).style.visibility = "hidden"; }
		}
		
}

//formatSSN
function formatSSN_onKeyUp(obj) {
	if (keyCodeOK()) {
		if 		((obj.value.length==4)&&(getIntegersOnly(obj.value).length==3)) 	{  obj.value = makeSSNFormat(getIntegersOnly(obj.value)) + "-" ; }
		else if ((obj.value.length==7)&&(getIntegersOnly(obj.value).length==5)) 	{  obj.value = makeSSNFormat(getIntegersOnly(obj.value)) + "-" ; }
		else if (!isSSNFormat(obj.value)){
			obj.value = makeSSNFormat(getIntegersOnly(obj.value)) ;
		}
	}
}
function formatSSN_onBlur(obj,errIMGid,isRequired) {
	
	obj.value = makeSSNFormat(getIntegersOnly(obj.value)) ;
	//if ((!isSSNFormat(obj.value))&&(obj.value.length > 0) ) { 	alert("SSN is incomplete") }
	if ((!isSSNFormat(obj.value))&&(obj.value.length > 0) ) { 	
		if(document.getElementById(errIMGid)) { 
			document.getElementById(errIMGid).style.visibility = "visible" ;
		 	//document.getElementById(errIMGid).alt = "Number not valid"  
		 	document.getElementById(errIMGid).title = "Number not valid"  
			//obj.focus()
		}
	}
	else if ( (isRequired)&&(obj.value.length == 0) ) {
		if(document.getElementById(errIMGid)) { 
			document.getElementById(errIMGid).style.visibility = "visible" ;
		 	//document.getElementById(errIMGid).alt = "Required Field"  
		 	document.getElementById(errIMGid).title = "Required Field"  
			//obj.focus()
		}
	}
		else {
			if(document.getElementById(errIMGid)) { document.getElementById(errIMGid).style.visibility = "hidden" }
		}
}

//formatDate
function formatDate_onKeyUp (obj) {
	if (keyCodeOK()) {
		if ((obj.value.length==3)&&(getIntegersOnly(obj.value).length==2)) 		{ obj.value = makeDateFormat(obj.value) + "/" ; }  // nn/
		else if ((obj.value.length==6)&&(getIntegersOnly(obj.value).length==4)) { obj.value = makeDateFormat(obj.value) + "/" ; }	// nn/nn/
		else if (!isDateFormat(obj.value)) 										{ obj.value = makeDateFormat(obj.value) ; } 
	}
}
function formatDate_onBlur (obj,errIMGid,isRequired) {
	obj.value = preDateFormat(obj.value)	
	
	// Year Correction
	var intValue0 = getIntegersOnly(obj.value)
	if ( intValue0.length==6 ) 		{ 
		if ( parseInt(intValue0.substring(4,8)) < 51 ) {
			obj.value = makeDateFormat( intValue0.substring(0,4) +"20"+ intValue0.substring(4,8) )  
		}
		else { obj.value = makeDateFormat( intValue0.substring(0,4) +"19"+ intValue0.substring(4,8))  }
	} 

	obj.value = makeDateFormat(obj.value) ;
	
	var intValue = getIntegersOnly(obj.value)
	var isValidDate_msg = isValidDate(intValue.substring(0,2),intValue.substring(2,4),intValue.substring(4,8))
	if ((isValidDate_msg==true )&&(obj.value.length == 10) ) { 
		if(document.getElementById(errIMGid)) { document.getElementById(errIMGid).style.visibility = "hidden" }	
	}
	else if (obj.value.length > 0)  {
		if(document.getElementById(errIMGid)) { 
			if (obj.value.length == 10) { 
			    //document.getElementById(errIMGid).alt = isValidDate_msg 
			    document.getElementById(errIMGid).title = isValidDate_msg 
			   }
				else {
				    //document.getElementById(errIMGid).alt = "Date not vaild"
				    document.getElementById(errIMGid).title = "Date not vaild"
				}
			document.getElementById(errIMGid).style.visibility = "visible" ;
			//obj.focus()
		}
	}
	else if ( (isRequired)&&(obj.value.length == 0) ) {
		if(document.getElementById(errIMGid)) { 
			document.getElementById(errIMGid).style.visibility = "visible" ;
		 	//document.getElementById(errIMGid).alt = "Required Field"  
		 	document.getElementById(errIMGid).title = "Required Field"  
			//obj.focus()
		}
	}
		else { 	obj.value = "" ; document.getElementById(errIMGid).style.visibility = "hidden"  }
}

// onBlur="fieldRequired_onBlur(this,'','errIMGid')"
function fieldRequired_onBlur(obj,mode,errIMGid) {
	var errMsg = ""
	switch (mode) {
		case "ZIP" :
			if (obj.value.length == 0)  						{   }
			else if ( getIntegersOnly(obj.value).length != 5 ) 	{ errMsg = "Zip is not complete" }
			break ;
		case "ZIP-r" :
		case "ZIP-R" :
			if (obj.value.length == 0)  						{ errMsg = "This field is required" }
			else if ( getIntegersOnly(obj.value).length != 5 ) 	{ errMsg = "Zip is not complete" }
			break ;
		case "DDL1" :
			if (obj.options[obj.selectedIndex].value == "" ) 	{ errMsg = "Required field" }
			break ;
		default:
			if (obj.value.length == 0)  { errMsg = "This field is required" } 
	}
	
	if ( (errMsg.length > 0 ) && (document.getElementById(errIMGid)) )  {
		document.getElementById(errIMGid).style.visibility = "visible" ;
		//document.getElementById(errIMGid).alt = errMsg  ;
		document.getElementById(errIMGid).title = errMsg  ;
	}
	else if (document.getElementById(errIMGid)) {
		document.getElementById(errIMGid).style.visibility = "hidden" ;	
		document.getElementById(errIMGid).alt = "" ;
		document.getElementById(errIMGid).title = "" ;
	}
	else { alert(errIMGid +'\n errIMGid does NOT exist') }
}

//function this_onFocus(obj) { /*obj.select()*/ }

function makePhoneFormat(val,ExtnAllowed) {
	//var maxLength = Math.min(val.length,10)
	if ( (val.length >10 )&&(ExtnAllowed)) 	{ return "("+val.substring(0,3)+") "+val.substring(3,6)+"-"+val.substring(6,10)+" Extn."+val.substring(10,val.length)  }
	else if (val.length >10 ) 				{ return "("+val.substring(0,3)+") "+val.substring(3,6)+"-"+val.substring(6,10)  }
	else if (val.length >6 ) 				{ return "("+val.substring(0,3)+") "+val.substring(3,6)+"-"+val.substring(6,val.length) }
	else if (val.length >3 ) 				{ return "("+val.substring(0,3)+") "+val.substring(3,val.length) ; }
	else 									{ return val ; }
}
function isPhoneFormat(val) {
	if ( (getIntegersOnly(val).length==10)&&(val.length==14) ){
		if ( (val.substring(0,1)=="(")&&(val.substring(4,6)==") ")&&(val.substring(9,10)=="-") ) {return true ;} 
	}
	return false ;
}

function makeSSNFormat(val) {
	var maxLength = Math.min(val.length,9)
	if (val.length >5 ) 					{ return val.substring(0,3)+"-"+val.substring(3,5)+"-"+val.substring(5,maxLength) }
	else if (val.length >3 ) 				{ return val.substring(0,3)+"-"+val.substring(3,val.length) ; }
	else 									{ return val ; }
}
function isSSNFormat(val) {
	if ((getIntegersOnly(val).length==9)&&(val.length==11)){
		if ((val.substring(3,4)=="-")&&(val.substring(6,7)=="-")) { return true ; } 
	}
	return false ;
}

function preDateFormat(val) {
	if ((val.indexOf("/") == 1) &&(getIntegersOnly(val.charAt(0)).length == 1) ) 	{ val = "0"+ val }
	if( (val.indexOf("/") == 2) && (val.indexOf("/",3) == 4 ) ) 					{ val = val.substring(0,2) + "/0" + val.substring(3) }
	return val ;
}
function makeDateFormat(val) {
	val = getIntegersOnly(preDateFormat(val))
	if ( val.length >8 ) 					{ return val.substring(0,2)+"/"+val.substring(2,4)+"/"+val.substring(4,8) ; }
	else if (val.length >4 ) 				{ return val.substring(0,2)+"/"+val.substring(2,4)+"/"+val.substring(4,val.length) ; }
	else if (val.length >2 ) 				{ return val.substring(0,2)+"/"+val.substring(2,val.length) ; }
	else 									{ return val ; }
}
function isDateFormat(val) {
	if ((getIntegersOnly(val).length==8)&&(val.length==10)){
		if ((val.substring(2,3)=="/")&&(val.substring(5,6)=="/")) {return true ;} 
	}
	return false ;
}

function getIntegersOnly(value) {
	if ( value.length > 1 ) 				{ return returnOnlyInteger(value.charAt(0))+getIntegersOnly(value.substring(1,value.length)) ; } 
	else if ( value.length <= 1 ) 			{ return returnOnlyInteger(value) ; } 
	else 									{ return "" ; }
	//------------
	function returnOnlyInteger(val) { if ((val >= "0")&&(val <= "9")) { return val ; } else { return "" ; } }
}
function keyCodeOK() {
    var event = AF_getEvent(window.event);
	if (event) {
		if(event.keyCode== 9) {return false ;}	// Tab
		if(event.keyCode== 16) {return false ;}	// Alt-Tab
	}
	return true ;
}

function setErrorImage(errImgId, mode , alt) {
	if( document.getElementById(errImgId) ) { 
		if ( mode == 1 ) {
			document.getElementById(errImgId).style.visibility = "visible" ;
			//document.getElementById(errImgId).alt = alt  ;
			document.getElementById(errImgId).title = alt  ;
		}
		else { document.getElementById(errImgId).style.visibility = "hidden"  }
	}
}
//if (maxlength <= getIntegersOnly(obj.value).length) { obj.form[(getIndex(obj)+1) % obj.form.length].focus(); }

function mainMenu_onMouseOver(mainMenuID) {
	onMainTabOver(1,mainMenuID)				// set class layout
	subMenuDisplay(1,mainMenuID)			// open subMunu	
	 selectsVisibility(0);
}

function mainMenu_onMouseOut(mainMenuID) {
	onMainTabOver(0,mainMenuID)				// set class layout
	subMenuDisplay(0,mainMenuID)			// close subMunu	
	 selectsVisibility(1);
	//alert( document.getElementById('mainMenu_TD_'+mainMenuID).width )
}

function onMainTabOver(mode, id) {
	document.getElementById('mainMenu_TB_'+id).getElementsByTagName('TD')[0].className = "mainMenuTabA_"+mode
	document.getElementById('mainMenu_TB_'+id).getElementsByTagName('TD')[1].className = "mainMenuTabB_"+mode
	document.getElementById('mainMenu_TB_'+id).getElementsByTagName('TD')[2].className = "mainMenuTabC_"+mode
}

function subMenuDisplay(mode , mainMenuID) {
	if ( mode == 0) {
		// close subMenu
		document.getElementById('mySubMenu_'+mainMenuID).style.display = "none";
	}
	else if ( mode == 1 ) {
		// reset subMenu Class
		// open subMenu
		document.getElementById('mySubMenu_'+mainMenuID).style.display = ""
		document.getElementById('mySubMenu_'+mainMenuID).style.top = "63" + 'px';
		document.getElementById('mySubMenu_'+mainMenuID).style.left = getObjOffsetPos( document.getElementById('mainMenu_TB_'+mainMenuID) , 'L' ) +1 + 'px';
		document.getElementById('mySubMenu_'+mainMenuID).style.width = document.getElementById('mainMenu_TB_'+mainMenuID).offsetWidth
	}
}

function onSubMenu(mode , mainMenuID) {
	if ( mode == 0) {
		document.getElementById('mySubMenu_'+mainMenuID).style.display = "none"
		selectsVisibility(1);
	}
	else if ( mode == 1 ) {
		selectsVisibility(0);
		document.getElementById('mySubMenu_'+mainMenuID).style.display = ""
	}
	
	document.getElementById('mainMenu_TB_'+mainMenuID).getElementsByTagName('TD')[0].className = "mainMenuTabA_"+mode
	document.getElementById('mainMenu_TB_'+mainMenuID).getElementsByTagName('TD')[1].className = "mainMenuTabB_"+mode
	document.getElementById('mainMenu_TB_'+mainMenuID).getElementsByTagName('TD')[2].className = "mainMenuTabC_"+mode
}

function subMenuInnerTB(thisObj, mode) {
	if ( mode == 0) {
		thisObj.getElementsByTagName('IMG')[0].src = "/IMAGES/home_v2/arrows/gray.gif"
	}
	else if ( mode == 1 ) {
		thisObj.getElementsByTagName('IMG')[0].src = "/IMAGES/home_v2/arrows/blue.gif"
	}
}

function  tabNavLinkURL(subModuleURL, subModuleUrlType) {
	//window.location = subModuleURL
	//self.location.href = subModuleURL
	window.location.href = subModuleURL
}


function selectsVisibility ( id ) {
	if ( (id == 0 ) && (windowedEleInWay) ) { // hide obj
		for (i=0 ; i != windowedEleInWay.length; ++i) {
			if(document.getElementById( windowedEleInWay[i] )) {
				document.getElementById( windowedEleInWay[i] ).style.visibility = "hidden";
			}
		}
	}
	else if ( (id == 1) && (windowedEleInWay) ) { //show obj
		for (i=0 ; i != windowedEleInWay.length; ++i) {
			if(document.getElementById( windowedEleInWay[i] )) {
				document.getElementById( windowedEleInWay[i] ).style.visibility = "visible";
			}
		}
	}
}

function openThisPopup( url, popName ) {
	window.open( url ,popName,'toolbar=no, directories=no, menubar=no, scrollbars=yes,location=no,status=yes,resizable=yes').focus()
}

function gotoGoogleCal() {
	window.open('http://www.google.com/calendar','Google_Cal','toolbar=no, directories=no, menubar=no, scrollbars=yes,location=no,status=yes,resizable=yes').focus()
}

function gotoFeedbackPopup() {
	window.open('/ASPX/dealer/popup/DealerFeedback_popup.aspx','popup_feedback','height=400,width=650,toolbar=no, directories=no, menubar=no, scrollbars=yes,location=no,status=yes,resizable=no').focus()
}
function gotolostPwordPopup() {
	window.open( '/ASPX/common/getPassword_popup.aspx' ,'getPassword','height=215,width=550,toolbar=no, directories=no, menubar=no, scrollbars=no,location=no,status=no,resizable=yes').focus()
}
function NADAbook() {
	var msgNada = ""
		msgNada	+= "The online valuation provided by NADA may differ from their print products. The print product valuations are used by Auto Use. \n"
		msgNada	+= "While booking out vehicles please remember: \n"
 		msgNada	+= "\n "
		msgNada	+= "Vehicles in the newer vehicles book (2007-2000): \n"
		msgNada	+= "- Use the average retail value adjusted for miles only \n"
		msgNada	+= "- Do not adjust for any accessory unless the vehicle is a truck and one single add is valued at $750 or more \n"
		msgNada	+= "\n "
		msgNada	+= "Vehicles in the older vehicles book (1999 and older): \n"
		msgNada	+= "- Use the average retail value only. DO NOT ADJUST FOR MILES \n"
		msgNada	+= "- Do not adjust for any accessory under any condition \n"
		msgNada	+= "\n "
		msgNada	+= "Please note: autofunds.com is not responsible for reductions in advance due to incorrect book values. \n"

	alert(msgNada)
	window.open('http://www.nadaguides.com/default.aspx?LI=1-21-0-5002-546-532-50099&l=1&w=21&p=1&f=5004','NADA_Window','height=900,width=800,toolbar=no, directories=no, menubar=no, scrollbars=yes,location=no,status=yes,resizable=yes').focus()
}

function AddCostandRepairs(inventoryId) {
	window.open("/ASPX/dealer/inventory/addCostandRepairs_PopUp.aspx?inventoryId=" + inventoryId,"AddRepairsAndCost","width=600, height=500, toolbar=no, directories=no, menubar=no, scrollbars=yes,location=no,status=no,resizable=no").focus()
}

function openWarrantyPopupPage( fromwhereText, dealid , Lender) {
	var fileName = "/ASPX/dealer/popup/WarrantyPopup.aspx?fromWhere=" + fromwhereText + "&dealid=" + dealid + "&L=" + Lender
	window.open(fileName,'WarrantyWindow','height=400,width=500,toolbar=no, directories=no, menubar=no, scrollbars=yes,location=no,status=yes,resizable=yes').focus()
}
//from Dashbord Main
function gotoPagePopup( url ) {
	if (url.length != 0) {
		window.open( url ,'popup','height=500,width=750,toolbar=no, directories=no, menubar=yes, scrollbars=yes,location=no,status=yes,resizable=yes').focus()
	}
}
//from:Deal 1 
function printerSettingsPopUp(filename){
	
	var formWindowPopup = window.open(filename,'PrinterCalibration','height=400,width=650,toolbar=no, directories=no, menubar=yes, scrollbars=yes,location=no,status=no,resizable=yes')	
	formWindowPopup.focus()
}
//from: DealsMainQuickdeal
function printPopUp(quickDealId){
	window.open("/ASPX/dealer/deal/quickdealformlist_popup.aspx?quickdealid=" + quickDealId,"RemarksWindow","width=800, height=600, toolbar=no, directories=no, menubar=no, scrollbars=yes,location=no,status=no,resizable=yes").focus()
	
}
//from : Deal_Main
function ChangeDealStage(dealid){
	childWindow = window.open("/ASPX/dealer/deal/ChangeStatus_Popup.aspx?Dealid=" + dealid,"ChangeStatus","width=600, height=400, toolbar=no, directories=no, menubar=no, scrollbars=yes,location=no,status=no,resizable=no")
	childWindow.focus()
}
//from: addcostandRepairs
function AddEditRepairTypes(fileName){
	//if (dropdownValue == "#~") {					
		childWindow1 = window.open(fileName,"AddEditRepairTypes","width=600, height=400, toolbar=no, directories=no, menubar=no, scrollbars=yes,location=no,status=no,resizable=yes")
		childWindow1.focus()
	//}
}
//from:Deal Maintience
function gotoPagePopup( url ) {
		if (url.length != 0) {
			window.open( url ,'popup','height=500,width=750,toolbar=no, directories=no, menubar=yes, scrollbars=yes,location=no,status=yes,resizable=yes').focus()
		}
}
function openPDF( url ) {
		if (url.length != 0) {
		window.open( url ,'PDF','height=500,width=750,toolbar=no, directories=no, menubar=yes, scrollbars=yes,location=no,status=yes,resizable=yes').focus()
	}
}
function openCreditReport(transId) {
	window.open( '/aspx/dealer/popup/CreditReport.aspx?Id=' + transId ,'CreditReport','height=620,width=850,toolbar=no, directories=no, menubar=no, scrollbars=yes,location=no,status=yes,resizable=yes').focus()
}
function openPDFmicrobiltSignUpDocs() {
	window.open( '/Data/Forms-MasterPDFs/autofunds.com-CreditBureauSignup.pdf' ,'MicroSignUpDocs','height=620,width=850,toolbar=no, directories=no, menubar=no, scrollbars=yes,location=no,status=yes,resizable=yes').focus()
}
function openImgUploadPopup( vehID ) {
	window.open( '/ASPX/dealer/popup/LoadInventoryImages_popup.aspx?Vid='+vehID ,'VehicleImages_popup','height=570,width=500,toolbar=no, directories=no, menubar=no, scrollbars=yes,location=no,status=yes,resizable=yes').focus()
}

function openActiveXImgUploadPopup( vehID ) {
	window.open( '/ASPX/dealer/popup/LoadInventoryImages_ActiveX.aspx?InventoryId='+vehID ,'VehicleImages_popup','height=600,width=700,toolbar=no, directories=no, menubar=no, scrollbars=yes,location=no,status=yes,resizable=yes').focus()
}

function openDocumentUploadPopup(objectId,objectType,objectInfo) {
    var uri = encodeURI('objectId=' + objectId + '&objectType=' + objectType + '&objectInfo=' + objectInfo);
    window.open('/ASPX/dealer/popup/DocumentScanner.aspx?' + uri,'DocScanner_Popup','height=605,width=750,toolbar=no, directories=no, menubar=no, scrollbars=no,location=no,status=no,resizable=no').focus();
}

function openAddFormFields_popup(BCID) {
	window.open( '/ASPX/admin/forms/AddFormFields_popup.aspx?BaseClassID='+BCID ,'VehicleImages_popup','height=500,width=650,toolbar=no, directories=no, menubar=no, scrollbars=yes,location=no,status=yes,resizable=yes').focus()
}

//timz
function openAddNewFields_popup(BCID){
window.open( '/ASPX/admin/forms/Forms_FieldNames.aspx?IsWinOpn=1&BaseClassID='+BCID ,'AddFields_Popup','height=500,width=650,toolbar=no, directories=no, menubar=no, scrollbars=yes,location=no,status=yes,resizable=yes').focus()
}

function openAddCustomFields_popup(BCID)
{

window.open( '/ASPX/admin/forms/AddEditFormCustomFields.aspx?IsWinOpn=1&BaseClassID='+BCID ,'AddFields_Popup','height=500,width=650,toolbar=no, directories=no, menubar=no, scrollbars=yes,location=no,status=yes,resizable=yes').focus()


}
//timz end



// -- Used for the form printing module: ---------------
function openPrintPopup_POPUP( url ) {
	//var myDate=new Date() ; 
	window.open( url ,'openPrintPopup_POPUP','height=700,width=550,toolbar=no, directories=no, menubar=no, scrollbars=yes,location=no,status=no,resizable=yes').focus()
}
function openPrintPopup_PRINTURL( url ) {
	var myDate=new Date() ; 
	window.open( url ,'openPrintPopup_PRINTURL'+myDate.getTime(),'height=700,width=700,toolbar=no, directories=no, menubar=no, scrollbars=yes,location=no,status=no,resizable=yes').focus()
}
// -----------------------------------------------------
function openTriVINExportWindow(dealID){
    var myDate=new Date() ; 
    var filename = "/aspx/dealer/deal/GeneratetriVIN.aspx?dealid=" + dealID//document.getElementById('dealId').value 
    window.open( filename,'AutoFunds'+myDate.getTime(),'height=10,width=10,toolbar=no, directories=no, menubar=no, scrollbars=yes,location=no,status=no,resizable=yes').focus()
}

function openPrintReport() {
    //modified by Jai 31-May-08 for Access checking for Inventory Report
//	var formWindowPopup = window.open('/ASPX/dealer/inventory/StdReportInput_PopUp.aspx','InventoryReport','height=600,width=800,toolbar=no, directories=no, menubar=yes, scrollbars=yes,location=no,status=yes,resizable=yes')	
//	formWindowPopup.focus()
	var objFormWinPopup = new GEF_WinPopup();
	objFormWinPopup.url = '/ASPX/dealer/inventory/StdReportInput_PopUp.aspx';
	objFormWinPopup.name = 'InventoryReport';
	objFormWinPopup.height = 600;
	objFormWinPopup.width = 800;
	objFormWinPopup.toolbar = 'no';
	objFormWinPopup.directories = 'no';
	objFormWinPopup.menubar = 'yes';
	objFormWinPopup.scrollbars = 'yes';
	objFormWinPopup.location = 'no';
	objFormWinPopup.status = 'yes';
	objFormWinPopup.resizable = 'yes';
	
	GE_AlertWindow_3a()
	GEF_ElementAccessCheck_onWinPopupLoad(objFormWinPopup,'IR')
}

function openReport_Profitability() {
	window.open('/ASPX/dealer/popup/Report_Profitability.aspx','Report_Profitability','height=600,width=1000,toolbar=no, directories=no, menubar=yes, scrollbars=yes,location=no,status=yes,resizable=yes').focus()
}
function openReport_SalesTax() {
	window.open('/ASPX/dealer/popup/Report_SalesTax.aspx','Report_SalesTax','height=600,width=1000,toolbar=no, directories=no, menubar=yes, scrollbars=yes,location=no,status=yes,resizable=yes').focus()
}



function openPostAdPOPUP(URL) {  
	window.open(URL,'openPostAdPOPUP','height=800,width=750,toolbar=no, directories=no, menubar=no, scrollbars=yes,location=no,status=no,resizable=yes').focus()	 
}

function openCragsListDEBUG(iID, dID) { 
	var URL = "/ASPX/dealer/inventory/Craigslist_InventoryDetail.aspx?inventoryid=" + iID + "&dealerid=" + dID
	window.open(URL,'oponCragsListDebug','height=550,width=750,toolbar=no, directories=no, menubar=no, scrollbars=yes,location=no,status=no,resizable=yes')
}

function openDealRecapPopup(DealID) {

    //modified by Jai 28-Jan-09 for element security 
	var objFormWinPopup = new GEF_WinPopup();
	objFormWinPopup.url = "/ASPX/dealer/popup/Report_DealRecap.aspx?dId=" + DealID;
	objFormWinPopup.name = 'openDealRecapPopup';
	objFormWinPopup.height = 900;
	objFormWinPopup.width = 850;
	objFormWinPopup.toolbar = 'yes';
	objFormWinPopup.directories = 'no';
	objFormWinPopup.menubar = 'no';
	objFormWinPopup.scrollbars = 'yes';
	objFormWinPopup.location = 'no';
	objFormWinPopup.status = 'no';
	objFormWinPopup.resizable = 'yes';
	
	GE_AlertWindow_3a()
	GEF_ElementAccessCheck_onWinPopupLoad(objFormWinPopup,'DR')

	//var URL = "/ASPX/dealer/popup/Report_DealRecap.aspx?dId=" + DealID
	//window.open(URL,'openDealRecapPopup','height=900,width=850,toolbar=yes, directories=no, menubar=no, scrollbars=yes,location=no,status=no,resizable=yes').focus()
}

function openGenericCreditApp() { window.open('/Data/Forms-MasterPDFs/Credit_Application_Generic[1].pdf','openDealRecapPopup','height=900,width=850,toolbar=yes, directories=no, menubar=no, scrollbars=yes,location=no,status=no,resizable=yes').focus() }



function openCredcoReport(transID) {
	window.open( '/aspx/dealer/popup/CredcoReport.aspx?TID=' + transID,'CredcoReport','height=620,width=850,toolbar=no, directories=no, menubar=no, scrollbars=yes,location=no,status=yes,resizable=yes').focus()
}


function openFedexLabel(trackID) {
	window.open( '/aspx/dealer/popup/FedexLabel.aspx?TID=' + trackID,'FedexLabel','height=620,width=850,toolbar=no, directories=no, menubar=no, scrollbars=yes,location=no,status=yes,resizable=yes').focus()
}

function openOFAC() {
	window.open( '/aspx/dealer/popup/OFAC.htm','OFAC','height=400,width=850,toolbar=no, directories=no, menubar=no, scrollbars=yes,location=no,status=yes,resizable=yes').focus()
}


function openInventoryIntegratedProductPopup(prodCode,inventoryID,url)
{
    window.open( '/aspx/dealer/inventory/IntegrationProductPostProcessor.aspx?ProdCode=' + prodCode  + '&InventoryID=' + inventoryID + '&URL=' + url,'IntegrationProducts','height=620,width=850,toolbar=no, directories=no, menubar=no, scrollbars=yes,location=no,status=yes,resizable=yes').focus()
}



function openInventoryIntegratedProductPopup_Admin(prodCode,url,strDealerID)
{
    window.open( '/aspx/admin/IntegrationProductPostProcessor_admin.aspx?ProdCode=' + prodCode   + '&URL=' + url+ '&DealerID=' + strDealerID ,'IntegrationProducts','height=620,width=850,toolbar=no, directories=no, menubar=no, scrollbars=yes,location=no,status=yes,resizable=yes').focus()
}

function openReport_IfByPhone()
{
    window.open('/ASPX/dealer/popup/IfByPhoneReport.aspx','Report_IfByPhone','height=600,width=1000,toolbar=no, directories=no, menubar=yes, scrollbars=yes,location=no,status=yes,resizable=yes').focus()
}


function openDealerBankDefaults(id) {
	window.open( '/ASPX/admin/Admin_Bank_Dealer_Defaults.aspx?ID='+id ,'VehicleImages_popup','height=500,width=650,toolbar=no, directories=no, menubar=no, scrollbars=yes,location=no,status=yes,resizable=yes').focus()
}